Method and device for acquiring equipment identification information, electronic equipment and storage medium

Obtaining printer device identification information through the terminal's print driver and client, solving the problem of permission restriction, and realizing unique and universal information acquisition and reporting.

CN120406868APending Publication Date: 2025-08-01SF TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202410140011.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-01-30
Publication Date
2025-08-01

AI Technical Summary

Technical Problem

In the prior art, the device identification information of the printer hardware is difficult to obtain, and the acquisition permissions are limited, resulting in inconsistency and poor universality.

Method used

Through the printing driver and client loaded in the terminal, the printer's device identification information is obtained, and written to the storage area, and the report information is generated and uploaded to the server in response to the printing command.

Benefits of technology

Break through the permission restrictions and obtain printer device identification information with stronger uniqueness and versatility, which is easy to identify and analyze and utilize.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120406868A_ABST
    Figure CN120406868A_ABST
Patent Text Reader

Abstract

The invention provides an equipment identification information acquisition method and device, electronic equipment and a storage medium. Relates to the technical field of data processing. The method comprises the steps that equipment identification information of a target printer is obtained through a printing drive program loaded on a terminal, the equipment identification information is written into a storage area of the terminal, and the equipment identification information is used for indicating an equipment identifier of the target printer; in response to a received printing instruction for a target printer, searching equipment identification information in a storage area through a target client loaded on the terminal; and generating report information which corresponds to the target printer and comprises the equipment identification information, and uploading the report information to a server. According to the method, the limitation of authority is broken through by printing the driving program, so that the equipment identification information of the printer is obtained, and the report information of the printer is successfully reported.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of data processing, and particularly to a method, an apparatus, an electronic device, and a storage medium for obtaining device identification information. Background Art

[0002] After a printer is put into use, in order to understand the usage situation of the printer, the server can obtain information of the printer.

[0003] In the related art, the software identification number of a printer is relatively easy to obtain, but the software identification numbers are diverse and often do not have uniqueness and universality. However, the uniqueness and universality of the device identification information of the printer hardware are better. Therefore, it is very important to obtain the device identification information of the printer hardware. The device identification information of the printer hardware is the factory setting information of the printer. However, due to permission restrictions, it is difficult to obtain the device identification information of the printer. Summary of the Invention

[0004] In view of this, the purpose of the present disclosure is to provide a method, an apparatus, an electronic device, and a storage medium for obtaining device identification information, and the present disclosure can break through the restriction on obtaining the permission of the printer hardware.

[0005] Based on the above purpose, in the first aspect, the present disclosure provides a method for obtaining device identification information, including: obtaining the device identification information of a target printer through a print driver loaded on a terminal, writing the device identification information into a storage area of the terminal, where the device identification information is used to indicate the device identifier of the target printer; in response to receiving a print instruction for the target printer, searching for the device identification information in the storage area through a target client loaded on the terminal; generating a reporting information corresponding to the target printer and including the device identification information, and uploading the reporting information to the server.

[0006] In the second aspect, a device for obtaining device identification information is further provided, including: a writing unit configured to write the device identification information of a target printer into a storage area of the terminal through a print driver loaded on the terminal, where the device identification information is used to indicate the device identifier of the target printer; a searching unit configured to search for the device identification information in the storage area through a target client loaded on the terminal in response to receiving a print instruction for the target printer; a reporting unit configured to generate a reporting information corresponding to the target printer and including the device identification information, and upload the reporting information to the server.

[0007] In the third aspect, an electronic device is further provided, including a memory, a processor, and a computer program stored on the memory and executable on the processor, and the processor runs the computer program to implement the method of the first aspect.

[0008] Fourthly, a computer-readable storage medium is also provided, on which a computer program is stored, and when the program is executed by a processor, the method according to any one of the first aspect is implemented.

[0009] Generally speaking, the present disclosure has at least the following beneficial effects: Through the print driver, the restriction on obtaining the printer hardware is broken through, so as to obtain the device identification information of the printer. And while successfully reporting the printer information, the reported information is made more unique and universal, and is easy to be recognized and utilized for subsequent analysis. BRIEF DESCRIPTION OF THE DRAWINGS

