Control method of MAC address, intelligent terminal and storage medium

文档序号:1616998 发布日期:2020-01-10 浏览:11次 中文

阅读说明:本技术 一种mac地址的控制方法、智能终端及存储介质 (Control method of MAC address, intelligent terminal and storage medium ) 是由 曹芝勇 于 2018-07-03 设计创作,主要内容包括:本发明公开了一种MAC地址的控制方法、智能终端及存储介质,所述方法包括:当智能终端在开机网络初始化时,读取当前的MAC地址和最近联网时间,进行MAC地址和最近联网时间合法性校验;智能终端向云端服务器请求合法的MAC地址,当请求通过后接收云端服务器发送的合法的MAC地址;智能终端存储合法的MAC地址和当前的联网时间,并进行正常的联网操作。本发明通过智能终端预设保留MAC地址,在开机网络初始化时,与云端服务器进行交互,从而获取可用、合法的MAC地址,避免了漏抄MAC地址的风险,同时将长期未使用的MAC地址动态回收。(The invention discloses a control method of an MAC address, an intelligent terminal and a storage medium, wherein the method comprises the following steps: when the intelligent terminal is initialized in a starting network, reading a current MAC address and the latest networking time, and verifying the validity of the MAC address and the latest networking time; the intelligent terminal requests a legal MAC address from the cloud server, and receives the legal MAC address sent by the cloud server after the request passes; the intelligent terminal stores the legal MAC address and the current networking time and carries out normal networking operation. According to the invention, the MAC address is preserved in advance through the intelligent terminal, and the intelligent terminal interacts with the cloud server when the network is started up for initialization, so that an available and legal MAC address is obtained, the risk of missing copying the MAC address is avoided, and meanwhile, the MAC address which is not used for a long time is dynamically recovered.)

1. A method for controlling a MAC address, the method comprising:

when the intelligent terminal is initialized in a starting network, reading a current MAC address and the latest networking time, and verifying the validity of the MAC address and the latest networking time;

the intelligent terminal requests a legal MAC address from the cloud server, and receives the legal MAC address sent by the cloud server after the request passes;

the intelligent terminal stores the legal MAC address and the current networking time and carries out normal networking operation.

2. The method for controlling the MAC address according to claim 1, wherein before the intelligent terminal reads the current MAC address and the latest networking time when the network is initialized at startup, the method further comprises:

the intelligent terminal presets and reserves a default MAC address and networking time in a local system; wherein the default MAC address is not activated.

3. The MAC address control method according to claim 2, wherein the pre-setting and reserving a default MAC address and a networking time in the local system by the intelligent terminal specifically comprises:

the intelligent terminal presets and reserves a default MAC address in a system software code, and all the intelligent terminal initial MAC addresses are the same and can be used for networking;

the intelligent terminal stores the latest networking time and is used for recording whether the network is not used for a long time.

4. The method for controlling the MAC address according to claim 3, wherein the reading the current MAC address and the latest networking time when the intelligent terminal initializes the network at startup, and the performing the validity check of the MAC address and the latest networking time specifically comprises:

the intelligent terminal initializes the starting network and reads the current MAC address and the latest networking time;

if the current MAC address is the reserved default MAC address, judging that the current MAC address is a non-legal address and requiring a legal address;

if the current MAC address is a legal address, checking whether the latest networking time exceeds a threshold value, if so, recovering the current MAC address and requiring the legal address again.

5. The method of claim 4, wherein if the current MAC address is the reserved default MAC address, determining that the current MAC address is an unauthorized address, and after a request for an authorized address is required, the method further comprises:

if the current MAC address is a legal address and the latest networking time is not checked to exceed the threshold value, the legal address does not need to be requested again.

6. The MAC address control method according to claim 4, wherein the intelligent terminal requests a legal MAC address from the cloud server, and receiving the legal MAC address sent by the cloud server after the request is passed specifically includes:

the intelligent terminal reports the terminal serial number, the MAC address and the latest networking time of the intelligent terminal to the cloud server, and requests a legal MAC address from the cloud server;

the cloud server takes the terminal serial number as a main key word, stores a data table of the terminal serial number, the MAC address and the networking time, and stores an unused MAC address data set;

the cloud server selects any MAC address from the unused MAC address data set, distributes the MAC address to the intelligent terminal and records the MAC address in a data table with the terminal serial number as a main key word.

7. The MAC address control method of claim 6, wherein the intelligent terminal requests a legal MAC address from the cloud server, and receiving the legal MAC address sent by the cloud server after the request is passed further comprises:

