UID code feature extraction method for electronic detonatorTechnical Field
The invention belongs to the technical field of electronic detonator UID code processing, and particularly relates to a method for extracting characteristics of an electronic detonator UID code.
Background
In the using process, the electronic detonators are connected to the initiation bus after being connected with a multi-detonator assembly network. In order to distinguish the electronic detonators, each electronic detonator has a unique UID code. According to the specification of the UID code design in GA 1531 and 2018 information management general rules of industrial electronic detonators and UID code coding and initiator coding specification, the number of UID code characters is required to be not less than 13.
The field communication needs to carry out point-to-point communication on the detonator, and the UID code is used as the communication characteristic of the electronic detonator, so that the defects of large number of communication bytes, long communication time and the like exist. Meanwhile, the electronic detonator is used in a severe environment, the probability of interference can be greatly improved when the data communication signal is exposed in an interference environment, and the overall power consumption is not reduced.
In addition, according to the encoding specification, each UID code has a fixed special field. And in field use, electronic detonators of detonator manufacturers used by blasting companies all use specific detonators.
Disclosure of Invention
In view of this, the present invention provides a method for extracting UID code characteristics of an electronic detonator.
Through research, the invention adopts the following technical scheme:
a UID code feature extraction method for an electronic detonator comprises the following steps:
respectively extracting a feature code, a year, a month, a date and a serial number in the UID code of the electronic detonator;
storing the feature codes separately;
combining the years and months together for separate storage;
and combining and converting the date and the serial number, and then storing the dates and the serial number separately.
Preferably, the feature code is stored by 1 byte.
Preferably, the year and month are stored using 1 byte.
Preferably, the year is stored in the upper 4 bits of the byte and the month is stored in the lower 4 bits of the byte.
Preferably, the year and month are combined into hexadecimal data and then stored with 1 byte.
Preferably, the specific manner of combining and converting the date and the serial number is that the date and the serial number are combined into a group of data, and after the group of data is converted into an integer, the data is stored by using 3 bytes.
Preferably, the specific operation of combining the date and the serial number into a group of data is to splice the date and the serial number into a character string directly from head to tail.
Preferably, the spliced character string is converted into a hexadecimal integer.
Preferably, the value converted to an integer is less than 1 million.
The invention has the beneficial effects that:
the invention relates to a method for extracting the UID code characteristics of an electronic detonator, which extracts the characteristic code, year, month, date and serial number in the UID code of the electronic detonator, then respectively and independently stores the characteristic code, the year and month are combined and then independently stored, the date and the serial number are combined into a group of data, and the group of data is converted into an integer and then independently stored, thereby compressing the UID code of the electronic detonator, so as to compress the number of data transmission, improve the anti-interference capability of communication, reduce power, optimize program and decryption time, and have popularization and application values in the using process of the electronic detonator.
Drawings
Fig. 1 is a schematic flow diagram of the method for extracting the UID code characteristic of the electronic detonator according to the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention are clearly and completely described below with reference to the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Example 1
A UID code feature extraction method for an electronic detonator comprises the following steps:
respectively extracting a feature code, a year, a month, a date and a serial number in the UID code of the electronic detonator;
storing the feature codes by adopting 1 byte;
the years and the months are combined together to be stored separately, in particular, after the years and the months are combined into hexadecimal data, the data are stored by 1 byte,
the specific mode of combining and converting the date and the serial number is that the date and the serial number are directly spliced into a group of data end to end, and the data are converted into a hexadecimal integer and then stored by adopting 3 bytes, namely, the UID code is compressed into 5 bytes for storage.
The UID code of the electronic detonator adopts ASCII code, one character adopts one byte for storage, and the UID feature extraction method is as follows: the digital portion in the UID is converted to integer data. The integer data described later is described in hexadecimal (0 x).
For example, the UID code of an electronic detonator is: 581900330A 00112.
In the UID code (1), the character 'A' represents the characteristic code of the UID and is stored by one byte, namely 0x41 in hexadecimal; (2) in the UID code, a character string '19' represents a date, '03' represents a month, then a single digit '9' and the month '03' of a year are extracted and combined into hexadecimal data 0x93 which is stored by a byte; (3) in the UID code, a character string "30" indicates a date, and "00112" indicates a serial number, two character strings are spliced end to form "3000112", and then converted into hexadecimal integer data 0x2DC730, which is stored in three bytes. Finally, the UID code is compressed into 5 bytes for storage, that is, a [5] ═ {0x41,0x93,0x2D,0xC7,0x30 }.
In summary, the method for extracting the characteristics of the electronic detonator UID code extracts the characteristic code, the year, the month, the date and the serial number in the electronic detonator UID code, then respectively stores the characteristic code by using 1 byte, stores the characteristic code by using 1 byte in the year and the month, combines the date and the serial number into a group of data, converts the group of data into an integer and stores the integer by using 3 bytes, so that the electronic detonator UID code is compressed into 5 bytes, the quantity of data transmission is compressed, the anti-interference capability of communication is improved, the power is reduced, the program and decryption time are optimized, and the method has popularization and application values in the use process of the electronic detonator.
It should be understood that the above description is only a preferred embodiment of the present invention, and not intended to limit the present invention, and although the present invention has been described in detail with reference to the foregoing embodiments, it will be apparent to those skilled in the art that modifications and equivalents may be made in the technical solutions described in the foregoing embodiments, or some technical features may be substituted. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.