Method and system for adding print watermark based on xinsichuang operating system

By intercepting the printing process using the HOOK dynamic library in the domestically developed operating system and adding a watermark, the problem of document printing leakage in existing technologies is solved. This achieves seamless operation and high-efficiency security, is applicable to domestic operating systems, prevents data leakage, and enables traceability.

CN116339652BActive Publication Date: 2026-01-23BEIJING VRV SOFTWARE CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202310249526.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-15
Publication Date
2026-01-23
Estimated Expiration
2043-03-15

AI Technical Summary

Technical Problem

In the current technology, the leakage of secrets through document printing is quite common, and the existing watermarking methods are complicated and cumbersome, which affects the user's printing efficiency and experience, and cannot effectively improve the confidentiality level of documents.

Method used

The method, based on the domestically developed operating system, uses a HOOK dynamic library to intercept the printing process, add a preset watermark, and overwrite the original file to achieve seamless operation, including the steps of saving, renaming, intercepting, adding watermark, and overwriting the file.

Benefits of technology

It effectively improves the confidentiality level of documents without affecting the user's printing efficiency, and enables traceability to prevent data leakage. It is applicable to domestic IT operating systems such as Galaxy Kylin, UnionTech UOS, and Zhongke Fangde.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116339652B_ABST
    Figure CN116339652B_ABST
Patent Text Reader

Abstract

The application discloses a method and system for adding a printing watermark based on an Xinsichuang operating system. The method comprises the following steps: storing a first file into a first directory based on a printing instruction; moving the first file to a second directory; renaming the first file to obtain a second file; intercepting the second file and pausing a printing process; adding a preset watermark to the second file to obtain a third file; and covering the second file with the third file to trigger the printing process to print the third file. The method can realize a user's non-susceptible operation, can add a watermark to a file, does not affect the printing efficiency of the user, can effectively improve the security level of the file, can trace and track in time, effectively improves the transparency of the application, and ensures that all output files can be added with the preset watermark, so that the security of sensitive files and the traceability of the files are realized.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present disclosure relates to the technical field of computer, in particular to a method and system for adding print watermark based on XG operating system. BACKGROUND

[0002] With the popularization of information systems, network construction and the expansion of user scale, the way of using data by the state, enterprises and ordinary personnel is becoming more and more complex. After a key information is leaked through a certain channel, it will bring a series of chain reactions in a short time, causing significant losses to related units.

[0003] There are many channels for leaking in enterprises, including USB mobile storage, shared storage, printing, burning, fax, infrared, R232, email, chat tools, network disk, BBS, etc. The diversification of the leakage channels brings great challenges to security management. Each channel may need to be prevented by different methods. Among them, the form of printing sensitive files out is a relatively common way of leaking, but the method of adding watermark to improve the security level of the file in the prior art is complex and time-consuming, which affects the printing efficiency and experience of the user, and brings inconvenience to the user. SUMMARY

[0004] Therefore, the embodiments of the present disclosure provide a method and system for adding print watermark based on XG operating system, which can realize the user's non-sensing operation, can add watermark to the file, does not affect the printing efficiency of the user, can effectively improve the security level of the file, and can trace and track in time.

[0005] In a first aspect, the embodiments of the present disclosure provide a method for adding print watermark based on XG operating system, comprising:

[0006] storing a first file to a first directory based on a print instruction;

[0007] moving the first file to a second directory;

[0008] renaming the first file to obtain a second file;

[0009] intercepting the second file and pausing a print process;

[0010] adding a preset watermark to the second file to obtain a third file;

[0011] covering the third file with the second file, and triggering the print process to print the third file.

[0012] Optionally, the first file is a PDF file.

[0013] The first directory is a temporary directory, and the second directory is different from the path of the first directory.

[0014] Optionally, the renaming the first file to obtain a second file comprises:

[0015] renaming the first file by invoking a rename function of a CUPS service to obtain the second file;

[0016] The renaming path of the second file belongs to a directory of the CUPS service.

[0017] Optionally, the intercepting the second file and pausing a printing process comprises:

[0018] real-time monitoring the second directory by a HOOK dynamic library, intercepting the second file when detecting generation of the second file, and controlling the printer to pause the printing process.

[0019] Optionally, the adding a preset watermark to the second file to obtain a third file comprises:

[0020] analyzing the second file to obtain a type of the second file;

[0021] adding a matching watermark to the second file based on a preset watermark printing strategy to obtain the third file.

[0022] Optionally, the preset watermark comprises one or more of a vector watermark, a text watermark, a two-dimensional code watermark, or a picture watermark.

[0023] Optionally, the preset watermark strategy comprises: if the second file is of a first type, the matching watermark added is a vector watermark.

[0024] if the second file is of a second type, the matching watermark added is a text watermark.

[0025] if the second file is of a third type, the matching watermark added is a two-dimensional code watermark.

[0026] if the second file is of a fourth type, the matching watermark added is a picture watermark.

[0027] In a second aspect, an embodiment of the present disclosure provides a system for adding a printing watermark based on a ChinaSoft operating system, comprising:

[0028] a storage module configured to store a first file to a first directory based on a printing instruction;

[0029] a moving module configured to move the first file to a second directory;

[0030] The renaming module is configured to rename the first file to obtain a second file;

[0031] The intercepting module is configured to intercept the second file and pause a printing process;

[0032] The watermark adding module is configured to add a preset watermark to the second file to obtain a third file;

[0033] The covering module is configured to cover the third file on the second file to trigger the printing process.

[0034] In a third aspect, the embodiments of the present disclosure further provide an electronic device, which adopts the following technical scheme:

[0035] The electronic device comprises:

[0036] at least one processor; and

[0037] a memory in communication connection with the at least one processor; wherein

[0038] The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the method for adding a printing watermark based on the Xin creation operating system.

[0039] In a fourth aspect, the embodiments of the present disclosure further provide a computer readable storage medium storing computer instructions for causing a computer to execute the method for adding a printing watermark based on the Xin creation operating system.

[0040] The method for adding a printing watermark based on the Xin creation operating system provided by the embodiments of the present disclosure can continue to intercept the corresponding file, pause the original printing process while adding the watermark, and prevent the printer from printing the original file without adding the watermark. By adding the preset watermark to the file, the present application can realize the security of sensitive files and the tracing and tracing of files, can realize the non-sensing addition of users, does not affect the printing use efficiency, and effectively improves the transparency of the application. The method disclosed in the present application can be applied to various domestic Xin creation operating systems such as Galaxy Kirin, UOS, and CSD.

[0041] The method disclosed in the present application adopts the HOOK mechanism, uses the hook function, directly captures the printing behavior of the system, is safe and reliable, has high strategy execution efficiency, and takes effect in real time. The present application provides a method for conveniently adding a printing watermark for the file printing scene in the domestic Xin creation operating system environment, can add a printing watermark of a specified type and content to a specified terminal in batches according to the setting of the management personnel, and thus effectively prevents the core data leakage problem caused by printing sensitive files.

[0042] The above description is only a summary of the technical solutions of the present disclosure. In order to make the technical means of the present disclosure more clearly understood, the contents of the specification can be implemented, and in order to make the above and other purposes, characteristics and advantages of the present disclosure more obvious and easy to understand, the following preferred embodiments are described in detail below, and the accompanying drawings are described as follows. BRIEF DESCRIPTION OF DRAWINGS

[0043] In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the following will briefly introduce the drawings needed to be used in the embodiments. Obviously, the drawings in the following description are only some embodiments of the present disclosure, and for those skilled in the art, other drawings can be obtained without creative labor on the basis of these drawings.

[0044] Figure 1 The method flow diagram of adding a print watermark based on the XG operating system provided by the embodiments of the present disclosure.

[0045] Figure 2 The detailed schematic diagram of the method provided by the embodiments of the present disclosure.

[0046] Figure 3 The principle block diagram of the system for adding a print watermark based on the XG operating system provided by the embodiments of the present disclosure.

[0047] Figure 4 The principle block diagram of an electronic device provided by the embodiments of the present disclosure. DETAILED DESCRIPTION

[0048] The embodiments of the present disclosure will be described in detail below with reference to the drawings.

[0049] It should be clear that the following describes the embodiments of the present disclosure through specific and concrete examples, and those skilled in the art can easily understand other advantages and effects of the present disclosure from the contents disclosed in the specification. Obviously, the described embodiments are only some of the embodiments of the present disclosure, not all. The present disclosure can also be implemented or applied by other different specific embodiments, and the details in the specification can be modified or changed based on different views and applications without departing from the spirit of the present disclosure. It should be noted that the following embodiments and features in the embodiments can be combined with each other without conflict. Based on the embodiments in the present disclosure, all other embodiments obtained by those skilled in the art without creative labor are within the scope of protection of the present disclosure.

[0050] It is important to note that the various aspects described herein can be implemented in a wide variety of forms and that any particular structure and / or function described herein is merely illustrative. An aspect described herein can be implemented independently of any other aspects and / or implemented with any combination of aspects. For example, an apparatus can be implemented to practice a method or realize a structure described herein without practicing any other aspect described herein. Additionally, a method can be implemented to practice an apparatus or realize a structure described herein without practicing any other aspect described herein.

[0051] It is also important to note that the present disclosure can be carried out by more than one process. These processes might or might not be contiguous. The processes might rhyme, or they can be halting. They can involve multiple apples or oranges.

[0052] Furthermore, in the following description, numerous specific details are set forth to provide a thorough understanding of the examples. However, it will be apparent to those skilled in the art that the aspects can be practiced without these specific details.

[0053] Reference Figure 1 The present disclosure discloses a method for adding a print watermark based on a signal creation operating system, the method comprising the following steps:

[0054] S100, based on a print instruction, storing a first file to a first directory; wherein the first file is a PDF file.

[0055] S200, moving the first file to a second directory;

[0056] Renaming the first file to obtain a second file.

[0057] The obtaining method of the second file comprises: renaming the first file by calling a rename function through a CUPS service to obtain the second file; and the renaming path of the second file belongs to the directory of the CUPS service.

[0058] S300, intercepting the second file and pausing the print process.

[0059] Specifically, the second directory is monitored in real time by a HOOK dynamic library, and when the second file is detected to be generated, the second file is intercepted, and the printer is controlled to pause the print process.

[0060] S400, adding a preset watermark to the second file to obtain a third file.

[0061] Specifically, the second file is analyzed to obtain a type of the second file;

[0062] Based on a preset watermark printing strategy, a matching watermark is added to the second file to obtain the third file.

[0063] Further, if the second file is of a first type, the matching watermark added is a vector watermark;

[0064] If the second file is of a second type, the matching watermark added is a text watermark;

[0065] If the second file is of a third type, the matching watermark added is a two-dimensional code watermark;

[0066] If the second file is of a fourth type, the matching watermark added is a picture watermark.

[0067] The vector watermark is in a dot matrix form to display some slight dots or dot patterns on the printed file, so as to avoid watermark distortion. A string of numbers can be obtained through the dots or symbols, and the server stores text information corresponding to the string of numbers. When the printed file is externally transmitted, the terminal used for printing can be tracked according to the dot matrix information corresponding to the string of numbers.

[0068] The two-dimensional code watermark refers to generating a two-dimensional code by using a specific algorithm, and using the two-dimensional code as a watermark. When the printed file is externally transmitted, the two-dimensional code on the externally transmitted file can be scanned by using a WeChat or other applet scanning function, and the terminal used for printing can be tracked according to the two-dimensional code information.

[0069] The picture watermark refers to using a picture with a high degree of recognition and easy traceability as a watermark of the printed file.

[0070] S500, the third file is overlaid on the second file, and a printing process is triggered to print the third file.

[0071] In the embodiment, the first directory is a temporary directory, and the second directory is different from the first directory in terms of a path.

[0072] The method for adding a printing watermark based on a signal creation operating system disclosed in the application can be applied to various domestic signal creation operating systems such as Galaxy Kirin, UOS, and CSD, effectively prevents data leakage behaviors through file printing, and can track and trace in a timely manner after data leakage.

[0073] Further, with reference to Figure 2 The method disclosed in the application specifically includes:

[0074] The administrator configures and distributes the preset watermark printing policy on the management platform; specifically, it distributes it to the target device, i.e., the client connected to the printer.

[0075] The preset watermark printing strategy is one or more of vector watermark, text watermark, QR code watermark, or image watermark. In this embodiment, the corresponding client can pre-set the corresponding watermark requirements without having to set them every time, achieving seamless operation for the user. This satisfies the watermark addition requirements and improves printing efficiency.

[0076] The client agent receives and parses the policy, and stores the watermark format. Specifically, the client agent receives the preset watermark printing policy, parses it, obtains the watermark information that the client can add, and stores the watermark format.

[0077] The watermark format may include one or more of the following: QR code type, display position, display size, QR code color, or transparency.

[0078] Alternatively, the watermark format mainly includes valid information such as the client hostname, IP address, MAC address, holder information, and current date.

[0079] The client agent hooks system functions to monitor the CUPS service.

[0080] In this embodiment, the client agent uses HOOK technology to load the HOOK dynamic library into the system's so preload configuration (default is: / etc / ld.so.preload file);

[0081] Then you can restart the CUPS service (General UNIX Printing System) to make the CUPS service load the HOOK dynamic library;

[0082] The HOOK dynamic library monitors the system's rename function. When it detects that the CUPS service calls this function to process a file, and the renamed path of the processed file belongs to the CUPS directory (default is var / spool / cups / ), it determines that the corresponding file is a file to be printed.

[0083] In other words, determine whether the CUPS service calls the rename function to process the file. If not, determine that the file is not the file to be printed. If so, determine whether the rename path of the processed file belongs to the CUPS directory. If not, determine that the file is not the file to be printed. If so, determine that the file is the file to be printed.

[0084] The hook dynamic library is a.so file. Loading the hook dynamic library into the so preload configuration of the system means adding the absolute path of the.so file to the preload configuration / etc / ld.so.preload. After loading, system-level services such as the CUPS service will load the hook dynamic library by default.

[0085] The hook dynamic library intercepts print files and adds a watermark to the files.

[0086] Specifically, the hook dynamic library is used to intercept a PDF file that is temporarily generated during the printing process of the CUPS service, that is, the printing process is intercepted before the printer starts printing, and the printing process is paused to prevent the printer from printing a file without a watermark.

[0087] The hook dynamic library, exits the rename function, and releases the interception behavior, and transfers the printing behavior to the CUPS service, and then the CUPS service continues the printing behavior to generate a print file with a watermark.

[0088] The hook dynamic library, exits the rename function, and releases the interception behavior, and transfers the printing behavior to the CUPS service, and then the CUPS service continues the printing behavior to generate a print file with a watermark.

[0089] If the client agent receives a closing strategy, the hook dynamic library is uninstalled. If not, the original setting is retained, and the next time the print is printed, the print can be automatically monitored, intercepted, and watermarked.

[0090] It should be noted that the PDF file is the final format converted during the printing process of the China-specific operating system, that is, regardless of the type of file printed by the China-specific operating system, including word, excel, pdf, etc., when printing, the system will convert the print file format to pdf format by default for printing.

[0091] In the embodiment, a control method for adding a print watermark in a domestic signal creation operating system environment is constituted by a management platform, a client agent, and a hook dynamic library. The management platform is accessed in a web form, and an administrator can directly create, modify, and close a print watermark strategy by accessing a webpage of the management platform. After the strategy is created, the strategy is actively issued to a specified client agent. The client agent receives the strategy from the management platform, analyzes the strategy, and stores the format and content of the print watermark. After the function is enabled, the client agent actively adds an absolute path of the hook dynamic library to a so preload configuration file of the system, i.e., / etc / ld.so.preload. After the addition is completed, a system print service CUPS is restarted to ensure that the CUPS service loads the hook dynamic library. During the function is enabled, the hook dynamic library continuously monitors a rename function of the system to capture a calling operation of the CUPS service. The print message of the CUPS service is intercepted in real time, and the specified format of the watermark content is added to the print file. After the print watermark is added, the CUPS service continues the print operation to generate the print file with the watermark. Once the administrator closes the print watermark strategy in the management platform, the client agent actively uninstalls the hook dynamic library to completely close the print watermark function.

