Authorization method and device
By reading and modifying the authorization data of the hardware driver function in the boot loader stage of the terminal device, the implementation problem of the software authorization hardware driver function is solved, and the legal authorization and management of the hardware functions is realized.
Patent Information
- Application Number
- CN202411568001.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-05
- Publication Date
- 2025-03-28
AI Technical Summary
The prior art cannot effectively solve the implementation problem of software authorized hardware driver functions.
In the boot loader stage of the terminal device, authorization data of the hardware driver function is read from the preset area, the device driver capability management file is modified, and the driver capability is loaded based on the modified file to drive the hardware functions corresponding to the authorization data.
It realizes the terminal equipment's support for the software-licensed hardware driver functions, ensuring the legal operation and management of hardware functions.
Smart Images

Figure CN119720169A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to an authorization method and device. Background Art
[0002] Software offline authorization can adopt the application authorization method. In the application authorization method, the authorization platform generates application encryption authorization data based on the electronic serial number (ESN) of the terminal device and deploys the application encryption authorization data to the terminal device. The terminal device obtains and decrypts the application encryption authorization data to complete the software authorization. However, the software offline authorization method is not applicable to the hardware driver function of software authorization.
[0003] Therefore, how to authorize software to drive hardware functions remains to be studied. Summary of the invention
[0004] The embodiments of the present application provide an authorization method and apparatus, which can enable a terminal device to authorize a hardware driver function for software.
[0005] In a first aspect, an embodiment of the present application provides an authorization method. The method includes: a terminal device reads authorization data of a hardware driver function from a preset area during a boot loader phase. The terminal device modifies a device driver capability management file based on the authorization data. The terminal device loads driver capability based on the modified device driver capability management file to drive the hardware function corresponding to the authorization data.
[0006] It can be seen that in the embodiment of the present application, the terminal device can read the authorization data of the hardware driver function from the preset area during the boot loader stage, so that the device driver capability management file can be modified based on the authorization data of the hardware driver function, and the driver capability can be loaded based on the modified device driver capability management file to drive the hardware function corresponding to the authorization data, thereby completing the authorization of the software to the hardware driver function.
[0007] In an optional implementation, the terminal device may further perform the following operations: receiving encrypted authorization data sent by the server, and storing the encrypted authorization data in a preset area, wherein the encrypted authorization data is obtained by encrypting authorization data generated based on the identification information and demand information of the terminal device.
[0008] In an optional implementation manner, the terminal device reads the authorization data of the hardware driver function from the preset area, including: decrypting the encrypted authorization data and obtaining the decrypted authorization data.
[0009] In an optional implementation manner, the terminal device modifies the device driver capability management file based on the authorization data, including: modifying the device driver capability management file at the kernel stage based on the authorization data.
[0010] In an optional implementation, the terminal device loads driver capabilities based on the modified device driver capability management file, including: restarting the terminal device, and loading driver capabilities based on the modified device driver capability management file in the kernel stage.
[0011] In a second aspect, an embodiment of the present application provides an authorization method. The method includes: a server generates authorization data for a hardware driver function according to identification information and requirement information of a terminal device. The server encrypts the authorization data to obtain encrypted authorization data. The server sends the encrypted authorization data to the terminal device.
[0012] It can be seen that in the embodiment of the present application, the server can generate authorization data for the hardware driver function, and send encrypted authorization data after encrypting the authorization data for the hardware driver function to the terminal device, which is conducive to the terminal device authorizing the hardware driver function to the software based on the encrypted authorization data of the hardware driver function.
[0013] In a third aspect, an embodiment of the present application provides an authorization device, the device comprising:
[0014] A reading module, used for reading authorization data of a hardware driver function from a preset area during a boot loader stage;
[0015] A modification module, used to modify the device driver capability management file based on the authorization data;
[0016] The loading module is used to load the driver capability based on the modified device driver capability management file to drive the hardware function corresponding to the authorization data.
[0017] In addition, in this aspect, other optional implementations of the authorization device can refer to the relevant content of the first aspect above, and will not be described in detail here.
[0018] In a fourth aspect, an embodiment of the present application provides an authorization device, the device comprising:
[0019] A generation module, used to generate authorization data for a hardware driver function according to identification information and requirement information of a terminal device;
[0020] An encryption module, used for encrypting the authorization data to obtain encrypted authorization data;
[0021] The sending module is used to send encrypted authorization data to the terminal device.
[0022] In a fifth aspect, an embodiment of the present application provides a module device, the module device includes a communication module, a power module, a storage module and a chip, wherein:
[0023] The power module is used to provide electrical energy to the module device;
[0024] The storage module is used to store data and instructions;
[0025] The communication module is used for internal communication of the module device, or for communication between the module device and an external device;
[0026] The chip is used to execute the methods described in the first and second aspects above.
[0027] In a sixth aspect, the present application further provides a computer device, comprising: a memory and a processor, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the steps of the above method are implemented.
[0028] In a seventh aspect, the present application further provides a computer storage medium, wherein the computer storage medium stores a computer program, and the computer program implements the steps of the above method when executed by a processor. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] 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. In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments are briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative labor.
[0030] Figure 1 A schematic diagram of the architecture of an authorization system provided in an embodiment of the present application;
[0031] Figure 2 A flowchart of an authorization method provided in an embodiment of the present application;
[0032] Figure 3 A flowchart of another authorization method provided in an embodiment of the present application;
[0033] Figure 4 A schematic diagram of the structure of an authorization device provided in an embodiment of the present application;
[0034] Figure 5 A schematic diagram of the structure of another authorization device provided in an embodiment of the present application;
[0035] Figure 6A schematic diagram of the structure of a module device provided in an embodiment of the present application;
[0036] Figure 7 A schematic diagram of the structure of a computer device provided in an embodiment of the present application.
[0037] The realization of the purpose, functional features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. The above-mentioned drawings have shown clear embodiments of this application, which will be described in more detail later. These drawings and textual descriptions are not intended to limit the scope of the concept of this application in any way, but to illustrate the concept of this application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0038] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.
[0039] It should be understood that the terms "comprising" and "including" indicate the presence of the described features, steps, operations, elements, components, items, kinds, and / or groups, but do not exclude the presence, occurrence or addition of one or more other features, steps, operations, elements, components, items, kinds, and / or groups. The terms "or", "and / or", "including at least one of the following", etc. used in this application may be interpreted as inclusive, or mean any one or any combination. For example, "including at least one of the following: A, B, C" means "any one of the following: A; B; C; A and B; A and C; B and C; A and B and C", and for another example, "A, B or C" or "A, B and / or C" means "any one of the following: A; B; C; A and B; A and C; B and C; A and B and C". Exceptions to this definition will only occur when the combination of elements, functions, steps or operations is inherently mutually exclusive in some way.
[0040] It should be understood that, although the various steps in the flowchart in the embodiment of the present application are displayed in sequence according to the indication of the arrows, these steps are not necessarily performed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and it can be performed in other orders. Moreover, at least a portion of the steps in the figure may include a plurality of sub-steps or a plurality of stages, and these sub-steps or stages are not necessarily performed at the same time, but can be performed at different times, and their execution order is not necessarily performed in sequence, but can be performed in turn or alternately with other steps or at least a portion of the sub-steps or stages of other steps.
[0041] It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0042] In the subsequent description, the suffixes such as "module", "component" or "unit" used to represent elements are only used to facilitate the description of the present application, and have no specific meanings. Therefore, "module", "component" or "unit" can be used in a mixed manner.
[0043] In order to better understand the authorization method disclosed in the embodiment of the present application, the system architecture applicable to the embodiment of the present application is described.
[0044] The authorization system involved in the embodiment of the present application is as follows Figure 1 As shown, the authorization system may include but is not limited to a server and a terminal device. Figure 1 The number and form of the devices shown are for illustrative purposes only and do not constitute a limitation on the embodiments of the present application. In actual applications, more than one server and more than one terminal device may be included. Figure 1 The authorization system shown is described by taking server 101 and terminal device 102 as an example, and server 101 can communicate with terminal device 102. In the embodiment of the present application, the authorization system may also include other devices that communicate with server 101 or terminal device 102, which is not limited in the embodiment of the present application.
[0045] The terminal device in the embodiment of the present application may also be referred to as a terminal, and may refer to various forms of user equipment (UE), access terminal, user unit, user station, mobile station, mobile station (MS), remote station, remote terminal, mobile device, user terminal, wireless communication device, user agent or user device. The terminal device may also be a cellular phone, a cordless phone, a session initiation protocol (SIP) phone, a wireless local loop (WLL) station, a personal digital assistant (PDA), a handheld device with wireless communication function, a computing device or other processing device connected to a wireless modem, a vehicle-mounted device, a wearable device, a terminal device in a fifth generation mobile communication (5G) network or a terminal device in a future public land mobile communication network (PLMN), etc., and the embodiment of the present application is not limited to this.
[0046] In the embodiments of the present application, the server may be an independent physical server, or a server cluster or distributed system composed of multiple physical servers. It may also be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms.
[0047] In the embodiment of the present application, the server 101 may send the encrypted authorization data of the hardware driver function to the terminal device 102. In the embodiment of the present application, the terminal device 102 may receive the encrypted authorization data of the hardware driver function from the server 101, and decrypt the encrypted authorization data of the hardware driver function to obtain the authorization data of the hardware driver function, and then modify the device driver capability management file based on the authorization data of the hardware driver function to obtain the modified device driver capability management file, and then load the driver capability based on the modified device driver capability management file to realize the authorization of the hardware driver function to the software.
[0048] The terminal device can access the authorization server through the network, and obtain and verify the authorization information according to the feature code to complete the online authorization of the software. However, the online software authorization method is not suitable for terminal devices that cannot be connected to the Internet or are inconvenient to connect to the Internet. The terminal device can also use the overall hardware authorization method or the application authorization method to complete the software authorization offline. However, the offline software authorization method is not suitable for the hardware driver function of software authorization.
[0049] The embodiment of the present application proposes an authorization method, in which the terminal device reads the authorization data of the hardware driver function from the preset area during the boot loader stage; the terminal device modifies the device driver capability management file based on the authorization data; the terminal device then loads the driver capability based on the modified device driver capability management file to drive the hardware function corresponding to the authorization data. The method enables the terminal device to authorize the hardware driver function to the software.
[0050] This application embodiment proposes an authorization method. Figure 2 A flowchart of an authorization method provided in an embodiment of the present application, the method includes but is not limited to:
[0051] S201. During the boot loader phase, the terminal device reads authorization data of the hardware driver function from a preset area.
[0052] Among them, the boot loader is a piece of code located in the computer system startup process, and its main function is to load the operating system kernel or other boot programs into the computer's memory and transfer control to the loaded program. Optionally, the boot loader can be a universal boot loader (U-BOOT). Among them, U-BOOT is a boot loader for embedded systems that can support a variety of different computer system structures, such as Linux systems.
[0053] In addition, the preset area may be a one time programmable (OTP) storage area of the terminal device. In this manner, the terminal device reads the authorization data of the hardware driver function from the preset area, including: reading the authorization data of the hardware driver function from the OTP storage area.
[0054] Optionally, the preset area may also be other areas inside the terminal device, which is not limited in the embodiments of the present application.
[0055] In an optional implementation, the terminal device may also perform the following steps: receiving encrypted authorization data sent by the server; wherein the encrypted authorization data is obtained by encrypting authorization data generated based on the identification information and demand information of the terminal device; and storing the encrypted authorization data in a preset area.
[0056] Optionally, the terminal device stores the encrypted authorization data in a preset area, which may be storing the encrypted authorization data of the hardware driver function in an OTP storage area.
[0057] Accordingly, the server may perform the following steps: generating authorization data for the hardware driver function according to the identification information and demand information of the terminal device; encrypting the authorization data for the hardware driver function to obtain encrypted authorization data; and sending the encrypted authorization data to the terminal device.
[0058] The identification information of the terminal device may be a system on a chip identifier (SOC ID) of the terminal device or an electronic serial number (ESN) of the terminal device.
[0059] Among them, the demand information of the terminal device can be the driving function of the hardware. For example, the demand information of the terminal device can be the function of the sensor. In this way, the server can generate authorization data corresponding to the function of the sensor based on the identification information of the terminal device and the function of the sensor.
[0060] Optionally, the server encrypts the authorization data of the hardware driver function to obtain the encrypted authorization data, including: asymmetrically encrypting the authorization data of the hardware driver function to obtain the encrypted authorization data of the hardware driver function. Asymmetric encryption, also known as public key encryption, refers to an encryption method consisting of a corresponding pair of unique keys (i.e., a public key and a private key).
[0061] It can be seen that the server can generate authorization data for the hardware driver function according to the identification information and demand information of the terminal device, and encrypt the authorization data for the hardware driver function to obtain the encrypted authorization data for the hardware driver function, thereby sending the encrypted authorization data for the hardware driver function to the terminal device. Then, the terminal device can receive and store the encrypted authorization data for the hardware driver function from the server, and then read the encrypted authorization data for the hardware driver function in the boot loader stage.
[0062] For example, the server may run a software license test tool. In the "Select Data" option of the license test tool, the "0" option indicates exiting the license program, and the "3" option indicates encrypting the authorization data of the hardware driver function and writing the encrypted authorization data of the hardware driver function to the terminal device. Therefore, the server receives the input "3", thereby encrypting the authorization data of the hardware driver function and writing the encrypted authorization data of the hardware driver function to the terminal device, that is, sending the encrypted authorization data of the hardware driver function to the terminal device.
[0063] In an optional implementation manner, the terminal device reads the authorization data of the hardware driver function from the preset area, including: decrypting the encrypted authorization data and obtaining the decrypted authorization data.
[0064] It can be seen that the terminal device can read the encrypted authorization data of the hardware driver function from the preset area, decrypt the encrypted authorization data, and obtain the decrypted authorization data of the hardware driver function, so that the terminal device can modify the device driver capability management file according to the authorization data of the hardware driver function.
[0065] In an optional implementation, the terminal device decrypts the encrypted authorization data to obtain the decrypted authorization data, including: asymmetrically decrypting the encrypted authorization data to obtain the decrypted authorization data.
[0066] In an optional implementation, the server asymmetrically encrypts the authorization data of the hardware driver function using a private key. Correspondingly, the terminal device asymmetrically decrypts the encrypted authorization data of the hardware driver function using a public key to obtain the authorization data of the hardware driver function. In this way, the terminal device obtains the authorization data of the hardware driver function after asymmetrically decrypting the encrypted authorization data of the hardware driver function using the public key. In this way, the authorization data is encrypted and decrypted using an asymmetrical encryption method, which can make it highly secure.
[0067] In an optional implementation, the terminal device reads the authorization data of the hardware driver function from the preset area, which may be reading the authorization data corresponding to the hardware driver function from the preset area. For example, the terminal device reads the authorization data corresponding to the sensor from the preset area, which is conducive to modifying the device driver capability management file based on the authorization data corresponding to the sensor to authorize the sensor function for the software.
[0068] In another optional implementation, the terminal device reads the authorization data of the hardware driver function from the preset area, which may be to read all the authorization data in the preset area from the preset area. For example, the terminal device reads all the stored authorization data from the preset area, and all the authorization data is the authorization data of one or more hardware functions, thereby facilitating the software to authorize one or more hardware functions based on all the authorization data.
[0069] S202. The terminal device modifies the device driver capability management file based on the authorization data.
[0070] Among them, the device driver capability management file is at least one of the following: device tree source file (device tree source, DTS), device tree binary file (device tree blob, DTB), device tree block overlay file (device tree blob overlay, DTBO), or disk image file (image, IMG). DTS is used to describe the information of the hardware device, such as the name, type, address, etc. of the hardware device. DTB is a binary file compiled by the device tree compiler from DTS. In the Linux system, the bootloader stage loads the DTB into the memory and parses the DTB in the kernel stage. DTBO is used to dynamically add or modify hardware configurations. IMG is used to store and transmit complete backups or copies in the operating system.
[0071] That is to say, based on the authorization data of the hardware driver function, the terminal device can modify any one file, any two files, any three files, or any four files among the DTS, DTB, DTBO, and IMG files corresponding to the software. For example, the terminal device can modify the DTB and DTBO corresponding to the software according to the authorization data of the hardware driver function, thereby realizing the hardware driver management function of the software authorization.
[0072] In an optional implementation manner, the terminal device modifies the device driver capability management file based on the authorization data, including: modifying the device driver capability management file at the kernel stage based on the authorization data.
[0073] The kernel is the most basic part of the operating system, responsible for managing the system's processes, memory, device drivers, files, and network systems. The kernel can provide some applications with secure access to computer hardware, but this access is limited, and the kernel determines when and how long a program can operate on a certain piece of hardware.
[0074] It can be seen that the terminal device can modify the device driver capability management file based on the authorization data of the hardware driver function at the kernel stage, so that the terminal device loads the driver capability according to the modified device driver capability management file.
[0075] S203. The terminal device loads the driver capability based on the modified device driver capability management file to drive the hardware function corresponding to the authorization data.
[0076] In an optional implementation, the terminal device loads driver capabilities based on the modified device driver capability management file, including: restarting the terminal device; and loading driver capabilities based on the modified device driver capability management file in the kernel stage.
[0077] It can be seen that the terminal device can be restarted after modifying the device driver capability management file, and load the driver capability based on the modified device driver capability management file to complete the hardware driver function of authorizing the software.
[0078] The software refers to the application software, and the hardware driver function can be used to implement specific functions. For example, the hardware driver function can refer to the function of a sensor. After the terminal device authorizes the sensor driver function to the application software, the sensor can be controlled by the application software to detect changes in the surrounding environment, thereby triggering corresponding operations according to the changes in the surrounding environment.
[0079] In an optional implementation, the server obtains a feature code, which is a logic code for the boot loading stage of the terminal device; the server sends the feature code to the terminal device. Correspondingly, the terminal device receives the feature code from the server and stores the feature code; the terminal device verifies the feature code during the boot loading stage; and the terminal device enters the boot loading stage when the feature code verification passes.
[0080] Optionally, the terminal device may store the feature code in the OTP storage area, thereby improving the security of the terminal device entering the boot loader stage.
[0081] It can be seen that in the embodiment of the present application, the terminal device can read the authorization data of the hardware driver function from the preset area during the boot loader stage, so that the device driver capability management file can be modified based on the authorization data of the hardware driver function, and the driver capability can be loaded based on the modified device driver capability management file to drive the hardware function corresponding to the authorization data, thereby completing the authorization of the software to the hardware driver function.
[0082] In addition, the method can be applied to the Linux system, and is suitable for terminal devices supporting a single card and terminal devices supporting dual cards, so that the terminal devices of this type can authorize the hardware driver function to the software.
[0083] See also Figure 3 , Figure 3 A flowchart of another authorization method provided in an embodiment of the present application, the method includes but is not limited to:
[0084] S301. The server generates authorization data for the hardware driver function according to the SOC ID or ESN of the terminal device.
[0085] For details about S301, please refer to the above Figure 2 The relevant description of S201 in the authorization method shown.
[0086] S302. The server digitally signs the authorization data of the hardware driver function, and writes the encrypted authorization data of the hardware driver function obtained after the digital signature into the terminal device.
[0087] Among them, the digital signature, also known as the public key digital signature, is a digital string that can only be generated by the sender of the information and cannot be forged by others. This digital string can also be an effective proof of the authenticity of the information sent by the sender.
[0088] In the embodiment of the present application, the server can use a private key to digitally sign the authorization data of the hardware driver function, obtain the encrypted authorization data of the hardware driver function, and write the encrypted authorization data of the hardware driver function into the terminal device.
[0089] The server writes the encrypted authorization data of the hardware driver function obtained after the digital signature into the terminal device, including: writing the encrypted authorization data of the hardware driver function obtained after the digital signature into the OTP / storage area of the terminal device.
[0090] S303. The terminal device reads the encrypted authorization data of the hardware driver function in the U-BOOT / bootloader stage.
[0091] The terminal device reads the encrypted authorization data of the hardware driver function in the U-BOOT / bootloader stage, including: reading the encrypted authorization data of the hardware driver function from the OTP / storage area of the terminal device in the U-BOOT / bootloader stage.
[0092] S304. The terminal device decrypts the encrypted authorization data of the hardware driver function to obtain the authorization data of the hardware driver function.
[0093] In the embodiment of the present application, the terminal device can use the public key to decrypt the encrypted authorization data of the hardware driver function to obtain the authorization data of the hardware driver function.
[0094] S305. The terminal device obtains the supported hardware driver function authorization feature.
[0095] The terminal device decrypts the encrypted authorization data of the hardware driver function, and after obtaining the authorization data of the hardware driver function, automatically obtains the supported authorization characteristics of the hardware driver function. For example, after the terminal device obtains the authorization data corresponding to the sensor, it automatically obtains the supported authorization characteristics corresponding to the sensor, so that the terminal device modifies the driver startup file at the kernel stage according to the authorization characteristics corresponding to the sensor.
[0096] S306. The terminal device modifies the driver startup file in the kernel stage: DTS / DTB / DTBO / IMG.
[0097] After the terminal device obtains the supported hardware driver function authorization feature, the driver startup file in the kernel stage is modified according to the hardware driver function authorization feature.
[0098] S307. The terminal device starts the kernel phase.
[0099] For details about S307, please refer to the above Figure 2 The relevant description of S203 in the authorization method shown.
[0100] S308. The terminal device loads the authorized hardware driver function in the kernel stage.
[0101] For details about S308, please refer to the above Figure 2 The relevant description of S203 in the authorization method shown.
[0102] S309. The terminal device starts normally.
[0103] The terminal device starts normally and can drive the hardware through software.
[0104] It can be seen that in the U-BOOT stage, the terminal device decrypts the encrypted authorization data of the hardware driver function, obtains the authorization data of the hardware driver function, and thus obtains the authorization characteristics of the supported hardware driver function, and then can authorize the hardware driver function in the kernel stage according to the hardware driver function authorization characteristics, and load the authorized hardware driver function in the kernel stage.
[0105] See also Figure 4 , Figure 4 This is a schematic diagram of the structure of an authorization device provided in an embodiment of the present application. The authorization device at least includes a reading module 401, a modification module 402 and a loading module 403, wherein:
[0106] The reading module 401 is used to read the authorization data of the hardware driver function from the preset area during the boot loader stage;
[0107] A modification module 402, used to modify the device driver capability management file based on the authorization data;
[0108] The loading module 403 is used to load the driver capability based on the modified device driver capability management file to drive the hardware function corresponding to the authorization data.
[0109] In an optional embodiment, the authorization device also includes: a receiving module for receiving encrypted authorization data sent by the server; wherein the encrypted authorization data is obtained by encrypting the authorization data generated based on the identification information and demand information of the terminal device; and a storage module for storing the encrypted authorization data in a preset area.
[0110] In an optional implementation manner, the reading module 401 reads the authorization data of the hardware driver function from a preset area, and is specifically used to: decrypt the encrypted authorization data to obtain the decrypted authorization data.
[0111] In an optional implementation, the modification module 402 modifies the device driver capability management file based on the authorization data, and is specifically used to modify the device driver capability management file at the kernel stage based on the authorization data.
[0112] In an optional implementation, the loading module 403 performs driver capability loading based on the modified device driver capability management file, specifically for: restarting the terminal device; and performing driver capability loading based on the modified device driver capability management file in the kernel stage.
[0113] The embodiments of the present application and the method embodiments shown above are based on the same concept, and the technical effects they bring are also the same. For the specific principles, please refer to the description of the embodiments shown above, and no further details will be given.
[0114] See also Figure 5 , Figure 5 This is a schematic diagram of the structure of another authorization device provided in an embodiment of the present application. The authorization device at least includes a generation module 501, an encryption module 502 and a sending module 503, wherein:
[0115] A generating module 501 is used to generate authorization data for a hardware driver function according to identification information and requirement information of a terminal device;
[0116] The encryption module 502 is used to encrypt the authorization data to obtain the encrypted authorization data;
[0117] The sending module 503 is used to send encrypted authorization data to the terminal device.
[0118] The embodiments of the present application and the method embodiments shown above are based on the same concept, and the technical effects they bring are also the same. For the specific principles, please refer to the description of the embodiments shown above, and no further details will be given.
[0119] See also Figure 6 , Figure 6 6 is a schematic diagram of a module device provided in an embodiment of the present application. The module device can execute the relevant steps of the terminal device or server in the aforementioned method embodiment, and the module device includes: a communication module 601, a power module 602, a storage module 603 and a chip 604.
[0120] Among them, the power module 602 is used to provide power to the module device; the storage module 603 is used to store data and instructions; the communication module 601 is used for internal communication of the module device, or for the module device to communicate with external devices; the chip 604 is used to execute the method executed by the terminal device or server in the above method embodiment.
[0121] The implementation method of the module device can refer to the relevant content of the above method embodiment, which will not be described in detail here.
[0122] The embodiments of the present application and the above-mentioned method embodiments are based on the same concept, and the technical effects they bring are also the same. For the specific principles, please refer to the description of the above-mentioned method embodiments, which will not be repeated here.
[0123] See also Figure 7 , Figure 7 A schematic diagram of the structure of a computer device provided in an embodiment of the present application. The computer device includes at least a processor 701, a memory 703, and a user interface 702, wherein the processor 701, the memory 703, and the user interface 702 are interconnected, wherein the memory 703 is used to store a computer program, the computer program includes program instructions, and the processor 701 is used to execute the program instructions.
[0124] The memory 703 may include a volatile memory (volatile memory), for example, a random-access memory (RAM); the memory 703 may also include a non-volatile memory (non-volatile memory), for example, a flash memory, a solid-state drive (SSD), etc.; the memory 703 may also include a combination of the above-mentioned types of memory.
[0125] The processor 701 may be a central processing unit (CPU). The processor 701 may further include a hardware chip. The hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD), etc. The PLD may be a field-programmable gate array (FPGA), a generic array logic (GAL), etc.
[0126] In an optional implementation, the memory 703 is also used to store program instructions. The processor 701 can call the program instructions: the processor 701 is configured to call the program instructions and perform the following steps:
[0127] During the bootloader phase, authorization data for hardware driver functions is read from a preset area;
[0128] Modify the device driver capability management file based on the authorization data;
[0129] The driver capability is loaded based on the modified device driver capability management file to drive the hardware function corresponding to the authorization data.
[0130] Optionally, the processor 701 further performs the following steps: receiving encrypted authorization data sent by the server; wherein the encrypted authorization data is obtained by encrypting authorization data generated based on identification information and demand information of the terminal device; and storing the encrypted authorization data in a preset area.
[0131] Optionally, the processor 701 reads authorization data of a hardware driver function from a preset area, specifically for: decrypting the encrypted authorization data to obtain the decrypted authorization data.
[0132] Optionally, the processor 701 modifies the device driver capability management file based on the authorization data, specifically for: modifying the device driver capability management file at the kernel stage based on the authorization data.
[0133] Optionally, the processor 701 performs driver capability loading based on the modified device driver capability management file, specifically for: restarting the terminal device; and performing driver capability loading based on the modified device driver capability management file in the kernel stage.
[0134] In an optional implementation, the memory 703 is also used to store program instructions. The processor 701 can call the program instructions: the processor 701 is configured to call the program instructions and perform the following steps:
[0135] Generate authorization data for hardware driver functions based on identification information and demand information of the terminal device;
[0136] Encrypting the authorization data to obtain encrypted authorization data;
[0137] Send encrypted authorization data to the terminal device.
[0138] The embodiments of the present application and the method embodiments shown above are based on the same concept, and the technical effects they bring are also the same. For the specific principles, please refer to the description of the embodiments shown above, and no further details will be given.
[0139] The present application also provides a computer-readable storage medium, on which a detection program is stored. When the detection program is executed by a processor, the steps of an authorization method in any of the above embodiments are implemented.
[0140] In the embodiments of the mobile terminal and computer-readable storage medium provided in the present application, all technical features of the embodiments of the above-mentioned authorization method are included. The expansion and explanation content of the specification are basically the same as those of the embodiments of the above-mentioned method, and will not be repeated here.
[0141] The embodiment of the present application further provides a computer program product, which includes a computer program code. When the computer program code runs on a computer, the computer executes the methods in the various possible implementation modes described above.
[0142] An embodiment of the present application also provides a chip, including a memory and a processor, the memory is used to store computer programs, and the processor is used to call and run the computer programs from the memory, so that a device equipped with the chip executes the methods in various possible implementation modes as described above.
[0143] 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.
[0144] The steps in the method of the embodiment of the present application can be adjusted in order, combined and deleted according to actual needs.
[0145] The units in the device of the embodiment of the present application can be merged, divided and deleted according to actual needs.
[0146] In the present application, the same or similar terminology concepts, technical solutions and / or application scenario descriptions are generally described in detail only the first time they appear. When they appear again later, they are generally not repeated for the sake of brevity. When understanding the technical solutions and other contents of the present application, for the same or similar terminology concepts, technical solutions and / or application scenario descriptions that are not described in detail later, reference can be made to the previous related detailed descriptions.
[0147] In the present application, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0148] The various technical features of the technical solution of the present application can be arbitrarily combined. In order to make the description concise, not all possible combinations of the various technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of the present application.
[0149] 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, magnetic disk, optical disk) as above, and includes a number of instructions for a terminal device (which can be a mobile phone, a computer, a server, a controlled terminal, or a network device, etc.) to execute the method of each embodiment of the present application.
[0150] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loading and executing computer program instructions on a computer, the process or function according to the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, a computer, a server or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server, a data center, etc. that contains one or more available media integrated. The available medium can be a magnetic medium, (e.g., a floppy disk, a storage disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state storage disk Solid State Disk (SSD)), etc.
[0151] 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. An authorization method, characterized in that: The method is applied to a terminal device, and the method comprises: During the bootloader phase, authorization data for hardware driver functions is read from a preset area; Modifying the device driver capability management file based on the authorization data; The driver capability is loaded based on the modified device driver capability management file to drive the hardware function corresponding to the authorization data.
2. The method according to claim 1, characterized in that The method further comprises: Receiving encrypted authorization data sent by the server; wherein the encrypted authorization data is obtained by encrypting authorization data generated based on the identification information and demand information of the terminal device; The encrypted authorization data is stored in the preset area.
3. The method according to claim 1, characterized in that The step of reading authorization data of a hardware driver function from a preset area includes: The encrypted authorization data is decrypted to obtain the decrypted authorization data.
4. The method according to claim 1, characterized in that: The modifying the device driver capability management file based on the authorization data includes: The device driver capability management file at the kernel stage is modified based on the authorization data.
5. The method according to claim 1, characterized in that The loading of the driver capability based on the modified device driver capability management file includes: Restarting the terminal device; In the kernel stage, the driver capability is loaded based on the modified device driver capability management file.
6. An authorization method, characterized in that: The method is applied to a server, and the method comprises: Generate authorization data for hardware driver functions based on identification information and demand information of the terminal device; Encrypting the authorization data to obtain encrypted authorization data; The encrypted authorization data is sent to the terminal device.
7. A module device, characterized in that: The module device includes a communication module, a power module, a storage module and a chip, wherein: The power module is used to provide electrical energy to the module device; The storage module is used to store data and instructions; The communication module is used for internal communication of the module device, or for communication between the module device and an external device; The chip is used to execute the method according to any one of claims 1 to 5, or to execute the method according to claim 6.
8. A computer device, characterized in that: The computer device comprises: a memory and a processor, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the method according to any one of claims 1 to 5 is implemented, or the method according to claim 6 is executed.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-readable instructions, and when the computer-readable instructions are executed on the authorization device, the authorization device executes the method described in any one of claims 1 to 5, or is used to execute the method described in claim 6.