Watermark processing method, device, equipment, storage medium and program product for drawings
By writing dark watermark codes generated based on watermark identifiers and traceability information into the source code of the drawing, the problem of drawing protection affecting the use in the prior art is solved, and efficient and universal drawing protection is achieved.
Patent Information
- Application Number
- CN202410740870.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-07
- Publication Date
- 2025-05-30
- Estimated Expiration
- 2044-06-07
AI Technical Summary
When the prior art protects drawings, it will affect the use of drawings, and the protection methods are poorly universal, which can easily affect the performance of CAD software.
By obtaining watermark information, including watermark identifiers and traceability information, and generating watermark codes based on preset characters, writing them into the source code of the drawing to form a dark watermark, thereby achieving the protection of the drawing.
It realizes the protection of drawings without affecting their normal use. It is suitable for drawings of different formats, and does not require deep adaptation of CAD software, avoiding performance impact.
Smart Images

Figure CN118628328B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the technical field of drawing processing, and particularly to a watermark processing method, apparatus, device, storage medium and program product for drawings. Background Art
[0002] With the development of Internet technology and network transmission technology, the copying, modification and dissemination of drawings have become more and more convenient, resulting in more and more difficult protection of drawings. In the related art, the drawings are mainly encrypted and decrypted by adding a watermark layer to the rasterized drawings or by a drawing protection software with deep adaptation to realize the protection of the drawings. However, in the process of protecting the drawings, these two protection methods will affect the use of the drawings. Summary of the Invention
[0003] In view of this, the present disclosure provides a watermark processing method, apparatus, device, storage medium and program product for drawings to solve the problem that the protection of drawings affects the use of the drawings.
[0004] In a first aspect, the present disclosure provides a watermark processing method for drawings, the method comprising:
[0005] Obtaining watermark information, the watermark information including a watermark identifier and traceability information;
[0006] Obtaining the source code of a first drawing, the source code being obtained by parsing the first drawing;
[0007] Based on the watermark information and a preset character, obtaining a watermark code;
[0008] Writing the watermark code into the source code to obtain a target drawing with a watermark added, wherein the preset character makes the watermark added to the first drawing a hidden watermark.
[0009] In a second aspect, the present disclosure provides another watermark processing method for drawings, the method comprising:
[0010] Obtaining a target drawing;
[0011] Obtaining the source code of the target drawing, the source code being obtained by parsing the target drawing;
[0012] Identifying the watermark identifier in the source code to determine the watermark code in the target drawing, the watermark code being obtained based on a preset character, the watermark identifier and traceability information, the preset character making the watermark added to the target drawing a hidden watermark;
[0013] Based on the watermark code, the preset character and the watermark identifier, determining the traceability information.
[0014] In a third aspect, the present disclosure provides a watermark processing device for drawings, the device comprising:
[0015] a watermark information acquisition module, configured to acquire watermark information, the watermark information including a watermark identifier and traceability information;
[0016] an original code acquisition module, configured to acquire the source code of a first drawing, the source code being obtained by parsing the first drawing;
[0017] a watermark code generation module, configured to obtain a watermark code based on the watermark information and a preset character;
[0018] a watermark code writing module, configured to write the watermark code into the source code to obtain a target drawing with a watermark added, wherein the preset character makes the watermark added to the first drawing a hidden watermark.
[0019] In a fourth aspect, the present disclosure provides another watermark processing device for drawings, the device comprising:
[0020] a watermark drawing acquisition module, configured to acquire a target drawing;
[0021] a target code acquisition module, configured to acquire the source code of the target drawing, the source code being obtained by parsing the target drawing;
[0022] a watermark code recognition module, configured to recognize the watermark identifier in the source code to determine the watermark code in the target drawing, the watermark code being obtained based on a preset character, the watermark identifier and traceability information, the preset character making the watermark added to the target drawing a hidden watermark;
[0023] a watermark information extraction module, configured to determine the traceability information based on the watermark code, the preset character and the watermark identifier.
[0024] In a fifth aspect, the present disclosure provides a computer device, comprising: a memory and a processor, which are communicatively connected to each other, wherein the memory stores computer instructions, and the processor executes the computer instructions to execute the watermark processing method for drawings according to the first aspect or any corresponding embodiment thereof, and / or execute the watermark processing method for drawings according to the second aspect or any corresponding embodiment thereof.
[0025] Sixth aspect, the present disclosure provides a computer-readable storage medium, on which computer instructions are stored, and the computer instructions are used to cause a computer to execute the watermark processing method for drawings in the first aspect or any corresponding embodiment thereof, and / or execute the watermark processing method for drawings in the second aspect or any corresponding embodiment thereof.
[0026] Seventh aspect, the present disclosure provides a computer program product, including computer instructions, and the computer instructions are used to cause a computer to execute the watermark processing method for drawings in the first aspect or any corresponding embodiment thereof, and / or execute the watermark processing method for drawings in the second aspect or any corresponding embodiment thereof.
[0027] The watermark processing method for drawings provided by the embodiments of the present disclosure obtains a watermark code based on a watermark identifier, traceability information, and a preset character, and writes the watermark code into the source code of the first drawing to obtain a target drawing with a watermark added; wherein, the preset character makes the watermark added to the first drawing a hidden watermark. Therefore, it is possible to determine the watermark code by identifying the watermark identifier in the source code of the target drawing, and obtain the traceability information through the watermark code, thereby realizing the protection of the drawing. At the same time, since the watermark is added to the source code of the drawing, the added watermark cannot be perceived in the displayed drawing, and it is not necessary to deeply adapt the drawing editing software based on a file filter driver, and the software performance is not affected, so it will not affect the normal use of the drawing. Description of the Drawings
[0028] In order to more clearly illustrate the specific embodiments of the present disclosure or the technical solutions in the prior art, the following will briefly introduce the drawings required for the description of the specific embodiments or the prior art. Obviously, the drawings in the following description are some embodiments of the present disclosure. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.
[0029] Figure 1 is a schematic flowchart of the first watermark processing method for drawings according to an embodiment of the present disclosure;
[0030] Figure 2 is a schematic flowchart of the second watermark processing method for drawings according to an embodiment of the present disclosure;
[0031] Figure 3 is a schematic flowchart of the third watermark processing method for drawings according to an embodiment of the present disclosure;
[0032] Figure 4 is a schematic code diagram of adding a watermark in the form of a comment according to an embodiment of the present disclosure;
[0033] Figure 5 It is a schematic flowchart of a watermark processing method for the fourth type of drawing according to an embodiment of the present disclosure;
[0034] Figure 6 It is a schematic code diagram for adding a watermark in the form of an invisible symbol according to an embodiment of the present disclosure;
[0035] Figure 7 It is a schematic flowchart of a watermark processing method for the fifth type of drawing according to an embodiment of the present disclosure;
[0036] Figure 8 It is a structural block diagram of a watermark processing device for a drawing according to an embodiment of the present disclosure;
[0037] Figure 9 It is a structural block diagram of another watermark processing device for a drawing according to an embodiment of the present disclosure;
[0038] Figure 10 It is a structural block diagram of a computer device according to an embodiment of the present disclosure. Detailed implementation manners
[0039] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although some embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. On the contrary, these embodiments are provided to more thoroughly and completely understand the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not used to limit the protection scope of the present disclosure.
[0040] In the description of the embodiments of the present disclosure, the term "including" and its similar terms should be understood as open inclusion, that is, "including but not limited to". The term "based on" should be understood as "at least partially based on". The term "one embodiment" or "the embodiment" should be understood as "at least one embodiment". The term "some embodiments" should be understood as "at least some embodiments". There may also be other explicit and implicit definitions hereinafter.
[0041] In this article, unless otherwise specified, performing a step "in response to A" does not mean that the step is immediately executed after "A", but may include one or more intermediate steps.
[0042] It can be understood that the data involved in the technical solution (including but not limited to the data itself, the acquisition, use, storage, or deletion of the data) should comply with the requirements of the corresponding laws, regulations, and related provisions.
[0043] It is understandable that before using the technical solutions disclosed in the embodiments of the present disclosure, relevant users should be informed of the type, scope of use, usage scenarios, etc. of the information involved in the present disclosure and obtain the authorization of relevant users through appropriate means in accordance with relevant laws and regulations. Among them, relevant users may include any type of rights holders, such as individuals, enterprises, and groups.
[0044] For example, when responding to an active request from a user, a prompt message is sent to the relevant user to clearly prompt the relevant user that the operation requested by the user will require obtaining and using the information of the relevant user, so that the relevant user can autonomously choose whether to provide information to software or hardware such as an electronic device, application program, server, or storage medium that executes the operation of the technical solution of the present disclosure according to the prompt message.
[0045] As an optional but non-limiting implementation manner, the manner of sending a prompt message to the relevant user in response to receiving an active request from the relevant user may be, for example, in the form of a pop-up window, and the prompt message may be presented in text in the pop-up window. In addition, the pop-up window may also carry a selection control for the user to choose "agree" or "disagree" to provide information to the electronic device.
[0046] It is understandable that the above process of notifying and obtaining user authorization is only illustrative and does not limit the implementation manner of the present disclosure. Other manners that meet relevant laws and regulations can also be applied to the implementation manner of the present disclosure.
[0047] Office security generally involves the security management of networks, identities, and terminals. By implementing private network networking, access control, management of terminals in the private network, and information security protection, digital office can be made more secure, efficient, and user-friendly. The security management at the network level can ensure that private networks such as office networks can operate safely and efficiently, and further ensure the secure transmission and storage of business data. The security management at the identity level can improve the efficiency and security of user authentication for accessing the private network. The security management at the terminal level can achieve unified management of terminal devices in the private network, data leakage prevention, and terminal threat protection, thereby ensuring the security of enterprise data.
[0048] In practical applications, the security management of networks, identities, and terminals can achieve technical associations in multiple technical branches such as networking strategies, network access and control, remote access, unified terminal management, terminal detection and response, enterprise data leakage prevention, and identity authentication management, so as to make digital office simpler, more efficient, and easier to implement.
[0049] Computer Aided Design (CAD) has extensive applications in modern industrial design, manufacturing, and other fields. With the development of Internet technology and network transmission technology, the protection of CAD drawings has become increasingly difficult. Among them, compared with rasterized CAD drawings, CAD vector images can be enlarged and modified without loss, which is more convenient for secondary development and utilization, so they are more likely to become targets of theft. Once a CAD vector image is leaked, it will cause huge losses to the owner of the CAD drawing.
[0050] In related technologies, for the protection of CAD drawings, mainly two methods are adopted: adding a watermark layer to the rasterized drawing or using a deeply adapted drawing protection software to encrypt and decrypt the drawing. Among them, for the first protection method, the CAD drawing is rendered into a rasterized CAD bitmap, and a watermark layer is added to the CAD bitmap. Then, watermark information such as the device, user, and enterprise to be written is encoded into a special image identifier, and the special image identifier is written into the watermark layer to obtain a CAD drawing with watermark information added, thereby realizing the protection of the CAD drawing. However, this method will cause obvious modification to the CAD bitmap, thus affecting the normal use of the CAD drawing.
[0051] For the second protection method, based on file filtering drivers, deep integration with CAD software is carried out to encrypt the drawings of CAD software, thereby realizing the protection and traceability of the drawings. When this method opens or edits a CAD drawing in CAD software, it is necessary to encrypt and decrypt the drawing file to protect the CAD drawing. However, this method requires individual adaptation for each CAD software, so its universality is poor, and it is easy to affect the performance of CAD software, thus affecting the normal use of CAD drawings.
[0052] In view of this, according to an embodiment of the present disclosure, an embodiment of a watermark processing method for drawings is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in a different order from here.
[0053] In this embodiment, a watermark processing method for drawings is provided, which can be used in the client of a security management software to add a watermark to a protected drawing. Among them, the security management software is used for watermark processing of drawings. The security management software is installed in the private network / proprietary network of an enterprise or other organization. The client of the security management software is deployed on the terminal device of the enterprise or other organization, and the server of the security management software is deployed on the management platform of the enterprise or other organization. Figure 1It is a schematic flowchart of a watermark processing method for the first type of drawing according to an embodiment of the present disclosure. As Figure 1 shown, the process includes the following steps:
[0054] Step S101, obtain watermark information, where the watermark information includes a watermark identifier and traceability information.
[0055] Specifically, an administrator can formulate a traceability policy on the server side of the security management software, including the watermark information to be written in the watermark, such as the user information of the modifier, the device information of the terminal device where the client is located, the copyright information of the drawing, etc., and determine the user scope and terminal device scope covered by the traceability policy. Then, based on the user scope and terminal device scope, the traceability policy is sent to the corresponding client, so that when users or terminal devices within the corresponding scope perform watermark processing on the drawing, the client of the security management software automatically obtains watermark information such as the user information of the modifier and the device information of the terminal device where the client is located, and obtains the corresponding watermark identifier from the server, so as to add a watermark to the first drawing according to the watermark information and the watermark identifier, thereby protecting the first drawing.
[0056] In actual operation, the corresponding watermark identifier can be generated according to pre-configured watermark rules, or the watermark identifier can be randomly generated by the server. The generation method of the watermark identifier is not limited here.
[0057] Step S102, obtain the source code of the first drawing, where the source code is obtained by parsing the first drawing.
[0058] It should be noted that the first drawing mentioned here mainly refers to a CAD vector drawing. In addition, it can also be a drawing in other formats. The format of the drawing is not limited here.
[0059] Specifically, the client of the security management software is configured with a Data Leakage Prevention (DLP) module. The DLP module reads the first drawing (mainly referring to a CDA vector drawing) as a text file, and then matches the source code of the first drawing on the terminal device through regular expressions and / or keywords to obtain the source code of the first drawing.
[0060] Step S103, obtain a watermark code based on the watermark information and a preset character.
[0061] It should be noted that in actual operation, the characters used to represent annotations or invisible symbols in the first drawing can be used as the preset characters. The addition of the watermark code should not affect the operation of the source code of the first drawing.
[0062] Step S104: Write the watermark code into the source code to obtain the target drawing with the watermark added, where the preset character makes the watermark added to the first drawing a hidden watermark.
[0063] Specifically, if the watermark code does not participate in the compilation and execution of the source code, such as drawing annotations, the watermark code can be written between any two lines of code or in any blank line of the source code. If the watermark code participates in the compilation and execution of the source code, such as invisible symbols, the watermark code can be written at a position far from the main body of the code.
[0064] The method for processing the watermark of the drawing provided in this embodiment obtains the watermark code based on the watermark identifier, the traceability information, and the preset character, and writes the watermark code into the source code of the first drawing to obtain the target drawing with the watermark added, where the preset character makes the watermark added to the first drawing a hidden watermark. Therefore, it is possible to determine the watermark code by identifying the watermark identifier in the source code of the target drawing, and obtain the traceability information through the watermark code, thereby realizing the protection of the drawing. At the same time, since the hidden watermark is added to the source code of the drawing, the added hidden watermark cannot be perceived in the drawing, and it is not necessary to deeply adapt the drawing editing software based on the file filtering driver, and the software performance is not affected. Therefore, it will not affect the normal use of the drawing.
[0065] In this embodiment, a second method for processing the watermark of the drawing is provided, which can be used in the client of the above-mentioned security management software. Figure 2 It is a schematic flowchart of the second method for processing the watermark of the drawing according to an embodiment of the present disclosure. As Figure 2 shown, the process includes the following steps:
[0066] Step S201: Obtain the watermark information, where the watermark information includes the watermark identifier and the traceability information.
[0067] In some optional embodiments, before the above step S201, the method for processing the watermark of the drawing of the present disclosure further includes: obtaining the closing time of the first drawing, and the watermark information further includes the closing time of the first drawing.
[0068] Further, the above step S201 includes: obtaining the watermark information, where the watermark information includes the watermark identifier and the traceability information; adding the closing time of the first drawing to the watermark information.
[0069] The method for processing the watermark of the drawing provided in this embodiment adds the closing time of the first drawing to the watermark information. Therefore, it is possible to confirm the creation time or modification time of the drawing to trace the modification history of the drawing.
[0070] Specifically, the above step S201 includes:
[0071] Step S2011: Receive the watermark configuration information sent by the server of the security management software. The watermark configuration information includes a watermark identifier and a traceability policy.
[0072] It should be noted that the traceability policy is used to confirm the traceability information to be written in the source code. For example, the user information of the modifier, the device information of the terminal device where the client is located, the copyright information of the drawing, etc. Among them, the server of the security management software can send the traceability policy in the form of a traceability information template.
[0073] Step S2012: Obtain the traceability information based on the traceability policy, and obtain the watermark information based on the watermark identifier and the traceability information.
[0074] Specifically, obtaining the traceability information based on the traceability policy and obtaining the watermark information based on the watermark identifier and the traceability information in step S2012 above include: in response to the closing event of the first drawing, obtaining the traceability information based on the traceability policy, and obtaining the watermark information based on the watermark identifier and the traceability information.
[0075] It should be noted that after the first drawing is closed, the modification information of the first drawing is obtained again. Therefore, the integrity and accuracy of the traceability information can be ensured. And it can avoid obtaining the traceability information frequently during the modification process to improve the data processing efficiency and avoid data conflicts.
[0076] Exemplarily, assuming that the server of the security management software sends the traceability policy in the form of a traceability information template, and the traceability information template is "{watermark identifier}-{user information of the modifier}-{device information of the terminal device}", then after obtaining the user information of the modifier and the device information of the terminal device where the client is located, the watermark identifier, the user information of the modifier, and the device information of the terminal device where the client is located can be written into the corresponding positions according to the traceability information template to obtain the watermark information.
[0077] Step S202: Obtain the source code of the first drawing. The source code is obtained by parsing the first drawing. For details, see step S102 above, and details will not be elaborated here.
[0078] Step S203: Obtain the watermark code based on the watermark information and the preset character. For details, see step S103 above, and details will not be elaborated here.
[0079] Step S204: Write the watermark code into the source code to obtain the target drawing with the watermark added. Among them, the preset character makes the watermark added to the first drawing a hidden watermark. For details, see step S104 above, and details will not be elaborated here.
[0080] In this embodiment, a third drawing processing method is provided, which can be used for the client of the above security management software. Figure 3It is a schematic flowchart of the third drawing processing method according to an embodiment of the present disclosure. As Figure 3 shown, the process includes the following steps:
[0081] Step S301, obtain watermark information, where the watermark information includes a watermark identifier and traceability information. See the above step S101 for details and will not be elaborated here.
[0082] Step S302, obtain the source code of the first drawing, and the source code is obtained by parsing the first drawing. See the above step S102 for details and will not be elaborated here.
[0083] Step S303, obtain a watermark code based on the watermark information and a preset character.
[0084] In some optional embodiments, the preset character includes a first preset character used to represent comments in the source code of the first drawing.
[0085] Specifically, the obtaining of the watermark code based on the watermark information and the preset character in the above step S303 includes:
[0086] Step S3031, determine the first preset character used to represent comments in the source code of the first drawing.
[0087] Exemplarily, assume that in the source code of the first drawing, the comment information in the source code is represented by the character "(**)", then "(**)" is used as the first preset character.
[0088] Step S3032, splice the watermark information and the first preset character to obtain a watermark code.
[0089] It should be noted that the splicing method of the watermark information and the first preset character depends on the comment requirements in the source code of the first drawing.
[0090] Step S304, write the watermark code into the source code to obtain a target drawing with a watermark added, where the preset character makes the watermark added to the first drawing a hidden watermark.
[0091] Specifically, the above step S304 includes:
[0092] Step S3041, determine the first blank code line in the source code.
[0093] Step S3042, write the watermark code into the first blank code line to obtain a target drawing.
[0094] Exemplarily, taking a CAD drawing as an example, assume that in the source code of the CAD drawing, the code lines starting with "#" are used to represent a symbol. If watermark codes are directly added after any code, it may cause compilation errors. Therefore, it is necessary to determine the first blank code line in the source code and then write the watermark code to avoid compilation errors.
[0095] Specifically, a new blank code line can be inserted between the code lines corresponding to any two symbols in the source code to obtain the first blank code line. Alternatively, any blank code line in the source code can be determined as the first blank code line.
[0096] The watermark processing method for the drawing provided in this embodiment obtains the watermark code based on the first preset character and the watermark information used to represent comments in the source code of the first drawing. And determine the first blank code line in the source code, and write the watermark code in the first blank code line. Therefore, it is possible to add a watermark to the first drawing in the form of a comment, thereby protecting the first drawing. At the same time, it is possible to avoid the added information from affecting the operation of the source code to ensure the normal use of the target drawing with the added watermark.
[0097] Exemplarily, taking the traceability information including the user information of the modifier and the device information of the terminal device where the client is located, the watermark identifier is "AAAAAA", the user information corresponding to the modifier is "123344", the device information corresponding to the client that modifies the drawing is "AS3E5F", and the first preset character is "(**)" as an example, then as Figure 4 shown, after splicing the watermark information with the first preset character, the obtained watermark code is "(*AAAAAA-123344-AS3E5F*)". Assume that the code corresponding to line 4235 in the source code is "#3773=<code 1>", the code corresponding to line 4236 is "#3774=<code 2>", and the code corresponding to line 4237 is "#3775=<code 3>". If the watermark code is to be inserted between the codes of line 4236 and line 4237, in order to avoid affecting the code of line 4236, at this time, a new line is started below the code of line 4236 as the first blank code line, and "(*AAAAAA-123344-AS3E5F*)" is written in the first blank code line. At this time, the original code of line 4237 becomes the code of line 4238, and the watermark addition is completed.
[0098] In this embodiment, a fourth watermark processing method for the drawing is provided, which can be used for the client of the above-mentioned security management software. Figure 5 It is a schematic flowchart of the fourth watermark processing method for the drawing according to the embodiment of the present disclosure. As Figure 5 shown, the process includes the following steps:
[0099] Step S501: Obtain watermark information, which includes a watermark identifier and traceability information. See the above Step S101 for details and will not be elaborated here.
[0100] Step S502: Obtain the source code of the first drawing, which is obtained by parsing the first drawing. See the above Step S102 for details and will not be elaborated here.
[0101] Step S503: Obtain a watermark code based on the watermark information and a preset character.
[0102] In some alternative embodiments, the preset character includes a second preset character used to represent an invisible symbol in the source code of the first drawing and a target symbol number, where the target symbol number is greater than the symbol number corresponding to the last code line in the source code.
[0103] Specifically, the above Step S503 includes:
[0104] Step S5031: Determine the second preset character used to represent an invisible symbol in the source code of the first drawing and the symbol number corresponding to the last code line in the source code.
[0105] Specifically, the invisible symbol can be a non-displayed pin symbol, a non-displayed circuit block symbol, a layer identifier of the drawing, an object identifier of a graphic primitive object, an attribute label of a graphic, a symbol with the same color as the drawing background, etc.
[0106] Step S5032: Determine the target symbol number based on the symbol number corresponding to the last code line in the source code, where the target symbol number is greater than the symbol number corresponding to the last code line in the source code.
[0107] In the source code of a CAD drawing, a symbol number is configured for each symbol of the drawing. For example, Figure 6 the 3780 shown in. Among them, 3780 means that the symbol corresponding to code 4 is the 3780th symbol in the drawing. When the drawing software edits the drawing, the symbol numbers will be incremented sequentially according to the order of symbol addition in the drawing. Therefore, when adding a watermark code in the form of an invisible symbol in the source code, the target symbol number can be determined by the symbol number corresponding to the last code line.
[0108] For example, when the symbol number corresponding to the last code line in the source code is 3781, 3782 can be used as the target symbol number.
[0109] Step S5033: Concatenate the target symbol number, the second preset character, and the watermark information to obtain the watermark code.
[0110] Specifically, the target symbol serial number can be placed at the head end and then sequentially spliced with the second preset character or the watermark information. The specific splicing method can be determined based on the programming language / compilation requirements of the source code of the first drawing.
[0111] Step S504, write the watermark code into the source code to obtain the target drawing with the watermark added. Among them, the preset character makes the watermark added to the first drawing a hidden watermark.
[0112] Specifically, the above step S504 includes:
[0113] Step S5041, determine the target writing position in the source code.
[0114] It should be noted that the target writing position can be between any two code lines of the source code or any blank code line of the source code.
[0115] Step S5042, if the target writing position is between two adjacent target code lines, insert a second blank code line between the two target code lines and write the watermark code in the second blank code line to obtain the target drawing.
[0116] It should be noted that the two adjacent target code lines belong to different drawing symbols. In order to avoid the original code compilation error, therefore, when writing the watermark code between the code lines of two adjacent drawing symbols, it is necessary to insert a blank code line between the two adjacent target code lines and then write the watermark code in the newly inserted blank code line.
[0117] Step S5043, if the target writing position is the third blank code line after the last code line of the source code, write the watermark code in the third blank code line to obtain the target drawing.
[0118] It should be noted that in the CAD drawing, in order to avoid the added watermark code affecting the writing of new code when the first drawing is edited next time, therefore, when adding a hidden watermark with an invisible symbol, the added content can be made far away from the original code in the data structure to avoid affecting the code obtained by the next edit when the drawing is edited next time.
[0119] The watermark processing method for the drawing provided in this embodiment obtains the watermark code based on the second preset character, the target symbol number, and the preset character used to represent the invisible symbol in the source code of the first drawing. The target symbol number is greater than the symbol number corresponding to the last code line in the source code. Then, when the target writing position of the watermark code is between two adjacent target code lines in the source code, a second blank code line is inserted between the two target code lines to write the watermark code. Alternatively, when the target writing position of the watermark code is the third blank code line after the last code line in the source code, the watermark code is written in the third blank code line, thereby obtaining the target drawing. Therefore, it is possible to add a hidden watermark to the first drawing in the form of an invisible symbol, thereby protecting the first drawing. At the same time, it is possible to avoid the added information affecting the operation of the source code to ensure the normal use of the target drawing.
[0120] Further, in order to leave enough space for writing new code during the next drawing editing, enough space can be left between the target writing position and the last line of the source code. The target writing position can be determined in the following way: determine the first position corresponding to the last line in the source code; based on the first position, determine the second position, and the code line where the second position is located is greater than the code line where the first position is located; use the second position as the target writing position.
[0121] Exemplarily, as Figure 6 shown, in the figure, 4243, 4244, and 6000 are the line numbers of the code lines, and 3780, 3781, and 3782 are the symbol numbers of the drawing symbols corresponding to the code lines. Assume that the symbol number corresponding to the last code line in the source code is 3781, and the target symbol number is determined to be 3782. After the second preset character is concatenated with the watermark information, it becomes "#<symbol number> <bbbb>", then the target symbol serial number and "#<symbol serial number> <bbbb>"Concatenate to obtain the watermark code as "#3782= <bbbb>”. Assume that the first position corresponding to the last line of the source code is line 4244 and the second position is line 6000. Then, write the watermark code at the position of line 6000, and the watermark addition is completed.
[0122] In this embodiment, a fifth method for watermark processing of drawings is provided, which can be used in the server or client of the above security management software to extract traceability information from the watermark of the protected drawing. Figure 7 It is a schematic flowchart of the fifth method for watermark processing of drawings according to an embodiment of the present disclosure, as Figure 7 shown. The process includes the following steps:
[0123] Step S701, obtain a target drawing.
[0124] Specifically, the target drawing here is a watermark-added drawing obtained by the method for watermark processing of drawings of the present disclosure.
[0125] Step S702, obtain the source code of the target drawing, and the source code is obtained by parsing the target drawing.
[0126] Specifically, the target drawing can be read as a text file through the DLP module of the client, and then the source code of the target drawing is matched through regular expressions and / or keywords to obtain the source code of the target drawing.
[0127] Step S703, identify the watermark identifier in the source code, and determine the watermark code in the target drawing. The watermark code is obtained based on a preset character, the watermark identifier, and the traceability information, and the preset character makes the watermark added to the target drawing a hidden watermark.
[0128] Exemplarily, as Figure 4 shown, assume that the watermark identifier is "AAAAAA", then "AAAAAA" can be searched for in the source code of the target drawing to obtain the watermark code.
[0129] Step S704, determine the traceability information based on the watermark code, the preset character, and the watermark identifier.
[0130] Exemplarily, assume that the watermark code is written in the form of a comment. By splicing the traceability information, the watermark identifier, and the first preset character used to represent the comment in the source code of the target drawing to obtain the watermark code, the traceability information can be extracted from the part of the watermark code other than the watermark identifier and the first preset character.
[0131] Alternatively, assume that the watermark code is written in the form of invisible symbols. By concatenating the traceability information, the watermark identifier, the second preset character used to represent the invisible symbol in the source code of the target drawing, and the target symbol number, the watermark code can be obtained. Then, the traceability information can be extracted from the part of the watermark code other than the watermark identifier, the target symbol number, and the second preset character.
[0132] The watermark processing method for drawings provided in this embodiment writes the corresponding traceability information in the source code of the target drawing in the form of a hidden watermark. Then, when it is necessary to trace the target drawing, the watermark identifier in the source code of the target drawing is recognized to determine the watermark code in the target drawing, and then the traceability information is extracted from the watermark code. Therefore, the drawing can be traced using the traceability information to protect the drawing. At the same time, since the watermark is added to the source code of the drawing, the added watermark cannot be perceived in the displayed drawing, and there is no need to deeply adapt the drawing editing software based on the file filter driver, so the software performance is not affected. Therefore, this drawing protection method will not affect the normal use of the drawing.
[0133] In some alternative embodiments, determining the traceability information based on the watermark code, the preset character, and the watermark identifier in step S704 includes: if the preset character includes the first preset character used to represent comments in the source code of the target drawing, then determining the traceability information based on the watermark code, the first preset character, and the watermark identifier.
[0134] Further, if the watermark code is obtained by concatenating the watermark information with the first preset character. Then, determining the traceability information based on the watermark code, the first preset character, and the watermark identifier includes: splitting the watermark code based on the watermark identifier and the first preset character to obtain the traceability information.
[0135] The watermark processing method for drawings provided in this embodiment writes the watermark code into the source code of the target drawing in the form of comments. Then, when it is necessary to trace the target drawing, the traceability information is obtained by the watermark code, the watermark identifier, and the first preset character used to represent comments. Therefore, it is possible to avoid the added information from affecting the operation of the source code to ensure the normal use of the drawing. And the tracing method is relatively simple, which can effectively improve the tracing efficiency while protecting the drawing.
[0136] In some alternative embodiments, determining the traceability information based on the watermark code, the preset character, and the watermark identifier in step S704 includes: if the preset character includes the second preset character used to represent invisible symbols and the target symbol number in the source code of the target drawing, then determining the traceability information based on the watermark code, the second preset character, the target symbol number, and the watermark identifier.
[0137] It should be noted that in the source code of the CAD drawing, a symbol serial number will be configured for each symbol of the drawing, and the symbol serial number will be added to the code corresponding to the symbol. The target symbol serial number is the symbol serial number of the invisible symbol corresponding to the watermark code.
[0138] Furthermore, if the watermark code is obtained by concatenating the target symbol serial number, the second preset character, and the watermark information. Then, based on the watermark code, the second preset character, the target symbol serial number, and the watermark identifier, the traceability information is determined, including: based on the watermark identifier, the target symbol serial number, and the second preset character, the watermark code is split to obtain the traceability information.
[0139] The watermark processing method for the drawing provided in this embodiment writes the watermark code into the source code of the target drawing in the form of an invisible symbol. Then, when it is necessary to trace the target drawing, the traceability information is extracted through the watermark code, the watermark identifier, the second preset character used to represent the invisible symbol, and the target symbol serial number. Therefore, it can avoid the added information from affecting the operation of the source code, thus ensuring the normal use of the drawing. And the traceability method is relatively simple, which can effectively improve the traceability efficiency while protecting the drawing.
[0140] As a specific application example, take the installation of security management software in the private network / special network of an enterprise as an example. Among them, the client of the security management software is deployed on the terminal devices inside the enterprise, and the server of the security management software is deployed on the enterprise management platform. The administrator can configure watermark configuration information on the server of the security management software. The watermark configuration information includes the watermark identifier and the traceability policy. The traceability policy includes information such as the user information of the modifier that needs to be written into the drawing and the device information of the terminal device where the client is located. The administrator can also configure the range of terminal devices and the range of users covered by the watermark configuration information on the server. The server distributes the watermark configuration information to the client of the security management software according to the range of terminal devices and the range of users. The Data Leakage Prevention (DLP) module of the client reads the traceability information of the protected drawing from the terminal device where the client is located based on the traceability policy sent by the server to obtain the watermark information. Then, the DLP module of the client further writes the watermark information into the source code of the protected drawing based on the watermark processing method of the drawing disclosed in this application, so as to protect the protected drawing.
[0141] When it is necessary to trace the protected drawings, the traceability information of the protected drawings can be obtained from the source code of the protected drawings through the watermark processing method of the drawings disclosed in this disclosure on the server or client of the security management software. For example, the user information of the modifier and the device information of the terminal device can be obtained to determine the creator of the protected drawings or the modifier who has modified the protected drawings.
[0142] In addition, in order to prevent the watermark code in the drawing source code from being deleted, the watermark protection function can be configured in the security management software to back up and cache the watermark code in the drawing source code. If any watermark code is detected to be deleted, the deleted watermark code will be restored after the drawing is closed.
[0143] It should be noted that in the related art, two protection methods are mainly used to protect CAD drawings: adding a watermark layer to the rasterized CAD drawings or encrypting and decrypting the drawings through a deeply adapted drawing protection software. As shown in Table 1, for the first drawing protection method of adding a watermark layer to the rasterized CAD drawings, although the watermark covers the rasterized CAD drawings and is thus not affected by the use platform and CAD software. However, the first protection method has the following deficiencies: First, since the rasterized CAD drawing formats and types of each CAD software are different, the applicable range of the drawings is small. Second, the watermark layer will affect the use of the drawings. Third, it takes a long time to add a watermark layer to the rasterized CAD drawings, so the watermark writing efficiency is low. Fourth, it takes a long time to parse the rasterized CAD drawings, so the watermark extraction efficiency is low.
[0144] For the second drawing protection method of encrypting and decrypting the drawings through a deeply adapted drawing protection software, although the drawing security is high. However, the second protection method still has the following deficiencies: First, since it is necessary to adapt to the CAD software and the drawing formats of different software are different, the applicable range of the drawings is small. Second, since the drawing protection software needs to be integrated with the CAD software, it may affect the use performance of the CAD software, thus affecting the normal use of the drawings. Third, each CAD software needs to be adapted separately. Since the CAD formats of each CAD software are not universal, the compatibility of the use platform and CAD software is poor. Fourth, since a large amount of calculation is required during the encryption and decryption process, the watermark writing efficiency is low. Fifth, since a large amount of calculation is required during the encryption and decryption process of the drawings, the watermark extraction efficiency is low.
[0145] Compared with the above two drawing protection methods, the watermark processing method for drawings in the present disclosure has the following advantages: First, watermarks are added through the source code, so it is applicable to different CAD vector drawings, and the applicable range of drawings is relatively wide. Second, dark watermarks are added through the source code, which cannot be perceived from the displayed drawings, thus having no impact on the use of the drawings. Third, since the watermarks are added to the source code of the drawings, they are not affected by the usage platform or CAD software. Fourth, the watermark writing method is simple and the speed is relatively fast. Fifth, the watermark extraction method is simple and the watermark extraction speed is relatively fast.
[0146] Table 1 Comparison results of the effects of different drawing protection methods
[0147]
[0148] It should be noted that the watermark processing method for drawings in the present disclosure can directly write watermarks in the form of comments or invisible symbols in the source code of CAD vector drawings, so as to accurately trace the source through the watermark code in the source code after the drawings are leaked, so as to effectively protect the drawings. At the same time, since the watermarks added to the source code cannot be perceived by users on the displayed drawings, the user experience of the drawing files can be guaranteed. Moreover, adding watermarks in the form of comments or invisible symbols in the source code of the drawings has a relatively simple implementation solution, and the watermark writing speed and watermark extraction speed are relatively fast, so the leakage of the drawings can be protected more timely.
[0149] In this embodiment, a watermark processing device for drawings is further provided. This device is used to implement the above-mentioned embodiments and preferred implementation manners, and those that have been described will not be repeated. As used below, the term "module" can be a combination of software and / or hardware that can achieve a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, implementation in hardware, or a combination of software and hardware is also possible and contemplated.
[0150] This embodiment provides a watermark processing device for drawings, as Figure 8 shown, this device includes:
[0151] A watermark information acquisition module 801, configured to acquire watermark information, where the watermark information includes a watermark identifier and traceability information;
[0152] An original code acquisition module 802, configured to acquire the source code of the first drawing, where the source code is obtained by parsing the first drawing;
[0153] A watermark code generation module 803, configured to obtain a watermark code based on the watermark information and a preset character;
[0154] A watermark code writing module 804 for writing a watermark code into the source code to obtain a target drawing with a watermark added, wherein a preset character makes the watermark added to the first drawing a hidden watermark.
[0155] In some alternative embodiments, the watermark processing device for drawings of the present disclosure further includes:
[0156] A closing time acquisition module for acquiring the closing time of the first drawing, and the watermark information further includes the closing time of the first drawing.
[0157] In some alternative embodiments, the watermark information acquisition module 801 includes:
[0158] A configuration information acquisition unit for receiving watermark configuration information sent by the server of the security management software, where the watermark configuration information includes a watermark identifier and a traceability policy;
[0159] A traceability information acquisition unit for acquiring traceability information based on the traceability policy, and obtaining watermark information based on the watermark identifier and the traceability information.
[0160] In some alternative embodiments, the traceability information acquisition unit includes:
[0161] A traceability information acquisition subunit for, in response to a closing event of the first drawing, acquiring traceability information based on the traceability policy, and obtaining watermark information based on the watermark identifier and the traceability information.
[0162] In some alternative embodiments, the preset character in the watermark code generation module 803 includes a first preset character used to represent a comment in the source code of the first drawing.
[0163] In some alternative embodiments, the watermark code writing module 804 includes:
[0164] A blank line determination unit for determining a first blank code line in the source code;
[0165] A first watermark writing unit for writing a watermark code in the first blank code line to obtain a target drawing.
[0166] In some alternative embodiments, the preset character in the watermark code generation module 803 includes a second preset character used to represent an invisible symbol in the source code of the first drawing and a target symbol serial number, and the target symbol serial number is greater than the symbol serial number corresponding to the last code line in the source code.
[0167] In some alternative embodiments, the watermark code writing module 804 further includes:
[0168] A writing position determination unit for determining a target writing position in the source code;
[0169] A second watermark writing unit, configured to insert a second blank code line between two target code lines if the target writing position is between two adjacent target code lines, and write watermark code in the second blank code line to obtain a target drawing;
[0170] A third watermark writing unit, configured to write watermark code in a third blank code line if the target writing position is the third blank code line after the last code line of the source code, to obtain a target drawing.
[0171] It should be noted that for the effects or functions that can be achieved by the watermark processing device for drawings of the present disclosure, reference may be made to the descriptions of the corresponding embodiments above, and details are not described herein again.
[0172] The further function descriptions of the above-mentioned various modules and units are the same as those of the corresponding embodiments above, and details are not described herein again.
[0173] The watermark processing device for drawings in this embodiment is presented in the form of functional units. Here, the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and a memory that execute one or more software or fixed programs, and / or other devices that can provide the above functions.
[0174] In this embodiment, another watermark processing device for drawings is further provided. This device is used to implement the above-mentioned embodiments and preferred implementation manners, and those that have been described will not be repeated. As used hereinafter, the term "module" may be a combination of software and / or hardware that can achieve a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, implementation in hardware, or a combination of software and hardware is also possible and contemplated.
[0175] This embodiment provides another watermark processing device for drawings, as Figure 9 shown. This device includes:
[0176] A watermark drawing acquisition module 901, configured to acquire a target drawing;
[0177] A target code acquisition module 902, configured to acquire the source code of the target drawing, where the source code is obtained by parsing the target drawing;
[0178] A watermark code recognition module 903, configured to recognize watermark identifiers in the source code to determine the watermark code in the target drawing, where the watermark code is obtained based on a preset character, a watermark identifier, and traceability information, and the preset character makes the watermark added to the target drawing a hidden watermark;
[0179] The watermark information extraction module 904 is configured to determine the traceability information based on the watermark code, the preset character, and the watermark identifier.
[0180] In some alternative embodiments, the watermark information extraction module 904 includes:
[0181] The first information extraction unit is configured to, if the preset character includes a first preset character used to represent a comment in the source code of the target drawing, determine the traceability information based on the watermark code, the first preset character, and the watermark identifier.
[0182] In some alternative embodiments, the watermark information extraction module 904 includes:
[0183] The second information extraction unit is configured to, if the preset character includes a second preset character used to represent an invisible symbol and the target symbol number in the source code of the target drawing, determine the traceability information based on the watermark code, the second preset character, the target symbol number, and the watermark identifier.
[0184] It should be noted that for the effects or functions that can be achieved by the watermark processing device for the drawings of the present disclosure, reference may be made to the descriptions of the corresponding embodiments above, and details are not described herein again.
[0185] The further function descriptions of the above-mentioned various modules and units are the same as those in the corresponding embodiments above, and details are not described herein again.
[0186] The watermark processing device for the drawings in this embodiment is presented in the form of functional units. Here, the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and a memory that execute one or more software or fixed programs, and / or other devices that can provide the above functions.
[0187] The embodiments of the present disclosure further provide a computer device having the above Figure 8 and / or Figure 9 shown watermark processing device for the drawings.
[0188] Please refer to Figure 10 , Figure 10 which is a structural block diagram of a computer device provided by an alternative embodiment of the present disclosure. As shown in Figure 10 As shown, the computer device includes: one or more processors 1001, a memory 1002, and interfaces for connecting the components, including a high-speed interface and a low-speed interface. Each component communicates with each other using different buses and can be installed on a common motherboard or installed in other ways as needed. The processor can process instructions executed within the computer device, including instructions stored in the memory or on the memory to display graphical information of the GUI on an external input / output device (such as a display device coupled to the interface). In some alternative embodiments, if needed, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (such as an array of servers, a set of blade servers, or a multi-processor system). Figure 10 In the figure, a processor 1001 is taken as an example.
[0189] The processor 1001 can be a central processing unit, a network processor, or a combination thereof. Among them, the processor 1001 can further include a hardware chip. The above-mentioned hardware chip can be an application-specific integrated circuit, a programmable logic device, or a combination thereof. The above-mentioned programmable logic device can be a complex programmable logic device, a field programmable gate array, a generic array logic, or any combination thereof.
[0190] Among them, the memory 1002 stores instructions executable by at least one processor 1001, so that at least one processor 1001 executes the method shown in the above embodiments.
[0191] The memory 1002 can include a program storage area and a data storage area. Among them, the program storage area can store an operating system and application programs required for at least one function; the data storage area can store data created according to the use of the computer device, etc. In addition, the memory 1002 can include a high-speed random access memory, and can also include a non-transitory memory, such as at least one disk storage device, a flash memory device, or other non-transitory solid-state storage devices. In some alternative embodiments, the memory 1002 can optionally include a memory remotely set relative to the processor 1001, and these remote memories can be connected to the computer device through a network. Examples of the above-mentioned network include but are not limited to the Internet, an enterprise intranet, a local area network, a mobile communication network, and a combination thereof.
[0192] The memory 1002 can include a volatile memory, such as a random access memory; the memory can also include a non-volatile memory, such as a flash memory, a hard disk, or a solid-state drive; the memory 1002 can also include a combination of the above types of memories.
[0193] The computer device further includes an input device 1003 and an output device 1004. The processor 1001, the memory 1002, the input device 1003, and the output device 1004 may be connected through a bus or other means. Figure 10 Take the connection through the bus as an example.
[0194] The input device 1003 can receive input digital or character information, and generate key signal inputs related to the user settings and function controls of the computer device, such as a touch screen, a keypad, a mouse, a trackpad, a touchpad, a pointing stick, one or more mouse buttons, a trackball, a joystick, etc. The output device 1004 may include a display device, an auxiliary lighting device (e.g., an LED), and a haptic feedback device (e.g., a vibration motor), etc. The above display device includes but is not limited to a liquid crystal display, a light emitting diode, a display, and a plasma display. In some alternative embodiments, the display device may be a touch screen.
[0195] The embodiments of the present disclosure also provide a computer-readable storage medium. The methods according to the embodiments of the present disclosure can be implemented in hardware, firmware, or be implemented as computer code that can be recorded on a storage medium, or be implemented as computer code that is originally stored in a remote storage medium or a non-transitory machine-readable storage medium and downloaded through a network and will be stored in a local storage medium, so that the methods described herein can be stored as such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only memory, a random access memory, a flash memory, a hard disk, or a solid-state drive, etc.; further, the storage medium may also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code, and when the software or computer code is accessed and executed by the computer, the processor, or the hardware, the methods shown in the above embodiments are implemented.
[0196] A part of the present disclosure can be applied as a computer program product, such as computer program instructions, which when executed by a computer, can call or provide the methods and / or technical solutions according to the present disclosure through the operation of the computer. Those skilled in the art should be able to understand that the forms in which computer program instructions exist in a computer-readable medium include but are not limited to source files, executable files, installation package files, etc. Correspondingly, the ways in which computer program instructions are executed by a computer include but are not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium can be any available computer-readable storage medium or communication medium accessible by the computer.
[0197] Although embodiments of the present disclosure have been described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of the present disclosure, and such modifications and variations all fall within the scope defined by the appended claims.< / bbbb> < / bbbb> < / bbbb>
Claims
1. A method for processing watermarks of drawings, characterized in that: The method comprises: Acquire watermark information, wherein the watermark information includes a watermark identifier and traceability information; Obtaining a source code of a first drawing, wherein the source code is obtained by parsing the first drawing; Based on the watermark information and preset characters, a watermark code is obtained, wherein the preset characters include a second preset character used to represent an invisible symbol in the source code of the first drawing and a target symbol sequence number, and the target symbol sequence number is greater than the symbol sequence number corresponding to the last code line in the source code; The watermark code is written into the source code to obtain a target drawing with a watermark, wherein the preset characters make the watermark added in the first drawing a dark watermark.
2. The method according to claim 1, characterized in that The preset characters include first preset characters used to represent comments in the source code of the first drawing.
3. The method according to claim 2, characterized in that Writing the watermark code into the source code to obtain a target drawing with a watermark includes: Determining a first blank code line in the source code; The watermark code is written into the first blank code line to obtain the target drawing.
4. The method according to claim 1, characterized in that: Writing the watermark code into the source code to obtain a target drawing with a watermark includes: determining a target write location in the source code; If the target writing position is located between two adjacent target code lines, insert a second blank code line between the two target code lines, and write the watermark code in the second blank code line to obtain the target drawing; If the target writing position is located at the third blank code line after the last code line of the source code, the watermark code is written in the third blank code line to obtain the target drawing.
5. The method according to claim 1, characterized in that The method further includes: acquiring the closing time of the first drawing, and the watermark information further includes the closing time of the first drawing.
6. The method according to claim 1, characterized in that The obtaining of watermark information comprises: Receive watermark configuration information sent by the server of the security management software, wherein the watermark configuration information includes a watermark identifier and a traceability strategy; The traceability information is acquired based on the traceability strategy, and the watermark information is obtained based on the watermark identifier and the traceability information.
7. The method according to claim 6, characterized in that The acquiring the traceability information based on the traceability strategy, and obtaining the watermark information based on the watermark identifier and the traceability information, includes: In response to a closing event of the first drawing, the traceability information is acquired based on the traceability strategy, and the watermark information is obtained based on the watermark identifier and the traceability information.
8. A method for processing watermarks of drawings, characterized in that: The method comprises: Get the target blueprint; Obtaining a source code of the target drawing, wherein the source code is obtained by parsing the target drawing; Identify the watermark identifier in the source code to determine the watermark code in the target drawing, wherein the watermark code is obtained based on preset characters, the watermark identifier and traceability information, and the preset characters make the watermark added to the target drawing a dark watermark; Determining the traceability information based on the watermark code, the preset character and the watermark identifier; The step of determining the traceability information based on the watermark code, the preset character, and the watermark identifier includes: If the preset characters include a second preset character used to represent an invisible symbol in the source code of the target drawing and a target symbol serial number, the traceability information is determined based on the watermark code, the second preset character, the target symbol serial number and the watermark identifier.
9. The method according to claim 8, characterized in that The determining the traceability information based on the watermark code, the preset character and the watermark identifier includes: If the preset characters include a first preset character used to represent a comment in the source code of the target drawing, the traceability information is determined based on the watermark code, the first preset character and the watermark identifier.
10. A drawing watermark processing device, characterized in that: The device comprises: A watermark information acquisition module, used to acquire watermark information, wherein the watermark information includes a watermark identifier and traceability information; An original code acquisition module, used to acquire the source code of the first drawing, wherein the source code is obtained by parsing the first drawing; a watermark code generating module, configured to obtain a watermark code based on the watermark information and preset characters, wherein the preset characters include a second preset character used to represent an invisible symbol in the source code of the first drawing and a target symbol sequence number, wherein the target symbol sequence number is greater than the symbol sequence number corresponding to the last code line in the source code; The watermark code writing module is used to write the watermark code into the source code to obtain a target drawing with a watermark, wherein the preset characters make the watermark added in the first drawing a dark watermark.
11. A drawing watermark processing device, characterized in that: The device comprises: A watermark drawing acquisition module is used to acquire the target drawing; A target code acquisition module, used to acquire the source code of the target drawing, wherein the source code is obtained by parsing the target drawing; A watermark code recognition module, used to recognize the watermark identifier in the source code and determine the watermark code in the target drawing, wherein the watermark code is obtained based on preset characters, the watermark identifier and traceability information, and the preset characters make the watermark added to the target drawing a dark watermark; A watermark information extraction module, used to determine the traceability information based on the watermark code, the preset character and the watermark identifier; Wherein, the watermark information extraction module includes: The second information extraction unit is used to determine the traceability information based on the watermark code, the second preset character, the target symbol serial number and the watermark identifier if the preset character includes a second preset character for representing an invisible symbol in the source code of the target drawing and a target symbol serial number.
12. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the watermark processing method for a drawing according to any one of claims 1 to 7 and / or the watermark processing method for a drawing according to any one of claims 8 to 9 by executing the computer instructions.
13. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the watermark processing method for a drawing according to any one of claims 1 to 7, and / or to execute the watermark processing method for a drawing according to any one of claims 8 to 9.
14. A computer program product, characterized in that The method comprises computer instructions, wherein the computer instructions are used to cause a computer to execute the watermark processing method for a drawing according to any one of claims 1 to 7, and / or execute the watermark processing method for a drawing according to any one of claims 8 to 9.
Citation Information
Patent Citations
Document watermark addition method and apparatus
CN107545157A
Watermark adding method and device, watermark application method and device, equipment and storage medium
CN117009931A