Terminal identification code generation method and device and storage medium
By directly obtaining and encrypting the hardware identification information of the terminal device and generating an identification code, the problem of hardware identification information in the prior art is solved, and the accuracy and uniqueness of the terminal identification code are improved.
Patent Information
- Application Number
- CN202310665649.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-06
- Publication Date
- 2024-12-06
AI Technical Summary
In the prior art, the terminal identification code obtains hardware identification information based on a third-party application, which is prone to tampering, resulting in inaccurate identification code and inaccurate identification device.
The preset assembly instructions directly obtain multiple hardware identification information of the terminal device, splice it to form a splicing code, and encrypt it to generate a target identification code, reducing the risk of hardware identification information being tampered with.
The accuracy of the terminal identification code is improved, the identification code changes caused by tampering with hardware identification information is avoided, and the unique identification of the device is ensured.
Smart Images

Figure CN119089426A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a method, device and storage medium for generating a terminal identification code. Background Art
[0002] The terminal identification code refers to a series of serial numbers formed by a series of encryption and hashing of the device hardware serial number, which can be used to uniquely identify the device. In actual scenarios, the terminal identification code can be used for software authorization, as a device key, as an information identification mark of the device, and other scenarios. Taking software authorization as an example, the software has taken certain protection measures to prevent piracy. When a user registers, a unique identification code will be generated based on the computer hardware information where the user's software is installed. It can generally be called a machine code, also called a serial number, authentication code, registration application code, etc. Only devices authorized by the identification code can use the software functions normally.
[0003] In actual applications, the terminal identification code is generated based on the device hardware identification information and generally does not change. The commonly used method to obtain the device hardware identification information is to obtain it from the registry or local records. This acquisition method generally relies on third-party applications. The hardware identification information is easily tampered with. Therefore, the terminal identification code may change due to reinstalling the system and obtaining hardware identification information that may be tampered with, and the device may not be accurately identified. Summary of the invention
[0004] The main purpose of the embodiments of the present application is to provide a terminal identification code generation method, device and storage medium, which can directly obtain the identification information of multiple hardware of the terminal device through assembly instructions, without relying on third-party information, reduce the risk of hardware identification information being tampered with, and improve the accuracy of the terminal identification code.
[0005] In a first aspect, an embodiment of the present application provides a terminal identification code generation method, comprising: in response to an identification code query request for a target terminal, obtaining identification information of multiple hardware in the target terminal based on a preset assembly instruction; splicing the identification information of the multiple hardware to obtain a splicing code; encrypting the splicing code to generate a target identification code for the target terminal.
[0006] In one embodiment, the method of obtaining identification information of multiple hardware in the target terminal based on a preset assembly instruction includes: calling the preset assembly instruction for a single target hardware in the target terminal, and obtaining return data of the preset assembly instruction from a corresponding register, wherein the return data includes the identification information of the target hardware.
[0007] In one embodiment, calling the preset assembly instruction and obtaining the return data of the preset assembly instruction from the corresponding register includes: obtaining the address of a specific function in the target terminal, the specific function being a system interface function in the target terminal; reading a target instruction corresponding to the specific function from a memory according to the address of the specific function, copying the target instruction, the preset assembly instruction including the target instruction; after passing preset parameters to the target instruction, executing the target instruction; and obtaining the return data from the register corresponding to the specific function.
[0008] In one embodiment, the identification information includes: a hard disk identification code of the target terminal; the preset assembly instruction includes: an instruction for calling a hardware abstraction layer function of the target terminal; the calling of the preset assembly instruction and obtaining return data of the preset assembly instruction from a corresponding register includes: calling the hardware abstraction layer function of the target terminal and reading return data from a register corresponding to the hardware abstraction layer function, wherein the return data includes the hard disk identification code of the target terminal;
[0009] In one embodiment, the preset assembly instruction includes: BIOS interrupt; calling the preset assembly instruction and obtaining the return data of the preset assembly instruction from the corresponding register includes: calling the BIOS interrupt of the target terminal and reading the return data from the register corresponding to the BIOS interrupt, wherein the return data includes the hard disk identification code of the target terminal.
[0010] In one embodiment, the target terminal includes multiple hard disks and at least one processor, and the identification information of the multiple hardware includes identification codes of the multiple hard disks and an identification code of the at least one processor; the splicing of the identification information of the multiple hardware to obtain a splicing code includes: sorting the identification codes of the multiple hard disks and generating a hard disk identification string of the target terminal according to the sorting result; splicing the hard disk identification string and the identification code of the at least one processor to obtain the splicing code.
[0011] In one embodiment, encrypting the concatenated code to generate the target identification code of the target terminal includes: performing a hash operation on the concatenated code to generate the target identification code of the target terminal.
[0012] In one embodiment, the identification information of the plurality of hardware further includes: one or more of a MAC address, a memory serial number, a mainboard serial number, and a graphics card serial number of the target terminal.
[0013] In a second aspect, an embodiment of the present application provides a terminal device verification method, the method comprising: in response to a software authorization request of a target terminal for a target software, generating an identification code query request for the target terminal; in response to the query request, adopting a method as described in any of the above aspects to obtain a target identification code of the target terminal based on preset assembly instructions and identification information of multiple hardware of the target terminal; verifying the target terminal according to the target identification code, and when the target identification code belongs to an authorized identification code, determining that the software authorization request of the target terminal for the target software is passed, otherwise rejecting the software authorization request of the target terminal for the target software.
[0014] In a third aspect, an embodiment of the present application provides a terminal device verification method, comprising: in response to a document access request of a target terminal to a target document, generating an identification code query request for the target terminal; in response to the query request, adopting a method as described in any of the above aspects, based on preset assembly instructions and identification information of multiple hardware of the target terminal, obtaining a target identification code of the target terminal; based on the target identification code and characteristic data of the target document, generating a key of the target terminal regarding the target document according to the target identification code and the target document, verifying the target terminal according to the key, and when the key passes the verification, allowing the target terminal to access the target document, otherwise denying the target terminal access to the target document.
[0015] In a fourth aspect, an embodiment of the present application provides a terminal identification code generating device, including:
[0016] An acquisition module, configured to, in response to an identification code query request for a target terminal, acquire identification information of multiple hardware of the target terminal based on a preset assembly instruction;
[0017] A splicing module, used for splicing the identification information of the plurality of hardware to obtain a splicing code;
[0018] The encryption module is used to encrypt the splicing code to generate a target identification code of the target terminal.
[0019] In one embodiment, the acquisition module is used to call the preset assembly instruction for a single target hardware in the target terminal, and obtain return data of the preset assembly instruction from a corresponding register, wherein the return data includes identification information of the target hardware.
[0020] In one embodiment, the acquisition module is used to acquire the address of a specific function in the target terminal, where the specific function is a system interface function in the target terminal; according to the address of the specific function, read a target instruction corresponding to the specific function from a memory, copy the target instruction, and the preset assembly instruction includes the target instruction; after passing preset parameters to the target instruction, execute the target instruction; and acquire the return data from a register corresponding to the specific function.
[0021] In one embodiment, the identification information includes: a hard disk identification code of the target terminal; the preset assembly instruction includes: an instruction for calling a hardware abstraction layer function of the target terminal; the acquisition module is used to call the hardware abstraction layer function of the target terminal and read return data from a register corresponding to the hardware abstraction layer function, wherein the return data includes the hard disk identification code of the target terminal;
[0022] In one embodiment, the preset assembly instruction includes: a BIOS interrupt; the acquisition module is used to call the BIOS interrupt of the target terminal and read return data from a register corresponding to the BIOS interrupt, wherein the return data includes a hard disk identification code of the target terminal.
[0023] In one embodiment, the target terminal includes multiple hard disks and at least one processor, and the identification information of the multiple hardware includes identification codes of the multiple hard disks and an identification code of the at least one processor; the splicing module is used to sort the identification codes of the multiple hard disks and generate a hard disk identification string of the target terminal according to the sorting result; and splice the hard disk identification string and the identification code of the at least one processor to obtain the splicing code.
[0024] In one embodiment, the encryption module is used to perform a hash operation on the splicing code to generate a target identification code of the target terminal.
[0025] In one embodiment, the identification information of the plurality of hardware further includes: one or more of a MAC address, a memory serial number, a mainboard serial number, and a graphics card serial number of the target terminal.
[0026] In a fifth aspect, an embodiment of the present application provides an electronic device, including:
[0027] at least one processor; and
[0028] a memory communicatively coupled to the at least one processor;
[0029] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the electronic device to execute the method described in any one of the above aspects.
[0030] In a sixth aspect, an embodiment of the present application provides a cloud device, including:
[0031] at least one processor; and
[0032] a memory communicatively coupled to the at least one processor;
[0033] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the cloud device to execute the method described in any one of the above aspects.
[0034] In a seventh aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions. When a processor executes the computer-executable instructions, the method described in any one of the above aspects is implemented.
[0035] In an eighth aspect, an embodiment of the present application provides a computer program product, including a computer program, which implements the method described in any of the above aspects when executed by a processor.
[0036] The terminal identification code generation method, device and storage medium provided in the embodiments of the present application, after receiving an identification code query request for a target terminal, obtains identification information of multiple hardware in the terminal device through preset assembly instructions, splices the obtained identification information of the multiple hardware to form a splicing code, and then encrypts the splicing code to generate a target identification code and return it. In this way, the identification information of multiple hardware of the terminal device is obtained directly through assembly instructions, without relying on third-party information, thereby reducing the risk of hardware identification information being tampered with and improving the accuracy of the terminal identification code. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] The drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present application, and are used together with the specification to explain the principles of the present application. Obviously, the drawings described below are some embodiments of the present invention, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative labor.
[0038] Figure 1 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application;
[0039] Figure 2 A schematic diagram of an application scenario of a terminal identification code generation solution provided in an embodiment of the present application;
[0040] Figure 3 A schematic diagram of a process for generating a terminal identification code provided in an embodiment of the present application;
[0041] Figure 4 A schematic diagram of a process for generating a terminal identification code provided in an embodiment of the present application;
[0042] Figure 5 A schematic diagram of a process flow of a terminal device verification method provided in an embodiment of the present application;
[0043] Figure 6 A schematic diagram of a process flow of a terminal device verification method provided in an embodiment of the present application;
[0044] Figure 7 A schematic diagram of the structure of a terminal identification code generating device provided in an embodiment of the present application;
[0045] Figure 8 A schematic diagram of the structure of a cloud device provided in an embodiment of the present application.
[0046] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0047] Here, exemplary embodiments are described in detail, and examples thereof are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application.
[0048] The term "and / or" in this article is used to describe the association relationship of associated objects, specifically indicating that there may be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone.
[0049] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0050] In order to clearly describe the technical solution of the embodiment of the present application, the terms involved in the present application are first defined:
[0051] CPU: Central Processing Unit.
[0052] API: Application Programming Interface, application programming interface.
[0053] ID: Identity document, ID card identification number, account number, unique code, exclusive number.
[0054] HAL: Hardware Abstraction Layer, hardware abstraction layer.
[0055] BIOS: Basic Input Output System, basic input output system.
[0056] JS: JavaScript is a lightweight, interpreted or just-in-time compiled programming language with function-first approach.
[0057] HTML: Hyper Text Markup Language. HTML5 is a language description method for building Web content, referred to as "H5".
[0058] CSS: Cascading Style Sheets, Cascading Style Sheets.
[0059] Electron: A cross-platform desktop application framework built using JavaScript, HTML, and CSS. It is a runtime environment that packages the browser kernel Webkit and NodeJS.
[0060] WebKit: is an open source browser engine.
[0061] NodeJS: is a JavaScript runtime environment based on the Chrome V8 engine.
[0062] C++: A high-level computer programming language.
[0063] ASCII: American Standard Code for Information Interchange, American Standard Code for Information Interchange.
[0064] Win: Windows, an operating system developed by Microsoft based on a graphical user interface.
[0065] OSx: macOS system is a set of computer operating systems developed by Apple.
[0066] UUID: Universally Unique Identifier, universally unique identifier.
[0067] Linux: GNU / Linux is an operating system.
[0068] MAC address: Media Access Control Address, media access control address.
[0069] IOCTL: input / output control, is a system call dedicated to device input and output operations. The call passes in a request code related to the device. The function of the system call depends entirely on the request code.
[0070] ATA: Advanced Technology Attachment, hard disk interface technology.
[0071] DWORD: Double Word, double-byte data type.
[0072] SHA256 algorithm: A hash algorithm that uses a hash value length of 256 bits.
[0073] like Figure 1 As shown, this embodiment provides an electronic device 1, including: at least one processor 11 and a memory 12, Figure 1 A processor is taken as an example. The processor 11 and the memory 12 are connected via a bus 10. The memory 12 stores instructions that can be executed by the processor 11, and the instructions are executed by the processor 11 so that the electronic device 1 can execute all or part of the process of the method in the following embodiment, so as to directly obtain the identification information of multiple hardware in the terminal device by assembling instructions, without relying on third-party information, reducing the risk of hardware identification information being tampered with, and improving the accuracy of the terminal identification code.
[0074] In one embodiment, the electronic device 1 may be a mobile phone, a tablet computer, a laptop computer, a desktop computer, or a large computing system composed of multiple computers.
[0075] Figure 2 Schematic diagram of an application scenario 200 of a terminal identification code generation solution provided in an embodiment of the present application. Figure 2 As shown, the system includes: a server 210 and a terminal 220, wherein:
[0076] The server 210 may be a data platform that provides terminal identification code generation services, such as a software authorization verification platform or a file permission verification platform. Taking the software authorization verification platform as an example, in actual scenarios, a software authorization verification platform may have multiple servers 210. Figure 2 In the figure, one server 210 is taken as an example.
[0077] Terminal 220 can be a computer, mobile phone, tablet or other device used by a user to log in to the software authorization verification platform. There can also be multiple terminals 220. Figure 2 Two terminals 220 are taken as an example for illustration.
[0078] The terminal 220 and the server 210 can transmit information via the Internet, so that the terminal 220 can access the data on the server 210. The terminal 220 and / or the server 210 can be implemented by the electronic device 1.
[0079] The terminal identification code generation solution of the embodiment of the present application can be deployed on the server 210, can also be deployed on the terminal 220, or can be deployed partially on the server 210 and partially on the terminal 220. In actual scenarios, it can be selected based on actual needs, and this embodiment does not limit it.
[0080] When the terminal identification code generation solution is fully or partially deployed on the server 210 , a calling interface may be opened to the terminal 220 to provide algorithm support to the terminal 220 .
[0081] The method provided in the embodiment of the present application can be implemented by executing the corresponding software code by the electronic device 1, and can be implemented by exchanging data with the server. The electronic device 1 can be a local terminal device. When the method is run on the server, the method can be implemented and executed based on the cloud interaction system, wherein the cloud interaction system includes a server and a client device.
[0082] In a possible implementation, the method provided by the embodiment of the present invention provides a graphical user interface through a terminal device, wherein the terminal device can be the local terminal device mentioned above, or can be the client device in the cloud interaction system mentioned above.
[0083] The terminal identification code generation method of the embodiment of the present application can be applied to any field that requires the use of a terminal device identification code.
[0084] The terminal identification code refers to a series of serial numbers formed by a series of encryption and hashing of the device hardware serial number, which can be used to uniquely identify the device. In actual scenarios, the terminal identification code can be used for software authorization, as a device key, as a device information identification mark, and other scenarios. Taking the software authorization scenario as an example, the software has taken certain protection measures to prevent piracy. When a user registers, a unique identification code will be generated based on the identification information of the hardware in the computer where the user's software is installed. It is generally called a machine code, also called a serial number, authentication code, registration application code, etc. Only devices authorized by the identification code can use the software functions normally.
[0085] Taking Electron software authorization as an example, Electron is a runtime environment that packages browser kernels Webkit and NodeJS. Using Electron, web (webpage) development technologies such as JavaScript, HTML, and CSS can be used to develop client software. After the development of the Electron program is completed, the H5 program developed using JavaScript, HTML, and CSS and the runtime environment provided by Electron will be packaged together into an installation package for users to download and install. The final software is installed on the user's computer and run. Before the user installs the software and runs it, the user's device may be authenticated to ensure that the legally authorized device uses the software. During the authentication process, the device identification code is needed as the unique identification information to identify the device. For example, the terminal identification code can be used by the Electron.js desktop application to identify the same machine.
[0086] In addition, the terminal identification code can also be used as a precondition for various information transmissions. Therefore, the accuracy of the terminal identification code is particularly important. In actual applications, the terminal identification code is generated based on the identification information of the terminal device hardware. For example, the hard disk and CPU have an unmodifiable identification code that generally does not change.
[0087] In the related art, a common way to obtain the identification information of the terminal device hardware is to obtain it from the registry or local records. For example, node-machine-id (a plug-in for obtaining the terminal identification code) can be used to obtain the machine identification code. The specific scenario is as follows:
[0088] 1. Under Win32 / 64 system, you can use the key value under the registry: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography to obtain the device identification code. The disadvantage is that the key value can be modified by the administrator, resulting in inaccurate information acquisition.
[0089] 2. Under OSx system, you can use IOPlatformUUID information: ioreg-rd1-cIOPlatformExpertDevice to obtain it. The disadvantage is that the application can be replaced and modified, resulting in inaccurate information acquisition.
[0090] 3. Under Linux system, it uses the record value of / var / lib / dbus / machine-id. The disadvantage is that this value can be modified by the root user, resulting in inaccurate information acquisition.
[0091] The above-mentioned terminal identification code acquisition method generally relies on a third-party application to obtain the identification information of the terminal device hardware. The hardware identification information is easily tampered with. Therefore, the terminal identification code may change due to reinstalling the system and obtaining hardware identification information that may be tampered with, and thus the device cannot be accurately identified.
[0092] In order to solve the above problems, an embodiment of the present application provides a terminal identification code generation solution. After receiving an identification code query request for a target terminal, identification information of multiple hardware of the terminal device is obtained through a preset assembly instruction, and the obtained identification information of the multiple hardware is spliced to form a splicing code, and then the splicing code is encrypted to generate a target identification code and return it. In this way, the identification information of the hardware of the terminal device is obtained directly through the assembly instruction without relying on third-party information, thereby reducing the risk of the hardware identification information being tampered with and improving the accuracy of the terminal identification code.
[0093] Some embodiments of the present application are described in detail below in conjunction with the accompanying drawings. In the case where there is no conflict between the embodiments, the following embodiments and the features in the embodiments can be combined with each other. In addition, the step sequence in the following method embodiments is only an example and not a strict limitation.
[0094] Please see Figure 3 , which is a terminal identification code generation method according to an embodiment of the present application, the method can be Figure 1 The electronic device 1 shown is used to perform and can be applied to Figure 2 In the application scenario of the terminal identification code generation shown in , the hardware identification information of the terminal device is obtained directly through assembly instructions, without relying on third-party information, reducing the risk of hardware identification information being tampered with, and improving the accuracy of the terminal identification code. This embodiment takes the terminal 220 as an execution end as an example, and the method includes the following steps:
[0095] Step 301: In response to an identification code query request for a target terminal, identification information of multiple hardware in the target terminal is obtained based on a preset assembly instruction.
[0096] In this step, the target terminal can be a device that needs to be authenticated, such as a mobile phone, computer or other device that needs software authentication, or a mobile phone, computer or other device that needs document key authentication. The terminal identification code is the unique identifier of the target terminal. The terminal identification code is generated based on the identification information of the hardware in the target terminal. The target terminal may include multiple hardware, such as a processor, a hard disk or other hardware. The identification information is used to identify the corresponding hardware. Each hardware has a unique identification information. The identification information can be the hardware identification code, serial number, etc. Assembly instructions are some operators and mnemonics used in assembly language, and also include some pseudo-instructions. Assembly instructions correspond to machine instructions one by one. Each CPU has its own assembly instruction set. Computers process data by executing instructions. In order to indicate the source of data, the destination of operation results and the operations performed, an instruction generally includes two parts: an operation code and an operand. When the processor is designed, its own specific instruction system has been specified. The function of this instruction system also determines the computer system composed of the microprocessor and its basic functions. Each instruction designed in the instruction system corresponds to a specified functional operation to be completed by the microprocessor, that is, the implementation of these instruction functions is completed by the physical devices in the microprocessor. In order for a computer to complete a complete task, it needs to execute a set of instructions, which is usually called a program. The collection of various different instructions that a computer can execute is called the instruction system of the processor. In this embodiment, when a query request for the identification code of the target terminal is received, in response to the query request, a preset assembly instruction can be used to complete the function of obtaining the identification information of multiple hardware in the target terminal, so that it does not rely on third-party applications, reduces the risk of hardware identification information being tampered with, and improves the accuracy of the terminal identification code.
[0097] In one embodiment, the target terminal may include multiple hardware, such as multiple processors and multiple hard disks, so the identification information of the multiple hardware includes but is not limited to: one or more of the processor identification code, hard disk identification code, MAC address, memory serial number, motherboard serial number, and graphics card serial number of the target terminal.
[0098] In actual scenarios, one or more hardware identification codes can be selected according to actual needs. The hardware identification information is stable and can characterize the hardware characteristics of the target terminal. The hardware characteristics are unique characteristics of the device, so they can be used to generate the target identification code of the target terminal and accurately identify the target terminal.
[0099] In one embodiment, step 301 may specifically include: for a single target hardware in the target terminal, calling a preset assembly instruction, obtaining return data of the preset assembly instruction from a corresponding register, wherein the return data includes identification information of multiple hardware.
[0100] In this embodiment, for each target hardware in the target terminal, the corresponding preset assembly instruction can be called respectively, and the parameters are passed in the preset assembly instruction. The passed parameters are configured with information such as the target hardware to be accessed and the storage location of the returned data, so that after executing the preset assembly instruction, the identification information of the corresponding target hardware (such as the hardware identification code) is obtained, and the identification information of the target hardware is stored as the returned data in the specified register, and then the returned data is directly read from the register to obtain the identification information of the target hardware in the target terminal. The preset assembly instruction can be a standard interface call instruction at the terminal system level to obtain the identification information of multiple hardware of the target terminal through the standard interface at the system level, such as obtaining the CPU ID and hard disk ID information through the standard interface at the system level.
[0101] In one embodiment, the _cpuid instruction can be called to obtain the processor information (such as CPU ID) of the target terminal returned by the _cpuid instruction from the specified register. This does not rely on third-party applications, reduces the risk of hardware identification information being tampered with, and improves the accuracy of the terminal identification code.
[0102] In one embodiment, calling the preset assembly instruction in step 301 and obtaining the return data of the preset assembly instruction from the corresponding register may specifically include: obtaining the address of a specific function in the target terminal, where the specific function is a system interface function in the target terminal. According to the address of the specific function, reading the target instruction corresponding to the specific function from the memory, copying the target instruction, the preset assembly instruction including the target instruction. After passing the preset parameters to the target instruction, executing the target instruction. Obtaining the return data from the register corresponding to the specific function.
[0103] In this embodiment, the specific function is a system interface function in the target terminal, that is, a system API function. Each system API function corresponds to a corresponding instruction for implementing the function of the system API function, such as the DeviceIoControl function. DeviceIoControl is a function that directly sends a control code to a specified device driver so that the corresponding mobile device can perform a corresponding operation. In this embodiment, the preset assembly instruction may include a target instruction of a specific function in the system API function. In an actual scenario, to obtain the address of a system API function, the system's LoadLibraryA() function (LoadLibraryA() is used to load the dynamic link library corresponding to the API function) and GetProcAddress() function (GetProcAddress() function is used to obtain the entry address corresponding to the API function) can be called to dynamically obtain it, and then the target instruction of the specific function in the system API is copied to the program of this embodiment for execution. After the target instruction is executed, the return data can be found in the register corresponding to the specific function. In related schemes, specific functions in the system API can also be called directly, and the physical layer of the target terminal directly executes the target instructions of the specific function. However, in this case, the information can be easily intercepted and modified, and security disclosure is required. This embodiment copies the target instructions to this program for execution, and then reads the return data from the register, which is not easily intercepted and has better accuracy.
[0104] In one embodiment, taking the Windows system running on the target terminal as an example, the hard disk identification code of the target terminal can be obtained in the following manner:
[0105] 1. Get the address of the system API-DeviceIoControl function and read the target instruction of the DeviceIoControl function.
[0106] 2. Copy the target instruction in 1 to the program of this solution, and then pass in the corresponding parameters and execute it.
[0107] 3. After execution, obtain the corresponding hard disk information from the corresponding register.
[0108] The DeviceIoControl function is a system function in the Windows API, which is used to communicate with the device driver. The parameters passed into the DeviceIoControl function in 2 above and their meanings can be as follows:
[0109] hDevice: a handle of a device, used to indicate the device to communicate with. In this embodiment, it refers to the handle of the hard disk of the target terminal.
[0110] dwIoControlCode: control code to be executed by the device driver, usually an IOCTL command code. In this embodiment, an IOCTL_ATA_PASS_THROUGH (buffered device control request) command code may be specified to issue an ATA_PASS_THROUGH_EX command to the hard disk.
[0111] lpInBuffer: A pointer to an input buffer, used to pass input parameters required by the device driver. In this embodiment, it points to the aforementioned ATA_PASS_THROUGH_EX structure.
[0112] nInBufferSize: The size of the input buffer (in bytes). In this embodiment, the size of the ATA_PASS_THROUGH_EX structure is specified.
[0113] lpOutBuffer: A pointer to an output buffer, used to obtain output data returned by the device driver. In this embodiment, it points to the buffer of the aforementioned ATA_PASS_THROUGH_EX structure and IDENTIFY_DEVICE_DATA (identification device data) structure to obtain the serial number of the hard disk.
[0114] nOutBufferSize: the size of the output buffer (in bytes). In this embodiment, it can be used to specify the total size of the aforementioned ATA_PASS_THROUGH_EX structure and IDENTIFY_DEVICE_DATA structure.
[0115] lpBytesReturned: A pointer to a variable for receiving the actual output data size. In this embodiment, it can be used to point to a variable dwBytesReturned (returned byte variable) of type DWORD.
[0116] lpOverlapped: a pointer to an OVERLAPPED structure (a structure containing information used for asynchronous input and output), used for asynchronous operations. In this embodiment, it can be NULL (null pointer).
[0117] It should be noted that the above parameters are only examples because the implementation of the hard disk driver may vary from manufacturer to manufacturer. In actual use, appropriate modifications can be made according to the specific model of the hard disk and the implementation of the driver.
[0118] In one embodiment, the target hardware may be each hard disk in the target terminal, and the identification information may include: multiple hard disk identification codes in the target terminal. The preset assembly instruction includes: an instruction for calling the hardware abstraction layer function of the target terminal. The calling of the preset assembly instruction in step 301, and obtaining the return data of the preset assembly instruction from the corresponding register, may specifically include: calling the hardware abstraction layer function of the target terminal, and reading the return data from the register corresponding to the hardware abstraction layer function, and the return data includes the hard disk identification code of the target terminal.
[0119] In this embodiment, the process of acquiring the hard disk identification code of the target terminal can also be implemented by calling the hardware abstraction layer HAL function of the target terminal. The hardware abstraction layer HAL function stores the returned hard disk identification code in a register, and the hard disk identification code can be directly read from the corresponding register. This case can be applicable to older versions of systems.
[0120] In one embodiment, assuming that the target hardware includes a hard disk, the identification information includes: a hard disk identification code of the target terminal. The preset assembly instruction includes: a BIOS interrupt. The calling of the preset assembly instruction in step 301 and obtaining the return data of the preset assembly instruction from the corresponding register may specifically include: calling the BIOS interrupt of the target terminal and reading the return data from the register corresponding to the BIOS interrupt, wherein the return data includes the hard disk identification code of the target terminal.
[0121] In this embodiment, the process of acquiring the hard disk identification code of the target terminal can also be implemented by calling a BIOS interrupt. After calling the BIOS interrupt, the returned hard disk identification code will be stored in the corresponding register, and the hard disk identification code can be directly read from the corresponding register. This case can be applicable to systems with older versions and expand the scope of application of the hardware identification information acquisition solution.
[0122] Step 302: splicing the identification information of multiple hardware to obtain a splicing code.
[0123] In this step, the identification information of the hardware in the target terminal may include information of multiple hardware, such as CPU identification code, hard disk identification code, etc. The identification information of multiple hardware can be spliced to obtain the spliced string as the splicing code. Multiple hardware identification information can improve the accuracy of the terminal identification code.
[0124] In one embodiment, step 302 may specifically include: sorting the identification codes of multiple hard disks, generating a hard disk identification string of the target terminal according to the sorting result, and concatenating the hard disk identification string with the identification code of at least one processor to obtain a concatenated code.
[0125] In this embodiment, the target terminal includes multiple hard disks and at least one processor, and the identification information of the multiple hardware includes the identification codes of the multiple hard disks and the identification code of at least one processor. The identification code of the hard disk can be represented by the hard disk serial number. In actual scenarios, multiple hard disks correspond to different connection cables. When the connection cables are exchanged between two hard disks, the hardware identification information will change, but in fact the hard disk of the terminal has not changed. For example, to deal with the change of hardware identification information caused by this situation, the hard disks can be sorted according to the serial numbers. For example, the order of the hard disk serial numbers can be arranged in the ASCII code sequence of their numbers. Assuming that the target terminal includes N hard disks (where N is a positive integer), the hard disk serial numbers are spliced based on the sorting result, and the generated hard disk identification string can be: hard disk ID-1+hard disk ID-2+hard disk ID-3...+hard disk ID-N. The sorted hard disk identification string can avoid the problem of changing the identification information of the hard disk due to the exchange of connection cables between different hard disks, and ensure the stability of the hardware identification information of the hard disk. Then the processor identification code CPU ID is arranged in front of the hard disk identification string, and the two are spliced to obtain the splicing code shown below:
[0126] CPUID+hard disk ID-1+hard disk ID-2+hard disk ID-3…+hard disk ID-N.
[0127] The above embodiment takes hard disk information and processor information as an example, and the splicing code may also be generated by identification information of other hardware of the target terminal. In actual scenarios, adaptive selection may be made according to actual needs.
[0128] Step 303: encrypt the splicing code to generate a target identification code of the target terminal.
[0129] In this step, the splicing code directly exposes the identification information of multiple hardware of the target terminal. In order to reduce the risk of information leakage and enhance information security, the splicing code can be encrypted to obtain an encrypted target identification code to improve information security.
[0130] In one embodiment, step 301 may specifically include: performing a hash operation on the concatenated code to generate a target identification code of the target terminal.
[0131] In this embodiment, the Hash operation can transform an input of any length into an output of a fixed length through a hash algorithm, and the output is the hash value. This conversion is a compression mapping, that is, the space of the hash value is usually much smaller than the space of the input. The Hash algorithm is a function that compresses a message of any length into a message digest of a fixed length, and it is difficult to find an inverse rule. The use of the Hash algorithm can improve the utilization of storage space. Therefore, the hash operation can ensure the security of data transmission. The splicing code obtained in step 302 can be hashed, and the result of the hash operation can be used as the target identification code of the target terminal, thereby improving the security of the terminal identification code and improving the utilization of storage space.
[0132] Take the concatenated code obtained by concatenating the CPU ID and the hard disk ID as an example. Assuming that the hash algorithm SHA256 is used to perform a hash operation on the string of the concatenated code, the following target identification code can be obtained after the hash operation:
[0133] Target identification code = SHA256 (CPUID + hard disk ID-1 + hard disk ID-2 + hard disk ID-3... + hard disk ID-N).
[0134] It should be noted that the SHA256 algorithm here is only used as an example of a hash operation method. In actual scenarios, different hash methods can be used according to different situations.
[0135] In this way, the solution of the above embodiment can be compiled into a NodeJS extension module through C++, loaded on Electron, and used to provide terminal identification code acquisition and verification services. Of course, it can also be used in NodeJS.
[0136] The above-mentioned terminal identification code generation method, after receiving the identification code query request for the target terminal, obtains the identification information of multiple hardware of the terminal device through the preset assembly instruction, splices the obtained identification information of multiple hardware to form a splicing code, and then encrypts the splicing code to generate the target identification code and return it. In this way, the hardware identification information of the terminal device is obtained directly through the assembly instruction, without relying on third-party information, avoiding the user to achieve the purpose of changing the terminal identification code by simply modifying the file, and the identification is more accurate. Moreover, since the hardware identification information CPUID and hard disk ID remain unchanged after reinstalling the system, the terminal identification code is avoided from being changed due to reinstalling the system. The corresponding inline assembly code can be written differently according to different operating systems. The inline assembly code can be encapsulated into a Node module to solve the problem of Electron.js's weak underlying capabilities.
[0137] In actual scenarios, the terminal identification code can be used as a unique identifier of the terminal device and can be used in various scenarios where the terminal identity needs to be verified to ensure that the unique identifier remains unchanged even after changing the account, uninstalling and reinstalling the software, reinstalling the system, etc. The target identification code of this embodiment can be applied to at least the following scenarios:
[0138] 1. Authorization registration: Allow the target terminal to use some software / functions that require authorization.
[0139] 2. As a local key: When the software encrypts local storage files, the target identification code is used as the target terminal's key for the stored files to prevent the files from being copied to other machines for use.
[0140] 3. As an information identification mark: For example, it is used as the identification mark of the target terminal when reporting software error information.
[0141] Please see Figure 4 , which is a terminal identification code generation method according to an embodiment of the present application, the method can be Figure 1 The electronic device 1 shown is used to perform and can be applied to Figure 2 In the application scenario of the terminal identification code generation shown in , the hardware identification information of the terminal device can be obtained directly through assembly instructions without relying on third-party information, reducing the risk of hardware identification information being tampered with and improving the accuracy of the terminal identification code. This embodiment takes terminal 220 as the execution end and the software authentication scenario based on Electron as an example. The terminal identification code generation method in the aforementioned embodiment is compiled into a NodeJS extension module through C++ and loaded on Electron to provide terminal identification code acquisition and verification services to solve the problem of weak underlying capabilities of Electron.js. The method comprises the following steps:
[0142] Step 401: Start with the call to Electron.js.
[0143] Step 402: Load the NodeJS extension module on Electron.js.
[0144] Step 403: calling the terminal identification code generation function through the NodeJS extension module.
[0145] Step 404: Obtain the hard disk ID model of the target terminal.
[0146] Step 405: Sort the hard disk IDs.
[0147] Step 406: Concatenate the hard disk IDs into a string.
[0148] Step 407: concatenate the CPU ID with the concatenated hard disk ID character string to obtain a concatenated code.
[0149] Step 408: Use the SHA256 hash algorithm to perform a hash operation on the concatenated code. It should be noted that the SHA256 algorithm is only used as an example of a hash operation method. In actual scenarios, different hash methods can be used according to different situations.
[0150] Step 409: Return the hash result as the target identification code of the target terminal.
[0151] For details of each step of the terminal identification code generation method, please refer to the relevant description of the aforementioned relevant embodiments, which will not be repeated here.
[0152] Please see Figure 5 , which is a terminal identification code generation method according to an embodiment of the present application, the method can be Figure 1 The electronic device 1 shown is used to perform and can be applied to Figure 2 In the application scenario of the terminal identification code generation shown in , the hardware identification information of the terminal device is obtained directly through assembly instructions, without relying on third-party information, reducing the risk of hardware identification information being tampered with, and improving the accuracy of the terminal identification code. This embodiment takes the terminal 220 as an execution end as an example. Compared with the previous embodiment, this embodiment takes the identity verification scenario of the terminal device during the software authorization process as an example. The method includes the following steps:
[0153] Step 501: In response to a software authorization request from a target terminal for target software, an identification code query request for the target terminal is generated.
[0154] In this step, before the software is downloaded, installed or used, the target terminal using the software can be authenticated. Since the identification code has the characteristic of uniquely identifying the device, the identification code of the target terminal can be used to authenticate it. Therefore, when a software authorization request for the target software is received from the target terminal, an identification code query request for the target terminal is generated in response to the authorization request.
[0155] Step 502: In response to the query request, a method as in any of the above embodiments is used to obtain a target identification code of the target terminal based on the preset assembly instruction and identification information of multiple hardware of the target terminal. For details, please refer to the relevant description in the above embodiments, which will not be repeated here.
[0156] Step 503: verify the target terminal according to the target identification code, and when the target identification code is an authorized identification code, determine that the software authorization request of the target terminal for the target software is approved, otherwise, reject the software authorization request of the target terminal for the target software.
[0157] In this step, the target identification code can be compared with a preset identification code list of authorized terminal devices. If the target identification code is in the list, it can be said that the target identification code is an authorized identification code, and the software authorization request of the target terminal for the target software is determined to be approved. Otherwise, the software authorization request of the target terminal for the target software is rejected. In this way, the accuracy of terminal identity authentication is improved.
[0158] For details of each step of the above-mentioned terminal device verification method, please refer to the relevant description of the above-mentioned relevant embodiments, which will not be repeated here.
[0159] Please see Figure 6 , which is a terminal identification code generation method according to an embodiment of the present application, the method can be Figure 1 The electronic device 1 shown is used to perform and can be applied to Figure 2 In the application scenario of the terminal identification code generation shown in , the hardware identification information of the terminal device is obtained directly through assembly instructions, without relying on third-party information, reducing the risk of hardware identification information being tampered with, and improving the accuracy of the terminal identification code. This embodiment takes the terminal 220 as an execution end as an example. Compared with the previous embodiment, this embodiment takes the identity verification scenario of the terminal device during the document access process as an example. The method includes the following steps:
[0160] Step 601: In response to a document access request from a target terminal to a target document, an identification code query request to the target terminal is generated.
[0161] In this step, the identification code can be used as key information for accessing the document. For example, in a scenario where a key needs to be verified to open a document, assuming that the target terminal is mobile phone A used by the user, when the user uses mobile phone A to open document B, mobile phone A can be authenticated. When a request to open document B is received from mobile phone A, an identification code query request for the target terminal is generated in response to the request.
[0162] Step 602: In response to the query request, a method as in any of the above embodiments is used to obtain a target identification code of the target terminal based on the preset assembly instruction and identification information of multiple hardware of the target terminal. For details, please refer to the relevant description in the above embodiments, which will not be repeated here.
[0163] Step 603: Generate a key for the target terminal regarding the target document based on the target identification code and the characteristic data of the target document, and verify the target terminal based on the key. When the key passes the verification, the target terminal is allowed to access the target document, otherwise the target terminal is denied access to the target document.
[0164] In this step, the target identification code of mobile phone A and the characteristic data of document B can be used together as the key of mobile phone A to document B, and the key is compared with the authorized key list. If the key is in the list, it means that the key has passed the verification, mobile phone A has the authority to open document B, and mobile phone A is allowed to open document B. Otherwise, mobile phone A is denied to open document B, and a prompt can be given to remind the user that mobile phone A has no authority to open document B, so that the user can know it in time. In this way, the accuracy of document authentication is improved, and the security of document information is improved.
[0165] For details of each step of the above-mentioned terminal device verification method, please refer to the relevant description of the above-mentioned relevant embodiments, which will not be repeated here.
[0166] Please see Figure 7 , which is a terminal identification code generating device 700 of an embodiment of the present application, which can be applied to Figure 1 The electronic device 1 shown can be applied to Figure 2 In the application scenario of the terminal identification code generation shown in , the hardware identification information of the terminal device is obtained directly through assembly instructions, without relying on third-party information, reducing the risk of hardware identification information being tampered with, and improving the accuracy of the terminal identification code. The device includes: an acquisition module 701, a splicing module 702 and an encryption module 703, and the functional principles of each module are as follows:
[0167] The acquisition module 701 is used to respond to an identification code query request for a target terminal and acquire identification information of multiple hardware of the target terminal based on a preset assembly instruction.
[0168] The splicing module 702 is used to splice the identification information of multiple hardware to obtain a splicing code.
[0169] The encryption module 703 is used to encrypt the splicing code to generate a target identification code of the target terminal.
[0170] In one embodiment, the acquisition module 701 is used to call a preset assembly instruction for a single target hardware in the target terminal, and obtain return data of the preset assembly instruction from a corresponding register, wherein the return data includes identification information of multiple hardware.
[0171] In one embodiment, the acquisition module 701 is used to acquire the address of a specific function in the target terminal, where the specific function is a system interface function in the target terminal. According to the address of the specific function, a target instruction corresponding to the specific function is read from the memory, the target instruction is copied, and the preset assembly instruction includes the target instruction. After the preset parameters are passed to the target instruction, the target instruction is executed. Return data is obtained from the register corresponding to the specific function.
[0172] In one embodiment, the identification information includes: a hard disk identification code of the target terminal. The preset assembly instruction includes: an instruction for calling a hardware abstraction layer function of the target terminal. The acquisition module 701 is used to call the hardware abstraction layer function of the target terminal and read the return data from the register corresponding to the hardware abstraction layer function, and the return data includes the hard disk identification code of the target terminal.
[0173] In one embodiment, the preset assembly instruction includes: BIOS interrupt. The acquisition module 701 is used to call the BIOS interrupt of the target terminal and read the return data from the register corresponding to the BIOS interrupt, wherein the return data includes the hard disk identification code of the target terminal.
[0174] In one embodiment, the target terminal includes multiple hard disks and at least one processor, and the identification information of the multiple hardware includes identification codes of the multiple hard disks and identification code of the at least one processor. The splicing module 702 is used to sort the identification codes of the multiple hard disks and generate a hard disk identification string of the target terminal according to the sorting result. The hard disk identification string and the identification code of the at least one processor are spliced to obtain a splicing code.
[0175] In one embodiment, the encryption module 703 is used to perform a hash operation on the splicing code to generate a target identification code of the target terminal.
[0176] In one embodiment, the identification information of the multiple hardware also includes: one or more of the MAC address of the target terminal, the memory serial number, the motherboard serial number, and the graphics card serial number.
[0177] For a detailed description of the terminal identification code generating device 700, please refer to the description of the relevant method steps in the above embodiment. The implementation principle and technical effect are similar and will not be repeated in this embodiment.
[0178] Figure 8 The following is a schematic diagram of the structure of a cloud device 80 provided in an exemplary embodiment of the present application. The cloud device 80 can be used to run the method provided in any of the above embodiments. Figure 8 As shown, the cloud device 80 may include: a memory 804 and at least one processor 805, Figure 8 A processor is taken as an example.
[0179] The memory 804 is used to store computer programs and can be configured to store various other data to support operations on the cloud device 80. The memory 804 can be an object storage service (OSS).
[0180] Memory 804 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk or optical disk.
[0181] The processor 805 is coupled to the memory 804 and is used to execute the computer program in the memory 804 to implement the solution provided by any of the above method embodiments. The specific functions and technical effects that can be achieved are not repeated here.
[0182] Furthermore, if Figure 8 The cloud device also includes: a firewall 801, a load balancer 802, a communication component 806, a power supply component 803 and other components. Figure 8 Only some components are shown schematically, which does not mean that the cloud device only includes Figure 8 Components shown.
[0183] In one embodiment, the above Figure 8 The communication component 806 in is configured to facilitate wired or wireless communication between the device where the communication component 806 is located and other devices. The device where the communication component 806 is located can access a wireless network based on a communication standard, such as WiFi, 2G, 3G, 4G, LTE (Long Term Evolution, Long Term Evolution, referred to as LTE), 5G and other mobile communication networks, or a combination thereof. In an exemplary embodiment, the communication component 806 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 806 also includes a near field communication (Near Field Communication, referred to as NFC) module to facilitate short-range communication. For example, the NFC module can be based on Radio Frequency Identification (Radio Frequency Identification, referred to as RFID) technology, Infrared Data Association (Infrared Data Association, referred to as IrDA) technology, Ultra Wide Band (UWB) technology, Bluetooth (BT) technology and other technologies.
[0184] In one embodiment, the above Figure 8 The power supply component 803 provides power to various components of the device where the power supply component 803 is located. The power supply component 803 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the device where the power supply component is located.
[0185] An embodiment of the present application further provides a computer-readable storage medium, in which computer-executable instructions are stored. When a processor executes the computer-executable instructions, the method of any of the aforementioned embodiments is implemented.
[0186] An embodiment of the present application also provides a computer program product, including a computer program, which implements the method of any of the aforementioned embodiments when executed by a processor.
[0187] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of modules is only a logical function division, and there may be other division methods in actual implementation, such as multiple modules can be combined or integrated into another system, or some features can be ignored or not executed.
[0188] The above-mentioned integrated module implemented in the form of a software function module can be stored in a computer-readable storage medium. The above-mentioned software function module is stored in a storage medium, including a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to perform some steps of the methods of various embodiments of the present application.
[0189] It should be understood that the above-mentioned processor can be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in the application can be directly embodied as being executed by a hardware processor, or can be executed by a combination of hardware and software modules in the processor. The memory may include a high-speed RAM (Random Access Memory) memory, and may also include non-volatile storage NVM (Nonvolatile memory, NVM for short), such as at least one disk storage, and can also be a USB flash drive, a mobile hard disk, a read-only memory, a disk or an optical disk, etc.
[0190] The above storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk. The storage medium can be any available medium that can be accessed by a general or special computer.
[0191] An exemplary storage medium is coupled to a processor so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can be located in an application specific integrated circuit (ASIC). Of course, the processor and the storage medium can also exist as discrete components in an electronic device or a main control device.
[0192] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.
[0193] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0194] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a disk, or an optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods of each embodiment of the present application.
[0195] In the technical solution of this application, the collection, storage, use, processing, transmission, provision and disclosure of user data and other information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0196] The above are only preferred embodiments of the present application, and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A method for generating a terminal identification code, characterized in that: The method comprises: In response to an identification code query request for a target terminal, obtaining identification information of multiple hardware in the target terminal based on a preset assembly instruction; Splicing the identification information of the plurality of hardware to obtain a splicing code; The splicing code is encrypted to generate a target identification code of the target terminal.
2. The method according to claim 1, characterized in that The obtaining, based on the preset assembly instruction, identification information of multiple hardware in the target terminal includes: For a single target hardware in the target terminal, the preset assembly instruction is called, and return data of the preset assembly instruction is obtained from a corresponding register, wherein the return data includes identification information of the target hardware.
3. The method according to claim 2, characterized in that The calling of the preset assembly instruction and obtaining the return data of the preset assembly instruction from the corresponding register includes: Acquire an address of a specific function in the target terminal, where the specific function is a system interface function in the target terminal; According to the address of the specific function, a target instruction corresponding to the specific function is read from a memory, and the target instruction is copied, wherein the preset assembly instruction includes the target instruction; After inputting preset parameters into the target instruction, the target instruction is executed; The return data is obtained from a register corresponding to the specific function.
4. The method according to claim 2, characterized in that: The identification information includes: a hard disk identification code of the target terminal; the preset assembly instruction includes: an instruction for calling a hardware abstraction layer function of the target terminal; the calling of the preset assembly instruction and obtaining return data of the preset assembly instruction from a corresponding register include: Calling a hardware abstraction layer function of the target terminal, and reading return data from a register corresponding to the hardware abstraction layer function, wherein the return data includes a hard disk identification code of the target terminal; Or the preset assembly instruction includes: BIOS interruption; calling the preset assembly instruction and obtaining the return data of the preset assembly instruction from the corresponding register, including: The BIOS interrupt of the target terminal is called, and return data is read from a register corresponding to the BIOS interrupt, wherein the return data includes a hard disk identification code of the target terminal.
5. The method according to claim 1, characterized in that The target terminal includes multiple hard disks and at least one processor, and the identification information of the multiple hardware includes identification codes of the multiple hard disks and identification code of the at least one processor; the splicing processing of the identification information of the multiple hardware to obtain the splicing code includes: Sorting the identification codes of the multiple hard disks, and generating a hard disk identification string of the target terminal according to the sorting result; The hard disk identification character string and the identification code of the at least one processor are concatenated to obtain the concatenated code.
6. The method according to claim 1, characterized in that The step of encrypting the splicing code to generate a target identification code of the target terminal includes: A hash operation is performed on the concatenated code to generate a target identification code of the target terminal.
7. The method according to claim 5, characterized in that The identification information of the multiple hardware also includes: one or more of the MAC address, memory serial number, mainboard serial number, and graphics card serial number of the target terminal.
8. A terminal device verification method, characterized in that: The method comprises: In response to a software authorization request from a target terminal for target software, generating an identification code query request for the target terminal; In response to the query request, acquiring a target identification code of the target terminal based on a preset assembly instruction and identification information of multiple hardware of the target terminal; The target terminal is verified according to the target identification code, and when the target identification code is an authorized identification code, it is determined that the software authorization request of the target terminal for the target software is passed, otherwise the software authorization request of the target terminal for the target software is rejected.
9. A terminal device verification method, characterized in that: The method comprises: In response to a document access request of a target terminal to a target document, generating an identification code query request to the target terminal; In response to the query request, acquiring a target identification code of the target terminal based on a preset assembly instruction and identification information of multiple hardware of the target terminal; Based on the target identification code and the characteristic data of the target document, a key of the target terminal regarding the target document is generated, and the target terminal is verified based on the key. When the key passes the verification, the target terminal is allowed to access the target document, otherwise the target terminal is denied access to the target document.
10. An electronic device, characterized in that: include: at least one processor; as well as a memory communicatively coupled to the at least one processor; The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the electronic device to perform the method according to any one of claims 1 to 9.
11. A cloud device, characterized in that: include: at least one processor; as well as a memory communicatively coupled to the at least one processor; The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the cloud device to execute the method described in any one of claims 1-9.
12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and when the processor executes the computer-executable instructions, the method according to any one of claims 1 to 9 is implemented.