[0010] In the drawings, unless otherwise specified, the same reference numerals throughout the several views denote the same or similar parts or elements. These drawings are not necessarily drawn to scale. It should be understood that these drawings only depict some embodiments disclosed according to the present disclosure, and should not be regarded as limiting the scope of the present disclosure.

[0011] Figure 1 A flowchart showing a method for obtaining device identification information according to an embodiment of the present disclosure;

[0012] Figure 2 Another flowchart showing a method for obtaining device identification information according to an embodiment of the present disclosure;

[0013] Figure 3a A schematic diagram of an application scenario of a method for obtaining device identification information according to an embodiment of the present disclosure;

[0014] Figure 3b Another flowchart showing a method for obtaining device identification information according to an embodiment of the present disclosure;

[0015] Figure 4 A schematic diagram showing the acquisition of device identification information according to an embodiment of the present disclosure;

[0016] Figure 5 A schematic diagram of the structure of an electronic device provided by an embodiment of the present disclosure;

[0017] Figure 6 A schematic diagram of a storage medium provided by an embodiment of the present disclosure. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0018] The present disclosure will be further described in detail below with reference to the drawings and embodiments. It can be understood that the specific embodiments described herein are only used to explain the related invention, rather than limiting the invention. In addition, it should be noted that for the sake of convenience of description, only parts related to the relevant invention are shown in the drawings.

[0019] It should be noted that, without conflict, the embodiments in the present disclosure and the features in the embodiments may be combined with each other. The following will describe the present disclosure in detail with reference to the accompanying drawings and in combination with the embodiments.

[0020] The technical problem to be solved by this application is specifically how to break through the permission limit and obtain the device identification information of the printer for reporting print data.

[0021] Figure 1 Disclosed is a method for obtaining device identification information. In an embodiment of the present disclosure, the method can be applied to a terminal, and the method may include:

[0022] Step S101, obtain the device identification information of the target printer through the print driver loaded on the terminal, and write the device identification information into the storage area of the terminal. The device identification information is used to indicate the device identifier of the target printer.

[0023] In this embodiment, the execution subject of the method for obtaining device identification information can obtain the device identification information of the target printer through the print driver loaded on the terminal. After that, the above execution subject can write the device identification information into the storage area of the terminal.

[0024] The device identifier is the identifier of the printer's hardware, such as the product serial number, that is, the SN (Serial Number) number, etc.

[0025] Step S102, in response to receiving a print instruction for the target printer, search for the device identification information in the storage area through the target client loaded on the terminal.

[0026] In this embodiment, when the above execution subject receives a print instruction for the target printer, it searches for the device identification information in the storage area of the terminal through the target client loaded on the terminal. Specifically, the terminal can generate a print instruction for the target printer in response to a user's print operation on the target printer.

[0027] The target client here can be a loadable and runnable entity such as an application or a small program. The target client can be loaded on the terminal in the form of installation or other forms such as a web page.

[0028] In some application scenarios, the terminal can be connected to multiple printers. If the terminal is connected to multiple printers, the terminal can obtain the device identifiers of the above multiple printers through the print driver loaded on the terminal. And the terminal can store the device identifiers of the above multiple printers in the storage area of the terminal. When the terminal receives a print operation on the target printer among the above multiple printers, it generates a print instruction for the target printer and searches for the device identifier of the target printer in the storage area through the target client loaded on the terminal.

[0029] For example: The terminal is connected to printers A, B, and C. The terminal can obtain the device identifiers of printers A, B, and C respectively through the print driver loaded on the terminal, and write the device identifiers of printers A, B, and C into the storage area of the terminal. When the terminal receives a print operation and generates a print instruction for printer A, the target client loaded on the terminal searches for the device identifier of printer A in the storage area.

[0030] Step S103: Generate a reporting message including device identification information corresponding to the target printer, and upload the reporting message to the server.

