CN114003437B - MAC address recovery method, device, equipment and storage medium - Google Patents
MAC address recovery method, device, equipment and storage medium Download PDFInfo
- Publication number
- CN114003437B CN114003437B CN202111286930.4A CN202111286930A CN114003437B CN 114003437 B CN114003437 B CN 114003437B CN 202111286930 A CN202111286930 A CN 202111286930A CN 114003437 B CN114003437 B CN 114003437B
- Authority
- CN
- China
- Prior art keywords
- address
- mac address
- burning file
- file
- mac
- 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
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/14—Error detection or correction of the data by redundancy in operation
- G06F11/1402—Saving, restoring, recovering or retrying
- G06F11/1415—Saving, restoring, recovering or retrying at system level
- G06F11/1435—Saving, restoring, recovering or retrying at system level using file system or storage system metadata
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/14—Error detection or correction of the data by redundancy in operation
- G06F11/1402—Saving, restoring, recovering or retrying
- G06F11/1415—Saving, restoring, recovering or retrying at system level
- G06F11/1438—Restarting or rejuvenating
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/60—Software deployment
- G06F8/61—Installation
- G06F8/63—Image based installation; Cloning; Build to order
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/40—Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
- H04N21/41—Structure of client; Structure of client peripherals
- H04N21/426—Internal components of the client ; Characteristics thereof
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Software Systems (AREA)
- Quality & Reliability (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Library & Information Science (AREA)
- Signal Processing For Digital Recording And Reproducing (AREA)
Abstract
The invention provides a method, a device, equipment and a storage medium for recovering an MAC address, wherein the method comprises the steps of reading the MAC address of a user and an address burning file stored in a currently connected U disk after receiving an operation of recovering the MAC address; judging whether the self MAC address is matched with the address burning file according to the MAC address stored in the address burning file, when the self MAC address is judged to be matched, modifying the initial MAC address marked by the address burning file according to the self MAC address to obtain a modified address burning file, wherein the initial MAC address is the MAC address used by the address burning file in the next burning, verifying the initial MAC address of the modified address burning file, and generating a prompt of MAC address recovery after verification is successful. The invention can avoid the problem that the MAC address is skipped or reused after the burning failure, and is convenient for the management of the MAC address.
Description
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method, an apparatus, a device, and a storage medium for recovering a MAC address.
Background
When a television is produced, the MAC address needs to be burned to uniquely mark the television. However, the burning failure of the MAC address caused by unexpected situations can be encountered during production. For example, the recording process is suddenly powered off, or the error of the normal recording MAC address is caused by the abnormality of the individual core board, or the production line adopts the USB flash disk to upgrade the MAC address, but the USB flash disk is suddenly damaged, and the recording data can not be read.
Taking the burning MAC address of the U disk as an example, before burning, copying a segmented mac.bin file to the U disk, wherein the mac.bin file comprises a plurality of MAC addresses. The USB flash disk is inserted into the USB port of the television A, enters a factory menu, clicks a recording option, and successfully records MAC. The USB flash disk is pulled out and inserted into the USB port of the television B, so that the damaged files of the USB flash disk are lost possibly because the USB flash disk is inserted into the television B at the moment of the problem of a television main board line, or the loss of the USB flash disk is overlarge after the USB flash disk is read and written for many times, and the internal storage medium is damaged to cause the file loss, so that the television B prompts that the mac. Bin file cannot be found and can not be burnt.
When the next MAC address to be burned is determined, if one MAC address is arbitrarily taken for updating, the MAC address may be skipped or reused, which is not only unfavorable for management of the MAC address, but also increases production cost.
Disclosure of Invention
In view of the above, it is an object of the present invention to provide a method, apparatus, device and storage medium for recovering a MAC address, so as to improve the above-mentioned problems.
The embodiment of the invention provides a MAC address recovery method, which comprises the following steps:
after receiving an operation of recovering the MAC address, reading the MAC address of the user and an address burning file stored in a currently connected U disk, wherein the address burning file records a plurality of continuous MAC addresses within a certain address range;
Judging whether the self MAC address is matched with the address burning file according to the MAC address stored in the address burning file;
When the address is judged to be matched, the initial MAC address marked by the address burning file is modified according to the self MAC address to obtain a modified address burning file, wherein the initial MAC address is the MAC address used by the address burning file in the next burning;
And verifying the initial MAC address of the modified address burning file, and generating a prompt for recovering the MAC address after the verification is successful.
Preferably, each MAC address comprises header information and address information, and judging whether the self MAC address is matched with the address burning file according to the MAC address stored in the address burning file, specifically comprising the following steps:
judging whether the header information of the MAC address in the address burning file is consistent with the header information of the self MAC address or not, and
And judging whether the address information of the self MAC address is positioned in the address range of the address burning file record.
Preferably, when the address record file is determined to be matched, modifying the initial MAC address of the address record file mark according to the self MAC address to obtain a modified address record file, which specifically includes:
when the matching is judged, the self MAC address is converted into long integer data, and a preset hysteresis value is added to the long integer data value to generate a recovered MAC address;
and modifying the address burning file in a file byte IO stream mode, so that the initial MAC address of the address burning file is the recovery MAC address.
Preferably, the hysteresis value is 1.
Preferably, after receiving the operation of recovering the MAC address, before reading the own MAC address and the address burning file stored in the currently accessed usb disk, the method further includes:
when the access of the USB flash disk is detected, an operation interface is generated, wherein the operation interface comprises an MAC address burning option and an MAC address recovery option;
a selection of the option is detected to perform an operation of MAC address burning or MAC address restoration.
Preferably, the address burning file is an original address burning file which is not burnt.
The embodiment of the invention also provides a MAC address recovery device, which comprises:
The device comprises a reading unit, a storage unit and a storage unit, wherein the reading unit is used for reading the self MAC address and an address burning file stored in a currently connected U disk after receiving the operation of recovering the MAC address, wherein the address burning file records a plurality of continuous MAC addresses within a certain address range;
The matching unit is used for judging whether the self MAC address is matched with the address burning file according to the MAC address stored in the address burning file;
The modifying unit is used for modifying the initial MAC address of the address burning file mark according to the self MAC address when the address is judged to be matched, so as to obtain a modified address burning file, wherein the initial MAC address is the MAC address used by the address burning file in the next burning;
And the verification unit is used for verifying the initial MAC address of the modified address burning file and generating a prompt for recovering the MAC address after the verification is successful.
Preferably, the modification unit is specifically configured to:
when the matching is judged, the self MAC address is converted into long integer data, and a preset hysteresis value is added to the long integer data value to generate a recovered MAC address;
and modifying the address burning file in a file byte IO stream mode, so that the initial MAC address of the address burning file is the recovery MAC address.
The embodiment of the invention also provides MAC address recovery equipment, which comprises a memory and a processor, wherein the memory stores a computer program which can be executed by the processor to realize the MAC address recovery method.
The embodiment of the invention also provides a computer readable storage medium, which is characterized in that a computer program is stored, and the computer program can be executed by a processor of a device where the computer readable storage medium is located, so as to implement the method for recovering the MAC address.
In summary, after the recording of the MAC address fails, the embodiment restores the address recording file by inserting the usb disk including the source address recording file into the restoration device that has completed recording before, so that the initial MAC address of the restored address recording file is consistent with the initial MAC address of the address recording file when the recording fails, thereby avoiding the problem that the MAC address is skipped or reused, and facilitating management of the MAC address.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings that are needed in the embodiments will be briefly described below, it being understood that the following drawings only illustrate some embodiments of the present invention and therefore should not be considered as limiting the scope, and other related drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a flowchart of a MAC address recovery method according to a first embodiment of the present invention.
Fig. 2 is another flow chart of a MAC address recovery method according to an embodiment of the present invention.
Fig. 3 is a schematic flow chart of performing MAC address burning on a device to be burned.
Fig. 4 is a schematic structural diagram of a MAC address recovery apparatus according to a second embodiment of the present invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
For a better understanding of the technical solution of the present invention, the following detailed description of the embodiments of the present invention refers to the accompanying drawings.
It should be understood that the described embodiments are merely some, but not all, embodiments of the invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
The terminology used in the embodiments of the invention is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used in this application and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
The invention is described in further detail below with reference to the attached drawings and detailed description:
Referring to fig. 1 and 2, a first embodiment of the present invention provides a MAC address recovery method, which may be executed by a MAC address recovery device (hereinafter referred to as a recovery device), and in particular, by one or more processors in the recovery device, so as to implement the following steps:
S101, after receiving operation of recovering the MAC address, reading the MAC address of the user and an address burning file stored in a currently connected U disk, wherein the address burning file records a plurality of continuous MAC addresses in a certain address range.
In this embodiment, the recovery device may be a burned device, such as a television. In addition, the recovery device may also be an intermediate device, which is connected to the usb disk and the device to be burned, and obtains information of the usb disk and the device to be burned, so as to implement the MAC address recovery method of this embodiment. In this embodiment, in particular, the device to be burned refers to a tv set that has completed burning normally, i.e. has recorded therein an own MAC address that has been burned.
In this embodiment, before the usb disk is inserted into the recovery device, an address burning file needs to be stored in the usb disk first, where the address burning file is a source mac. Bin file, which refers to a group of files including mac addresses that have been segmented before by mass production devices. One possible mac. Bin file format is as follows:
00 1A 34 BD 93 FF 00 1A 34 BD 94 62
The MAC. Bin file here includes a start MAC address (00 1A 34 BD 93 FF) and a maximum MAC address (00 1A 34 BD 94 62), where each MAC address includes two pieces of information, header information (00 a 34) and address information (BD 93 FF and BD 94 62) representing the manufacturer's code, so that the address range of the MAC. Bin file is from BD 93 FF to BD 94 62.
In this embodiment, after the usb disk is inserted into the recovery device, the recovery device may sense the access of the usb disk and simultaneously display a corresponding interface for a user to operate, for example, the displayed interface may include a recovery burn MAC address option and a recovery MAC address option, and the user may enter a corresponding function by triggering the corresponding option. For example, the user may generate an instruction to recover the MAC address by triggering a recover MAC address option.
S102, judging whether the self MAC address is matched with the address burning file according to the MAC address stored in the address burning file.
In this embodiment, when judging, firstly, header information of the own MAC address is extracted, and whether the header information is consistent with the header information of the MAC address in the address burning file is judged, if so, the header information of the two is judged to be matched. If the information is inconsistent, prompting the unmatched information so that a user can replace the U disk or replace the address burning file.
And then, extracting the address information of the self MAC address, and judging whether the address information is positioned in the address range recorded by the address burning file.
For example, assuming that the own MAC address of the recovery device is 01 1A 34 BD 94 60, since the header information thereof is different from the header information of the MAC address stored in the address burning file, the two do not match.
For another example, assume that the recovery device has its own MAC address 00 1A 34 BD 94 65, and its header information is the same as that of the MAC address stored in the address burning file, but its address information is not within the address range of the MAC address stored in the address burning file, so that the two are not matched.
For another example, assume that the own MAC address of the recovery device is 00 1A 34 BD 94 50, and the header information of the recovery device is the same as the header information of the MAC address stored in the address burning file, and the address information is also in the address range of the MAC address stored in the address burning file, so that the two match.
And S103, when the address is judged to be matched, modifying the initial MAC address of the address burning file mark according to the self MAC address to obtain a modified address burning file, wherein the initial MAC address is the MAC address used by the address burning file in the next burning.
In this embodiment, specifically, after the matching is successful, the recovery device converts the self MAC address into long-integer data, adds a preset hysteresis value to the long-integer data value, generates a recovered MAC address, and modifies the address burning file in a file byte IO stream manner, so that the starting MAC address of the address burning file is the recovered MAC address.
In this embodiment, the hysteresis value is determined according to the recording relationship between the recovery device and the device that fails to record. For example, if the recovery device is the first N devices of the failed device, the hysteresis value is N. In particular, in order to avoid errors, the hysteresis value of the embodiment is preferably 1, that is, the device preceding the device with failed burning is taken as the recovery device.
In this embodiment, taking the hysteresis value equal to 1 as an example, at this time, if the own MAC address of the recovery device is 00 1A 34 BD 94 50, the recovery MAC address is 00 1A 34 BD 94 51. Then the modified address burn file becomes internally 00 1A 34 BD 94 5100 1A 34 BD 94 62.
S104, verifying the initial MAC address of the modified address burning file, and generating a prompt for MAC address recovery after verification is successful.
In this embodiment, after the modification is completed, the recovery device reads the starting MAC address of the modified address burning file again, determines whether the starting MAC address is equal to the recovered MAC address, if so, verifies to pass, generates a prompt for MAC address recovery, and if not, generates a prompt for unsuccessful MAC address recovery.
Referring to fig. 3, in this embodiment, after the MAC address is successfully recovered, the user may pull out the U disc from the recovery device, then insert the U disc into the next device (such as a television) to be burned to burn the MAC address of the television, and the MAC address of the burned television is 00 1A 34 BD 94 51, so that the continuous use of the MAC address is realized, and the problem that the MAC address is skipped or reused is avoided.
In summary, after the recording of the MAC address fails, the embodiment restores the address recording file by inserting the usb disk including the source address recording file into the restoration device that has completed recording before, so that the initial MAC address of the restored address recording file is consistent with the initial MAC address of the address recording file when the recording fails, thereby avoiding the problem that the MAC address is skipped or reused, and facilitating management of the MAC address.
Referring to fig. 4, the second embodiment of the present invention further provides a MAC address recovery apparatus, which includes:
the reading unit 210 is configured to read the self MAC address and an address burning file stored in the currently connected usb disk after receiving an operation of recovering the MAC address, where the address burning file records a plurality of continuous MAC addresses within a certain address range;
A matching unit 220, configured to determine, according to the MAC address stored in the address burning file, whether the own MAC address matches the address burning file;
A modifying unit 230, configured to modify, when it is determined that the address is matched, a starting MAC address of the address recording file according to the self MAC address, to obtain a modified address recording file, where the starting MAC address is a MAC address used when the address recording file is recorded next time;
the verification unit 240 is configured to verify the initial MAC address of the modified address burning file, and generate a prompt for MAC address recovery after the verification is successful.
Preferably, each MAC address includes header information and address information, and the matching unit 220 is specifically configured to:
judging whether the header information of the MAC address in the address burning file is consistent with the header information of the self MAC address or not, and
And judging whether the address information of the self MAC address is positioned in the address range of the address burning file record.
Preferably, the modification unit 230 is specifically configured to:
when the matching is judged, the self MAC address is converted into long integer data, and a preset hysteresis value is added to the long integer data value to generate a recovered MAC address;
and modifying the address burning file in a file byte IO stream mode, so that the initial MAC address of the address burning file is the recovery MAC address.
Preferably, the hysteresis value is 1.
Preferably, the operation unit is further included for:
when the access of the USB flash disk is detected, an operation interface is generated, wherein the operation interface comprises an MAC address burning option and an MAC address recovery option;
a selection of the option is detected to perform an operation of MAC address burning or MAC address restoration.
Preferably, the address burning file is an original address burning file which is not burnt.
The third embodiment of the present invention also provides a MAC address recovery apparatus, which includes a memory and a processor, where the memory stores a computer program, and the computer program is capable of being executed by the processor to implement a MAC address recovery method as described above.
The fourth embodiment of the present invention further provides a computer readable storage medium, where a computer program is stored, where the computer program can be executed by a processor of a device where the computer readable storage medium is located, so as to implement a MAC address recovery method as described above.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus and method may be implemented in other manners. The apparatus and method embodiments described above are merely illustrative, for example, flow diagrams and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
In addition, functional modules in the embodiments of the present invention may be integrated together to form a single part, or each module may exist alone, or two or more modules may be integrated to form a single part.
The functions, if implemented in the form of software functional modules and sold or used as a stand-alone product, may be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, an electronic device, or a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present invention. The storage medium includes a U disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, an optical disk, or other various media capable of storing program codes. It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises an element.
The above description is only of the preferred embodiments of the present invention and is not intended to limit the present invention, but various modifications and variations can be made to the present invention by those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims (8)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202111286930.4A CN114003437B (en) | 2021-11-02 | 2021-11-02 | MAC address recovery method, device, equipment and storage medium |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202111286930.4A CN114003437B (en) | 2021-11-02 | 2021-11-02 | MAC address recovery method, device, equipment and storage medium |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN114003437A CN114003437A (en) | 2022-02-01 |
| CN114003437B true CN114003437B (en) | 2025-03-14 |
Family
ID=79926338
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202111286930.4A Active CN114003437B (en) | 2021-11-02 | 2021-11-02 | MAC address recovery method, device, equipment and storage medium |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN114003437B (en) |
Citations (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101764918A (en) * | 2009-12-16 | 2010-06-30 | 康佳集团股份有限公司 | Method for programming MAC address into set top box |
Family Cites Families (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US7433356B2 (en) * | 2004-05-13 | 2008-10-07 | International Business Machines Corporation | Methods and apparatus for creating addresses |
| CN103716693B (en) * | 2013-12-06 | 2018-08-14 | 乐视致新电子科技(天津)有限公司 | A kind of setting method and smart television of MAC Address |
-
2021
- 2021-11-02 CN CN202111286930.4A patent/CN114003437B/en active Active
Patent Citations (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101764918A (en) * | 2009-12-16 | 2010-06-30 | 康佳集团股份有限公司 | Method for programming MAC address into set top box |
Also Published As
| Publication number | Publication date |
|---|---|
| CN114003437A (en) | 2022-02-01 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| JP2009187134A (en) | Information processing device, information processing device activation control method, program, and recording medium | |
| CN101458645A (en) | Computer operating system and file data repair system and method of software thereof | |
| CN102982274A (en) | Management method of intelligent terminal system and intelligent terminal | |
| CN103064752B (en) | A kind of Ile repair method and device | |
| KR20120063455A (en) | Apparatus and method for updating firmware | |
| CN104899114A (en) | Continuous time data protection method on solid state drive | |
| US11928217B2 (en) | Information processing apparatus, control method of information processing apparatus, and storage medium | |
| JP4696052B2 (en) | Storage device, storage medium, control device, memory, server device, server client system | |
| CN103339615B (en) | storage system and information processing method | |
| CN116578307A (en) | Data presetting method, electronic device and computer readable storage medium | |
| CN117850824A (en) | Firmware updating method, electronic device and server | |
| CN114003437B (en) | MAC address recovery method, device, equipment and storage medium | |
| CN110968446B (en) | A metadata restoration method, apparatus, system and computer-readable storage medium | |
| CN102346696B (en) | A kind of file access pattern method and device | |
| CN112433738A (en) | Firmware update test method, system, equipment and medium | |
| CN112596800A (en) | U-Boot image upgrading and checking method and device and electronic equipment | |
| KR101542329B1 (en) | Automatic Data Backup System and Operating Method thereof | |
| CN110704085A (en) | RAID executable file updating method, device, equipment and storage medium | |
| JP5246255B2 (en) | Information processing apparatus, BIOS setup setting value recovery method, program | |
| JP2010198479A (en) | System for automatically executing application test | |
| CN114594967A (en) | Basic input output system updating method, device, equipment and medium | |
| JP5790415B2 (en) | Information processing apparatus and program | |
| JP2002041292A (en) | Computer recovery device | |
| JP6278078B2 (en) | Information processing apparatus and program | |
| JP5994901B2 (en) | Information processing apparatus and program |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant |