CN114943205A - Method, system, storage medium and electronic equipment for generating identity recognition code UUID - Google Patents

Method, system, storage medium and electronic equipment for generating identity recognition code UUID Download PDF

Info

Publication number
CN114943205A
CN114943205A CN202210642160.0A CN202210642160A CN114943205A CN 114943205 A CN114943205 A CN 114943205A CN 202210642160 A CN202210642160 A CN 202210642160A CN 114943205 A CN114943205 A CN 114943205A
Authority
CN
China
Prior art keywords
code
data
product
uuid
generating
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.)
Pending
Application number
CN202210642160.0A
Other languages
Chinese (zh)
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.)
BEIJING JCZ TECHNOLOGY CO LTD
Original Assignee
BEIJING JCZ TECHNOLOGY CO 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 BEIJING JCZ TECHNOLOGY CO LTD filed Critical BEIJING JCZ TECHNOLOGY CO LTD
Priority to CN202210642160.0A priority Critical patent/CN114943205A/en
Publication of CN114943205A publication Critical patent/CN114943205A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/12Use of codes for handling textual entities
    • G06F40/126Character encoding
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/602Providing cryptographic facilities or services
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q30/00Commerce
    • G06Q30/018Certifying business or products

Abstract

The invention discloses a method, a system, a storage medium and electronic equipment for generating an identity recognition code UUID, wherein the method comprises the following steps: acquiring a code of a product; generating a current timestamp; and combining the current timestamp and the code of the product to generate an identity recognition code UUID. The invention has the beneficial effects that: the generated identity identification code UUID adds extra product coding information, the timestamp adds timeliness inspection, the protection information contained on the whole is more diversified, the information verification of multiple dimensions can be realized through single coding, the interface design of a program and the data transmission process required to be carried out are simplified, and the complexity and the cost of product maintenance are reduced.

Description

Method, system, storage medium and electronic equipment for generating identity recognition code UUID
Technical Field
The invention relates to the field of code synthesis, in particular to a method and a system for generating a UUID (user authentication identifier) code, a storage medium and electronic equipment.
Background
UUID is a resource identification code which is common in the software field. The autonomous definition of the identification codes of the distributed system is mainly realized, and the uniform distribution of a central control end is not needed.
The unique identification code of the embedded hardware device is coded and identified by adopting a UUID pure software mode, so that the condition that the code is irrelevant and unrelated to the hardware can occur, the identification capability of the identification code is reduced, and illegal copying and pirating are not favorably prevented.
The other method is to simply rely on a pure hardware UID mode to carry out coding identification, and because the UID generation mode mainly adopts the characteristic of sequential coding, the problem that the coding rule is easy to master exists.
Disclosure of Invention
The invention aims to solve the problems that a UUID pure software mode and a pure hardware UID mode are adopted for coding identification in the background art, codes are irrelevant to hardware, no relevance exists, and a coding rule is easy to master.
In order to achieve the above object, a first aspect of the present invention provides a method for generating a UUID, including:
acquiring a code of a product; generating a current timestamp; and combining the current timestamp with the code of the product to generate an identity recognition code UUID.
In some possible embodiments, the code of the product includes at least a set of product master control chip codes UID.
In some possible embodiments, the merging method adopts a data bit splicing method, and specifically includes the following steps:
adopting the current time stamp and the code of the product to be in n-system digital representation;
determining the number of n-ary numbers and the number of connectors "-";
determining the division mode of the n-system number through the connector "-";
sequentially dividing the current time stamp and the code of the product into n-system digital representations
And splicing in a mode.
In some possible embodiments, data obfuscation is performed on the UUID, and the data obfuscation is obtained by rearranging original data according to a certain rule.
In some possible embodiments, the data obfuscation comprises: data shifting, data negation, data exclusive or, data mapping, data encryption, a linear equation, cyclic redundancy check and hash table remainder division.
In some possible embodiments, the data encryption method uses a key for encryption.
In some possible embodiments, the current timestamp selects a second time from a specified date to a current point in time.
In a second aspect of the present invention, a system for generating a UUID is provided, which comprises
A code acquisition module: the code of the product is obtained and,
a timestamp generation module: generating a current timestamp;
and a coding synthesis module: and combining the current timestamp with the code of the product to generate the UUID.
In some possible embodiments, the presynthesized code includes at least a master chip code UID for a group of products.
In some possible embodiments, the merging method adopts a data bit splicing method, and specifically includes the following steps:
adopting the current time stamp and the code of the product to be in n-system digital representation;
determining the number of n-ary numbers and the number of connectors "-";
determining the division mode of the n-system number through the connector "-";
and splicing the current timestamp and the code of the product in sequence according to a segmentation mode by adopting n-system digital representation.
In some possible embodiments, the method further comprises: and the coded data confusion module is used for rearranging the original coded data according to a certain rule to obtain the confusion coded data.
In some possible embodiments, the data obfuscation comprises: data shifting, data negation, data exclusive or, data mapping, data encryption, a linear equation, cyclic redundancy check and hash table residue removal.
In some possible embodiments, the data encryption method uses a key for encryption.
In some possible embodiments, the current timestamp selects a second time from a specified date to a current point in time.
In a third aspect of the present invention, a computer-readable storage medium is provided, which is used for storing a program code for executing the method for generating the UUID of the identification code or the system for generating the UUID of the identification code.
In a fourth aspect of the present invention, an electronic device is provided, which includes a processor and a memory: the memory is used for storing program codes and transmitting the program codes to the processor; the processor is used for executing the program code according to the instruction in the program code and executing the method for generating the UUID or the system for generating the UUID.
The invention has the beneficial effects that: the generated identity identification code UUID adds extra product coding information, the timestamp adds timeliness inspection, the protection information contained on the whole is more diversified, the information verification of multiple dimensions can be realized through single coding, the interface design of a program and the data transmission process required to be carried out are simplified, and the complexity and the cost of product maintenance are reduced.
Drawings
Fig. 1 is a flowchart illustrating steps of a method for generating a UUID of an id code according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating a method for generating a UUID according to data bits in a method for generating a UUID according to an embodiment of the present invention;
fig. 3 is a schematic diagram illustrating a UUID structure of an id code according to an embodiment of the present invention.
Detailed Description
The following detailed description of the preferred embodiments of the present invention, taken in conjunction with the accompanying drawings, will make the advantages and features of the invention easier to understand by those skilled in the art, and thus will clearly and clearly define the scope of the invention.
In a first aspect of this embodiment, a system for generating a UUID is provided, including
A code acquisition module: acquiring the code of a product, wherein the code of the product at least comprises a group of main control chip codes UID of the product,
a timestamp generation module: a current timestamp is generated that selects a second time from the specified date to the current point in time.
And a coding synthesis module: and combining the current timestamp with the code of the product to generate the UUID.
The code of the product includes, but is not limited to, a main control chip code UID of the product, a serial code PID of the product, and some memory chip codes of the product and a sensor chip code with a communication interface, such as a temperature sensor chip code, a pressure sensor chip code, and an acceleration sensor chip code.
And the coded data confusion module is used for rearranging the original coded data according to a certain rule to obtain the confusion coded data.
The data obfuscation includes: the method comprises a data shifting method, a data negation method, a data exclusive-or method, a data mapping method, a data encryption method, a linear equation method, a cyclic redundancy check method and a hash table residue removing method. The data encryption method adopts a key for encryption.
A second aspect of this embodiment provides a method for generating an identification code uuid (universal Unique identifier), which is shown in fig. 1 and includes the following steps:
and S1, acquiring the code of the product, wherein the product can be an embedded device, and the code of the embedded device at least comprises a group of main control chip codes UID of the product. The codes of the embedded device include, but are not limited to, a main control chip code uid (uniform identification) of the embedded device, a product serial code pid (product identification) of the embedded device, and some memory chip codes of the embedded device and sensor chip codes with communication interfaces, such as a temperature sensor chip code, a pressure sensor chip code, and an acceleration sensor chip code.
The code of the embedded device includes a main control chip code UID-1 of the embedded device, a serial code PID of the embedded device and a memory chip code UID-2 of the embedded device.
S2, generating a current timestamp selecting seconds from a specified date to a current time point, the specified date may be according to a common standard, such as: 1/1970; customization can also be selected, such as: 1 month and 1 day in 2000;
and S3, combining the current time stamp with the code of the product to generate an identity recognition code UUID. The merging method adopts a method of splicing according to data bits, and specifically comprises the following steps, with reference to fig. 2:
s31, the current time stamp is expressed by 16-system numbers: taking 0 min 0 s at 8 o 'clock 1/1970 as an example of the starting time, and 0 min 0 s at 0 o' clock 1/2022 as a time point of timestamp generation, the second timer is 1640966400, and the 16-system is 0x61CF 2900.
S32, the coding of the embedded device adopts 16-system digital representation; the code of the embedded device comprises a main control chip code UID-1(11170026) of the embedded device, a serial code PID (including a model number (A016), a batch number (AB01) and a serial number (0009)) of the embedded device and a memory chip code UID-2(4026) of the embedded device.
At S33, it is determined that the number of 16-ary digits is 32 and the number of connectors "-" is 4.
And S34, determining the segmentation mode of the 16-system number through the connector "-", wherein the segmentation mode of the 16-system number is as follows: 8-4-4-4-12.
S35, splicing the current timestamp and the codes of the embedded equipment in sequence according to a segmentation mode by adopting n-system digital representation to obtain an identity recognition code UUID:
(61CF2900-A016-AB01-0009-11170026-4026), referring to FIG. 3, FIG. 3 is a schematic diagram of UUID.
For the serial code PID of the device, if the data bits are insufficient, the redundant coding bits in the PID can be reduced properly, and the redundant coding can adopt a mapping conversion mode. If the code contains the complete date code: 20220202, which can be reduced to a number in the range of 0-0xFFFF, the encoded bits are reduced by half.
Some UIDs adopt digital string codes, can be represented by 16 systems during storage, further reduce code occupation, and realize that codes contain more information contents. The use of 16-ary coding saves space on code footprint, and the most space-saving is for example the decimal number 1000, denoted 0x3E8 by 16, 0x1000 by BCD8421 and 0x31303030 by ASCII.
In some possible embodiments, data obfuscating is performed on the UUID, where the data obfuscating is to rearrange original data according to a certain rule to obtain obfuscated data, and the data obfuscating includes: data shifting, data negation, data exclusive or, data mapping, data encryption, a linear equation, a cyclic redundancy check method and a hash table residue removal method. The data shifting, data negation, data exclusive or, data mapping and data encryption methods are lossless data transformation methods, and original data can be restored; the linear equation method, the cyclic redundancy check method and the hash table residue removal method are all lossy data transformation methods, original data cannot be recovered, and the transformed data can save coding bit resources.
Example (c): the code is expressed by 16-system numbers.
Data shifting: the contract data is shifted left or right by a few bits as a whole, 0x4321 cycles left by three bits, the obfuscated data is 0x190A, and the reverse operation is to cycle right by three bits.
Data inversion: taking the code 0x4321 as an example, the inverted code is 0xBCDE, and the reverse operation is inverted again.
Data exclusive or: taking encoding 0x4321 as an example, XOR-ing with 0x1234 is then 0x5115, and the reverse operation is to XOR 0x4321 with 0x1234 again.
Data mapping: taking the encoding 0x4321 as an example, it is agreed to exchange 0bit and 7bit of each byte, and after mapping, the result is 0xC2a0, and the reverse operation is to exchange 0bit and 7bit of each byte again.
Data encryption and decryption are carried out by adopting an AES key;
the plaintext is: 154956EC2022AB 010009111700264026;
the AES key is: C5D6E7
The ciphertext is:
W618UdhXhfXMZV2Rm0xZ106XI18i/Ix1gHWZ2k1uguqgYXSAvEZZ8ai6X34KinkN。
the linear equation: the linear equation is in the form of the new code C ═ aX + bY + cZ, where X, Y, Z is the original code, a, b, C are coefficients, and C is the alias code. For example, codes 0x1234, 0x5678, and 0x9ABC are mixed by coefficients 1, 2, and 3 in this order, and the result is 0x8F58, and only the lower 16 bits of data are retained as a result of the operation.
Cyclic redundancy: taking the CRC-16/MODBUS check calculation method as an example, the CRC operation result of the code 0x123456789ABC is 0x2D 48.
Hash table residue removal method: the residue is selected to be 65521, and the hash result of encoding 0x123456789ABC is 0xACB 3.
In a third aspect of the present invention, a computer-readable storage medium is provided, where the computer-readable storage medium is used for storing a program code, and the program code is used for executing the method for generating the UUID of the identification code or the system for generating the UUID of the identification code.
The storage medium stores program instructions capable of implementing all the methods described above, wherein the program instructions may be stored in the storage medium in the form of a software product, and include instructions for causing a computer device (which may be a personal computer, a server, a network device, or the like) or a processor (processor) to execute all or part of the steps of the methods according to the embodiments of the present invention. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a mobile hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, or terminal devices, such as a computer, a server, a mobile phone, and a tablet.
In a fourth aspect of the invention, an electronic device is provided, the electronic device comprising a processor and a memory: the memory is used for storing program codes and transmitting the program codes to the processor; the processor is used for executing the program code according to the instruction in the program code and executing the method for generating the UUID or the system for generating the UUID.
The processor may also be referred to as a CPU (Central Processing Unit). The processor may be an integrated circuit chip having signal processing capabilities. The processor may also be a general purpose processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other programmable logic device, discrete gate or transistor logic, discrete hardware components. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The above embodiments are merely illustrative of the technical concept and features of the present invention, and the present invention is not limited thereto, and any equivalent changes or modifications made according to the spirit of the present invention should be included in the scope of the present invention.