[0031] In this embodiment, the above execution entity can generate a reporting message for the target printer and upload the reporting message to the server. The target printer corresponds to the reporting message.

[0032] The generated reporting message includes device identification information. In addition, the reporting message may further include at least one of printer operation information, print software information, and user-related information. Among them, the printer operation information may be, for example, the number of prints indicated by the above print instruction. The print software information may be, for example, relevant information of a preset order printing system. Here, the order printing system may refer to any software system for printing bills. The user-related information may include the Universal Call Identifier (UCID).

[0033] In this embodiment, through the print driver, the access permission limit for the printer hardware is broken through, so as to obtain the device identification information of the printer. Moreover, while successfully reporting the printer information, the reported information is made more unique and general, and is easy to be recognized and used for subsequent analysis.

[0034] In some optional implementation manners of any embodiment of the present disclosure, writing the device identification information into the storage area of the terminal includes: associatively writing the device identification information and the printer name of the target printer into the storage area of the terminal; searching for the device identification information in the storage area includes: searching for the device identification information of the target printer through the printer name of the target printer.

[0035] In these optional implementation manners, the above execution entity can associatively write the printer name while writing the device identification information. That is, the above execution entity can associatively write the printer name and the device identification information into the storage area.

[0036] When the above-mentioned execution entity searches for device identification information, it can search for the printer name of the target printer, so as to find the device identification information associated with the printer name. In this way, the found device identification information is the device identification information of the target printer.

[0037] The terminal can associate and write the device identification information and the printer name of the target printer into the storage area of the terminal. In this way, the device identification information and the target printer are associated in the storage area. The target printer is one of the multiple printers connected to the terminal. Specifically, the terminal can read the device identification information of all printers in the storage area, and find the printer name of the target printer from the read device identification information through the printer name of the target printer. Or, the terminal can search for the device identification information of the target printer in the storage area through the printer name of the target printer.

[0038] These implementation methods can accurately match the device identification information corresponding to the printer name when searching for device identification information through the printer name. Especially when multiple printers are connected to the same terminal of the user, the above-mentioned execution entity can accurately match the device identification information corresponding to the printer used by the user.

[0039] In some alternative implementation manners of any embodiment of the present disclosure, writing the device identification information into the storage area of the terminal includes: determining whether the print driver has the write permission for the system hard disk of the terminal; in the case of determining that the print driver has the write permission for the system hard disk of the terminal, writing the device identification information of the target printer into the system hard disk of the terminal; in the case of determining that the print driver does not have the write permission for the system hard disk of the terminal, writing the device identification information of the target printer into other hard disks other than the system hard disk in the terminal.

[0040] In these implementation manners, the system hard disk here can be, for example, drive C. Other hard disks other than the system hard disk can include at least one of drive D, drive E, etc.

[0041] These implementation manners can preferentially write the device identification information into the system hard disk of the terminal, so as to ensure the reading priority and reading speed of the device identification information.

[0042] Figure 2 Show a method for obtaining device identification information according to an embodiment of the present disclosure. As Figure 2 shown, the method includes:

[0043] Step S201, obtaining the device identification information of the target printer through the print driver loaded on the terminal, and writing the device identification information into the storage area of the terminal, where the device identification information is used to indicate the device identifier of the target printer.

[0044] Step S202, in response to receiving a print instruction for the target printer, in the rendering process running on the target client, send a device identification request to the main process running on the target client.

[0045] In this embodiment, the execution subject of the device identification information acquisition method can run the main process of the target client and the rendering process for printing, and through the interaction between these two processes, realize reading the device identification information from the storage area. The rendering process refers to the process of rendering the printed picture.

[0046] Specifically, the above execution subject can confirm receiving the print instruction when detecting the user's confirmation print operation or receiving a print request sent by other electronic devices. In some application scenarios, the interface interaction process including receiving the print instruction can be carried out in the rendering process. Then, the rendering process can send a device identification request to the main process to request the device identification information.

[0047] Step S203, in response to listening for the device identification request in the main process, look up the device identification information in the storage area in the main process, and send the device identifier indicated by the device identification information to the rendering process.