the cloud server checks the latest networking time of each intelligent terminal every preset period, and if the latest networking time exceeds a threshold value, the MAC address is recovered.

8. The MAC address control method according to claim 7, wherein the intelligent terminal stores a legal MAC address and a current networking time, and performs a normal networking operation specifically includes:

the intelligent terminal stores a legal MAC address and the current networking time;

and the intelligent terminal performs normal networking operation through a legal MAC address.

9. An intelligent terminal, characterized in that, intelligent terminal includes: memory, a processor and a control program for a MAC address stored on the memory and executable on the processor, the control program for a MAC address implementing the steps of the control method for a MAC address according to any one of claims 1 to 8 when executed by the processor.

10. A storage medium storing a control program of a MAC address, the control program of the MAC address realizing the steps of the control method of the MAC address according to any one of claims 1 to 8 when executed by a processor.

Technical Field

The present invention relates to the field of communications technologies, and in particular, to a method for controlling an MAC address, an intelligent terminal, and a storage medium.

Background

An intelligent terminal accessing the internet often needs to have a MAC address (Media Access Control or Media Access Control, which is translated into Media Access Control, or called physical address, hardware address, and is used to define the location of a network device) identification identity, the MAC address is usually burned in an internal memory of the intelligent device terminal, the MAC address is determined by a network card and is fixed, and the MAC address is used to identify the addresses of a computer sending data and a host receiving data when transmitting data, that is, the MAC address identifies a network host through the physical address in the network transmission process.

With the development of network technology, more and more intelligent terminals are configured with network functions, such as televisions, mobile phones, and the like, and the intelligent terminals often have two access modes, namely wired access mode and wireless access mode.

In the prior art, the wired and wireless MAC addresses are generally copied through a factory serial port command, and in the prior art, the MAC address sharing is realized through a wired network card and a wireless network card, but at least one MAC address still needs to be copied; meanwhile, the risk of missing copying the MAC address exists in a factory, and the network of a factory machine can not be used possibly; in addition, the MAC address has uniqueness, which causes the waste of MAC address resources if the television is never networked; in addition, the MAC address of the failed scrap and inactive machines is not effectively recycled.

Accordingly, the prior art is yet to be improved and developed.

Disclosure of Invention

The invention aims to solve the technical problem that the control method of the MAC address, the intelligent terminal and the storage medium are provided aiming at overcoming the defects of the prior art, and the control method of the MAC address, the intelligent terminal and the storage medium aim to obtain an available and legal MAC address by presetting and reserving the MAC address through the intelligent terminal and interacting with a cloud server when a network is started to initialize, so that the risk of missing reading the MAC address is avoided, and meanwhile, the MAC address which is not used for a long time is dynamically recycled.

The technical scheme adopted by the invention for solving the technical problem is as follows:

a control method of a MAC address, wherein the control method of the MAC address comprises the following steps:

when the intelligent terminal is initialized in a starting network, reading a current MAC address and the latest networking time, and verifying the validity of the MAC address and the latest networking time;

the intelligent terminal requests a legal MAC address from the cloud server, and receives the legal MAC address sent by the cloud server after the request passes;

the intelligent terminal stores the legal MAC address and the current networking time and carries out normal networking operation.

The method for controlling the MAC address, wherein when the intelligent terminal initializes the network at startup, reading the current MAC address and the latest networking time, and performing validity check on the MAC address and the latest networking time further includes:

the intelligent terminal presets and reserves a default MAC address and networking time in a local system; wherein the default MAC address is not activated.

The MAC address control method, wherein presetting and reserving a default MAC address and networking time in the local system by the intelligent terminal specifically includes:

the intelligent terminal presets and reserves a default MAC address in a system software code, and all the intelligent terminal initial MAC addresses are the same and can be used for networking;

the intelligent terminal stores the latest networking time and is used for recording whether the network is not used for a long time.

The MAC address control method includes reading a current MAC address and a latest networking time when the intelligent terminal initializes the network at startup, and performing validity check on the MAC address and the latest networking time specifically includes:

the intelligent terminal initializes the starting network and reads the current MAC address and the latest networking time;

if the current MAC address is the reserved default MAC address, judging that the current MAC address is a non-legal address and requiring a legal address;

if the current MAC address is a legal address, checking whether the latest networking time exceeds a threshold value, if so, recovering the current MAC address and requiring the legal address again.

The MAC address control method, wherein if the current MAC address is the reserved default MAC address, determining that the current MAC address is a non-legal address, and after a legal address is requested, the method further includes:

if the current MAC address is a legal address and the latest networking time is not checked to exceed the threshold value, the legal address does not need to be requested again.

The MAC address control method includes that the intelligent terminal requests a legal MAC address from the cloud server, and receiving the legal MAC address sent by the cloud server after the request passes includes:

the intelligent terminal reports the terminal serial number, the MAC address and the latest networking time of the intelligent terminal to the cloud server, and requests a legal MAC address from the cloud server;

the cloud server takes the terminal serial number as a main key word, stores a data table of the terminal serial number, the MAC address and the networking time, and stores an unused MAC address data set;

the cloud server selects any MAC address from the unused MAC address data set, distributes the MAC address to the intelligent terminal and records the MAC address in a data table with the terminal serial number as a main key word.

The MAC address control method includes that the intelligent terminal requests a legal MAC address from the cloud server, and receiving the legal MAC address sent by the cloud server after the request passes the legal MAC address request further includes:

the cloud server checks the latest networking time of each intelligent terminal every preset period, and if the latest networking time exceeds a threshold value, the MAC address is recovered.

The MAC address control method includes the steps of storing a legal MAC address and current networking time by the intelligent terminal, and performing normal networking operation specifically including:

the intelligent terminal stores a legal MAC address and the current networking time;

and the intelligent terminal performs normal networking operation through a legal MAC address.

An intelligent terminal, wherein the intelligent terminal comprises: the control program of the MAC address is stored on the memory and can run on the processor, and when being executed by the processor, the control program of the MAC address realizes the steps of the control method of the MAC address.

A storage medium, wherein the storage medium stores a control program of a MAC address, which when executed by a processor implements the steps of the control method of the MAC address as described above.

The invention discloses a control method of an MAC address, an intelligent terminal and a storage medium, wherein the method comprises the following steps: when the intelligent terminal is initialized in a starting network, reading a current MAC address and the latest networking time, and verifying the validity of the MAC address and the latest networking time; the intelligent terminal requests a legal MAC address from the cloud server, and receives the legal MAC address sent by the cloud server after the request passes; the intelligent terminal stores the legal MAC address and the current networking time and carries out normal networking operation. According to the invention, the MAC address is preserved in advance through the intelligent terminal, and the intelligent terminal interacts with the cloud server when the network is started up for initialization, so that an available and legal MAC address is obtained, the risk of missing copying the MAC address is avoided, and meanwhile, the MAC address which is not used for a long time is dynamically recovered.

Drawings

FIG. 1 is a flow chart of a preferred embodiment of a method for controlling a MAC address of the present invention;

FIG. 2 is a flowchart of step S10 in the preferred embodiment of the method for controlling MAC address of the present invention;

FIG. 3 is a flowchart of step S20 in the preferred embodiment of the method for controlling MAC address of the present invention;

FIG. 4 is a flowchart of step S30 in the preferred embodiment of the method for controlling MAC address of the present invention;

fig. 5 is a schematic operating environment diagram of an intelligent terminal according to a preferred embodiment of the present invention.

Detailed Description

In order to make the objects, technical solutions and advantages of the present invention clearer and clearer, the present invention is further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.

As shown in fig. 1, a method for controlling an MAC address according to a preferred embodiment of the present invention includes the following steps:

and step S10, when the intelligent terminal is initialized in the startup network, reading the current MAC address and the latest networking time, and checking the validity of the MAC address and the latest networking time.

Specifically, the method further includes, before the step S10: the intelligent terminal presets and reserves a default MAC address and networking time in a local system; wherein the default MAC address is not activated. The intelligent terminal presets and reserves a default MAC address and networking time in a local system, and the method specifically comprises the following steps: the intelligent terminal presets and reserves a default MAC address in a system software code, and all the intelligent terminal initial MAC addresses are the same and can be used for networking default MAC addresses (a default value is initialized so as to judge whether to be activated or not); the intelligent terminal stores the latest networking time and is used for recording whether the network is not used for a long time.

For example, the reserved MAC address may be defined as 5C-FF-35-0B-95-B5, and this MAC address is randomly defined with no special requirement as long as networking-capable requirements are met.

Please refer to fig. 2, which is a flowchart of step S10 in the MAC address control method according to the present invention.

As shown in fig. 2, the step S10 includes:

s11, the intelligent terminal initializes the startup network and reads the current MAC address and the latest networking time;