Claims (16)

1. A method for generating an identity recognition code UUID is characterized by comprising the following steps:
acquiring a code of a product; generating a current timestamp; and combining the current timestamp and the code of the product to generate an identity recognition code UUID.
2. The method as claimed in claim 1, wherein the product code comprises at least one set of product key control chip codes UID.
3. The method for generating an identity recognizing coded UUID as claimed in claim 1, wherein the merging mode adopts a method of splicing according to data bits, specifically comprising the steps of:
adopting the current time stamp and the code of the product to be in n-system digital representation;
determining the number of n-ary numbers and the number of connectors "-";
determining the division mode of the n-system number through the connector "-";
and splicing the current timestamp and the code of the product in sequence according to a segmentation mode by adopting n-system digital representation.
4. The method as claimed in claim 1, wherein the UUID is subjected to data obfuscation, and the data obfuscation is obtained by rearranging original data according to a certain rule.
5. The method as claimed in claim 4, wherein the data obfuscation comprises: data shifting, data negation, data exclusive or, data mapping, data encryption, a linear equation, cyclic redundancy check and hash table remainder division.
6. The method as claimed in claim 5, wherein the data encryption method uses a key for encryption.
7. The method of claim 1, wherein the current timestamp is selected from seconds to the current time point from a specified date.
8. A system for generating UUID code is characterized by comprising
A code acquisition module: the code of the product is obtained and,
a timestamp generation module: generating a current timestamp;
the coding synthesis module: and combining the current timestamp with the code of the product to generate the UUID.
9. The system of claim 8, wherein the pre-composed code comprises at least one set of master control chip codes UID of the product.
10. The system of claim 8, wherein the merging is performed by concatenating the data bits, and comprises the steps of:
adopting the current time stamp and the code of the product to be in n-system digital representation;
determining the number of n-ary numbers and the number of connectors "-";
determining the division mode of the n-system number through the connector "-";
and splicing the current timestamp and the code of the product in sequence according to a segmentation mode by adopting n-system digital representation.
11. The system of claim 8, wherein the system further comprises: and the coded data confusion module is used for rearranging the original coded data according to a certain rule to obtain the confusion coded data.
12. The system of claim 8, wherein the data obfuscation comprises: data shifting, data negation, data exclusive or, data mapping, data encryption, a linear equation, cyclic redundancy check and hash table residue removal.
13. The system of claim 8, wherein the data encryption method uses a key to encrypt the data.
14. The system of claim 8, wherein the current timestamp selects seconds from a specified date to a current time point.
15. A computer-readable storage medium, characterized in that the computer-readable storage medium is configured to store a program code for performing the method for generating an identification code UUID according to any of claims 1-7 or the system for generating an identification code UUID according to any of claims 8-14.
16. An electronic device, comprising a processor and a memory: the memory is used for storing program codes and transmitting the program codes to the processor; the processor is configured to execute the program code according to instructions in the program code to perform the method for generating an identity code UUID according to any one of claims 1-7 or the system for generating an identity code UUID according to any one of claims 8-14.
CN202210642160.0A 2022-06-08 2022-06-08 Method, system, storage medium and electronic equipment for generating identity recognition code UUID Pending CN114943205A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210642160.0A CN114943205A (en) 2022-06-08 2022-06-08 Method, system, storage medium and electronic equipment for generating identity recognition code UUID

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210642160.0A CN114943205A (en) 2022-06-08 2022-06-08 Method, system, storage medium and electronic equipment for generating identity recognition code UUID

Publications (1)

Publication Number Publication Date
CN114943205A true CN114943205A (en) 2022-08-26

Family

ID=82908865

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210642160.0A Pending CN114943205A (en) 2022-06-08 2022-06-08 Method, system, storage medium and electronic equipment for generating identity recognition code UUID

Country Status (1)

Country Link
CN (1) CN114943205A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115561622A (en) * 2022-10-14 2023-01-03 安测半导体技术(江苏)有限公司 Method and system for writing unique ID in chip test

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115561622A (en) * 2022-10-14 2023-01-03 安测半导体技术(江苏)有限公司 Method and system for writing unique ID in chip test
CN115561622B (en) * 2022-10-14 2023-10-03 安测半导体技术(江苏)有限公司 Method and system for writing unique ID in chip test

Similar Documents

Publication Publication Date Title
CN108377183B (en) XDR data information encryption method, device, equipment and medium
CN101610088B (en) System and method for encoding data based on a compression technique with security features
KR102154164B1 (en) Method for generating a pseudorandom sequence, and method for coding or decoding a data stream
CN111191255B (en) Information encryption processing method, server, terminal, device and storage medium
CN108052805B (en) Data encryption and decryption method and device
CN107534549B (en) Readable storage medium, method and system for encrypting data stream block
CN116032474A (en) Safety protection system based on big data computer network
CN114943205A (en) Method, system, storage medium and electronic equipment for generating identity recognition code UUID
CN115580477A (en) File encryption method and decryption method based on AES encryption and related equipment
CN105718978B (en) QR code generation method and device, and decoding method and device
WO2002054664A2 (en) R-conversion encryption method and system
CN112235319A (en) Data encryption and decryption method and device and encryption and decryption circuit
CN116827507A (en) Ciphertext cracking method and device, storage medium and electronic equipment
CN115834018A (en) Multi-party data processing method, system and equipment for protecting privacy
JP2008140104A (en) Memory system and memory access method
CN114968206A (en) Dynamic confusion method and system for programming language codes
RU2259639C2 (en) Method for complex protection of distributed information processing in computer systems and system for realization of said method
CN115935299A (en) Authorization control method, device, computer equipment and storage medium
CN111064560B (en) Data encryption transmission method and device, terminal and data encryption transmission system
CN114499465A (en) Hash algorithm, circuit and electronic equipment
CN117057804B (en) Financial transaction data secure storage method and system based on hash sequence
CN1252663C (en) Calculation device and calculation method
CN115834163B (en) Method, device, equipment and storage medium for generating secret key of encrypted data
Al-Jarrah et al. Word-based encryption algorithm using dictionary indexing with variable encryption key length
CN116484407B (en) Data security protection method and device, electronic equipment and storage medium

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