[0048] In this embodiment, if the main process listens for the device identification request, it can look up the device identification information in the storage area, and then return the found device identification information to the rendering process.

[0049] Step S204, generate a reporting information including the device identification information corresponding to the target printer, and upload the reporting information to the server.

[0050] This embodiment can, through the interaction between the rendering process and the main process, read the device identification information through the main process with stronger processing capabilities, so as to realize smoothly and efficiently reading the device identification information.

[0051] In some optional implementation manners of this embodiment, the target client is developed based on a preset technology stack, and a preset operating environment is integrated in the main process of the preset technology stack; the above looking up the device identification information in the storage area in the main process may include: in the main process, call a preset interface in the preset operating environment to look up the device identification information from the storage area.

[0052] In these optional implementation manners, the target client can run on the preset technology stack. For example: the preset technology stack can be the Electron technology stack. This technology stack can integrate a preset operating environment in the main process. For example: the preset operating environment can be the node environment.

[0053] The above-mentioned execution entity can call a preset interface, namely the API (Application Programming Interface), in the main process in the preset operating environment, so as to search for device identification information in the storage area. The preset interface is used to search for device identification information in the storage area.

[0054] In these implementation manners, the reading ability of the device identification information can be given to the main thread through a preset interface in the operating environment integrated by the technology stack, so that the device identification can be successfully found in the main thread.

[0055] In some alternative implementation manners of this embodiment, the print instruction includes the current print information; the above-mentioned generation of the reporting information including the device identification information corresponding to the target printer and uploading the reporting information to the server includes: in the rendering process, extracting the current print information from the print instruction, and the current print information includes at least one of user-related information and print operation information; in the rendering process, generating the reporting information including the current print information and the device identifier, and uploading the reporting information to the server.

[0056] In these implementation manners, the above-mentioned execution entity can, in the rendering process, execute extracting the print operation information from the print instruction, generating the reporting information, and reporting the reporting information.

[0057] In some embodiments, the print operation information may include at least one of the number of prints, the printer association table, and the print software information.

[0058] These implementation manners can extract the information of the current print in the rendering process, so as to obtain real-time print information, which helps the server obtain detailed and accurate reporting information.

[0059] In some alternative implementation manners of this embodiment, the device identification information is a device identification file, and the device identification file is a variable-length character encoding file with a byte order mark; after the device identification information is searched for in the storage area in the main process, the method further includes: removing the byte order mark from the device identification file to obtain a device identifier to be processed; converting the device identifier to be processed into an array format of data to obtain the device identifier indicated by the device identification information.

[0060] In these alternative implementation manners, the above-mentioned execution entity can remove the byte order mark, and the device identification file after removing the byte order mark is the device identifier to be processed. Then, the above-mentioned execution entity can convert the device identifier to be processed into an array format of data, and the conversion result is the device identifier indicated by the device identification information.

[0061] A variable-length character-encoded file can be, for example, a UTF-8 (Unicode Transformation Format - 8-bit) file. Specifically, the byte order mark carried by the file can be a BOM (Byte Order Mark) header.

[0062] In these implementation methods, when the file has a byte order mark, the main process can remove the mark to prevent garbled characters from occurring after the device identification file is read.

[0063] As Figure 3a shown, the figure shows a schematic diagram of the application scenario of the method for obtaining device identification information in this application. The print interaction component of the rendering process in the client can receive the print instruction triggered by the user's print operation. After that, the above-mentioned rendering process can, through the Hypertext Transfer Protocol (HTTP), request the print data for the current print indicated by the print instruction. The print data here can include at least one of the printer association table and the print quantity, etc. After that, the rendering process can communicate with the main process to obtain the SN information, that is, the SN number, from the main process. The rendering process can integrate the SN information and the print data and upload the integration result to the analysis platform for operation data.

[0064] After the main process in the node running environment hears the request from the rendering process, it can determine whether it has the read and write permissions for the system hard disk. If it has, the main process can read the device identification file from the system hard disk. If not, the main process can read the device identification file from drive D. After that, the main process can perform format processing on the device identification file, such as removing the BOM header, to generate a JSON array, and this JSON array is the SN information.