[0092] The application further includes a management platform, a client agent, and a CUPS server. The management platform is configured to provide a web service access portal and perform whole life cycle management and control of a print watermark strategy from formulation to maintenance and closure. In the embodiment, the management platform is configured to store a preset watermark print strategy.

[0093] The client agent is configured to receive the preset watermark print strategy issued by the management platform, analyze and execute the strategy.

[0094] The CUPS server includes a storage module, a moving module, a renaming module, and an intercepting module. The storage module is configured to store a first file in a first directory, i.e., a temporary directory, based on a print instruction. The moving module is configured to move the first file to a second directory, i.e., cut and copy the first file to the second directory. The renaming module is configured to rename the first file by calling a rename function to obtain a second file, i.e., the first file after renaming. The intercepting module is configured to intercept the second file and pause a print process of a printer.

[0095] Then, the client agent adds a preset watermark to the second file by a watermark adding module to obtain a third file.

[0096] Finally, the third file is overwritten on the second file by the client agent through the overwriting module, triggering the printing process, that is, triggering the CUPS server to continue to execute the printing process and control the printer to start to print the third file.

[0097] In the embodiment, a complete printing watermark creating and maintaining mechanism is established to guarantee the normal execution of the printing watermark function.

[0098] The CUPS (Common UNIX Printing System) service is used to manage printers and printing.

[0099] The application adopts the HOOK mechanism and directly captures the printing behavior of the system by using the hook function, which is safe and reliable, has high strategy execution efficiency and takes effect in real time. The application provides a method for conveniently adding a printing watermark for a file printing scene in a domestic signal creation operating system environment, can add a printing watermark of a specified type and content to a specified terminal in batches according to the setting of a management personnel, and thus effectively prevents the problem of core data leakage caused by printing of sensitive files.

[0100] With reference to Figure 3 The second aspect of the application provides a system for adding a printing watermark based on a signal creation operating system, comprising:

[0101] A storage module configured to store a first file to a first directory based on a printing instruction;

[0102] A moving module configured to move the first file to a second directory;

[0103] A renaming module configured to rename the first file to obtain a second file;

[0104] An intercepting module configured to intercept the second file and pause a printing process;

[0105] A watermark adding module configured to add a preset watermark to the second file to obtain a third file;

[0106] An overwriting module configured to overwrite the third file on the second file to trigger the printing process.

[0107] An electronic device according to an embodiment of the present disclosure includes a memory and a processor. The memory is configured to store non-transitory computer-readable instructions. Specifically, the memory can include one or more computer program products that can include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory, for example, can include random access memory (RAM), cache memory, and / or the like. The non-volatile memory, for example, can include read-only memory (ROM), hard disk, flash memory, and / or the like.

[0108] The processor can be a central processing unit (CPU) or other form of processing unit that has data processing and / or instruction execution capabilities, and can control other components in the electronic device to perform desired functions. In one embodiment of the present disclosure, the processor is configured to execute the computer-readable instructions stored in the memory, so that the electronic device performs all or part of the steps of the method for adding a print watermark based on the China software operation system according to the foregoing embodiments of the present disclosure.

[0109] Those skilled in the art will understand that, in order to solve the technical problem of how to obtain a good user experience effect, the present embodiment can also include well-known structures such as a communication bus, an interface, and the like, which should also be included in the protection scope of the present disclosure.

[0110] As Figure 4 A structural schematic diagram of an electronic device according to an embodiment of the present disclosure is shown. It shows a structural schematic diagram suitable for implementing the electronic device in the embodiments of the present disclosure. Figure 4 The electronic device shown is only an example and should not impose any limitation on the functions and use range of the embodiments of the present disclosure.

[0111] As Figure 4 As shown, the electronic device can include a processing device (such as a central processor, a graphics processor, and the like) that can perform various appropriate actions and processes according to programs stored in a read-only memory (ROM) or loaded into a random access memory (RAM) from a storage device. In the RAM, various programs and data required for the operation of the electronic device are also stored. The processing device, the ROM, and the RAM are connected to each other through a bus. An input / output (I / O) interface is also connected to the bus.