s12, if the current MAC address is the reserved default MAC address, judging that the current MAC address is a non-legal address (if the current MAC address is the default MAC address in the intelligent terminal, the current MAC address is not activated, the current MAC address is considered to be illegal, the legal MAC address is unique on the network, and the default MAC address is the same and can be multiplexed by a plurality of machines and is not unique), and requesting the legal address;

s13, if the current MAC address is a valid address, checking whether the latest networking time exceeds a threshold (the checking sequence between the MAC address and the latest networking time may be exchanged), and if so, recovering the current MAC address and requesting the valid address again (since the valid MAC address is not used for a long time, the valid MAC address is recovered, the time difference needs to be compared, and it is determined whether a new valid address needs to be requested again).

If the current MAC address is a legal address and the latest networking time is not checked to exceed the threshold value, the legal address does not need to be requested again.

And step S20, the intelligent terminal requests a legal MAC address from the cloud server, and receives the legal MAC address sent by the cloud server after the request is passed.

Specifically, the intelligent terminal reports the serial number of the terminal, the MAC address of the intelligent terminal and the latest networking time of the intelligent terminal to the cloud server; the intelligent terminal requests a legal MAC address from the cloud server; the cloud server takes the terminal serial number as a main key word and stores a data table of the terminal serial number, the MAC address and the networking time; storing an unused MAC address data set on a cloud server; the cloud selects any MAC address from the unused MAC address data set, then distributes the MAC address to the intelligent terminal, and records the MAC address in a data table with the terminal serial number as a main key word.

Please refer to fig. 3, which is a flowchart of step S20 in the MAC address control method according to the present invention.

As shown in fig. 3, the step S20 includes:

s21, the intelligent terminal reports the terminal serial number, the MAC address and the latest networking time of the intelligent terminal to the cloud server, and requests a legal MAC address from the cloud server;

s22, the cloud server takes the terminal serial number as a main key word, stores a data table of the terminal serial number, the MAC address and the networking time, and stores an unused MAC address data set;

s23, the cloud server selects any MAC address from the unused MAC address data set, distributes the MAC address to the intelligent terminal and records the MAC address in a data table with the terminal serial number as a main key word.

In addition, the cloud server checks the latest networking time of each intelligent terminal every predetermined period (for example, at a certain time every day), and if the latest networking time exceeds a threshold value, the MAC address is recovered, so that the MAC address is effectively recovered and utilized.

And step S30, the intelligent terminal stores the legal MAC address and the current networking time and performs normal networking operation.

Specifically, the intelligent terminal stores a legal MAC address and the current networking time, and the intelligent terminal performs normal networking operation through the legal MAC address.

Please refer to fig. 4, which is a flowchart of step S30 in the MAC address control method according to the present invention.

As shown in fig. 4, the step S30 includes:

s31, the intelligent terminal stores the legal MAC address and the current networking time;

and S32, the intelligent terminal performs normal networking operation through a legal MAC address.

The invention solves the defects that the factory has the risk of missing copying the MAC address, and the network of the factory machine can not be used, simultaneously solves the problem that the MAC address has uniqueness, for example, the television is not networked, so that the resource of the MAC address is wasted, and also solves the problem that the MAC address of the machine which is scrapped and not activated has no effective recycling, and the MAC address deployed by a cloud server is used for management and control, thereby realizing the dynamic recycling of the MAC address which is not used for a long time without copying the MAC address by the factory.

As shown in fig. 5, based on the above MAC address control method, the present invention also provides an intelligent terminal, which includes a processor 10, a memory 20, and a display 30. Fig. 5 shows only some of the components of the smart terminal, but it is to be understood that not all of the shown components are required to be implemented, and that more or fewer components may be implemented instead.

The memory 20 may be an internal storage unit of the intelligent terminal in some embodiments, such as a hard disk or a memory of the intelligent terminal. The memory 20 may also be an external storage device of the Smart terminal in other embodiments, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, which are provided on the Smart terminal. Further, the memory 20 may also include both an internal storage unit and an external storage device of the smart terminal. The memory 20 is used for storing application software installed in the intelligent terminal and various data, such as program codes of the installed intelligent terminal. The memory 20 may also be used to temporarily store data that has been output or is to be output. In an embodiment, the memory 20 stores a control program 40 of the MAC address, and the control program 40 of the MAC address is executable by the processor 10, so as to implement the control method of the MAC address in the present application.

The processor 10 may be a Central Processing Unit (CPU), a microprocessor or other data Processing chip in some embodiments, and is used for executing program codes stored in the memory 20 or Processing data, such as executing the control method of the MAC address.