[0065] The main process stores the device identification file and the relevant information of the device identification file in the file system. The file system can store at least one of the following: file read and write permissions, JSON array, device identification file, and the format of the array. In addition, the printer driver can obtain the above-mentioned SN number, as well as the internal and external network information, and store the obtained information in the file system.

[0066] As Figure 3bAs shown in the figure, a flowchart of a method for obtaining device identification information is shown. The terminal can be connected to a printer, obtain the SN information file corresponding to the printer through the print driver, and determine whether the print driver has access rights to the C drive. If it does, the terminal can write the SN information file to the C drive through the print driver. If not, the terminal can write the SN information file to the D drive. If the terminal starts to execute printing on the target printer, it can determine whether the print driver has access rights to the C drive. If it does, the target client can read the SN information files of all the connected printers from the C drive. If not, the target client can read the SN information files of all the connected printers from the D drive. Through the SN number in the SN information file, in the SN information files of all the printers, the SN information of the target printer can be matched through the printer name. The terminal can integrate the print data and the SN information and upload the integration result to the server. The server can generate a data report for the uploaded integration result.

[0067] Embodiments of the present disclosure provide a device for obtaining device identification information. This device is used to execute the method for obtaining device identification information in the above embodiments, as Figure 4 shown. The device includes: a writing unit 401 configured to obtain the device identification information of the target printer through the print driver loaded on the terminal and write the device identification information to the storage area of the terminal. The device identification information is used to indicate the device identifier of the target printer; a searching unit 402 configured to search for the device identification information in the storage area through the target client loaded on the terminal in response to receiving a print instruction for the target printer; a reporting unit 403 configured to generate reporting information corresponding to the target printer including the device identification information and upload the reporting information to the server.

[0068] Optionally, the writing unit 401 is configured to write the device identification information to the storage area of the terminal in the following manner: associate and write the device identification information and the printer name of the target printer to the storage area of the terminal; searching for the device identification information in the storage area includes: searching for the device identification information of the target printer through the printer name of the target printer.

[0069] Optionally, the writing unit 401 is configured to write the device identification information to the storage area of the terminal in the following manner: determine whether the print driver has the write permission for the system hard disk of the terminal; in the case where it is determined that the print driver has the write permission for the system hard disk of the terminal, write the device identification information of the target printer to the system hard disk of the terminal; in the case where it is determined that the print driver does not have the write permission for the system hard disk of the terminal, write the device identification information of the target printer to other hard disks other than the system hard disk in the terminal.

[0070] Optionally, the lookup unit 402 is configured to perform, through the target client loaded on the terminal, a lookup for device identification information in the storage area in the following manner: in the rendering process running on the target client, send a device identification request to the main process running on the target client; in response to the device identification request being monitored in the main process, look up the device identification information in the main process from the storage area, and send the device identifier indicated by the device identification information to the rendering process.

[0071] Optionally, the target client is developed based on a preset technology stack, and the preset technology stack integrates a preset operating environment in the main process; the lookup unit 402 is configured to perform, in the main process, a lookup for device identification information in the storage area in the following manner: in the main process, call a preset interface in the preset operating environment to look up the device identification information from the storage area.

[0072] Optionally, the print instruction includes the current print information; the reporting unit 403 is configured to perform, in the following manner, generating a reporting information corresponding to the target printer and including the device identification information, and uploading the reporting information to the server: in the rendering process, extract the current print information from the print instruction, where the current print information includes at least one of user-related information and print operation information; in the rendering process, generate reporting information including the current print information and the device identifier, and upload the reporting information to the server.

[0073] Optionally, the device identification information is a device identification file, and the device identification file is a variable-length character encoding file with a byte order mark; the apparatus is further configured to: after looking up the device identification information in the main process from the storage area, remove the byte order mark from the device identification file to obtain a device identifier to be processed; convert the device identifier to be processed into an array format data to obtain the device identifier indicated by the device identification information.