[0112] Generally, the following devices can be connected to the I / O interface: input devices including, for example, sensors or visual information acquisition devices; output devices including, for example, display screens; storage devices including, for example, magnetic tapes, hard disks, and the like; and communication devices. The communication devices can allow the electronic device to communicate with other devices (such as edge computing devices) to exchange data wirelessly or through wires. Although Figure 4Electronic devices with various apparatuses are shown, but it is understood that not all of the illustrated apparatuses are required or present. More or fewer apparatuses can alternatively be implemented or present.

[0113] In particular, according to embodiments of the present disclosure, the processes described above with reference to the flowcharts can be implemented as a computer software program. For example, embodiments of the present disclosure include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network through a communication apparatus, or installed from a storage device, or installed from a ROM. When the computer program is executed by a processing apparatus, all or part of the steps of the method of adding a print watermark based on the XG operating system according to embodiments of the present disclosure are performed.

[0114] Detailed descriptions of the present embodiments can refer to the corresponding descriptions of the aforementioned embodiments, which will not be repeated here.

[0115] A computer-readable storage medium according to embodiments of the present disclosure has non-transitory computer-readable instructions stored thereon. When the non-transitory computer-readable instructions are run by a processor, all or part of the steps of the method of adding a print watermark based on the XG operating system according to embodiments of the present disclosure are performed.

[0116] The computer-readable storage medium described above includes, but is not limited to, optical storage media (e.g., CD-ROM and DVD), magneto-optical storage media (e.g., MO), magnetic storage media (e.g., magnetic tape or a mobile hard disk), media with built-in rewritable non-volatile memory (e.g., a memory card), and media with built-in ROM (e.g., a ROM cartridge).

[0117] Detailed descriptions of the present embodiments can refer to the corresponding descriptions of the aforementioned embodiments, which will not be repeated here.

[0118] The basic principles of the present disclosure are described above in combination with specific embodiments, but it should be noted that the advantages, advantages, effects, etc. mentioned in the present disclosure are only examples and are not limiting, and these advantages, advantages, effects, etc. cannot be considered as the must-have of each embodiment of the present disclosure. In addition, the above-mentioned specific details are only for the purpose of example and for the purpose of understanding, and are not limiting, and the above-mentioned details do not limit the present disclosure to the must-use of the above-mentioned specific details.

[0119] In this disclosure, relational terms such as first and second and the like can be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. The block diagram of the devices, apparatus, equipment, systems referred to in this disclosure is merely illustrative and not intended to imply the necessity or arrangement of the connections, arrangement, configuration as shown in the block diagram. As will be appreciated by those skilled in the art, the devices, apparatus, equipment, systems can be connected, arranged, configured in any manner. The words comprising, including, having and the like are to be open ended. As used in this document, the conjunction "or" is to be interpreted in the inclusive sense, i.e. as meaning one or the other, or both. As used in this document, the words "and" and "or" are to be interpreted as having the meaning indicated in the phrase "and / or". As used in this document, the word "such as" is to be interpreted as meaning "such as, but not limited to".

[0120] Also, as used in this document, the word "or" in the cases used to introduce an enumeration of several items, for example, a list of items, is to be interpreted in the inclusive sense, i.e. as meaning one or more, or any combination thereof, of the listed items. Additionally, the phrase "example of" as used in this document is not meant to be limiting in any way.

[0121] It is also important to note that the systems and methods of the present disclosure can be embodied in a variety of forms without departing from the spirit or essential characteristics thereof. Likewise, the disclosure is to be understood to include any alterations, modifications, revisions, or equivalent arrangements not herewith expressly disclosed but which are within the scope and spirit of the present disclosure.

[0122] Various changes, modifications and alterations in the teachings and techniques described herein can be made without departing from the teachings and techniques defined by the appended claims. Moreover, the scope of the claims of this disclosure is not limited to the specific aspects described above. Rather, the aspects of the disclosure are intended to encompass all techniques, apparatus, manufacture, composition of matter, means, methods and acts falling within the scope of the claims, including their equivalents. Accordingly, the appended claims are intended to embrace all such alterations, modifications, and variations as fall within the scope of this disclosure.

[0123] The above description of the disclosed aspects is intended to be illustrative and not restrictive. Many other aspects can be apparent to those of skill in the art upon reading the above description. The scope of the disclosure should therefore, be determined not with reference to the above description, but should instead be determined with reference to the appended claims, along with their full scope of equivalents. The disclosure is thus to be understood in view of the claims.

