Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present application more apparent, the technical solutions of the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application, and it is apparent that the described embodiments are some embodiments of the present application, but not all embodiments of the present application. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
The following disclosure provides many different embodiments, or examples, for implementing different structures of the application. In order to simplify the present disclosure, components and arrangements of specific examples are described below. They are, of course, merely examples and are not intended to limit the application. Furthermore, the present application may repeat reference numerals and/or letters in the various examples. This repetition is for the purpose of simplicity and clarity and does not in itself dictate a relationship between the various embodiments and/or configurations discussed.
The application provides a printer authorization using method. Referring to FIG. 1, a method flow diagram of an embodiment of a method for authorizing printer use according to the present application is shown. The method may be performed by an electronic device, which may be implemented in software and/or hardware. The authorized use method of the printer comprises the following steps:
step S10, responding to a request of using a printer by a user, and acquiring a server authorization code to be verified and a printer authorization code to be verified, which are carried in the request;
Step S20, after decrypting the server authorization code to be verified, matching the server authorization code with a server authorization code of a pre-generated authorization account to obtain a first matching result;
step S30, after decrypting the printer authorization code to be verified, matching the printer authorization code with a printer authorization code of a pre-generated authorization account to obtain a second matching result;
and S40, if the first matching result and the second matching result indicate that the matching is successful, activating and allowing the user to use the printer.
The printer has various functions such as high-speed printing, batch scanning, print job encryption and the like, and also has various software such as document management software, security printing software, scanning software and the like, and a user can configure corresponding service lives and authorities for the functions and the software, namely the functions can be used or the software can be used only by obtaining authorization. In the process of actually using the printer, the situation that the user continues to use, authorizes to repeatedly install and use or authorizes to mix with different account bodies after the authorization of the software or the function expires may occur, so that the user needs to verify the authorization situation when using the printer.
Taking the imprint management software of the printer or a certain authorization function in the imprint management software as an example, the scheme of the embodiment is described, the user can input the server authorization code to be verified and the printer authorization code to be verified through the interactive interface of the terminal, initiate a request for using the printer, respond to the request and acquire the server authorization code to be verified and the printer authorization code to be verified carried in the request, if the server authorization code to be verified passes verification, the server can be activated, if the printer authorization code to be verified passes verification, the printer can be activated, and after the server and the printer are activated, the user can use the imprint management software of the printer or use a certain authorization function in the imprint management software.
The server authorization code to be verified refers to the authorization code allocated to the user by the server after the user obtains the authorization of the fingerprint management software of the printer, and is generated through the hardware serial number of the server and the related information of the authorization account. The printer authorization code to be verified refers to the authorization code allocated to the user by the printer after the user obtains the authorization of the imprint management software of the printer, and the printer authorization code is generated through the hardware serial number, the network address and the related information of the authorized account of the printer.
After decrypting the server authorization code to be verified, the obtained decryption result comprises the server basic code to be verified and related information of the user, the decryption result is matched with the server authorization code of the authorization account which is generated in advance to obtain a matching result (marked as a first matching result), the server authorization code of the authorization account is generated by encrypting the server hardware basic code of the authorization account and the related information of the authorization account, if the first matching result indicates that the matching is successful, the server authorization code to be verified passes verification, and at the moment, the server is successfully activated. If the first matching result indicates that the matching fails, the server authorization code to be verified is not verified, and the server is not activated at the moment, namely the user is not allowed to use the imprint management software of the printer or a certain authorization function in the imprint management software.
After decrypting the printer authorization code to be verified, the obtained decryption result comprises the hardware serial number, the network address and the related information of the authorization account of the printer, the decryption result is matched with the printer authorization code of the authorization account which is generated in advance to obtain a matching result (recorded as a second matching result), the printer authorization code of the authorization account is generated by encrypting the hardware serial number of the printer, the network address of the printer and the related information of the authorization account, if the second matching result indicates that the matching is successful, the printer authorization code to be verified passes verification, and at the moment, the printer is successfully activated. If the second matching result indicates that the matching fails, the printer authorization code to be verified is not verified, and at the moment, the printer is not activated, namely the user is not allowed to use the imprint management software of the printer or a certain authorization function in the imprint management software.
If the first matching result and the second matching result indicate successful matching, the server and the printer are both activated successfully, at the moment, the user is allowed to use the imprint management software of the printer or a certain authorization function in the imprint management software, and if the first matching result and/or the second matching result indicate that verification is not passed, the server and/or the printer are activated unsuccessfully, at the moment, the user is refused to use the imprint management software of the printer or a certain authorization function in the imprint management software.
Because the authorization may have a certain period and use time, when the user needs to use the imprint management software of the printer or use a certain authorization function in the imprint management software, the situation that the user still continues to use, the user is authorized to repeatedly install and use or different account main bodies are authorized to mix after the authorization is expired can be avoided by verifying the server authorization code to be verified and the printer authorization code to be verified.
In one embodiment, the generation of the server authorization code for authorizing an account includes:
reading a plurality of hardware serial numbers of a server;
After encrypting each hardware serial number of the server, splicing the encryption results to obtain a server hardware basic code of the authorized account;
reading related information of the authorized account;
Combining the server hardware basic code of the authorized account with the related information of the authorized account to generate a first character string to be encrypted;
and encrypting the first character string to be encrypted to obtain the server authorization code of the authorization account.
And reading serial numbers such as a main board serial number, a CPU serial number and a C-disk hard disk serial number of the server, respectively encrypting each hardware serial number of the server by utilizing an MD5 algorithm to obtain an encryption result of each hardware serial number, splicing the encryption results, and converting the encryption result into a full-capital character string serving as a server hardware basic code of an authorized account. And reading related information of the authorized account, wherein the related information of the authorized account comprises at least one of printer authorized service life, main account information, an authorized version number and value added service item information. And combining the server hardware basic code of the authorized account and the related information of the authorized account to generate a standard JSON character string (marked as a first character string to be encrypted), and encrypting the first character string to be encrypted by using an AES algorithm to obtain the server authorization code of the authorized account.
Further, the step of "after decrypting the server authorization code to be verified" matches the server authorization code of the authorization account generated in advance to obtain a first matching result "specifically includes:
decrypting the server authorization code to be verified to obtain a decrypted server basic code to be verified and related information of the user;
Comparing the server basic code to be verified with the server hardware basic code of the authorized account to obtain a first comparison result;
Comparing the related information of the user with the related information of the authorized account to obtain a second comparison result;
And if the first comparison result and the second comparison result both indicate that the comparison is consistent, the first matching result indicates that the matching is successful.
And decrypting the server authorization code to be verified by using an AES algorithm to obtain the decrypted server basic code to be verified and related information (including printer authorization service life, main account information, authorization version number and value added service item information) of the user, wherein a decryption result is a standard JSON character string. And comparing the decrypted server basic code to be verified with the server hardware basic code of the authorized account to obtain a comparison result (marked as a first comparison result), wherein the server hardware basic code of the authorized account can be obtained by splicing a plurality of encrypted hardware serial numbers of the server again. And comparing the related information of the user with the related information of the authorized account to obtain a comparison result (marked as a second comparison result), and if the first comparison result and the second comparison result indicate that the comparison is consistent, the first comparison result indicates that the matching is successful, and the related information of the authorization is written after the matching is successful, so that the server is successfully activated. If the two comparison results are inconsistent, the first matching result indicates that the matching is failed, for example, if the related information of the user is inconsistent with the related information of the authorized account (for example, the authorized service life is inconsistent, the main account information is inconsistent, etc.), the server cannot be activated at this time, so that the situation that the user still continues to use after the authorization expires, the user is authorized to repeatedly install and use or the different account main authorities authorize the mixed printer can be avoided.
In one embodiment, the process of generating the printer authorization code for the authorization account includes:
Reading a hardware serial number and a network address of the printer;
reading related information of the authorized account;
combining the hardware serial number of the printer, the network address and the related information of the authorized account based on a preset combination rule to obtain a second character string to be encrypted;
And encrypting the second character string to be encrypted to obtain the printer authorization code of the authorization account.
Obtaining information such as a main board serial number, a brand model number, a MAC address, an IP address and the like of a printer to generate a marked JSON character string, reading related information (including printer authorization service life, main account information, authorization version number and value added service item information) of an authorization account, and combining and splicing the information into a character string to be encrypted (recorded as a second character string to be encrypted) according to the following rules:
[ motherboard Serial number @ = @ brand model @ = @ MAC address @ = @ IP address @ = @ authorized lifetime @ = @ body account information ]. It should be noted that, the preset combination rule may also be to splice by using other characters, and the splicing order may also be exchanged, where the spliced characters and the sequence are not specifically limited. And encrypting the second character string to be encrypted by using an AES algorithm to obtain the printer authorization code of the authorized account.
Further, the step of "after decrypting the printer authorization code to be verified, matching the printer authorization code of the authorization account generated in advance to obtain a second matching result" specifically includes:
Decrypting the printer authorization code to be verified to obtain a decrypted hardware serial number to be verified, a network address to be verified and related information of the user;
matching the hardware serial number to be verified with the hardware serial number of the printer;
Matching the network address to be verified with the network address of the printer;
Matching the related information of the user with the related information of the authorized account;
and if the matching is successful, the second matching result indicates that the matching is successful.
Decrypting the printer authorization code to be verified by using an AES algorithm to obtain a decrypted hardware serial number to be verified, a network address to be verified and related information of a user, wherein the decryption result is a plaintext rule character string, field information is intercepted through "@ = @" to obtain the hardware serial number to be verified, the network address to be verified and related information of the user, and matching results obtained by respectively matching the main board serial number, the brand model, the MAC address, the IP address, the authorization service life of the user, the main body account information of the user and corresponding information in the printer authorization code of an authorized account are recorded as second matching results, and if the matching is successful, the second matching results indicate that the matching is successful.
If the matching of the hardware serial number to be verified and the hardware serial number of the printer fails, or the matching of the network address to be verified and the network address of the printer fails, or the matching of the related information of the user and the related information of the authorized account fails, the second matching result indicates that the matching fails, for example, if the matching of the serial number of the main board of the printer fails, or the matching of the IP address fails, or the matching of the authorized service life fails, the printer cannot be activated at this time. Therefore, the situation that the user still continues to use after the authorization is expired, the user is authorized to repeatedly install and use or the different account bodies authorize the mixed printer can be avoided.
Referring to FIG. 2, a functional block diagram of a printer authorized for use device 100 according to the present application is shown.
The printer authorized use device 100 of the present application may be installed in an electronic apparatus. Depending on the functions implemented, the printer authorized use device 100 may include an acquisition module 110, a first matching module 120, a second matching module 130, and an activation module 140. The module of the application, which may also be referred to as a unit, refers to a series of computer program segments, which are stored in the memory of the electronic device, capable of being executed by the processor of the electronic device and of performing a fixed function.
In the present embodiment, the functions concerning the respective modules/units are as follows:
The obtaining module 110 is configured to respond to a request of a user for using a printer, and obtain a server authorization code to be verified and a printer authorization code to be verified, which are carried in the request;
the first matching module 120 is configured to decrypt the server authorization code to be verified, and then match the decrypted server authorization code with a server authorization code of a pre-generated authorization account to obtain a first matching result;
the second matching module 130 is configured to decrypt the printer authorization code to be verified, and then match the decrypted printer authorization code with a printer authorization code of a pre-generated authorization account to obtain a second matching result;
And the activation module 140 is used for activating and allowing the user to use the printer if the first matching result and the second matching result indicate that the matching is successful.
In one embodiment, the process of generating the server authorization code of the authorization account includes:
reading a plurality of hardware serial numbers of a server;
After encrypting each hardware serial number of the server, splicing the encryption results to obtain a server hardware basic code of the authorized account;
reading related information of the authorized account;
Combining the server hardware basic code of the authorized account with the related information of the authorized account to generate a first character string to be encrypted;
and encrypting the first character string to be encrypted to obtain the server authorization code of the authorization account.
In one embodiment, the process of generating the printer authorization code for the authorization account includes:
Reading a hardware serial number and a network address of the printer;
reading related information of the authorized account;
combining the hardware serial number of the printer, the network address and the related information of the authorized account based on a preset combination rule to obtain a second character string to be encrypted;
And encrypting the second character string to be encrypted to obtain the printer authorization code of the authorization account.
In one embodiment, after decrypting the server authorization code to be verified, matching the server authorization code with a server authorization code of a pre-generated authorization account to obtain a first matching result, including:
decrypting the server authorization code to be verified to obtain a decrypted server basic code to be verified and related information of the user;
Comparing the server basic code to be verified with the server hardware basic code of the authorized account to obtain a first comparison result;
Comparing the related information of the user with the related information of the authorized account to obtain a second comparison result;
And if the first comparison result and the second comparison result both indicate that the comparison is consistent, the first matching result indicates that the matching is successful.
In one embodiment, after decrypting the to-be-verified printer authorization code, matching the to-be-verified printer authorization code with a pre-generated printer authorization code of the authorized account to obtain a second matching result, including:
Decrypting the printer authorization code to be verified to obtain a decrypted hardware serial number to be verified, a network address to be verified and related information of the user;
matching the hardware serial number to be verified with the hardware serial number of the printer;
Matching the network address to be verified with the network address of the printer;
Matching the related information of the user with the related information of the authorized account;
and if the matching is successful, the second matching result indicates that the matching is successful.
In one embodiment, the related information of the authorized account comprises at least one of printer authorized lifetime, main account information, authorized version number and value added service item information.
In one embodiment, the activation module 140 is further configured to:
And if the first matching result and/or the second matching result indicate that the verification is not passed, rejecting the user to use the printer.
Referring to fig. 3, a schematic diagram of a preferred embodiment of the electronic device of the present application is shown.
The electronic device comprises a processor 111, a communication interface 112, a memory 113 and a communication bus 114, wherein the processor 111, the communication interface 112 and the memory 113 are communicated with each other through the communication bus 114;
A memory 113 for storing a computer program, for example, a printer authorized use program;
processor 111 may be, among other things, a central processing unit (Central Processing Unit, CPU), a controller, a microcontroller, a microprocessor, or other data processing chip in some embodiments. The processor 111 is typically used to control the overall operation of the electronic device, such as performing data interaction or communication related control and processing, etc. In this embodiment, the processor 111 is configured to execute a program code or process data stored in the memory 113, for example, a program code for authorizing a printer to use a program.
The communication interface 112 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface), and the communication interface 112 may also be used to establish communication connections between the electronic device and other electronic devices.
The memory 113 includes at least one type of readable storage medium including flash memory, hard disk, multimedia card, card memory (e.g., SD or DX memory, etc.), random Access Memory (RAM), static Random Access Memory (SRAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), programmable Read Only Memory (PROM), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the storage 113 may be an internal storage unit of the electronic device, such as a hard disk or a memory of the electronic device. In other embodiments, the memory 113 may also be an external storage device of the electronic device, such as a plug-in hard disk equipped with the electronic device, a smart memory card (SMART MEDIA CARD, SMC), a Secure Digital (SD) card, a flash memory card (FLASH CARD), or the like. Of course, the memory 113 may also include both an internal memory unit and an external memory device of the electronic device. In this embodiment, the memory 11 is typically used to store an operating system installed on the electronic device and various types of computer programs, such as program codes of programs authorized for use by the printer. In addition, the memory 113 may also be used to temporarily store various types of data that have been output or are to be output.
Fig. 3 shows only an electronic device having components 111-114, but it should be understood that not all of the illustrated components are required to be implemented and that more or fewer components may be implemented instead.
In one embodiment of the present application, the processor 111 is configured to implement the method for authorizing use of a printer provided in any one of the foregoing method embodiments when executing a program stored in the memory 113, where the method includes:
responding to a request of a user using a printer, and acquiring a server authorization code to be verified and a printer authorization code to be verified, which are carried in the request;
after decrypting the server authorization code to be verified, matching the server authorization code with a server authorization code of a pre-generated authorization account to obtain a first matching result;
After decrypting the printer authorization code to be verified, matching the printer authorization code with a printer authorization code of a pre-generated authorization account to obtain a second matching result;
and if the first matching result and the second matching result indicate that the matching is successful, activating and allowing the user to use the printer.
For a detailed description of the above steps, please refer to the above description of fig. 1 for a flowchart of an embodiment of a method for authorizing printer use.
Furthermore, the embodiment of the application also provides a computer readable storage medium, which can be nonvolatile or volatile. The computer readable storage medium includes a storage data area and a storage program area, the storage program area stores a printer authorized use program, and the printer authorized use program when executed by the processor realizes the following operations:
responding to a request of a user using a printer, and acquiring a server authorization code to be verified and a printer authorization code to be verified, which are carried in the request;
after decrypting the server authorization code to be verified, matching the server authorization code with a server authorization code of a pre-generated authorization account to obtain a first matching result;
After decrypting the printer authorization code to be verified, matching the printer authorization code with a printer authorization code of a pre-generated authorization account to obtain a second matching result;
and if the first matching result and the second matching result indicate that the matching is successful, activating and allowing the user to use the printer.
The embodiment of the computer readable storage medium of the present application is substantially the same as the embodiment of the authorized use method of the printer, and will not be described herein.
The apparatus embodiments described above are merely illustrative, wherein the elements illustrated as separate elements may or may not be physically separate, and the elements shown as elements may or may not be physical elements, may be located in one place, or may be distributed over a plurality of network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
From the above description of embodiments, it will be apparent to those skilled in the art that the embodiments may be implemented by means of software plus a general purpose hardware platform, or may be implemented by hardware. Based on such understanding, the foregoing technical solution may be embodied essentially or in a part contributing to the related art in the form of a software product, which may be stored in a computer readable storage medium, such as ROM/RAM, a magnetic disk, an optical disk, etc., including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform the method described in the respective embodiments or some parts of the embodiments.
It should be noted that the description of "first", "second", etc. in this disclosure is for descriptive purposes only and is not to be construed as indicating or implying a relative importance or implying an indication of the number of technical features being indicated. Thus, a feature defining "a first" or "a second" may explicitly or implicitly include at least one such feature. In addition, the technical solutions of the embodiments may be combined with each other, but it is necessary to base that the technical solutions can be realized by those skilled in the art, and when the technical solutions are contradictory or cannot be realized, the combination of the technical solutions should be considered to be absent and not within the scope of protection claimed in the present application.
It is to be understood that the terminology used herein is for the purpose of describing particular example embodiments only, and is not intended to be limiting. As used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. The terms "comprises," "comprising," "includes," "including," and "having" are inclusive and therefore specify the presence of stated features, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, steps, operations, elements, components, and/or groups thereof. The method steps, processes, and operations described herein are not to be construed as necessarily requiring their performance in the particular order described or illustrated, unless an order of performance is explicitly stated. It should also be appreciated that additional or alternative steps may be used.
The foregoing is only a specific embodiment of the application to enable those skilled in the art to understand or practice the application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.