[0074] The apparatus for obtaining device identification information provided by the above embodiments of the present disclosure and the method for obtaining device identification information provided by the embodiments of the present disclosure are based on the same inventive concept, and have the same beneficial effects as the methods adopted, run, or implemented by the application programs stored therein.

[0075] The embodiments of the present disclosure also provide an electronic device corresponding to the method for obtaining device identification information provided by the foregoing embodiments to execute the method for obtaining device identification information. The embodiments of the present disclosure do not make limitations.

[0076] Please refer to Figure 5 which shows a schematic diagram of an electronic device provided by some embodiments of the present disclosure. As Figure 5As shown, the electronic device 50 includes: a processor 500, a memory 501, a bus 502, and a communication interface 503. The processor 500, the communication interface 503, and the memory 501 are connected through the bus 502; a computer program that can run on the processor 500 is stored in the memory 501. When the processor 500 runs the computer program, it executes the method provided in any of the foregoing embodiments of the present disclosure.

[0077] Among them, the memory 501 may include a high-speed random access memory (RAM: Random Access Memory), and may also include a non-volatile memory, such as at least one disk memory. Through at least one communication interface 503 (which can be wired or wireless), a communication connection is realized between this system network element and at least one other network element, and the Internet, wide area network, local area network, metropolitan area network, etc. can be used.

[0078] The bus 502 may be an ISA bus, a PCI bus, an EISA bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. Among them, the memory 501 is used to store programs. After receiving an execution instruction, the processor 500 executes the program. The method for obtaining device identification information disclosed in any of the foregoing embodiments of the present disclosure can be applied to or implemented by the processor 500.

[0079] The processor 500 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the integrated logic circuit in the hardware of the processor 500 or by instructions in the form of software. The above-mentioned processor 500 may be a general-purpose processor, including a central processing unit (CPU for short), a network processor (NP for short), etc.; it may also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. It can implement or execute the various methods, steps, and logic block diagrams disclosed in the embodiments of the present disclosure. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. The steps of the method disclosed in combination with the embodiments of the present disclosure can be directly embodied as being executed by a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software module may be located in a mature storage medium in the art such as a random access memory, flash memory, read-only memory, programmable read-only memory, or electrically erasable programmable memory, register, etc. This storage medium is located in the memory 501, and the processor 500 reads the information in the memory 501 and combines its hardware to complete the steps of the above method.

[0080] The electronic device provided by the embodiments of the present disclosure and the method for obtaining device identification information provided by the embodiments of the present disclosure are based on the same inventive concept and have the same beneficial effects as the methods adopted, run, or implemented by them.

[0081] The embodiments of the present disclosure also provide a computer-readable storage medium corresponding to the method for obtaining device identification information provided by the foregoing embodiments. Please refer to Figure 6 , which shows that the computer-readable storage medium is an optical disc 60, on which a computer program (i.e., a program product) is stored. When the computer program is run by a processor, it will execute the method for obtaining device identification information provided by any of the foregoing embodiments.

[0082] It should be noted that examples of computer-readable storage media may also include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory, or other optical and magnetic storage media, which will not be elaborated here one by one.

[0083] The computer-readable storage medium provided by the above embodiments of the present disclosure and the method for obtaining device identification information provided by the embodiments of the present disclosure are based on the same inventive concept and have the same beneficial effects as the methods adopted, run, or implemented by the application programs stored therein.

[0084] It should be noted that:

[0085] In the above text, the term "including", "comprising", or any other variant thereof is intended to cover non-exclusive inclusion, such that a process, method, article, or device including a series of elements not only includes those elements but also includes other elements not expressly listed, or further includes elements inherent to such process, method, article, or device. Without further limitation, an element defined by the statement "including a..." does not exclude the existence of additional identical elements in the process, method, article, or device including that element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present disclosure is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in a reverse order according to the functions involved. For example, the described methods may be performed in an order different from that described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.

