CN107968848B - A kind of method, terminal device and storage medium obtaining IP address - Google Patents

A kind of method, terminal device and storage medium obtaining IP address Download PDF

Info

Publication number
CN107968848B
CN107968848B CN201711202552.0A CN201711202552A CN107968848B CN 107968848 B CN107968848 B CN 107968848B CN 201711202552 A CN201711202552 A CN 201711202552A CN 107968848 B CN107968848 B CN 107968848B
Authority
CN
China
Prior art keywords
address
priority level
configuration protocol
host configuration
dynamic host
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201711202552.0A
Other languages
Chinese (zh)
Other versions
CN107968848A (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.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp 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 Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN201711202552.0A priority Critical patent/CN107968848B/en
Publication of CN107968848A publication Critical patent/CN107968848A/en
Application granted granted Critical
Publication of CN107968848B publication Critical patent/CN107968848B/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/50Address allocation
    • H04L61/5007Internet protocol [IP] addresses
    • H04L61/5014Internet protocol [IP] addresses using dynamic host configuration protocol [DHCP] or bootstrap protocol [BOOTP]

Abstract

The application is suitable for field of communication technology, provide a kind of method, terminal device and storage medium for obtaining IP address, include: to be based on preset priority level after receiving the instruction for obtaining IP address, the solicited message for obtaining IP address is sent to Dynamic Host Configuration Protocol server;If not receiving the response message comprising IP address that the Dynamic Host Configuration Protocol server returns within the default response time, then reducing the priority level;Based on the priority level after reduction, the solicited message for obtaining IP address is sent to Dynamic Host Configuration Protocol server, and the success rate that terminal device obtains IP address can be improved by the application.

Description

A kind of method, terminal device and storage medium obtaining IP address
Technical field
The application belongs to field of communication technology more particularly to a kind of method for obtaining IP address, terminal device and storage are situated between Matter.
Background technique
Dynamic host configuration protocol (Dynamic Host Configuration Protocol, DHCP) is for allowing network On host from a Dynamic Host Configuration Protocol server obtain the network that one can allow the host normal communication between interconnection agreement The address (Internet protocol, IP) and relevant configuration information.
Currently, host on network is usually that host is sent out to Dynamic Host Configuration Protocol server from the method that Dynamic Host Configuration Protocol server obtains IP address The solicited message for sending an acquisition IP address, after Dynamic Host Configuration Protocol server receives the solicited message of host transmission, returning to one includes The response message of IP address.However, the method for obtaining IP address this at present, the success rate for obtaining IP address are lower.
Summary of the invention
In view of this, the embodiment of the present application provides a kind of method, terminal device and storage medium for obtaining IP address, with Solve the problems, such as that the success rate of the terminal device acquisition IP address on current network is lower.
The first aspect of the embodiment of the present application provides a kind of method for obtaining IP address, comprising:
After receiving the instruction for obtaining IP address, it is based on preset priority level, sends and obtains to Dynamic Host Configuration Protocol server The solicited message of IP address;
If not receiving the response message comprising IP address that the Dynamic Host Configuration Protocol server returns within the default response time, Then reduce the priority level;
Based on the priority level after reduction, the solicited message for obtaining IP address is sent to Dynamic Host Configuration Protocol server.
The second aspect of the embodiment of the present application provides a kind of terminal device, comprising:
First solicited message sending module, for being based on preset priority after receiving the instruction for obtaining IP address Grade sends the solicited message for obtaining IP address to Dynamic Host Configuration Protocol server;
First priority level reduces module, if not receiving the Dynamic Host Configuration Protocol server within the default response time The response message comprising IP address returned, then reduce the priority level;
Second solicited message sending module, for sending and obtaining to Dynamic Host Configuration Protocol server based on the priority level after reduction The solicited message of IP address.
The third aspect of the embodiment of the present application provides a kind of terminal device, including memory, processor and is stored in In the memory and the computer program that can run on the processor, when the processor executes the computer program The step of realizing the method that the embodiment of the present application first aspect provides.
The fourth aspect of the embodiment of the present application provides a kind of computer readable storage medium, the computer-readable storage Media storage has computer program, and the computer program realizes the embodiment of the present application when being executed by one or more processors On the one hand the step of the method provided.
5th aspect of the embodiment of the present application provides a kind of computer program product, and the computer program product includes Computer program, the computer program realize that the embodiment of the present application first aspect provides when being executed by one or more processors The method the step of.
The embodiment of the present application is based on preset priority level after receiving the instruction for obtaining IP address, takes to DHCP The solicited message for device transmission acquisition IP address of being engaged in, if not receiving what the Dynamic Host Configuration Protocol server returned within the default response time Response message comprising IP address then reduces the priority level, based on the priority level after reduction, to Dynamic Host Configuration Protocol server Send the solicited message for obtaining IP address.Due to sending acquisition to Dynamic Host Configuration Protocol server with preset priority level in the application After the solicited message of IP address, if within the response time of setting, be not received by the Dynamic Host Configuration Protocol server return includes The response message of IP address is then reduced the priority level, then is continued with the priority level after reducing to Dynamic Host Configuration Protocol server The solicited message for obtaining IP address is sent, so that Dynamic Host Configuration Protocol server is because the DHCP data packet of various priority levels can not be handled When, it can be adjusted to adapt to the DHCP data packet for the priority level that Dynamic Host Configuration Protocol server is capable of handling, this makes it possible to increase to obtain Take the success rate of IP address.
Detailed description of the invention
It in order to more clearly explain the technical solutions in the embodiments of the present application, below will be to embodiment or description of the prior art Needed in attached drawing be briefly described, it should be apparent that, the accompanying drawings in the following description is only some of the application Embodiment for those of ordinary skill in the art without any creative labor, can also be according to these Attached drawing obtains other attached drawings.
Fig. 1 is a kind of implementation process schematic diagram of the method for acquisition IP address that one embodiment of the application provides;
Fig. 2 is a kind of implementation process schematic diagram of the method for acquisition IP address that the another embodiment of the application provides;
Fig. 3 is a kind of implementation process schematic diagram of the method for acquisition IP address that the another embodiment of the application provides;
Fig. 4 is the schematic block diagram for the terminal device that one embodiment of the application provides;
Fig. 5 is the schematic block diagram for the terminal device that the another embodiment of the application provides.
Specific embodiment
In being described below, for illustration and not for limitation, the tool of such as particular system structure, technology etc is proposed Body details, so as to provide a thorough understanding of the present application embodiment.However, it will be clear to one skilled in the art that there is no these specific The application also may be implemented in the other embodiments of details.In other situations, it omits to well-known system, device, electricity The detailed description of road and method, so as not to obscure the description of the present application with unnecessary details.
It should be appreciated that ought use in this specification and in the appended claims, term " includes " instruction is described special Sign, entirety, step, operation, the presence of element and/or component, but be not precluded one or more of the other feature, entirety, step, Operation, the presence or addition of element, component and/or its set.
It is also understood that mesh of the term used in this present specification merely for the sake of description specific embodiment And be not intended to limit the application.As present specification and it is used in the attached claims, unless on Other situations are hereafter clearly indicated, otherwise " one " of singular, "one" and "the" are intended to include plural form.
It will be further appreciated that the term "and/or" used in present specification and the appended claims is Refer to any combination and all possible combinations of one or more of associated item listed, and including these combinations.
As used in this specification and in the appended claims, term " if " can be according to context quilt Be construed to " when ... " or " once " or " in response to determination " or " in response to detecting ".Similarly, phrase " if it is determined that " or " if detecting [described condition or event] " can be interpreted to mean according to context " once it is determined that " or " in response to true It is fixed " or " once detecting [described condition or event] " or " in response to detecting [described condition or event] ".
In order to illustrate technical solution described herein, the following is a description of specific embodiments.
Fig. 1 is the implementation process schematic diagram of the method for the acquisition IP address that one embodiment of the application provides, and as shown in the figure should Method may comprise steps of:
Step S101 is based on preset priority level, to Dynamic Host Configuration Protocol server after receiving the instruction for obtaining IP address Send the solicited message for obtaining IP address.
In the embodiment of the present application, in one network, when having the terminal device newly accessed, the terminal device newly accessed is all It needs to obtain IP address, be communicated by this IP address obtained with other terminal devices in network.With obtaining IP When location, have in such a way that static IP is set, also by DHCP mode, the embodiment of the present application is to obtain IP by DHCP mode Address, i.e., newly for the terminal device of access network to Dynamic Host Configuration Protocol server transmission DHCP data packet, DHCP data packet, which contains, obtains IP The solicited message of address.When Dynamic Host Configuration Protocol server receives the solicited message for obtaining IP address, it can divide for the terminal device newly accessed With IP address.
After the instruction for receiving acquisition IP address, the terminal device newly accessed can be after actuation, i.e., the described end End equipment indicates to receive the instruction for obtaining IP address after completing starting.In certain practical application, other instructions can also be set As the instruction for obtaining IP address, for sending the solicited message for obtaining IP address to Dynamic Host Configuration Protocol server.DHCP data are surrounded by not With priority level, for example, the form of Voice, this priority level is higher, can be with higher priority level to DHCP Server sends the solicited message for obtaining IP address, can accelerate the speed of DHCP processing.It can also be Best Effort shape Formula, this priority level can obtain IP address to the greatest extent.Priority level can be preset in terminal device, it can basis Preset priority level, the solicited message for obtaining IP address is sent to Dynamic Host Configuration Protocol server, and the priority level refers to The priority level of the solicited message for obtaining IP address or the priority level of DHCP data packet.
Step S102, if do not receive the Dynamic Host Configuration Protocol server return includes IP address within the default response time Response message then reduces the priority level.
In the embodiment of the present application, request of the Dynamic Host Configuration Protocol server in the acquisition IP address for receiving terminal device transmission After information, if it is possible to handle, then the terminal device that can be directed toward to the solicited message returns to the response comprising IP address Information can not return to the sound comprising IP address if Dynamic Host Configuration Protocol server can not handle this solicited message for obtaining IP address Answer information, it is possible to a response time is set, if the Dynamic Host Configuration Protocol server can be received within the default response time The response message comprising IP address returned, indicates successfully to obtain IP address, if not receiving institute within the default response time State the response message comprising IP address of Dynamic Host Configuration Protocol server return, then it represents that possible this obtains the excellent of the solicited message of IP address First grade grade is too high, and Dynamic Host Configuration Protocol server can not handle this solicited message for obtaining IP address, in order to enable DHCP is capable of handling The solicited message of the acquisition IP address received can reduce the priority level for obtaining the solicited message of IP address.
Step S103 sends the solicited message for obtaining IP address to Dynamic Host Configuration Protocol server based on the priority level after reduction.
In the embodiment of the present application, after the priority level for reducing the solicited message for obtaining IP address, so that it may base Priority level after reduction sends the solicited message for obtaining IP address to Dynamic Host Configuration Protocol server.In this way, if Dynamic Host Configuration Protocol server When can not handle because the priority level of the solicited message of the acquisition IP address received is higher, terminal device be can reduce Retransmit the solicited message for obtaining IP address, Dynamic Host Configuration Protocol server energy after priority level with the priority level after reduction again Enough processing obtain the solicited message of IP address, to return to the response message comprising IP address.
Due to sending asking for acquisition IP address to Dynamic Host Configuration Protocol server with preset priority level in the embodiment of the present application After seeking information, if being not received by the sound comprising IP address that the Dynamic Host Configuration Protocol server returns within the response time of setting Information is answered, then reduces the priority level, then continue to send acquisition IP to Dynamic Host Configuration Protocol server with the priority level after reducing The solicited message of address, so that Dynamic Host Configuration Protocol server can be adjusted because when can not handle the DHCP data packet of various priority levels The whole DHCP data packet to adapt to the priority level that Dynamic Host Configuration Protocol server is capable of handling, this makes it possible to increase to obtain IP address Success rate.
Fig. 2 is the flow diagram of the method for the acquisition IP address that the another embodiment of the application provides, the party as shown in the figure Method may comprise steps of:
Step S201 is based on preset priority level, to Dynamic Host Configuration Protocol server after receiving the instruction for obtaining IP address Send the solicited message for obtaining IP address.
The step is consistent with step S101 content, specifically can refer to the description of step S101, details are not described herein.
Can according to different DHCP data packet forms, by the priority level of DHCP data packet be set as level-one, second level, Three-level ... etc..Level-one indicates that priority level highest, second level, three-level ... successively indicate that priority level gradually decreases, when So, in practical application, the mode of the priority level setting can also be other way, herein a different citing.
Step S202, if do not receive the Dynamic Host Configuration Protocol server return includes IP address within the default response time Response message is then based on preset priority level, continues to send the solicited message for obtaining IP address to Dynamic Host Configuration Protocol server.
In the embodiment of the present application, if terminal device does not receive the Dynamic Host Configuration Protocol server and return within the default response time The response message comprising IP address returned, on the one hand may be the acquisition that the terminal device is sent with preset priority level The priority level of the solicited message of IP address is too high, and the Dynamic Host Configuration Protocol server can not be handled;On the other hand it is likely to be described Dynamic Host Configuration Protocol server is capable of handling the solicited message of the acquisition IP address of preset priority level, but the IP address that obtains Phenomena such as loss of data or DHCP clothes occur during sending from terminal device to the Dynamic Host Configuration Protocol server for solicited message Business device, which currently breaks down, to return to the response message comprising IP address to terminal device in time.So if in default response In time, the response message comprising IP address that the Dynamic Host Configuration Protocol server returns is not received, is reducing the priority level Before, it is also necessary to be based on preset priority level, continue to send the solicited message for obtaining IP address to Dynamic Host Configuration Protocol server.
Step S203, if the number of the solicited message sent to Dynamic Host Configuration Protocol server based on preset priority level be greater than it is pre- If when number, not receiving the response message comprising IP address that the Dynamic Host Configuration Protocol server returns yet, then reducing the priority Grade.
In the embodiment of the present application, the request letter that terminal device is sent based on preset priority level to Dynamic Host Configuration Protocol server Breath, solicited message of every transmissions wait for presetting the response time accordingly, if with preset priority level to DHCP service When the number for the solicited message that device is sent is greater than preset times, do not receive the Dynamic Host Configuration Protocol server return yet includes IP address Response message, described solicited message the problem of losing during transmission for obtaining IP address can be excluded substantially, it is described Dynamic Host Configuration Protocol server possibly can not handle the solicited message of the acquisition IP address of preset priority level, at this moment just need to reduce institute State priority level.
By way of example it is assumed that the preset priority level of DHCP data packet is second level in the terminal device, response is preset Time is 3 seconds, and preset times are 5 times, and terminal device is sent to the Dynamic Host Configuration Protocol server with the DHCP data packet of second level and obtains IP The solicited message of address, if not receiving the response message comprising IP address that the Dynamic Host Configuration Protocol server returns in 3 seconds, then after Continuous using priority level is that the DHCP data packet of second level sends to the Dynamic Host Configuration Protocol server and obtains the solicited message of IP address, often with Priority level is that the DHCP data packet of second level sends the solicited message for obtaining IP address to the Dynamic Host Configuration Protocol server, is required It is hair 5 times continuous in this way to 3 seconds response times, the sound comprising IP address that the Dynamic Host Configuration Protocol server returns still is not received Information is answered, then reducing the priority level is three-level.
It should be noted that once being sent with obtaining IP with preset priority level to the Dynamic Host Configuration Protocol server any In the default response time after the solicited message of location, if receiving the response letter comprising IP address that the Dynamic Host Configuration Protocol server returns Breath, then without being further continued for sending the solicited message for obtaining IP address to the Dynamic Host Configuration Protocol server.
Step S204 sends the solicited message for obtaining IP address to Dynamic Host Configuration Protocol server based on the priority level after reduction.
The step is consistent with step S103 content, specifically can refer to the description of step S103, details are not described herein.
Step S205, if do not receive the Dynamic Host Configuration Protocol server return yet includes IP address within the default response time Response message, then continue to reduce current priority level, and the solicited message for obtaining IP address is sent to Dynamic Host Configuration Protocol server, The response message comprising IP address returned until receiving the Dynamic Host Configuration Protocol server.
In the embodiment of the present application, if the solicited message of the acquisition IP address sent with the priority level after reducing is pre- If in the response time, the response message comprising IP address that the Dynamic Host Configuration Protocol server returns still can not be received, then it represents that described Dynamic Host Configuration Protocol server may still can not handle the solicited message of the priority level after reducing, at this moment, it is necessary to continue to reduce excellent First grade grade.
Continue with the description citing in step S203, after priority level is reduced to three-level from second level, with three-level Priority level sends the solicited message for obtaining IP address to Dynamic Host Configuration Protocol server, if still could not within 3 seconds response times The response message comprising IP address that the Dynamic Host Configuration Protocol server returns is received, then continues to reduce priority level, by priority Grade is reduced to level Four from three-level, then proceedes to send asking for acquisition IP address to Dynamic Host Configuration Protocol server with the priority level of level Four Information is sought, if the response comprising IP address that the Dynamic Host Configuration Protocol server returns still can not be received within 3 seconds response times Information then continues to reduce priority level, priority level is reduced to Pyatyi from level Four ... ....
Priority level of every reduction requires to send with obtaining IP with newest priority level to Dynamic Host Configuration Protocol server The solicited message of location, while the preset response time is needed to wait for, only within the preset response time, do not receive described The response message comprising IP address that Dynamic Host Configuration Protocol server returns just will continue to reduce priority level.
The condition of termination is: after sending the solicited message for obtaining IP address to Dynamic Host Configuration Protocol server with arbitrary priority level Response time in, receive the response message comprising IP address that the Dynamic Host Configuration Protocol server returns, be then not necessarily to continue to reduce excellent First grade grade;Alternatively, being taken with minimum priority level to DHCP after priority level to be reduced to minimum priority level In response time after the solicited message of device transmission acquisition IP address of being engaged in, the packet that the Dynamic Host Configuration Protocol server returns still is not received Response message containing IP address.
The embodiment of the present application obtains IP address by sending with preset priority level continuous several times to Dynamic Host Configuration Protocol server Solicited message, avoid and obtain IP address since DHCP data packet packet loss or the Dynamic Host Configuration Protocol server can not temporarily be handled The problem of obtaining IP address caused by solicited message not successfully makes also by reducing the priority level of DHCP data packet step by step The solicited message for obtaining IP address can be sent with multiple priorities grade to Dynamic Host Configuration Protocol server by obtaining terminal device, in this way, even if Dynamic Host Configuration Protocol server can not handle the DHCP data packet of high priority grade, also can be by reducing the preferential of DHCP data packet step by step Grade grade, so that improving the success rate that terminal device obtains IP address.
Fig. 3 is the flow diagram of the method for the acquisition IP address that the another embodiment of the application provides, the party as shown in the figure Method is embodiment on the basis of Fig. 1 or embodiment illustrated in fig. 2, specifically includes the following steps:
Step S301 accesses the corresponding wireless access point of the Dynamic Host Configuration Protocol server according to the IP address, and described in generation It is used when the hardware address of wireless access point and the response message comprising IP address for receiving the Dynamic Host Configuration Protocol server return The corresponding relationship is stored in default memory space by the corresponding relationship of priority level.
In the embodiment of the present application, the wireless access point refers to wireless access points (WirelessAccess Point, wireless aps).After the information for obtaining the IP address that the Dynamic Host Configuration Protocol server is sent, terminal device can access DHCP The corresponding wireless access point of server.At the same time it can also the response message comprising IP address for returning to the Dynamic Host Configuration Protocol server Priority level used in corresponding solicited message is recorded, and by the Dynamic Host Configuration Protocol server return comprising IP address Priority level used in the corresponding solicited message of response message associates with the hardware address of current wireless access point.Institute State wireless access point hardware address refer to the media access control of the wireless access point (Media Access Control or Medium Access Control, MAC) address, also referred to as physical address, hardware address, for defining the position of the network equipment It sets, there is uniqueness.
Step S302 obtains the hardware address of wireless access point to be connected after receiving the instruction for obtaining IP address.
Step S303, if the hardware address of the wireless access point to be connected is stored in default memory space, from institute It states default memory space and obtains priority level corresponding with the hardware address of the wireless access point to be connected.
In the embodiment of the present application, it after terminal device receives the instruction for obtaining IP address, can first obtain wait connect Wireless access point hardware address, be then confirmed whether that the hardware address for saving wireless access point to be connected is corresponding excellent First grade grade obtains the corresponding priority level of hardware address of wireless access point to be connected, the institute of preservation if saving The corresponding priority level of physical address for stating wireless access point to be accessed can also indicate the wireless access to be accessed The priority level that point is capable of handling.
Step S304 is based on the corresponding priority level, and the request letter for obtaining IP address is sent to Dynamic Host Configuration Protocol server Breath.
In the embodiment of the present application, after the corresponding priority level of acquisition, so that it may based on described corresponding preferential Grade grade, the solicited message for obtaining IP address is sent to Dynamic Host Configuration Protocol server, avoids the needs in Fig. 1 or embodiment illustrated in fig. 2 It the problem of repeatedly could successfully obtaining IP address to the solicited message that Dynamic Host Configuration Protocol server sends acquisition IP address, improves and obtains Take the success rate of IP address.
It should be understood that the size of the serial number of each step is not meant that the order of the execution order in above-described embodiment, each process Execution sequence should be determined by its function and internal logic, the implementation process without coping with the embodiment of the present application constitutes any limit It is fixed.
Fig. 4 is that the schematic block diagram for the terminal device that one embodiment of the application provides only is shown and this Shen for ease of description It please the relevant part of embodiment.
The terminal device 4 can be the software unit being built in the terminal devices such as existing mobile phone, notebook, hardware cell Or the unit of soft or hard combination, it can also be used as independent pendant and be integrated into the terminal devices such as the mobile phone, notebook.
The terminal device 4 includes:
First solicited message sending module 41, it is preset preferential for being based on after receiving the instruction for obtaining IP address Grade grade, the solicited message for obtaining IP address is sent to Dynamic Host Configuration Protocol server;
First priority level reduces module 42, if not receiving the DHCP service within the default response time The response message comprising IP address that device returns, then reduce the priority level;
Second solicited message sending module 43, for being obtained to Dynamic Host Configuration Protocol server transmission based on the priority level after reduction Take the solicited message of IP address.
Optionally, the first priority level reduction module 42 includes:
Solicited message transmission unit 421, if not receiving the Dynamic Host Configuration Protocol server within the default response time and returning The response message comprising IP address, then be based on preset priority level, continue to Dynamic Host Configuration Protocol server send obtain IP address Solicited message;
Priority level reduces unit 422, if for being asked based on preset priority level to what Dynamic Host Configuration Protocol server was sent When the number of information being asked to be greater than preset times, the response letter comprising IP address that the Dynamic Host Configuration Protocol server returns is not received yet Breath, then reduce the priority level.
Optionally, the terminal device 4 further include:
Second priority level reduces module 44, for being sent out to Dynamic Host Configuration Protocol server based on the priority level after reduction After sending the solicited message for obtaining IP address, if not receiving what the Dynamic Host Configuration Protocol server returned yet within the default response time Response message comprising IP address then continues to reduce current priority level, and sends to Dynamic Host Configuration Protocol server and obtain IP address Solicited message, the response message comprising IP address returned until receiving the Dynamic Host Configuration Protocol server.
Optionally, the terminal device 4 further include:
Memory module 45, for accessing the corresponding wireless access point of the Dynamic Host Configuration Protocol server according to the IP address, and it is raw At the hardware address of the wireless access point and when receiving the response message comprising IP address that the Dynamic Host Configuration Protocol server returns The corresponding relationship is stored in default memory space by the corresponding relationship of the priority level used.
Optionally, the terminal device 4 further include:
Hardware address obtains module 46, for obtaining the hardware address of wireless access point to be connected;
Priority level obtain module 47, if the hardware address for the wireless access point to be connected be stored in it is default Memory space is then obtained from the default memory space corresponding with the hardware address of the wireless access point to be connected preferential Grade grade;
Third solicited message sending module 48 is sent for being based on the corresponding priority level to Dynamic Host Configuration Protocol server Obtain the solicited message of IP address.
It is apparent to those skilled in the art that for convenience of description and succinctly, only with above-mentioned each function Can unit, module division progress for example, in practical application, can according to need and by above-mentioned function distribution by different Functional unit, module are completed, i.e., the internal structure of the terminal device is divided into different functional unit or module, to complete All or part of function described above.Each functional unit in embodiment, module can integrate in one processing unit, It is also possible to each unit to physically exist alone, can also be integrated in one unit with two or more units, above-mentioned collection At unit both can take the form of hardware realization, can also realize in the form of software functional units.In addition, each function Unit, module specific name be also only for convenience of distinguishing each other, the protection scope being not intended to limit this application.Above-mentioned dress The specific work process for setting middle unit, module, can refer to corresponding processes in the foregoing method embodiment, and details are not described herein.
Fig. 5 is the schematic block diagram for the terminal device that the another embodiment of the application provides.As shown in figure 5, the end of the embodiment End equipment 5 includes: one or more processors 50, memory 51 and is stored in the memory 51 and can be in the processing The computer program 52 run on device 50.The processor 50 is with realizing above-mentioned each acquisition IP when executing the computer program 52 Step in the embodiment of the method for location, such as step S101 to S103 shown in FIG. 1.Alternatively, the processor 50 execute it is described The function of each module/unit in above-mentioned terminal device embodiment, such as module 41 to 43 shown in Fig. 4 are realized when computer program 52 Function.
Illustratively, the computer program 52 can be divided into one or more module/units, it is one or Multiple module/units are stored in the memory 51, and are executed by the processor 50, to complete the application.Described one A or multiple module/units can be the series of computation machine program instruction section that can complete specific function, which is used for Implementation procedure of the computer program 52 in the terminal device 5 is described.For example, the computer program 52 can be divided It is cut into the first solicited message sending module, the first priority level reduces module, the second solicited message sending module.
The first solicited message sending module, for being based on preset excellent after receiving the instruction for obtaining IP address First grade grade sends the solicited message for obtaining IP address to Dynamic Host Configuration Protocol server;
First priority level reduces module, if not receiving the DHCP clothes within the default response time The response message comprising IP address that business device returns, then reduce the priority level;
The second solicited message sending module, for being sent to Dynamic Host Configuration Protocol server based on the priority level after reduction Obtain the solicited message of IP address.
Other modules or unit can refer to the description in embodiment shown in Fig. 4, and details are not described herein.
The terminal device includes but are not limited to processor 50, memory 51.It will be understood by those skilled in the art that figure 5 be only an example of terminal device 5, does not constitute the restriction to terminal device 5, may include more more or less than illustrating Component, perhaps combine certain components or different components, for example, the terminal device can also include input equipment, it is defeated Equipment, network access equipment, bus etc. out.
The processor 50 can be central processing unit (Central Processing Unit, CPU), can also be Other general processors, digital signal processor (Digital Signal Processor, DSP), specific integrated circuit (Application Specific Integrated Circuit, ASIC), ready-made programmable gate array (Field- Programmable Gate Array, FPGA) either other programmable logic device, discrete gate or transistor logic, Discrete hardware components etc..General processor can be microprocessor or the processor is also possible to any conventional processor Deng.
The memory 51 can be the internal storage unit of the terminal device 5, such as the hard disk or interior of terminal device 5 It deposits.The memory 51 is also possible to the External memory equipment of the terminal device 5, such as be equipped on the terminal device 5 Plug-in type hard disk, intelligent memory card (Smart Media Card, SMC), secure digital (Secure Digital, SD) card dodge Deposit card (Flash Card) etc..Further, the memory 51 can also both include the storage inside list of the terminal device 5 Member also includes External memory equipment.The memory 51 is for storing needed for the computer program and the terminal device Other programs and data.The memory 51 can be also used for temporarily storing the data that has exported or will export.
In the above-described embodiments, it all emphasizes particularly on different fields to the description of each embodiment, is not described in detail or remembers in some embodiment The part of load may refer to the associated description of other embodiments.
Those of ordinary skill in the art may be aware that list described in conjunction with the examples disclosed in the embodiments of the present disclosure Member and algorithm steps can be realized with the combination of electronic hardware or computer software and electronic hardware.These functions are actually It is implemented in hardware or software, the specific application and design constraint depending on technical solution.Professional technician Each specific application can be used different methods to achieve the described function, but this realization is it is not considered that exceed Scope of the present application.
In embodiment provided herein, it should be understood that disclosed terminal device and method can pass through it Its mode is realized.For example, terminal device embodiment described above is only schematical, for example, the module or list Member division, only a kind of logical function partition, there may be another division manner in actual implementation, for example, multiple units or Component can be combined or can be integrated into another system, or some features can be ignored or not executed.Another point is shown The mutual coupling or direct-coupling or communication connection shown or discussed can be through some interfaces, between device or unit Coupling or communication connection are 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 both can take the form of hardware realization, can also realize in the form of software functional units.
If the integrated module/unit be realized in the form of SFU software functional unit and as independent product sale or In use, can store in a computer readable storage medium.Based on this understanding, the application realizes above-mentioned implementation All or part of the process in example method, can also instruct relevant hardware to complete, the meter by computer program Calculation machine program can be stored in a computer readable storage medium, the computer program when being executed by processor, it can be achieved that on The step of stating each embodiment of the method.Wherein, the computer program includes computer program code, the computer program generation Code can be source code form, object identification code form, executable file or certain intermediate forms etc..The computer-readable medium It may include: any entity or device, recording medium, USB flash disk, mobile hard disk, magnetic that can carry the computer program code Dish, CD, computer storage, 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 described The content that computer-readable medium includes can carry out increasing appropriate according to the requirement made laws in jurisdiction with patent practice Subtract, such as in certain jurisdictions, according to legislation and patent practice, computer-readable medium do not include be electric carrier signal and Telecommunication signal.
Embodiment described above is only to illustrate the technical solution of the application, rather than its limitations;Although referring to aforementioned reality Example is applied the application is described in detail, those skilled in the art should understand that: it still can be to aforementioned each Technical solution documented by embodiment is modified or equivalent replacement of some of the technical features;And these are modified Or replacement, the spirit and scope of each embodiment technical solution of the application that it does not separate the essence of the corresponding technical solution should all Comprising within the scope of protection of this application.

Claims (8)

1. a kind of method for obtaining IP address characterized by comprising
After receiving the instruction for obtaining IP address, it is based on preset priority level, is sent to Dynamic Host Configuration Protocol server with obtaining IP The solicited message of location, the priority level refer to the priority level of the solicited message for obtaining IP address;
If not receiving the response message comprising IP address that the Dynamic Host Configuration Protocol server returns within the default response time, showing The Dynamic Host Configuration Protocol server can not return to the response message comprising IP address, then terminal device reduces the priority level;
Based on the priority level after reduction, the solicited message for obtaining IP address is sent to Dynamic Host Configuration Protocol server;
If not receiving the response message comprising IP address that the Dynamic Host Configuration Protocol server returns within the default response time, dropping Before the low priority level, further includes:
Based on preset priority level, continue to send the solicited message for obtaining IP address to Dynamic Host Configuration Protocol server;
If be greater than preset times to the number that Dynamic Host Configuration Protocol server sends solicited message based on preset priority level, do not connect yet The response message comprising IP address that the Dynamic Host Configuration Protocol server returns is received, then reduces the priority level.
2. obtaining the method for IP address as described in claim 1, which is characterized in that based on the priority level after reduction, After the solicited message for sending acquisition IP address to Dynamic Host Configuration Protocol server, further includes:
If not receiving the response message comprising IP address that the Dynamic Host Configuration Protocol server returns yet, then within the default response time Continue to reduce current priority level, and send the solicited message for obtaining IP address to Dynamic Host Configuration Protocol server, until receiving State the response message comprising IP address of Dynamic Host Configuration Protocol server return.
3. obtaining the method for IP address as claimed in claim 2, which is characterized in that returned receiving the Dynamic Host Configuration Protocol server The response message comprising IP address after, further includes:
The corresponding wireless access point of the Dynamic Host Configuration Protocol server is accessed according to the IP address, and generates the hard of the wireless access point Pair of the priority level used when part address and the response message comprising IP address for receiving the Dynamic Host Configuration Protocol server return It should be related to, the corresponding relationship is stored in default memory space.
4. obtaining the method for IP address as claimed in claim 3, which is characterized in that receiving the instruction for obtaining IP address Afterwards, further includes:
Obtain the hardware address of wireless access point to be connected;
If the hardware address of the wireless access point to be connected is stored in default memory space, from the default memory space Obtain priority level corresponding with the hardware address of the wireless access point to be connected;
Based on the corresponding priority level, the solicited message for obtaining IP address is sent to Dynamic Host Configuration Protocol server.
5. a kind of terminal device characterized by comprising
First solicited message sending module, for being based on preset priority level after receiving the instruction for obtaining IP address, The solicited message for obtaining IP address is sent to Dynamic Host Configuration Protocol server, the priority level refers to the request letter for obtaining IP address The priority level of breath;
First priority level reduces module, if not receiving the Dynamic Host Configuration Protocol server within the default response time and returning The response message comprising IP address, show that the Dynamic Host Configuration Protocol server can not return to the response message comprising IP address, then it is described Terminal device reduces the priority level;
Second solicited message sending module, for being sent to Dynamic Host Configuration Protocol server with obtaining IP based on the priority level after reduction The solicited message of location;
First priority level reduces module
Solicited message transmission unit, if within the default response time, do not receive the Dynamic Host Configuration Protocol server return includes The response message of IP address is then based on preset priority level, continues to send the request for obtaining IP address to Dynamic Host Configuration Protocol server Information;
Priority level reduces unit, if time for sending solicited message to Dynamic Host Configuration Protocol server based on preset priority level When number is greater than preset times, the response message comprising IP address that the Dynamic Host Configuration Protocol server returns is not received yet, then reduces institute State priority level.
6. terminal device as claimed in claim 5, which is characterized in that further include:
Second priority level reduces module, if not receiving the Dynamic Host Configuration Protocol server yet within the default response time and returning The response message comprising IP address returned then continues to reduce current priority level, and sends to Dynamic Host Configuration Protocol server and obtain IP The solicited message of address, the response message comprising IP address returned until receiving the Dynamic Host Configuration Protocol server.
7. a kind of terminal device, including memory, processor and storage are in the memory and can be on the processor The computer program of operation, which is characterized in that the processor realizes such as Claims 1-4 when executing the computer program The step of any one the method.
8. a kind of computer readable storage medium, which is characterized in that the computer-readable recording medium storage has computer journey Sequence realizes the step such as any one of Claims 1-4 the method when the computer program is executed by one or more processors Suddenly.
CN201711202552.0A 2017-11-27 2017-11-27 A kind of method, terminal device and storage medium obtaining IP address Active CN107968848B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711202552.0A CN107968848B (en) 2017-11-27 2017-11-27 A kind of method, terminal device and storage medium obtaining IP address

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711202552.0A CN107968848B (en) 2017-11-27 2017-11-27 A kind of method, terminal device and storage medium obtaining IP address

Publications (2)

Publication Number Publication Date
CN107968848A CN107968848A (en) 2018-04-27
CN107968848B true CN107968848B (en) 2019-08-13

Family

ID=61998755

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711202552.0A Active CN107968848B (en) 2017-11-27 2017-11-27 A kind of method, terminal device and storage medium obtaining IP address

Country Status (1)

Country Link
CN (1) CN107968848B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109639755B (en) * 2018-10-23 2022-04-12 平安科技(深圳)有限公司 Associated system server decoupling method, device, medium and electronic equipment
CN113039751B (en) * 2018-11-27 2023-10-31 蚂蚁矿池科技有限公司 Fault notification method, device and equipment
CN110166321A (en) * 2019-05-28 2019-08-23 上海联影医疗科技有限公司 Medical image acquisition method, apparatus, equipment and medium
CN116032417B (en) * 2021-10-25 2024-04-19 青岛海尔科技有限公司 Message processing method, terminal and server

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101005367A (en) * 2006-01-19 2007-07-25 华为技术有限公司 Medium stream transmission system and control method for medium stream transmission quality
CN101019387A (en) * 2005-01-17 2007-08-15 美国博通公司 Network user priority assignment system
CN101198165A (en) * 2007-10-19 2008-06-11 中兴通讯股份有限公司 Resource admission control method
CN101924736A (en) * 2009-06-16 2010-12-22 中兴通讯股份有限公司 Method and device for transmitting dynamic host configuration protocol message
CN101932036A (en) * 2009-06-23 2010-12-29 中兴通讯股份有限公司 Method and system for terminal to acquire IP address in WiMAX access process
CN103581345A (en) * 2012-07-19 2014-02-12 中兴通讯股份有限公司 IP address allocation method and IP address allocation device based on dynamic host configuration protocol
CN105577546A (en) * 2015-12-28 2016-05-11 中铁工程装备集团有限公司 Method for actively requesting access based on QoS

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100527752C (en) * 2005-08-19 2009-08-12 杭州华三通信技术有限公司 DHCP address allocation method
US20110142017A1 (en) * 2009-12-11 2011-06-16 Alcatel-Lucent Usa Inc. Differentiated QoS for Wi-Fi clients connected to a cable/DSL network

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101019387A (en) * 2005-01-17 2007-08-15 美国博通公司 Network user priority assignment system
CN101005367A (en) * 2006-01-19 2007-07-25 华为技术有限公司 Medium stream transmission system and control method for medium stream transmission quality
CN101198165A (en) * 2007-10-19 2008-06-11 中兴通讯股份有限公司 Resource admission control method
CN101924736A (en) * 2009-06-16 2010-12-22 中兴通讯股份有限公司 Method and device for transmitting dynamic host configuration protocol message
CN101932036A (en) * 2009-06-23 2010-12-29 中兴通讯股份有限公司 Method and system for terminal to acquire IP address in WiMAX access process
CN103581345A (en) * 2012-07-19 2014-02-12 中兴通讯股份有限公司 IP address allocation method and IP address allocation device based on dynamic host configuration protocol
CN105577546A (en) * 2015-12-28 2016-05-11 中铁工程装备集团有限公司 Method for actively requesting access based on QoS

Also Published As

Publication number Publication date
CN107968848A (en) 2018-04-27

Similar Documents

Publication Publication Date Title
CN107968848B (en) A kind of method, terminal device and storage medium obtaining IP address
CN108040367B (en) A kind of band of position UE update method, access network entity, UE and core network entity
CN102790776B (en) Heartbeat connection normalizing processing method, terminal, server and communication system
CN108282895A (en) A kind of accidental access method and terminal
CN104216761B (en) It is a kind of that the method for sharing equipment is used in the device that can run two kinds of operating system
CN109699089B (en) Channel access method and device
CN107484190B (en) Method for connecting network, mobile terminal and computer readable storage medium
CN103618667A (en) Information transfer method, access gateway and system
CN103346980A (en) Method and device for service dispatching and network equipment
CN109168171A (en) configuration information obtaining method, device, equipment and system
CN109040210A (en) Communication means, terminal device and storage medium between a kind of application
CN102957594A (en) Message queue-based message processing method, related device and system
US20200344785A1 (en) Data transmission method and device
CN105978606B (en) Bluetooth equipment remote communication method, bluetooth equipment and client
CN110351757A (en) A kind of scheduling request transmission method, terminal and network side equipment
CN107734556A (en) Data transfer control method and Related product
CN113438169A (en) Data scheduling method, electronic equipment and storage medium
CN109120731B (en) Universal communication method, system and device
US10045372B2 (en) Management of the use of a gateway by a plurality of terminals
CN107592361B (en) Data transmission method, device and equipment based on dual IB network
CN108256492A (en) A kind of image-recognizing method, apparatus and system
CN113572695B (en) Link aggregation method, device, computing equipment and computer storage medium
CN107506491B (en) OSD data distribution method and device of distributed file system
CN109639555B (en) Link layer message generation method, link layer message generation device and terminal equipment
CN106028303A (en) Smart device discovering method and device

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
CB02 Change of applicant information

Address after: Changan town in Guangdong province Dongguan 523860 usha Beach Road No. 18

Applicant after: OPPO Guangdong Mobile Communications Co., Ltd.

Address before: Changan town in Guangdong province Dongguan 523860 usha Beach Road No. 18

Applicant before: Guangdong OPPO Mobile Communications Co., Ltd.

CB02 Change of applicant information
GR01 Patent grant
GR01 Patent grant