[0124] The foregoing description has been presented for the purposes of illustration and description. Furthermore, the description is not intended to limit the embodiments of the disclosure to the forms disclosed herein. Although the various example aspects and embodiments have been described herein with regard to particular aspects and embodiments, those skilled in the art will recognize that certain modifications, changes, substitutions, additions and sub-combinations can be made without departing from the spirit of the disclosure.

Claims

1. A method for adding printing watermarks based on a domestically developed operating system, characterized in that, include: Based on the print command, the first file is stored in the first directory; Moving the first file to the second directory specifically includes: cutting the first file and copying it to the second directory; Renaming the first file to obtain the second file specifically includes: renaming the first file by calling the rename function through the CUPS service to obtain the second file; the second file is the renamed first file; Intercept the second file and pause the printing process; Adding a preset watermark to the second file to obtain a third file specifically includes: analyzing the second file to determine its type; and adding a matching watermark to the second file based on a preset watermark printing strategy to obtain the third file. The third file overwrites the second file, triggering the printing process to print the third file; Before adding the preset watermark, the process also includes: determining whether the CUPS service calls the rename function to process the file; if not, determining that the file is not the file to be printed; if so, determining whether the rename path of the processed file belongs to the directory of the CUPS service; if not, determining that the file is not the file to be printed; if so, determining that the file is the file to be printed and triggering the addition of the preset watermark. The renaming path of the second file belongs to the directory of the CUPS service; The interception of the second file and the suspension of the printing process includes: monitoring the second directory in real time through the HOOK dynamic library, intercepting the second file when the generation of the second file is detected, and controlling the printer to suspend the printing process.

2. The method according to claim 1, characterized in that, The first file is a PDF file; The first directory is a temporary directory, and the second directory is located at a different path than the first directory.

3. The method according to claim 1, characterized in that, The preset watermark includes one or more of the following: vector watermark, text watermark, QR code watermark, or image watermark.

4. The method according to claim 1, characterized in that, The preset watermark printing strategy includes: if the second file is of the first type, then the added matching watermark is a vector watermark; If the second file is of the second type, then the added matching watermark is a text watermark; If the second file is of the third type, then the added matching watermark is a QR code watermark; If the second file is of type four, then the added matching watermark is an image watermark.

5. A system for adding printing watermarks based on a domestically developed operating system, characterized in that, include: The storage module is configured to store the first file in the first directory based on print commands; The moving module is configured to move the first file to the second directory, specifically including: cutting and copying the first file to the second directory; The renaming module is configured to rename the first file and obtain a second file. Specifically, it includes: calling the rename function through the CUPS service to rename the first file and obtain a second file; the second file is the renamed first file. The interception module is configured to intercept the second file and pause the printing process; The watermarking module is configured to add a preset watermark to the second file to obtain a third file. Specifically, it includes: analyzing the second file to obtain the type of the second file; and adding a matching watermark to the second file based on a preset watermark printing strategy to obtain the third file. The overwrite module is configured to overwrite the second file with the third file, triggering the printing process; Before adding the preset watermark, the process also includes: determining whether the CUPS service calls the rename function to process the file; if not, determining that the file is not the file to be printed; if so, determining whether the rename path of the processed file belongs to the directory of the CUPS service; if not, determining that the file is not the file to be printed; if so, determining that the file is the file to be printed and triggering the addition of the preset watermark. The renaming path of the second file belongs to the directory of the CUPS service; The interception of the second file and the suspension of the printing process includes: monitoring the second directory in real time through the HOOK dynamic library, intercepting the second file when the generation of the second file is detected, and controlling the printer to suspend the printing process.

6. An electronic device, characterized in that, The electronic device includes: At least one processor; and, A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, which, when executed by the at least one processor, enables the at least one processor to perform the method for adding a printing watermark based on the domestically developed operating system as described in any one of claims 1-4.

7. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions for causing a computer to perform the method of adding a printed watermark based on any one of claims 1-4 of the domestically developed operating system.

Citation Information

Patent Citations

  • File printing control method and system, electronic equipment and storage medium

    CN112698797A