[0086] Through the description of the above embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus a necessary general hardware platform. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation. Based on such an understanding, the technical solution of the present disclosure, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions for causing a terminal (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods of various embodiments of the present disclosure.

[0087] The embodiments of the present disclosure have been described above in conjunction with the accompanying drawings, which are only specific implementation manners of the present disclosure. However, the present disclosure is not limited to the above specific implementation manners. The above specific implementation manners are merely illustrative rather than restrictive. Under the inspiration of the present disclosure, those of ordinary skill in the art can also make many forms without departing from the purpose of the present disclosure and the scope protected by the claims, and all of them belong to the protection scope of the present disclosure.

Claims

1. A method for obtaining device identification information, characterized in that Applied to a terminal, including: Obtain the device identification information of the target printer through the print driver loaded on the terminal, and write the device identification information into the storage area of the terminal. The device identification information is used to indicate the device identifier of the target printer; In response to receiving a print instruction for the target printer, search for the device identification information in the storage area through the target client loaded on the terminal; Generate a reporting information corresponding to the target printer including the device identification information, and upload the reporting information to the server.

2. The method according to claim 1, wherein The step of writing the device identification information into the storage area of the terminal includes: Associate and write the device identification information and the printer name of the target printer into the storage area of the terminal; The step of searching for the device identification information in the storage area includes: Search for the device identification information of the target printer through the printer name of the target printer.

3. The method according to claim 1, wherein The step of writing the device identification information into the storage area of the terminal includes: Determine whether the print driver has the write permission for the system hard disk of the terminal; In the case of determining that the print driver has the write permission for the system hard disk of the terminal, write the device identification information of the target printer into the system hard disk of the terminal; In the case of determining that the print driver does not have the write permission for the system hard disk of the terminal, write the device identification information of the target printer into other hard disks other than the system hard disk in the terminal.

4. The method according to any one of claims 1 to 3, characterized in that, The step of searching for the device identification information in the storage area through the target client loaded on the terminal includes: In the rendering process in which the target client runs, send a device identification request to the main process in which the target client runs; In response to the device identification request being monitored in the main process, search for the device identification information in the main process from the storage area, and send the device identifier indicated by the device identification information to the rendering process.

5. The method according to claim 4, characterized in that The target client is developed based on a preset technology stack, and the preset technology stack integrates a preset operating environment in the main process; The step of searching for the device identification information in the storage area in the main process includes: In the main process, call a preset interface in the preset operating environment to search for the device identification information from the storage area.

6. The method according to claim 4, characterized in that, The print instruction includes the current print information; the step of generating a reporting information corresponding to the target printer including the device identification information and uploading the reporting information to the server includes: In the rendering process, extract the current print information from the print instruction. The current print information includes at least one of user-related information and print operation information; In the rendering process, generate a reporting information including the current print information and the device identifier, and upload the reporting information to the server.

7. The method according to claim 4, characterized in that, The device identification information is a device identification file, and the device identification file is a variable-length character encoding file with a byte order mark; After searching for the device identification information in the storage area in the main process, the method further includes: Remove the byte order mark from the device identification file to obtain a device identifier to be processed; Convert the device identifier to be processed into data in an array format to obtain the device identifier indicated by the device identification information.

8. An apparatus for obtaining device identification information, characterized in that, It includes: A writing unit configured to write the device identification information of a target printer into the storage area of the terminal through a print driver loaded on the terminal, where the device identification information is used to indicate the device identifier of the target printer; A searching unit configured to search for the device identification information in the storage area through a target client loaded on the terminal in response to receiving a print instruction for the target printer; A reporting unit configured to generate reporting information including the device identification information corresponding to the target printer and upload the reporting information to the server.

9. An electronic device, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein The processor runs the computer program to implement the method according to any one of claims 1-7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, The program is executed by the processor to implement the method according to any one of claims 1-7.

Citation Information

Patent Citations

  • Printer configuration method and device based on interaction and electronic equipment

    CN113741832A

  • Printing method and device, electronic equipment and computer readable storage medium

    CN115599317A

  • Common driver application device and method

    CN1629828A

  • Printer Identification and Mobile Printing

    US20130021638A1