The display 30 may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch panel, or the like in some embodiments. The display 30 is used for displaying information at the intelligent terminal and for displaying a visual user interface. The components 10-30 of the intelligent terminal communicate with each other via a system bus.

In one embodiment, when the processor 10 executes the control program 40 for the MAC address in the memory 20, the following steps are implemented:

when the intelligent terminal is initialized in a starting network, reading a current MAC address and the latest networking time, and verifying the validity of the MAC address and the latest networking time;

the intelligent terminal requests a legal MAC address from the cloud server, and receives the legal MAC address sent by the cloud server after the request passes;

the intelligent terminal stores the legal MAC address and the current networking time and carries out normal networking operation.

When the intelligent terminal is initialized in a startup network, the method further comprises the following steps of reading the current MAC address and the latest networking time, and checking the validity of the MAC address and the latest networking time:

the intelligent terminal presets and reserves a default MAC address and networking time in a local system; wherein the default MAC address is not activated.

The intelligent terminal presets and reserves a default MAC address and networking time in a local system, and the method specifically comprises the following steps:

the intelligent terminal presets and reserves a default MAC address in a system software code, and all the intelligent terminal initial MAC addresses are the same and can be used for networking;

the intelligent terminal stores the latest networking time and is used for recording whether the network is not used for a long time.

When the intelligent terminal is initialized in a startup network, reading the current MAC address and the latest networking time, and verifying the validity of the MAC address and the latest networking time specifically comprises the following steps:

the intelligent terminal initializes the starting network and reads the current MAC address and the latest networking time;

if the current MAC address is the reserved default MAC address, judging that the current MAC address is a non-legal address and requiring a legal address;

if the current MAC address is a legal address, checking whether the latest networking time exceeds a threshold value, if so, recovering the current MAC address and requiring the legal address again.

If the current MAC address is the reserved default MAC address, judging that the current MAC address is a non-legal address, and after a legal address is required to be requested, the method further comprises the following steps:

if the current MAC address is a legal address and the latest networking time is not checked to exceed the threshold value, the legal address does not need to be requested again.

The intelligent terminal requests a legal MAC address from the cloud server, and the receiving of the legal MAC address sent by the cloud server after the request is passed specifically comprises the following steps:

the intelligent terminal reports the terminal serial number, the MAC address and the latest networking time of the intelligent terminal to the cloud server, and requests a legal MAC address from the cloud server;

the cloud server takes the terminal serial number as a main key word, stores a data table of the terminal serial number, the MAC address and the networking time, and stores an unused MAC address data set;

the cloud server selects any MAC address from the unused MAC address data set, distributes the MAC address to the intelligent terminal and records the MAC address in a data table with the terminal serial number as a main key word.

The intelligent terminal stores a legal MAC address and the current networking time, and performs normal networking operation specifically including:

the intelligent terminal stores a legal MAC address and the current networking time;

and the intelligent terminal performs normal networking operation through a legal MAC address.

The invention also provides a storage medium, wherein the storage medium stores a control program of the MAC address, and the control program of the MAC address realizes the steps of the control method of the MAC address when being executed by a processor; as described above.

In summary, the present invention provides a MAC address control method, an intelligent terminal and a storage medium, where the method includes: when the intelligent terminal is initialized in a starting network, reading a current MAC address and the latest networking time, and verifying the validity of the MAC address and the latest networking time; the intelligent terminal requests a legal MAC address from the cloud server, and receives the legal MAC address sent by the cloud server after the request passes; the intelligent terminal stores the legal MAC address and the current networking time and carries out normal networking operation. According to the invention, the MAC address is preserved in advance through the intelligent terminal, and the intelligent terminal interacts with the cloud server when the network is started up for initialization, so that an available and legal MAC address is obtained, the risk of missing copying the MAC address is avoided, and meanwhile, the MAC address which is not used for a long time is dynamically recovered.

Of course, it will be understood by those skilled in the art that all or part of the processes of the methods of the above embodiments may be implemented by a computer program instructing relevant hardware (such as a processor, a controller, etc.), and the program may be stored in a computer readable storage medium, and when executed, the program may include the processes of the above method embodiments. The storage medium may be a memory, a magnetic disk, an optical disk, etc.

It is to be understood that the invention is not limited to the examples described above, but that modifications and variations may be effected thereto by those of ordinary skill in the art in light of the foregoing description, and that all such modifications and variations are intended to be within the scope of the invention as defined by the appended claims.

12页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:用于阻止、检测和/或防止恶意流量的方法和设备

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类