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

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

Info

Publication number
CN107968848A
CN107968848A CN201711202552.0A CN201711202552A CN107968848A CN 107968848 A CN107968848 A CN 107968848A CN 201711202552 A CN201711202552 A CN 201711202552A CN 107968848 A CN107968848 A CN 107968848A
Authority
CN
China
Prior art keywords
address
configuration protocol
host configuration
dynamic host
protocol server
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
CN201711202552.0A
Other languages
Chinese (zh)
Other versions
CN107968848B (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, there is provided a kind of method, terminal device and storage medium for obtaining IP address, including:After the instruction for obtaining IP address is received, based on default priority level, the solicited message for obtaining IP address is sent to Dynamic Host Configuration Protocol server;If within the default response time, the response message for including IP address that the Dynamic Host Configuration Protocol server returns is not received, then 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, the success rate of terminal device acquisition IP address can be improved by the application.

Description

A kind of method, terminal device and storage medium for 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 technology
Dynamic host configuration protocol (Dynamic Host Configuration Protocol, DHCP) is used to allow network On host from a Dynamic Host Configuration Protocol server obtain a network that can allow the host normal communication between interconnection agreement (Internet protocol, IP) address and relevant configuration information.
At present, the method that the host on network obtains IP address from Dynamic Host Configuration Protocol server is typically that host is sent out to Dynamic Host Configuration Protocol server Send the solicited message of an acquisition IP address, after Dynamic Host Configuration Protocol server receives the solicited message of host transmission, return to one and include The response message of IP address.However, the method for obtaining IP address this at present, the success rate for obtaining IP address are relatively low.
The content 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 relatively low.
The first aspect of the embodiment of the present application provides a kind of method for obtaining IP address, including:
After the instruction for obtaining IP address is received, based on default priority level, send and obtain to Dynamic Host Configuration Protocol server The solicited message of IP address;
If within the default response time, the response message for including IP address that the Dynamic Host Configuration Protocol server returns is not received, 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, including:
First solicited message sending module, for receive obtain IP address instruction after, based on default priority Grade, the solicited message for obtaining IP address is sent to Dynamic Host Configuration Protocol server;
First priority level reduces module, if within the default response time, not receiving the Dynamic Host Configuration Protocol server The response message for including IP address returned, then reduce the priority level;
Second solicited message sending module, for based on the priority level after reduction, sending and obtaining to Dynamic Host Configuration Protocol server 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 performs 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 recording 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, based on default priority level, takes after the instruction for obtaining IP address is received to DHCP The solicited message for device transmission acquisition IP address of being engaged in, if within the default response time, does not receive what the Dynamic Host Configuration Protocol server returned Response message comprising IP address, then reduce 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 in the application with default priority level After the solicited message of IP address, if within the response time of setting, including for the Dynamic Host Configuration Protocol server return is not received by The response message of IP address, then reduce the priority level, then is continued with the priority level after reduction to Dynamic Host Configuration Protocol server Send the solicited message for obtaining IP address so that Dynamic Host Configuration Protocol server is because the DHCP data packets of various priority levels can not be handled When, it can be adjusted to adapt to the DHCP data packets for the priority level that Dynamic Host Configuration Protocol server can be handled, this makes it possible to increase to obtain Take the success rate of IP address.
Brief description of the drawings
, below will be to embodiment or description of the prior art in order to illustrate more clearly of the technical solution in the embodiment of the present application Needed in attached drawing be briefly described, it should be apparent that, drawings in the following description are only some of the application Embodiment, for those of ordinary skill in the art, without having to pay creative labor, can also be according to these Attached drawing obtains other attached drawings.
Fig. 1 is that a kind of method for the acquisition IP address that one embodiment of the application provides realizes flow diagram;
Fig. 2 is that the method for acquisition IP address that the another embodiment of the application provides a kind of realizes flow diagram;
Fig. 3 is that the method for acquisition IP address that the another embodiment of the application provides a kind of realizes flow diagram;
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.
Embodiment
In being described below, in order to illustrate rather than in order to limit, it is proposed that such as tool of particular system structure, technology etc Body details, to understand thoroughly the embodiment of the present application.However, it will be clear to one skilled in the art that these are specific The application can also be realized in the other embodiments of details.In other situations, omit to well-known system, device, electricity Road and the detailed description of method, in case unnecessary details hinders the description of the present application.
It should be appreciated that ought be special described by the instruction of term " comprising " use in this specification and in the appended claims Sign, entirety, step, operation, the presence of element and/or component, but be not precluded from one or more of the other feature, entirety, step, Operation, element, component and/or its presence or addition for gathering.
It is also understood that the term used in this present specification is merely for the sake of the mesh for describing 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 singulative, "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 combinations and all possible combinations of one or more of the 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 determining " 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, illustrated below by specific embodiment.
Fig. 1 is that the method for the acquisitions IP address that the application one embodiment provides realizes flow diagram, as shown in the figure this Method may comprise steps of:
Step S101, after the instruction for obtaining IP address is received, based on default priority level, to Dynamic Host Configuration Protocol server 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 Need to obtain IP address, communicated by the IP address of this acquisition with other terminal devices in network.With obtaining IP During location, have by way of static IP is set, also by DHCP modes, the embodiment of the present application is to obtain IP by DHCP modes Address, i.e., newly the terminal device of access network sends DHCP data packets to Dynamic Host Configuration Protocol server, and DHCP data packets, which contain, obtains IP The solicited message of address.Can be the terminal device point newly accessed when Dynamic Host Configuration Protocol server receives the solicited message for obtaining IP address With IP address.
It is described receive obtain IP address instruction after, can be the terminal device newly accessed upon actuation, i.e., described end End equipment is completed to represent to receive the instruction for obtaining IP address after starting.In certain practical application, other instructions can also be set As the instruction for obtaining IP address, for sending the solicited message of acquisition 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 shapes Formula, this priority level can farthest obtain IP address.Priority level can be preset in terminal device, can basis Priority level set in advance, 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 packets.
Step S102, if within the default response time, do not receive that the Dynamic Host Configuration Protocol server returns comprising IP address Response message, then reduce 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 can return to a response for including IP address to the terminal device that the solicited message is directed toward Information, if Dynamic Host Configuration Protocol server can not handle the solicited message that this obtains IP address, can not return to the sound comprising IP address Answer information, it is possible to set a response time, if within the default response time, the Dynamic Host Configuration Protocol server can be received The response message for including IP address returned, represents successfully to obtain IP address, if within the default response time, does not receive institute State Dynamic Host Configuration Protocol server return the response message for include IP address, then it represents that it is possible this acquisition IP address solicited message it is excellent First level 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 can be handled The solicited message of the acquisition IP address received, can reduce the priority level for the solicited message for obtaining IP address.
Step S103, based on the priority level after reduction, the solicited message for obtaining IP address is sent to Dynamic Host Configuration Protocol server.
In the embodiment of the present application, after the priority level for the solicited message for obtaining IP address is reduced, it is possible to base Priority level after reduction, the solicited message for obtaining IP address is sent to Dynamic Host Configuration Protocol server.If in this way, Dynamic Host Configuration Protocol server Because the priority level of the solicited message of the acquisition IP address received is higher and when can not handle, terminal device can reduce Resend the solicited message for obtaining IP address after priority level with the priority level after reduction again, Dynamic Host Configuration Protocol server is with regard to energy Enough processing obtain the solicited message of IP address, so as to return to the response message comprising IP address.
Due to sending asking for acquisition IP address to Dynamic Host Configuration Protocol server in the embodiment of the present application with default priority level After seeking information, if within the response time of setting, the sound for including IP address that the Dynamic Host Configuration Protocol server returns is not received by Information is answered, then reduces the priority level, then continue to send to Dynamic Host Configuration Protocol server with the priority level after reduction and obtain IP The solicited message of address so that Dynamic Host Configuration Protocol server can be adjusted because when can not handle the DHCP data packets of various priority levels The DHCP data packets of the whole priority level that can be handled for adaptation Dynamic Host Configuration Protocol server, 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, as shown in the figure the party Method may comprise steps of:
Step S201, after the instruction for obtaining IP address is received, based on default priority level, to Dynamic Host Configuration Protocol server Send the solicited message for obtaining IP address.
The step is consistent with step S101 contents, 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 packets be arranged to level-one, two level, Three-level ... etc..Level-one represents priority level highest, and two level, three-level ... represent that priority level gradually reduces successively, when So, in practical application, the mode that the priority level is set can also be other manner, and differ a citing herein.
Step S202, if within the default response time, do not receive that the Dynamic Host Configuration Protocol server returns comprising IP address Response message, then based on default priority level, continue 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 for including IP address returned, is on the one hand probably the acquisition that the terminal device is sent with default 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 can handle the solicited message of the acquisition IP address of default priority level, but the IP address that obtains Solicited message from terminal device to the Dynamic Host Configuration Protocol server send during occur loss of data phenomena such as or DHCP clothes Business device currently breaks down can not return to the response message for including IP address to terminal device in time.So if in default response In time, the response message for including IP address that the Dynamic Host Configuration Protocol server returns is not received, is reducing the priority level Before, it is also necessary to based on default 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 based on default priority level to Dynamic Host Configuration Protocol server is more than in advance If during number, the response message for including IP address that the Dynamic Host Configuration Protocol server returns is not received yet, then reduces the priority Grade.
In the embodiment of the present application, terminal device is believed based on default priority level to the request that Dynamic Host Configuration Protocol server is sent Breath, often sends a solicited message, waits for the default response time accordingly, if with default priority level to DHCP service When the number for the solicited message that device is sent is more than preset times, do not receive the Dynamic Host Configuration Protocol server return yet includes IP address Response message, the solicited message of the acquisition IP address can be excluded substantially lost during transmission the problem of, it is described Dynamic Host Configuration Protocol server possibly can not handle the solicited message of the acquisition IP address of default priority level, at this moment just need to reduce institute State priority level.
By way of example it is assumed that the default priority level of DHCP data packets is two 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 packets of two level and obtains IP The solicited message of address, if in 3 seconds, does not receive the response message for including IP address that the Dynamic Host Configuration Protocol server returns, then after The continuous DHCP data packets using priority level as two level send the solicited message for obtaining IP address to the Dynamic Host Configuration Protocol server, often with Priority level sends the solicited message for obtaining IP address for the DHCP data packets of two level to the Dynamic Host Configuration Protocol server, is required for To the response time of 3 seconds, so continuously hair 5 times, the sound for including IP address that the Dynamic Host Configuration Protocol server returns still is not received Information is answered, then it is three-level to reduce the priority level.
It should be noted that once sent with obtaining IP to the Dynamic Host Configuration Protocol server with default priority level any In the default response time after the solicited message of location, if receiving the letter of the response comprising IP address that the Dynamic Host Configuration Protocol server returns Breath, then need not be further continued for sending the solicited message for obtaining IP address to the Dynamic Host Configuration Protocol server.
Step S204, based on the priority level after reduction, the solicited message for obtaining IP address is sent to Dynamic Host Configuration Protocol server.
The step is consistent with step S103 contents, specifically can refer to the description of step S103, details are not described herein.
Step S205, if within the default response time, do not receive the Dynamic Host Configuration Protocol server return yet includes IP address 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 for including 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 reduction is pre- If in the response time, it still can not receive the response message for including IP address that the Dynamic Host Configuration Protocol server returns, then it represents that described Dynamic Host Configuration Protocol server still may can not handle the solicited message of the priority level after reducing, at this moment, it is necessary to continue to reduce excellent First level grade.
Continue with step S203 description illustrate, by priority level after two level is reduced to three-level, with three-level Priority level sends the solicited message for obtaining IP address to Dynamic Host Configuration Protocol server, if within the response time of 3 seconds, still can not The response message for including 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 within the response time of 3 seconds, still can not receive the response for including IP address that the Dynamic Host Configuration Protocol server returns Information, then continue to reduce priority level, priority level be reduced to Pyatyi from level Four ... ....
A priority level is often reduced, is required for sending with obtaining IP to Dynamic Host Configuration Protocol server with newest priority level The solicited message of location, while the default response time is needed to wait for, only within the default response time, do not receive described The response message for including IP address that Dynamic Host Configuration Protocol server returns, just may proceed to reduce priority level.
The condition of termination is:After the solicited message for obtaining IP address being sent with arbitrary priority level to Dynamic Host Configuration Protocol server Response time in, receive the response message for including IP address that the Dynamic Host Configuration Protocol server returns, then need not continue to reduce excellent First level grade;Alternatively, after priority level to be reduced to minimum priority level, taken with minimum priority level to DHCP In response time after the solicited message of device transmission acquisition IP address of being engaged in, the bag 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 being sent with default priority level continuous several times to Dynamic Host Configuration Protocol server Solicited message, avoid and obtain IP address since DHCP data packets packet loss or the Dynamic Host Configuration Protocol server can not be handled temporarily The problem of obtaining IP address caused by solicited message not successfully, also by reducing the priority level of DHCP data packets step by step, makes 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 packets of high priority grade, also can be by reducing the preferential of DHCP data packets step by step Level grade so that improve 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, as shown in the figure the party Method is the embodiment on the basis of Fig. 1 or embodiment illustrated in fig. 2, specifically includes following steps:
Step S301, the corresponding wireless access point of the Dynamic Host Configuration Protocol server is accessed according to the IP address, and described in generation 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 correspondence of priority level, default memory space is stored in by the correspondence.
In the embodiment of the present application, the wireless access point, refers to wireless access points (WirelessAccess Point, wireless aps).After the information for the IP address that the Dynamic Host Configuration Protocol server is sent is obtained, terminal device can access DHCP The corresponding wireless access point of server.At the same time it can also the response message for including 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 is associated 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 Put, there is uniqueness.
Step S302, after the instruction for obtaining IP address is received, obtains the hardware address of wireless access point to be connected.
Step S303, if the hardware address of the wireless access point to be connected is stored in default memory space, from institute State default memory space and obtain priority level corresponding with the hardware address of the wireless access point to be connected.
In the embodiment of the present application, after terminal device receives the instruction for obtaining IP address, it can first obtain and wait to 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 level grade, if saving, obtains the corresponding priority level of hardware address of wireless access point to be connected, the institute of preservation The wireless access to be accessed can also be represented by stating the corresponding priority level of physical address of wireless access point to be accessed The priority level that point can be handled.
Step S304, based on the corresponding priority level, 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, it is possible to based on described corresponding preferential Level 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 The problem of repeatedly could successfully obtaining IP address to the solicited message of Dynamic Host Configuration Protocol server transmission acquisition IP address, improve and obtain Take the success rate of IP address.
It is to be understood that the size of the sequence number of each step is not meant to the priority of execution sequence, each process in above-described embodiment Execution sequence should determine that the implementation process without tackling the embodiment of the present application forms any limit with its function and internal logic It is fixed.
Fig. 4 is the schematic block diagram for the terminal device that one embodiment of the application provides, and for convenience of description, is only shown and this Shen Please the relevant part of embodiment.
The terminal device 4 can be software unit, the hardware cell being built in the terminal devices such as existing mobile phone, notebook Or the unit of soft or hard combination, it can also be integrated into as independent suspension member in the terminal devices such as the mobile phone, notebook.
The terminal device 4 includes:
First solicited message sending module 41, for after the instruction for obtaining IP address is received, based on default preferential Level grade, the solicited message for obtaining IP address is sent to Dynamic Host Configuration Protocol server;
First priority level reduces module 42, if within the default response time, not receiving the DHCP service The response message for including IP address that device returns, then reduce the priority level;
Second solicited message sending module 43, for based on the priority level after reduction, sending and obtaining to Dynamic Host Configuration Protocol server Take the solicited message of IP address.
Optionally, first priority level reduces module 42 and includes:
Solicited message transmitting element 421, if within the default response time, not receiving the Dynamic Host Configuration Protocol server and returning The response message for including IP address, then based on default priority level, continue to send to Dynamic Host Configuration Protocol server and obtain IP address Solicited message;
Priority level reduces unit 422, if for being asked based on default priority level to what Dynamic Host Configuration Protocol server was sent When asking the number of information to be more than preset times, the letter of the response 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 includes:
Second priority level reduces module 44, for the priority level after based on reduction, is sent out to Dynamic Host Configuration Protocol server After sending the solicited message for obtaining IP address, if within the default response time, do not receive what the Dynamic Host Configuration Protocol server returned yet Response message comprising IP address, then continue to reduce current priority level, and is sent to Dynamic Host Configuration Protocol server and obtain IP address Solicited message, the response message for including IP address returned until receiving the Dynamic Host Configuration Protocol server.
Optionally, the terminal device 4 further includes:
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 Into 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 correspondence of the priority level used, default memory space is stored in by the correspondence.
Optionally, the terminal device 4 further includes:
Hardware address acquisition module 46, for obtaining the hardware address of wireless access point to be connected;
Priority level acquisition module 47, if the hardware address for the wireless access point to be connected be stored in it is default Memory space, then obtain corresponding with the hardware address of the wireless access point to be connected preferential from the default memory space Level grade;
3rd solicited message sending module 48, for based on the corresponding priority level, being sent 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 work( Can unit, module division progress for example, in practical application, can be as needed and by above-mentioned function distribution by different Functional unit, module are completed, will the internal structure of the terminal device be divided into different functional units or module, to complete All or part of function described above.Each functional unit, module in embodiment can be integrated in a processing unit, Can also be that unit is individually physically present, can also two or more units integrate in a unit, above-mentioned collection Into unit can both have been realized in the form of hardware, can also be realized in the form of SFU software functional unit.In addition, each function Unit, the specific name of module are not limited to the protection domain of the application also only to facilitate mutually distinguish.Above-mentioned dress Middle unit, the specific work process of module are put, may be referred to the corresponding process in preceding method embodiment, 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 it 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 performing the computer program 52 Step in the embodiment of the method for location, such as the step S101 to S103 shown in Fig. 1.Alternatively, the processor 50 perform 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 during computer program 52 Function.
Exemplary, 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 performed by the processor 50, to complete the application.Described one A or multiple module/units can be the series of computation machine programmed 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 receive obtain IP address instruction after, based on default excellent First level grade, the solicited message for obtaining IP address is sent to Dynamic Host Configuration Protocol server;
First priority level reduces module, if within the default response time, not receiving the DHCP clothes The response message for including IP address that business device returns, then reduce the priority level;
The second solicited message sending module, for based on the priority level after reduction, being sent to Dynamic Host Configuration Protocol server Obtain the solicited message of IP address.
Other modules or unit can refer to the description in the 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 form the restriction to terminal device 5, can be included more more or less than illustrating Component, either combine some components or different components, such as the terminal device can also include input equipment, defeated Go out equipment, network access equipment, bus etc..
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), application-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 can also be any conventional processor Deng.
The memory 51 can be the internal storage unit of the terminal device 5, such as the hard disk of terminal device 5 or interior Deposit.The memory 51 can also be the External memory equipment of the terminal device 5, such as be equipped with the terminal device 5 Plug-in type hard disk, intelligent memory card (Smart Media Card, SMC), secure digital (Secure Digital, SD) card, dodges 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 used to store 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, the description to each embodiment all emphasizes particularly on different fields, and 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 realize that each exemplary list described with reference to the embodiments described herein Member and algorithm steps, can be realized with the combination of electronic hardware or computer software and electronic hardware.These functions are actually Performed with hardware or software mode, application-specific and design constraint depending on technical solution.Professional technician Described function can be realized using distinct methods to each specific application, 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 The division of member, is only a kind of division of logic function, can there is other dividing mode when actually realizing, for example, multiple units or Component can combine or be desirably integrated into another system, or some features can be ignored, or not perform.It is another, show Show or the mutual coupling discussed or direct-coupling or communication connection can be by some interfaces, between device or unit Coupling or communication connection are connect, can be electrical, machinery or other forms.
The unit illustrated as separating component may or may not be physically separate, be shown as unit The component shown may or may not be physical location, you can with positioned at a place, or can also be distributed to multiple In network unit.Some or all of unit therein can be selected to realize the mesh of this embodiment scheme according to the actual needs 's.
In addition, each functional unit in each embodiment of the application can be integrated in a processing unit, can also That unit is individually physically present, can also two or more units integrate in a unit.Above-mentioned integrated list Member can both be realized in the form of hardware, can also be realized in the form of SFU software functional unit.
If the integrated module/unit realized in the form of SFU software functional unit and as independent production marketing or In use, it can be stored in a computer read/write memory medium.Based on such understanding, the application realizes above-mentioned implementation All or part of flow 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 recording 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 some intermediate forms etc..The computer-readable medium It can include:Any entity or device, recording medium, USB flash disk, mobile hard disk, the magnetic of the computer program code can be carried Dish, CD, computer storage, read-only storage (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium etc..It is it should be noted that described The content that computer-readable medium includes can carry out appropriate increasing according to legislation in jurisdiction and the requirement of patent practice Subtract, such as in some 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 with reference to foregoing reality Example is applied the application is described in detail, it will be understood by those of ordinary skill in the art that:It still can be to foregoing each Technical solution described in embodiment is modified, or carries out equivalent substitution to which part technical characteristic;And these are changed Or replace, the essence of appropriate technical solution is departed from the spirit and scope of each embodiment technical solution of the application, should all Within the protection domain of the application.

Claims (10)

  1. A kind of 1. method for obtaining IP address, it is characterised in that including:
    After the instruction for obtaining IP address is received, based on default priority level, sent to Dynamic Host Configuration Protocol server with obtaining IP The solicited message of location;
    If within the default response time, the response message for including IP address that the Dynamic Host Configuration Protocol server returns is not received, then is dropped The low priority level;
    Based on the priority level after reduction, the solicited message for obtaining IP address is sent to Dynamic Host Configuration Protocol server.
  2. 2. the method for IP address is obtained as claimed in claim 1, it is characterised in that if within the default response time, do not receive The response message for including IP address returned to the Dynamic Host Configuration Protocol server, before the priority level is reduced, further includes:
    Based on default priority level, continue to send the solicited message for obtaining IP address to Dynamic Host Configuration Protocol server;
    If the number of the solicited message sent based on default priority level to Dynamic Host Configuration Protocol server is more than preset times, not yet The response message for including IP address that the Dynamic Host Configuration Protocol server returns is received, then reduces the priority level.
  3. 3. the method for IP address is obtained as claimed in claim 1 or 2, it is characterised in that priority after based on reduction etc. Level, after the solicited message for obtaining IP address is sent to Dynamic Host Configuration Protocol server, further includes:
    If within the default response time, the response message for including IP address that the Dynamic Host Configuration Protocol server returns is not received yet, then Continue to reduce current priority level, and the solicited message for obtaining IP address is sent to Dynamic Host Configuration Protocol server, until receiving State the response message for including IP address of Dynamic Host Configuration Protocol server return.
  4. 4. the method for IP address is obtained as claimed in claim 3, it is characterised in that returned receiving the Dynamic Host Configuration Protocol server The response message comprising IP address after, further include:
    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 Part address and pair for receiving the priority level used during the response message comprising IP address of the Dynamic Host Configuration Protocol server return It should be related to, the correspondence is stored in default memory space.
  5. 5. the method for IP address is obtained as claimed in claim 4, it is characterised in that receiving the instruction of acquisition IP address Afterwards, further include:
    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.
  6. A kind of 6. terminal device, it is characterised in that including:
    First solicited message sending module, for after the instruction for obtaining IP address is received, based on default priority level, The solicited message for obtaining IP address is sent to Dynamic Host Configuration Protocol server;
    First priority level reduces module, if within the default response time, not receiving the Dynamic Host Configuration Protocol server and returning The response message for including IP address, then reduce the priority level;
    Second solicited message sending module, for based on the priority level after reduction, being sent to Dynamic Host Configuration Protocol server with obtaining IP The solicited message of location.
  7. 7. terminal device as claimed in claim 6, it is characterised in that first priority level, which reduces module, to be included:
    Solicited message transmitting element, if within the default response time, not receiving including for the Dynamic Host Configuration Protocol server return The response message of IP address, then based on default priority level, continue to send the request for obtaining IP address to Dynamic Host Configuration Protocol server Information;
    Priority level reduces unit, if for solicited message from default priority level to Dynamic Host Configuration Protocol server that sent based on When number is more than preset times, the response message for including IP address that the Dynamic Host Configuration Protocol server returns is not received yet, then is reduced The priority level.
  8. 8. terminal device as claimed in claim 6, it is characterised in that further include:
    Second priority level reduces module, if within the default response time, not receiving the Dynamic Host Configuration Protocol server yet and returning The response message for including IP address returned, then continue to reduce current priority level, and is sent to Dynamic Host Configuration Protocol server and obtain IP The solicited message of address, the response message for including IP address returned until receiving the Dynamic Host Configuration Protocol server.
  9. 9. a kind of terminal device, including memory, processor and it is stored in the memory and can be on the processor The computer program of operation, it is characterised in that the processor realizes such as claim 1 to 5 when performing the computer program The step of any one the method.
  10. 10. a kind of computer-readable recording medium, it is characterised in that the computer-readable recording medium storage has computer journey Sequence, is realized such as the step of any one of claim 1 to 5 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 true CN107968848A (en) 2018-04-27
CN107968848B 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)

Cited By (5)

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

Citations (9)

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

Patent Citations (9)

* 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
CN1744612A (en) * 2005-08-19 2006-03-08 杭州华为三康技术有限公司 DHCP address allocation method
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
US20110142017A1 (en) * 2009-12-11 2011-06-16 Alcatel-Lucent Usa Inc. Differentiated QoS for Wi-Fi clients connected to a cable/DSL network
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

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109639755A (en) * 2018-10-23 2019-04-16 平安科技(深圳)有限公司 Interconnected system server decoupling method, device, medium and electronic equipment
CN113039751A (en) * 2018-11-27 2021-06-25 蚂蚁矿池科技有限公司 Fault notification method, device and 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
CN116032417A (en) * 2021-10-25 2023-04-28 青岛海尔科技有限公司 Message processing method, terminal and server
CN116032417B (en) * 2021-10-25 2024-04-19 青岛海尔科技有限公司 Message processing method, terminal and server

Also Published As

Publication number Publication date
CN107968848B (en) 2019-08-13

Similar Documents

Publication Publication Date Title
CN106961741B (en) A kind of uplink resource allocating method and device
CN109618373A (en) Link choosing method and relevant apparatus
CN109041262A (en) Data transmission method and relevant apparatus
CN109639636A (en) Business datum forwarding, business data processing method, device and electronic equipment
CN105263178B (en) The reception operation mode instruction saved for electric power
CN102790776A (en) Heartbeat connection normalizing processing method, terminal, server and communication system
CN108040358A (en) A kind of connection method of wireless network, terminal device and storage medium
CN107396287A (en) The choosing method and device of a kind of working frequency points
CN107968848A (en) A kind of method, terminal device and storage medium for obtaining IP address
CN109274596A (en) Data transmission method and relevant apparatus
CN109168171A (en) configuration information obtaining method, device, equipment and system
CN103618667A (en) Information transfer method, access gateway and system
CN109526020A (en) Data transmission method and Related product
CN107949031A (en) A kind of scan method of wireless network, mobile terminal and storage medium
CN109951400A (en) Instruction sending method, device, electronic equipment and the readable storage medium storing program for executing of terminal
CN105978606B (en) Bluetooth equipment remote communication method, bluetooth equipment and client
CN107404752A (en) Frequency choosing method and internet-of-things terminal based on signal intensity
CN107040427A (en) A kind of method and device of network card configuration
TWI771522B (en) Method and device of wireless communication
CN107770847A (en) Method for network access, access device and terminal device
CN106028469B (en) A kind of communication connection method for building up, device and mobile terminal
CN109639555B (en) Link layer message generation method, link layer message generation device and terminal equipment
CN105142166B (en) The transmission method and device of smart mobile phone signal
CN102891888B (en) A kind of data access method and relevant device, system
CN104851409B (en) A kind of data processing method, device and a kind of display screen drive chip

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