Checking method of layout file and checking device of layout file

By extracting information and calculating similarity of the processing areas and non-processing areas of the layout file, the problem of inaccurate verification of the layout file is solved, and fine-grained content protection and accurate verification between different formats are achieved.

CN119004548AActive Publication Date: 2024-11-22中国邮政储蓄银行股份有限公司
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411169288.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-23
Publication Date
2024-11-22
Estimated Expiration
2044-08-23

AI Technical Summary

Technical Problem

The prior art cannot perform fine-grained control of layout files, and cannot achieve protection verification of some content, and the verification of layout files between different formats is inaccurate.

Method used

By obtaining the processing area and the non-processing area of ​​the layout file, processing is performed separately to extract relevant information, and calculating the similarity of the processed file. If the similarity is greater than the threshold, the verification is passed.

Benefits of technology

It realizes the content verification between different formats of the layout file, solves the problem of inaccurate verification results, and ensures the accuracy of the file content.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119004548A_ABST
    Figure CN119004548A_ABST
Patent Text Reader

Abstract

The invention provides a layout file verification method and device, and the method comprises the steps: obtaining an initial layout file, carrying out the first processing of a processing region of the initial layout file, obtaining a first processing file, and enabling the first processing to be task processing corresponding to a current node; second processing is carried out on the initial layout file to obtain first target information, second processing is carried out on the first processing file to obtain second target information, and the second processing is to extract related information of a non-processing area of the initial layout file or extract related information of a non-processing area of the first processing file to obtain second target information; the related information comprises at least one of image information and text information; and calculating the similarity between the first target information and the second target information, and when the similarity is greater than or equal to a similarity threshold, determining that the verification result is passed. According to the method, the technical problem of inaccurate layout file verification result in the prior art is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of file verification, and in particular, to a verification method for a layout file, a verification device for a layout file, a computer-readable storage medium, and an electronic device. Background Art

[0002] As a carrier of information in various business scenarios, layout files go through multiple circulation nodes in their entire life cycle, from file creation at the start of a business process to document sealing at the end of a business process. In each node, content may be added or deleted in the layout file, including printing, scanning, signature and other processing.

[0003] At present, the anti-tampering protection for layout files has the following shortcomings and problems: First, the layout file can only perform anti-tampering protection on the entire document, and it is impossible to perform fine-grained control on the layout file and implement partial content protection verification. Second, the layout file is printed, processed, and re-scanned before and after the process node, and the layout file is converted from text format to scanned image format. The two different content presentation formats cannot be directly used for content protection verification. Therefore, there is an urgent need for a layout file verification method that can solve the above problems. Summary of the invention

[0004] The main purpose of the present application is to provide a verification method for a layout file, a verification device for a layout file, a computer-readable storage medium and an electronic device, so as to at least solve the problem of inaccurate verification results of layout files in the prior art.

[0005] According to one aspect of the present application, a verification method for a layout file is provided, which is applied to a current node in a node control process, wherein the node control process includes a plurality of sequentially connected task nodes, wherein the task node is used to execute corresponding task processing, and the current node is any one of the plurality of task nodes, and the method includes: obtaining an initial layout file, and performing a first processing on a processing area of ​​the initial layout file to obtain a first processing file, wherein the first processing is the task processing corresponding to the current node, the initial layout file includes the processing area and the non-processing area, and the processing area and the non-processing area do not overlap, and the task processing includes editing processing, printing processing, and signing processing. At least one of processing and scanning processing; performing a second processing on the initial layout file to obtain first target information, and performing the second processing on the first processed file to obtain second target information, wherein the second processing is to extract relevant information of a non-processed area of ​​the initial layout file or to extract relevant information of a non-processed area of ​​the first processed file, and the relevant information includes at least one of image information and text information; calculating the similarity between the first target information and the second target information, and determining that the verification result is a passed verification when the similarity is greater than or equal to a similarity threshold; and determining that the verification result is a failed verification when the similarity is less than the similarity threshold.

[0006] Optionally, obtaining the initial layout file includes: determining whether the current node is the first task node among the multiple task nodes; if the current node is not the first task node, receiving the layout file sent by the previous node to obtain the initial layout file.

[0007] Optionally, a second processing is performed on a predetermined file to obtain target information of the predetermined file, wherein the predetermined file is the initial layout file or the first processed file. When the predetermined file is the initial layout file, the target information of the predetermined file is the first target information, and when the predetermined file is the first processed file, the target information of the predetermined file is the second target information, including: obtaining a content representation form of the predetermined file, wherein the content representation form includes a text form and a picture form; performing a third processing on the predetermined file according to the content representation form to obtain a second processed file; obtaining domain distribution information of the second processed file and regional text distribution information of the second processed file, and performing compression representation processing on the domain distribution information and the regional text distribution information to obtain the target information of the predetermined file.

[0008] Optionally, the second processing file includes a first sub-processing file and a second sub-processing file, and the predetermined file is subjected to a third processing according to the content representation form to obtain a second processing file, including: when the content representation form is the picture form, the predetermined file is subjected to image processing to obtain an image processing file, wherein the image processing includes at least one of distortion processing, tilt processing and affine transformation processing; the image processing file is subjected to optical character recognition processing to obtain the first sub-processing file; when the content representation form is the text form, the predetermined file is subjected to text processing to obtain the second sub-processing file, wherein the text processing includes rendering processing.

[0009] Optionally, obtaining the domain distribution information of the second processed file includes: dividing the second processed file to obtain a plurality of text domains; and obtaining coordinate information of each of the text domains to obtain the domain distribution information.

[0010] Optionally, the regional text distribution information includes first information and second information, and obtaining the regional text distribution information of the second processed file includes: dividing the text domain to obtain multiple characters; obtaining coordinate information corresponding to each of the characters to obtain the first information; obtaining multi-dimensional vector representation information corresponding to each of the characters to obtain the second information.

[0011] Optionally, after determining that the verification result is a passed verification, the method further includes: sending the first processed file to a node next to the current node.

[0012] According to another aspect of the present application, a verification device for a layout file is provided, which is applied to a current node in a node control process, wherein the node control process includes a plurality of task nodes connected in sequence, wherein the task node is used to execute corresponding task processing, and the current node is any one of the plurality of task nodes, and the device includes: a first processing unit, which is used to obtain an initial layout file, and perform a first processing on a processing area of ​​the initial layout file to obtain a first processing file, wherein the first processing is the task processing corresponding to the current node, the initial layout file includes the processing area and the non-processing area, and the processing area and the non-processing area do not overlap, and the task processing includes editing processing, printing processing, signing processing, and scanning processing. at least one of the processes; a second processing unit, used to perform a second processing on the initial layout file to obtain first target information, and perform the second processing on the first processed file to obtain second target information, wherein the second processing is to extract relevant information of a non-processed area of ​​the initial layout file or to extract relevant information of a non-processed area of ​​the first processed file, and the relevant information includes at least one of image information and text information; a calculation unit, used to calculate the similarity between the first target information and the second target information, and when the similarity is greater than or equal to a similarity threshold, determine that the verification result is a passed verification; a determination unit, used to determine that the verification result is a failed verification when the similarity is less than the similarity threshold.

[0013] According to another aspect of the present application, a computer-readable storage medium is provided, wherein the computer-readable storage medium includes a stored program, wherein when the program is executed, the device where the computer-readable storage medium is located is controlled to execute any one of the methods described.

[0014] According to another aspect of the present application, an electronic device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to execute any one of the methods described through the computer program.

[0015] Applying the technical solution of the present application, first, obtain the initial layout file, and perform the first processing on the processing area of ​​the initial layout file to obtain the first processing file, the first processing is the task processing corresponding to the current node; then perform the second processing on the initial layout file to obtain the first target information, and perform the second processing on the first processing file to obtain the second target information, the second processing is to extract the relevant information of the non-processing area of ​​the initial layout file or extract the relevant information of the non-processing area of ​​the first processing file, the relevant information includes at least one of image information and text information; finally, calculate the similarity of the first target information and the second target information, and determine that the verification result is passed when the similarity is greater than or equal to the similarity threshold. In the above method, the influence of the change of the information storage format of the layout file caused by the process processing is taken into account, and the first target information and the second target information including image information and text information are obtained by performing the second processing on the initial layout file and the first processing file respectively to realize information extraction, and then calculate the similarity of the first target information and the second target information, so as to realize the mutual verification of the content of the text format and the picture format layout file, and solve the technical problem of inaccurate verification results of the layout file in the prior art. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] The drawings constituting part of the present application are used to provide a further understanding of the present application. The exemplary embodiments and descriptions of the present application are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0017] Figure 1 A hardware structure block diagram of a mobile terminal for executing a verification method for a layout file provided in an embodiment of the present application is shown;

[0018] Figure 2 A schematic diagram of a flow chart of a format file verification method provided according to an embodiment of the present application is shown;

[0019] Figure 3 A schematic diagram of a process flow of a method for verifying a layout file in a node control process provided in an embodiment of the present application is shown;

[0020] Figure 4 A schematic flow chart of a method for performing a second process on a first process file provided in an embodiment of the present application is shown;

[0021] Figure 5 A specific flow chart of a format file verification method provided according to an embodiment of the present application is shown;

[0022] Figure 6 A structural block diagram of a format file verification device provided according to an embodiment of the present application is shown.

[0023] The above drawings include the following reference numerals:

[0024] 102, processor; 104, memory; 106, transmission device; 108, input and output devices. DETAILED DESCRIPTION

[0025] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0026] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.

[0027] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present application described here. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0028] For the convenience of description, some nouns or terms involved in the embodiments of the present application are explained below:

[0029] Layout file: As a way of expressing documents, layout files have the characteristic that the display effect of their contents will not change with the changes of the devices on different devices. The text style, tables, pictures, paragraph layout, headers and footers in the document are fixed when the layout file is generated, and only some comments, signatures and other information can be added to it later. The non-editable nature of layout files can ensure a high degree of consistency in different software, operating systems and other environments. The current mainstream layout file formats are PDF and OFD, among which PDF format is more widely used.

[0030] Layout file text domain: the aggregation area of ​​discrete information elements in the layout file; it performs typeset rendering on content information, and its display format does not change with the processing device; in the layout file, the information is saved as basic elements (characters, lines, pictures, etc.), and the main information of each element is display coordinates, format, and information; therefore, for paragraph information in the file rendering page, its storage format is a cluster of discrete text, and this cluster area is the text domain of the layout file.

[0031] As introduced in the background technology, the verification result of the layout file in the prior art is inaccurate. To solve the above problem, the embodiments of the present application provide a layout file verification method, a layout file verification device, a computer-readable storage medium and an electronic device.

[0032] The technical solutions in the embodiments of the present invention will be described clearly and completely below in conjunction with the accompanying drawings in the embodiments of the present invention.

[0033] The method embodiments provided in the embodiments of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Taking running on a mobile terminal as an example, Figure 1 FIG. 1 is a hardware structure block diagram of a mobile terminal for a format file verification method according to an embodiment of the present invention. Figure 1 As shown, the mobile terminal may include one or more ( Figure 1 Only one is shown in the figure) a processor 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data, wherein the mobile terminal may also include a transmission device 106 and an input / output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is for illustration only and does not limit the structure of the mobile terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations shown.

[0034] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the verification method of the format file in the embodiment of the present invention. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, the above method is implemented. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories can be connected to the mobile terminal via a network. Examples of the above-mentioned network include but are not limited to the Internet, an intranet, a local area network, a mobile communication network and a combination thereof. The transmission device 106 is used to receive or send data via a network. The above-mentioned specific example of the network may include a wireless network provided by a communication provider of the mobile terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 may be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0035] In this embodiment, a method for verifying a layout file running on a mobile terminal, a computer terminal or a similar computing device 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 a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0036] Figure 2 1 is a flow chart of a method for verifying a format file according to an embodiment of the present application. Figure 2 As shown, the method is applied to the current node in the node control process, the node control process includes a plurality of task nodes connected in sequence, the task nodes are used to perform corresponding task processing, the current node is any one of the plurality of task nodes, and the method includes the following steps:

[0037] Step S201, obtaining an initial layout file, and performing a first process on a processing area of ​​the initial layout file to obtain a first processing file, wherein the first process is a task process corresponding to the current node, the initial layout file includes the processing area and the non-processing area, and the processing area and the non-processing area do not overlap, and the task process includes at least one of an editing process, a printing process, a signing process, and a scanning process;

[0038] Specifically, the above-mentioned task processing can be editing of paragraphs and contents in a specific area, signature and seal in a specific area, etc. The above-mentioned first processed file obtained after the first processing is actually also a layout file.

[0039] Step S202, performing a second process on the initial layout file to obtain first target information, and performing the second process on the first processed file to obtain second target information, wherein the second process is to extract relevant information of a non-processed area of ​​the initial layout file or to extract relevant information of a non-processed area of ​​the first processed file, and the relevant information includes at least one of image information and text information;

[0040] Specifically, the first target information and the second target information are obtained by merely extracting relevant information of the non-processing area.

[0041] Step S203, calculating the similarity between the first target information and the second target information, and when the similarity is greater than or equal to a similarity threshold, determining that the verification result is verification passed;

[0042] Specifically, the above-mentioned calculation of the similarity between the first target information and the second target information can adopt the cosine similarity calculation method, TF-IDF model, Jaccard similarity coefficient, edit distance, Pearson correlation coefficient and the like; cosine similarity is a widely used text similarity calculation method, which measures the similarity of two vectors by calculating the cosine value of the angle between them. The value of cosine similarity is between 0 and 1, and the closer the value is to 1, the more similar they are. TF-IDF (Term Frequency-Inverse Document Frequency) is a commonly used weighting technique for information retrieval and text mining. It is a statistical method for evaluating the importance of a word to a document set or one of the documents in a corpus. The Jaccard similarity coefficient is used to compare the similarity and difference between finite sample sets, and the similarity is determined by calculating the ratio of the intersection and union of two samples. The larger its value, the higher the sample similarity. Edit distance measures the difference between two strings by calculating the minimum number of single-character editing (insertion, deletion or replacement) operations required to convert one string into another. Pearson correlation coefficient: It is used to measure the linear correlation between two variables, and its value ranges from -1 to 1.

[0043] Step S204: when the similarity is less than the similarity threshold, determine that the verification result is verification failure.

[0044] Specifically, if the verification result is a verification failure, it indicates that in the above-mentioned first processing process, in addition to changing the content in the processing area, the content in the non-processing area is also affected, resulting in changes in the content in the non-processing area.

[0045] Through this embodiment, a verification method for a layout file is provided. First, an initial layout file is obtained, and a first processing is performed on a processing area of ​​the initial layout file to obtain a first processing file, and the first processing is the task processing corresponding to the current node; then the initial layout file is second processed to obtain first target information, and the first processing file is second processed to obtain second target information, and the second processing is to extract relevant information of a non-processing area of ​​the initial layout file or extract relevant information of a non-processing area of ​​the first processing file, and the relevant information includes at least one of image information and text information; finally, the similarity of the first target information and the second target information is calculated, and when the similarity is greater than or equal to a similarity threshold, the verification result is determined to be a verification pass. In the above method, the influence of the change of the information storage format of the layout file caused by the process processing is taken into account. By performing the second processing on the initial layout file and the first processing file respectively to realize information extraction, the first target information and the second target information including image information and text information are obtained, and then the similarity of the first target information and the second target information is calculated, so that the content of the text format and the picture format layout file can be mutually verified, and the technical problem of inaccurate verification results of the layout file in the prior art is solved.

[0046] In the specific implementation process, the above step S201 can be implemented by the following steps: step S2011, determining whether the current node is the first task node among the multiple task nodes; step S2012, when the current node is not the first task node, receiving the layout file sent by the previous node to obtain the initial layout file. This method can further quickly obtain the above initial layout file.

[0047] Specifically, when the current node is not the first task node, taking the current node as the Sth node as an example, the initial layout file of the S node is obtained by obtaining the file output by the previous node, that is, the S-1 node. When the current node is the first task node, the input layout file can be directly used as the above initial layout file.

[0048] In order to further improve the generalization ability of the above target information, the above step S202 of the present application can be implemented by the following steps: step S2021, obtaining the content representation form of the predetermined file, wherein the content representation form includes text form and image form; step S2022, performing a third process on the predetermined file according to the content representation form to obtain a second processed file; step S2023, obtaining the domain distribution information of the second processed file and the regional text distribution information of the second processed file, and performing compression representation processing on the domain distribution information and the regional text distribution information to obtain the target information of the predetermined file. This method can further improve the generalization ability of the above target information through compression representation processing.

[0049] Specifically, compressed representation refers to the use of specific algorithms or models in the field of machine learning and artificial intelligence to convert raw data into a more compact and efficient data representation. This conversion can not only reduce the storage space of data and increase processing speed, but also help algorithms better understand and process data, especially in feature learning, data compression, and generative models.

[0050] The second processed file includes a first sub-processed file and a second sub-processed file. The above step S2022 can also be implemented in other ways, for example: step S20221, when the content representation form is the picture form, image processing is performed on the predetermined file to obtain an image processing file, wherein the image processing includes at least one of distortion processing, tilt processing and affine transformation processing; step S20222, optical character recognition processing is performed on the image processing file to obtain the first sub-processed file; step S20223, when the content representation form is the text form, text processing is performed on the predetermined file to obtain the second sub-processed file, wherein the text processing includes rendering processing. The method performs corresponding processing on the picture form and the text form of the predetermined file, and further quickly obtains the second processed file.

[0051] Specifically, performing image processing on the predetermined file can help correct geometric distortion in the image, improve image quality, or achieve specific visual effects, thereby further improving the accuracy of optical character recognition processing. In image processing, this distortion can be corrected by an inverse transformation method. For example, using the function in the OpenCV library, distortion correction is performed according to the distortion coefficient and intrinsic parameter matrix of the camera to restore the original appearance of the image. In order to correct the tilt, the getAffineTransform method in OpenCV can be used to calculate the affine transformation matrix M of the tilted image, and then the warpAffine function is applied to achieve image tilt correction. This method requires determining the three corner points of the image and calculating the affine transformation based on these three points. Affine transformation is a linear transformation from a two-dimensional coordinate to a two-dimensional coordinate, which can include operations such as translation, rotation, and scaling. In OpenCV, affine transformation can be implemented by the warpAffine function.

[0052] In some embodiments, the above step S2023 can be specifically implemented by the following steps: step S20231, dividing the second processed file to obtain multiple text domains; step S20232, obtaining coordinate information of each of the text domains to obtain the domain distribution information. This method can further quickly obtain the above domain distribution information.

[0053] Specifically, a text domain refers to an area that represents text in an image or document. In the second processed file, the file can be divided into three rectangular text domains: the header part, the body part, and the footer part. In different application scenarios, the text domain can have different definitions and acquisition methods. The method of obtaining the coordinates of the text domain will vary depending on the specific scenario and requirements. A deep learning model can be used to detect the text area in the image and locate the position and size of the text. In addition, a component-based method can be used to extract candidate components and use a classifier to filter out non-text components, thereby accurately detecting the text domain.

[0054] The regional text distribution information includes the first information and the second information, and step S2023 can also be implemented by the following steps: step S20233, dividing the text domain to obtain multiple characters; step S20234, obtaining the coordinate information corresponding to each of the characters to obtain the first information; step S20235, obtaining the multi-dimensional vector representation information corresponding to each of the characters to obtain the second information. This method can further quickly obtain the above regional text distribution information.

[0055] Specifically, text vector representation refers to the representation of text characters through vectors, and the vectors of different texts are in the tensor space of the same dimension. The vector of a text is generated by mapping the rules between certain texts in reality. In the field of deep learning and related algorithms, it can be achieved through models such as Word2Vec, RankBM25, Sentence-BERT, CoSENT, and BERT.

[0056] After the above step S203, the method further includes step S205: sending the first processed file to the next node of the current node. This method can further improve the accuracy of the flow and processing of the layout file in multiple task nodes.

[0057] Specifically, if the verification result is passed, it means that in the above-mentioned first processing process, only the content in the processing area is changed, and the content in the non-processing area is not affected. Therefore, the first processing file can be further sent to the next node for further processing.

[0058] In order to enable those skilled in the art to more clearly understand the technical solution of the present application, the implementation process of the format file verification method of the present application will be described in detail below in conjunction with specific embodiments.

[0059] Example 1

[0060] This embodiment relates to a verification method for a layout file in a node control process, such as Figure 3 As shown, the following steps are included:

[0061] In the process node S area, first, based on the verified document output from step S-1, the S-step process task is executed; the entire task is divided into process processing, document information aggregation, and node information verification;

[0062] The process processing includes but is not limited to the editing, printing, signing, scanning and other operations of the layout document; the information change of the layout document is limited by the node settings, such as the editing of the paragraph content in a specific area, the signature and seal in a specific area, etc.; the content of other non-changed areas should be consistent with the output document of step S-1 after completing the S node; in addition, if the process processing includes printing and scanning, the output layout file will be converted into an image format;

[0063] Document information aggregation is to extract document information after process processing;

[0064] The node information verification is carried out by comparing the layout document output by the current S node with the layout document information output by the previous node S-1 step in the process document verification center. The core data of the verification and comparison is only the non-changed domain data.

[0065] Example 2

[0066] This embodiment relates to a method for performing a second process on a first process file, such as Figure 4 As shown, the following steps are included:

[0067] After the current process is processed, the temporary layout document of step S is output; the information aggregation operation, i.e. the second processing, needs to be performed; before aggregation, it is necessary to analyze whether the representation form of the layout file content is text or image format;

[0068] When the document content is saved in image format, it is necessary to extract the layout file and enter the image processing stage. In the image processing stage, according to the distortion and tilt of the actual content, repair it based on affine transformation to ensure the correct coordinates of the OCR page recognition information in the next step;

[0069] If the layout document is in text format, it will be rendered directly to realize the division of text block domains;

[0070] Combining the processing results of the image format and the text format, the information extraction of the page text and the identification of the block domain are completed, and the page text domain information and the text distribution in the block domain are compressed and represented respectively, and finally the second target information is output.

[0071] Example 3

[0072] This embodiment relates to a specific format file verification method, such as Figure 5 As shown, the following steps are included:

[0073] For domain distribution information, implement text domain coordinates Coord area Extract. For the text distribution in the area, include the text coordinates Coord word And the text N-dimensional vector representation Vector; through the function Summarize all representation information and store it in the process document verification center;

[0074] In the layout document verification stage, the S node outputs the document representation information based on the cache of the process document verification center. The S-1 document representation information of the previous node Compare and use similarity algorithm Calculate the similarity of the non-changed domain;

[0075] When the similarity meets the threshold condition, it means that the document representation information output by the S node has passed the verification, and its non-changing domain data is consistent with the S-1 document; if the similarity calculation cannot meet the threshold, it means that the non-changing domain data has changed during the process processing at the S node, and the document fine-grained content protection verification cannot be passed;

[0076] The present application embodiment also provides a kind of verification device of layout file, it should be noted that, the verification device of layout file of the present application embodiment can be used to execute the verification method for layout file provided by the present application embodiment. The device is used to implement the above-mentioned embodiment and preferred implementation mode, and the description has been made no more. As used below, the term "module" can realize the combination of software and / or hardware of predetermined function. Although the device described in the following embodiments is preferably realized by software, the realization of hardware, or the combination of software and hardware is also possible and conceived.

[0077] The following is an introduction to the format file verification device provided in the embodiment of the present application.

[0078] Figure 6 Schematic diagram of a format file verification device according to an embodiment of the present application. Figure 6 As shown, the device is applied to the current node in the node control process, the node control process includes a plurality of task nodes connected in sequence, the task nodes are used to perform corresponding task processing, the current node is any one of the plurality of task nodes, and the device includes:

[0079] The first processing unit 10 is used to obtain an initial layout file, and perform a first processing on a processing area of ​​the initial layout file to obtain a first processing file, wherein the first processing is a task processing corresponding to the current node, the initial layout file includes the processing area and the non-processing area, and the processing area and the non-processing area do not overlap, and the task processing includes at least one of editing processing, printing processing, signing processing and scanning processing;

[0080] Specifically, the above-mentioned task processing can be editing of paragraphs and contents in a specific area, signature and seal in a specific area, etc. The above-mentioned first processed file obtained after the first processing is actually also a layout file.

[0081] A second processing unit 20 is used to perform a second processing on the initial layout file to obtain first target information, and perform the second processing on the first processed file to obtain second target information, wherein the second processing is to extract relevant information of a non-processed area of ​​the initial layout file or to extract relevant information of a non-processed area of ​​the first processed file, and the relevant information includes at least one of image information and text information;

[0082] Specifically, the first target information and the second target information are obtained by merely extracting relevant information of the non-processing area.

[0083] A calculation unit 30, configured to calculate a similarity between the first target information and the second target information, and determine that a verification result is a verification pass when the similarity is greater than or equal to a similarity threshold;

[0084] Specifically, the above-mentioned calculation of the similarity between the first target information and the second target information can adopt the cosine similarity calculation method, TF-IDF model, Jaccard similarity coefficient, edit distance, Pearson correlation coefficient and the like; cosine similarity is a widely used text similarity calculation method, which measures the similarity of two vectors by calculating the cosine value of the angle between them. The value of cosine similarity is between 0 and 1, and the closer the value is to 1, the more similar they are. TF-IDF (Term Frequency-Inverse Document Frequency) is a commonly used weighting technique for information retrieval and text mining. It is a statistical method for evaluating the importance of a word to a document set or one of the documents in a corpus. The Jaccard similarity coefficient is used to compare the similarity and difference between finite sample sets, and the similarity is determined by calculating the ratio of the intersection and union of two samples. The larger its value, the higher the sample similarity. Edit distance measures the difference between two strings by calculating the minimum number of single-character editing (insertion, deletion or replacement) operations required to convert one string into another. Pearson correlation coefficient: It is used to measure the linear correlation between two variables, and its value ranges from -1 to 1.

[0085] The determination unit 40 is configured to determine that the verification result is a verification failure when the similarity is less than the similarity threshold.

[0086] Specifically, if the verification result is a verification failure, it indicates that in the above-mentioned first processing process, in addition to changing the content in the processing area, the content in the non-processing area is also affected, resulting in changes in the content in the non-processing area.

[0087] Through this embodiment, a verification device for a layout file is provided, wherein a first processing unit obtains an initial layout file, and performs a first processing on a processing area of ​​the initial layout file to obtain a first processing file, wherein the first processing is a task processing corresponding to the current node; a second processing unit performs a second processing on the initial layout file to obtain a first target information, and performs a second processing on the first processing file to obtain a second target information, wherein the second processing is to extract relevant information of a non-processing area of ​​the initial layout file or to extract relevant information of a non-processing area of ​​the first processing file, wherein the relevant information includes at least one of image information and text information; a calculation unit calculates the similarity between the first target information and the second target information, and when the similarity is greater than or equal to a similarity threshold, determines that the verification result is a verification pass. In the above device, the influence of the change of the information storage format of the layout file caused by the process processing is taken into account, and by performing a second processing on the initial layout file and the first processing file respectively to realize information extraction, the first target information and the second target information including image information and text information are obtained, and then the similarity between the first target information and the second target information is calculated, so that the content of the text format and the picture format layout file can be mutually verified, and the technical problem of inaccurate verification results of the layout file in the prior art is solved.

[0088] In a specific implementation process, the first processing unit includes a determination module and a receiving module, wherein the determination module is used to determine whether the current node is the first task node among the multiple task nodes; the receiving module is used to receive the layout file sent by the previous node when the current node is not the first task node, and obtain the initial layout file. The device can further quickly obtain the initial layout file.

[0089] Specifically, when the current node is not the first task node, taking the current node as the Sth node as an example, the initial layout file of the S node is obtained by obtaining the file output by the previous node, that is, the S-1 node. When the current node is the first task node, the input layout file can be directly used as the above initial layout file.

[0090] In order to further improve the generalization ability of the above target information, the above second processing unit of the present application includes a first acquisition module, a processing module and a second acquisition module, wherein the first acquisition module is used to obtain the content representation form of the predetermined file, wherein the content representation form includes a text form and a picture form; the processing module is used to perform a third processing on the predetermined file according to the content representation form to obtain a second processed file; the second acquisition module is used to obtain the domain distribution information of the second processed file and the regional text distribution information of the second processed file, and compress the domain distribution information and the regional text distribution information to obtain the target information of the predetermined file. The device can further improve the generalization ability of the above target information through compression representation processing.

[0091] Specifically, compressed representation refers to the use of specific algorithms or models in the field of machine learning and artificial intelligence to convert raw data into a more compact and efficient data representation. This conversion can not only reduce the storage space of data and increase processing speed, but also help algorithms better understand and process data, especially in feature learning, data compression, and generative models.

[0092] The second processing file includes a first sub-processing file and a second sub-processing file, and the processing module includes a first processing sub-module, a second processing sub-module and a third processing sub-module, wherein the first processing sub-module is used to perform image processing on the predetermined file to obtain an image processing file when the content representation form is the picture form, wherein the image processing includes at least one of distortion processing, tilt processing and affine transformation processing; the second processing sub-module is used to perform optical character recognition processing on the image processing file to obtain the first sub-processing file; the third processing sub-module is used to perform text processing on the predetermined file to obtain the second sub-processing file when the content representation form is the text form, wherein the text processing includes rendering processing. The device performs corresponding processing on the picture form and the text form of the predetermined file, and further quickly obtains the second processing file.

[0093] Specifically, performing image processing on the predetermined file can help correct geometric distortion in the image, improve image quality, or achieve specific visual effects, thereby further improving the accuracy of optical character recognition processing. In image processing, this distortion can be corrected by an inverse transformation method. For example, using the function in the OpenCV library, distortion correction is performed according to the distortion coefficient and intrinsic parameter matrix of the camera to restore the original appearance of the image. In order to correct the tilt, the getAffineTransform method in OpenCV can be used to calculate the affine transformation matrix M of the tilted image, and then the warpAffine function is applied to achieve image tilt correction. This method requires determining the three corner points of the image and calculating the affine transformation based on these three points. Affine transformation is a linear transformation from a two-dimensional coordinate to a two-dimensional coordinate, which can include operations such as translation, rotation, and scaling. In OpenCV, affine transformation can be implemented by the warpAffine function.

[0094] In some embodiments, the second acquisition module includes a fourth processing submodule and a first acquisition submodule, wherein the fourth acquisition submodule is used to divide the second processed file to obtain multiple text domains; the first acquisition submodule is used to obtain the coordinate information of each of the text domains to obtain the domain distribution information. The device can further quickly obtain the domain distribution information.

[0095] Specifically, a text domain refers to an area that represents text in an image or document. In the second processed file, the file can be divided into three rectangular text domains: the header part, the body part, and the footer part. In different application scenarios, the text domain can have different definitions and acquisition methods. The method of obtaining the coordinates of the text domain will vary depending on the specific scenario and requirements. A deep learning model can be used to detect the text area in the image and locate the position and size of the text. In addition, a component-based method can be used to extract candidate components and use a classifier to filter out non-text components, thereby accurately detecting the text domain.

[0096] The regional text distribution information includes the first information and the second information, and the second acquisition module includes the fifth processing submodule, the second acquisition submodule and the third acquisition submodule, wherein the fifth processing submodule is used to divide the text domain to obtain multiple characters; the second acquisition submodule is used to obtain the coordinate information corresponding to each of the characters to obtain the first information; the third acquisition submodule is used to obtain the multi-dimensional vector representation information corresponding to each of the characters to obtain the second information. The device can further quickly obtain the above regional text distribution information.

[0097] Specifically, text vector representation refers to the representation of text characters through vectors, and the vectors of different texts are in the tensor space of the same dimension. The vector of a text is generated by mapping the rules between certain texts in reality. In the field of deep learning and related algorithms, it can be achieved through models such as Word2Vec, RankBM25, Sentence-BERT, CoSENT, and BERT.

[0098] The above device also includes a sending unit, which is used to send the first processing file to the next node of the current node. The device can further improve the accuracy of the layout file in the circulation and processing process of multiple task nodes.

[0099] Specifically, if the verification result is passed, it means that in the above-mentioned first processing process, only the content in the processing area is changed, and the content in the non-processing area is not affected. Therefore, the first processing file can be further sent to the next node for further processing.

[0100] The format file verification device includes a processor and a memory, wherein the first processing unit, the second processing unit, the calculation unit, and the determination unit are stored in the memory as program units, and the processor executes the program units stored in the memory to implement corresponding functions. The modules are all located in the same processor; or, the modules are located in different processors in any combination.

[0101] The processor includes a kernel, which retrieves the corresponding program unit from the memory. One or more kernels can be set to verify the layout file by adjusting the kernel parameters.

[0102] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.

[0103] An embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium includes a stored program, wherein when the program is executed, the device where the computer-readable storage medium is located is controlled to execute the verification method for the layout file.

[0104] Specifically, the verification method of the layout file includes:

[0105] Step S201, obtaining an initial layout file, and performing a first process on a processing area of ​​the initial layout file to obtain a first processing file, wherein the first process is a task process corresponding to the current node, the initial layout file includes the processing area and the non-processing area, and the processing area and the non-processing area do not overlap, and the task process includes at least one of an editing process, a printing process, a signing process, and a scanning process;

[0106] Specifically, the above-mentioned task processing can be editing of paragraphs and contents in a specific area, signature and seal in a specific area, etc. The above-mentioned first processed file obtained after the first processing is actually also a layout file.

[0107] Step S202, performing a second process on the initial layout file to obtain first target information, and performing the second process on the first processed file to obtain second target information, wherein the second process is to extract relevant information of a non-processed area of ​​the initial layout file or to extract relevant information of a non-processed area of ​​the first processed file, and the relevant information includes at least one of image information and text information;

[0108] Specifically, the first target information and the second target information are obtained by merely extracting relevant information of the non-processing area.

[0109] Step S203, calculating the similarity between the first target information and the second target information, and when the similarity is greater than or equal to a similarity threshold, determining that the verification result is verification passed;

[0110] Specifically, the above-mentioned calculation of the similarity between the first target information and the second target information can adopt the cosine similarity calculation method, TF-IDF model, Jaccard similarity coefficient, edit distance, Pearson correlation coefficient and the like; cosine similarity is a widely used text similarity calculation method, which measures the similarity of two vectors by calculating the cosine value of the angle between them. The value of cosine similarity is between 0 and 1, and the closer the value is to 1, the more similar they are. TF-IDF (Term Frequency-Inverse Document Frequency) is a commonly used weighting technique for information retrieval and text mining. It is a statistical method for evaluating the importance of a word to a document set or one of the documents in a corpus. The Jaccard similarity coefficient is used to compare the similarity and difference between finite sample sets, and the similarity is determined by calculating the ratio of the intersection and union of two samples. The larger its value, the higher the sample similarity. Edit distance measures the difference between two strings by calculating the minimum number of single-character editing (insertion, deletion or replacement) operations required to convert one string into another. Pearson correlation coefficient: It is used to measure the linear correlation between two variables, and its value ranges from -1 to 1.

[0111] Step S204: when the similarity is less than the similarity threshold, determine that the verification result is verification failure.

[0112] Specifically, if the verification result is a verification failure, it indicates that in the above-mentioned first processing process, in addition to changing the content in the processing area, the content in the non-processing area is also affected, resulting in changes in the content in the non-processing area.

[0113] Optionally, obtaining the initial layout file includes: determining whether the current node is the first task node among the multiple task nodes; if the current node is not the first task node, receiving the layout file sent by the previous node to obtain the initial layout file.

[0114] Optionally, a second processing is performed on a predetermined file to obtain target information of the predetermined file, wherein the predetermined file is the initial layout file or the first processed file. When the predetermined file is the initial layout file, the target information of the predetermined file is the first target information, and when the predetermined file is the first processed file, the target information of the predetermined file is the second target information, including: obtaining a content representation form of the predetermined file, wherein the content representation form includes a text form and a picture form; performing a third processing on the predetermined file according to the content representation form to obtain a second processed file; obtaining domain distribution information of the second processed file and regional text distribution information of the second processed file, and performing compression representation processing on the domain distribution information and the regional text distribution information to obtain the target information of the predetermined file.

[0115] Optionally, the second processing file includes a first sub-processing file and a second sub-processing file, and the predetermined file is subjected to a third processing according to the content representation form to obtain a second processing file, including: when the content representation form is the picture form, the predetermined file is subjected to image processing to obtain an image processing file, wherein the image processing includes at least one of distortion processing, tilt processing and affine transformation processing; the image processing file is subjected to optical character recognition processing to obtain the first sub-processing file; when the content representation form is the text form, the predetermined file is subjected to text processing to obtain the second sub-processing file, wherein the text processing includes rendering processing.

[0116] Optionally, obtaining the domain distribution information of the second processed file includes: dividing the second processed file to obtain a plurality of text domains; and obtaining coordinate information of each of the text domains to obtain the domain distribution information.

[0117] Optionally, the regional text distribution information includes first information and second information, and obtaining the regional text distribution information of the second processed file includes: dividing the text domain to obtain multiple characters; obtaining coordinate information corresponding to each of the characters to obtain the first information; obtaining multi-dimensional vector representation information corresponding to each of the characters to obtain the second information.

[0118] Optionally, after determining that the verification result is a passed verification, the method further includes: sending the first processed file to a node next to the current node.

[0119] An embodiment of the present invention provides a processor, which is used to run a program, wherein the verification method of the layout file is executed when the program is running.

[0120] Specifically, the verification method of the layout file includes:

[0121] Step S201, obtaining an initial layout file, and performing a first process on a processing area of ​​the initial layout file to obtain a first processing file, wherein the first process is a task process corresponding to the current node, the initial layout file includes the processing area and the non-processing area, and the processing area and the non-processing area do not overlap, and the task process includes at least one of an editing process, a printing process, a signing process, and a scanning process;

[0122] Specifically, the above-mentioned task processing can be editing of paragraphs and contents in a specific area, signature and seal in a specific area, etc. The above-mentioned first processed file obtained after the first processing is actually also a layout file.

[0123] Step S202, performing a second process on the initial layout file to obtain first target information, and performing the second process on the first processed file to obtain second target information, wherein the second process is to extract relevant information of a non-processed area of ​​the initial layout file or to extract relevant information of a non-processed area of ​​the first processed file, and the relevant information includes at least one of image information and text information;

[0124] Specifically, the first target information and the second target information are obtained by merely extracting relevant information of the non-processing area.

[0125] Step S203, calculating the similarity between the first target information and the second target information, and when the similarity is greater than or equal to a similarity threshold, determining that the verification result is verification passed;

[0126] Specifically, the above-mentioned calculation of the similarity between the first target information and the second target information can adopt the cosine similarity calculation method, TF-IDF model, Jaccard similarity coefficient, edit distance, Pearson correlation coefficient and the like; cosine similarity is a widely used text similarity calculation method, which measures the similarity of two vectors by calculating the cosine value of the angle between them. The value of cosine similarity is between 0 and 1, and the closer the value is to 1, the more similar they are. TF-IDF (Term Frequency-Inverse Document Frequency) is a commonly used weighting technique for information retrieval and text mining. It is a statistical method for evaluating the importance of a word to a document set or one of the documents in a corpus. The Jaccard similarity coefficient is used to compare the similarity and difference between finite sample sets, and the similarity is determined by calculating the ratio of the intersection and union of two samples. The larger its value, the higher the sample similarity. Edit distance measures the difference between two strings by calculating the minimum number of single-character editing (insertion, deletion or replacement) operations required to convert one string into another. Pearson correlation coefficient: It is used to measure the linear correlation between two variables, and its value ranges from -1 to 1.

[0127] Step S204: when the similarity is less than the similarity threshold, determine that the verification result is verification failure.

[0128] Specifically, if the verification result is a verification failure, it indicates that in the above-mentioned first processing process, in addition to changing the content in the processing area, the content in the non-processing area is also affected, resulting in changes in the content in the non-processing area.

[0129] Optionally, obtaining the initial layout file includes: determining whether the current node is the first task node among the multiple task nodes; if the current node is not the first task node, receiving the layout file sent by the previous node to obtain the initial layout file.

[0130] Optionally, a second processing is performed on a predetermined file to obtain target information of the predetermined file, wherein the predetermined file is the initial layout file or the first processed file. When the predetermined file is the initial layout file, the target information of the predetermined file is the first target information, and when the predetermined file is the first processed file, the target information of the predetermined file is the second target information, including: obtaining a content representation form of the predetermined file, wherein the content representation form includes a text form and a picture form; performing a third processing on the predetermined file according to the content representation form to obtain a second processed file; obtaining domain distribution information of the second processed file and regional text distribution information of the second processed file, and performing compression representation processing on the domain distribution information and the regional text distribution information to obtain the target information of the predetermined file.

[0131] Optionally, the second processing file includes a first sub-processing file and a second sub-processing file, and the predetermined file is subjected to a third processing according to the content representation form to obtain a second processing file, including: when the content representation form is the picture form, the predetermined file is subjected to image processing to obtain an image processing file, wherein the image processing includes at least one of distortion processing, tilt processing and affine transformation processing; the image processing file is subjected to optical character recognition processing to obtain the first sub-processing file; when the content representation form is the text form, the predetermined file is subjected to text processing to obtain the second sub-processing file, wherein the text processing includes rendering processing.

[0132] Optionally, obtaining the domain distribution information of the second processed file includes: dividing the second processed file to obtain a plurality of text domains; and obtaining coordinate information of each of the text domains to obtain the domain distribution information.

[0133] Optionally, the regional text distribution information includes first information and second information, and obtaining the regional text distribution information of the second processed file includes: dividing the text domain to obtain multiple characters; obtaining coordinate information corresponding to each of the characters to obtain the first information; obtaining multi-dimensional vector representation information corresponding to each of the characters to obtain the second information.

[0134] Optionally, after determining that the verification result is a passed verification, the method further includes: sending the first processed file to a node next to the current node.

[0135] An embodiment of the present invention provides a device, the device comprising a processor, a memory, and a program stored in the memory and executable on the processor, and when the processor executes the program, at least the following steps are implemented:

[0136] Step S201, obtaining an initial layout file, and performing a first process on a processing area of ​​the initial layout file to obtain a first processing file, wherein the first process is a task process corresponding to the current node, the initial layout file includes the processing area and the non-processing area, and the processing area and the non-processing area do not overlap, and the task process includes at least one of an editing process, a printing process, a signing process, and a scanning process;

[0137] Step S202, performing a second process on the initial layout file to obtain first target information, and performing the second process on the first processed file to obtain second target information, wherein the second process is to extract relevant information of a non-processed area of ​​the initial layout file or to extract relevant information of a non-processed area of ​​the first processed file, and the relevant information includes at least one of image information and text information;

[0138] Step S203, calculating the similarity between the first target information and the second target information, and when the similarity is greater than or equal to a similarity threshold, determining that the verification result is verification passed;

[0139] Step S204: when the similarity is less than the similarity threshold, determine that the verification result is verification failure.

[0140] The devices in this article can be servers, PCs, PADs, mobile phones, etc.

[0141] The present application also provides a computer program product, which, when executed on a data processing device, is suitable for executing a program for initializing at least the following method steps:

[0142] Step S201, obtaining an initial layout file, and performing a first process on a processing area of ​​the initial layout file to obtain a first processing file, wherein the first process is a task process corresponding to the current node, the initial layout file includes the processing area and the non-processing area, and the processing area and the non-processing area do not overlap, and the task process includes at least one of an editing process, a printing process, a signing process, and a scanning process;

[0143] Step S202, performing a second process on the initial layout file to obtain first target information, and performing the second process on the first processed file to obtain second target information, wherein the second process is to extract relevant information of a non-processed area of ​​the initial layout file or to extract relevant information of a non-processed area of ​​the first processed file, and the relevant information includes at least one of image information and text information;

[0144] Step S203, calculating the similarity between the first target information and the second target information, and when the similarity is greater than or equal to a similarity threshold, determining that the verification result is verification passed;

[0145] Step S204: when the similarity is less than the similarity threshold, determine that the verification result is verification failure.

[0146] Obviously, those skilled in the art should understand that the above modules or steps of the present invention can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order than here, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.

[0147] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0148] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0149] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0150] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0151] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0152] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0153] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0154] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0155] From the above description, it can be seen that the above embodiments of the present application achieve the following technical effects:

[0156] 1) The verification method of the layout file of the present application, first, obtain the initial layout file, and perform the first processing on the processing area of ​​the initial layout file to obtain the first processing file, the first processing is the task processing corresponding to the current node; then perform the second processing on the initial layout file to obtain the first target information, and perform the second processing on the first processing file to obtain the second target information, the second processing is to extract the relevant information of the non-processing area of ​​the initial layout file or extract the relevant information of the non-processing area of ​​the first processing file, the relevant information includes at least one of image information and text information; finally, calculate the similarity of the first target information and the second target information, and determine that the verification result is passed when the similarity is greater than or equal to the similarity threshold. In the above method, the influence of the change of the information storage format of the layout file caused by the process processing is taken into account, and the first target information and the second target information including image information and text information are obtained by performing the second processing on the initial layout file and the first processing file respectively to realize information extraction, and then calculating the similarity of the first target information and the second target information, so as to realize the mutual verification of the content of the text format and the picture format layout file, and solve the technical problem of inaccurate verification results of the layout file in the prior art.

[0157] 2) The verification device of the layout file of the present application, the first processing unit obtains the initial layout file, and performs the first processing on the processing area of ​​the initial layout file to obtain the first processing file, the first processing is the task processing corresponding to the current node; the second processing unit performs the second processing on the initial layout file to obtain the first target information, and performs the second processing on the first processing file to obtain the second target information, the second processing is to extract the relevant information of the non-processing area of ​​the initial layout file or extract the relevant information of the non-processing area of ​​the first processing file, the relevant information includes at least one of image information and text information; the calculation unit calculates the similarity of the first target information and the second target information, and determines that the verification result is passed when the similarity is greater than or equal to the similarity threshold. In the above device, the influence of the change of the information storage format of the layout file caused by the process processing is taken into account, and the first target information and the second target information including image information and text information are obtained by performing the second processing on the initial layout file and the first processing file respectively to realize information extraction, and then calculating the similarity of the first target information and the second target information, so as to realize the mutual verification of the content of the text format and the picture format layout file, and solve the technical problem of inaccurate verification results of the layout file in the prior art.

[0158] The above description is only the preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims

1. A verification method for a layout file, It is characterized in that Applied to a current node in a node control process, the node control process includes a plurality of sequentially connected task nodes, the task nodes are used to perform corresponding task processing, the current node is any one of the plurality of task nodes, the method includes: Acquire an initial layout file, and perform a first process on a processing area of ​​the initial layout file to obtain a first processing file, wherein the first process is a task process corresponding to the current node, the initial layout file includes the processing area and a non-processing area, and the processing area and the non-processing area do not overlap, and the task process includes at least one of an editing process, a printing process, a signing process, and a scanning process; Performing a second process on the initial layout file to obtain first target information, and performing the second process on the first processed file to obtain second target information, wherein the second process is to extract relevant information of a non-processed area of ​​the initial layout file or to extract relevant information of a non-processed area of ​​the first processed file, and the relevant information includes at least one of image information and text information; Calculating the similarity between the first target information and the second target information, and determining that the verification result is a verification pass when the similarity is greater than or equal to a similarity threshold; When the similarity is less than the similarity threshold, the verification result is determined to be verification failure.

2. The method according to claim 1, It is characterized in that Get the initial layout files, including: Determine whether the current node is the first task node among the multiple task nodes; When the current node is not the first task node, the layout file sent by the previous node is received to obtain the initial layout file.

3. The method according to claim 1, It is characterized in that Performing a second process on a predetermined file to obtain target information of the predetermined file, wherein the predetermined file is the initial layout file or the first processed file, and when the predetermined file is the initial layout file, the target information of the predetermined file is the first target information, and when the predetermined file is the first processed file, the target information of the predetermined file is the second target information, including: Acquire a content representation form of the predetermined file, wherein the content representation form includes a text form and a picture form; According to the content representation form, performing a third process on the predetermined file to obtain a second processed file; The domain distribution information of the second processed file and the regional text distribution information of the second processed file are obtained, and compression and representation processing are performed on the domain distribution information and the regional text distribution information to obtain the target information of the predetermined file.

4. The method according to claim 3, It is characterized in that The second processed file includes a first sub-processed file and a second sub-processed file. According to the content representation form, the predetermined file is subjected to a third process to obtain a second processed file, including: In the case where the content representation form is the picture form, performing image processing on the predetermined file to obtain an image processing file, wherein the image processing includes at least one of distortion processing, tilt processing and affine transformation processing; Performing optical character recognition processing on the image processing file to obtain the first sub-processing file; In the case where the content representation form is the text form, text processing is performed on the predetermined file to obtain the second sub-processed file, wherein the text processing includes rendering processing.

5. The method according to claim 3, It is characterized in that Acquiring the domain distribution information of the second processed file includes: dividing the second processed file to obtain a plurality of text fields; The coordinate information of each of the text fields is obtained to obtain the field distribution information.

6. The method according to claim 5, It is characterized in that The regional text distribution information includes first information and second information, and obtaining the regional text distribution information of the second processed file includes: Dividing the text domain to obtain a plurality of texts; Obtaining coordinate information corresponding to each of the characters to obtain the first information; The multi-dimensional vector representation information corresponding to each of the characters is obtained to obtain the second information.

7. The method according to claim 1, It is characterized in that After determining that the verification result is a verification pass, the method further includes: The first processed file is sent to a node next to the current node.

8. A verification device for a format file, It is characterized in that Applied to a current node in a node control process, the node control process includes a plurality of sequentially connected task nodes, the task nodes are used to perform corresponding task processing, the current node is any one of the plurality of task nodes, the device includes: A first processing unit is used to obtain an initial layout file, and perform a first processing on a processing area of ​​the initial layout file to obtain a first processing file, wherein the first processing is a task processing corresponding to the current node, the initial layout file includes the processing area and the non-processing area, and the processing area and the non-processing area do not overlap, and the task processing includes at least one of editing processing, printing processing, signing processing, and scanning processing; A second processing unit is used to perform a second processing on the initial layout file to obtain first target information, and perform the second processing on the first processed file to obtain second target information, wherein the second processing is to extract relevant information of a non-processed area of ​​the initial layout file or to extract relevant information of a non-processed area of ​​the first processed file, and the relevant information includes at least one of image information and text information; a calculation unit, configured to calculate a similarity between the first target information and the second target information, and determine that a verification result is a verification pass when the similarity is greater than or equal to a similarity threshold; A determination unit is used to determine that the verification result is a verification failure when the similarity is less than the similarity threshold.

9. A computer-readable storage medium, It is characterized in that The computer-readable storage medium includes a stored program, wherein when the program is executed, the device where the computer-readable storage medium is located is controlled to execute the method according to any one of claims 1 to 7.

10. An electronic device comprising a memory and a processor, It is characterized in that A computer program is stored in the memory, and the processor is configured to execute the method according to any one of claims 1 to 7 through the computer program.

Citation Information

Patent Citations

  • Integrity verification method and device, terminal equipment and verification server

    CN112989430A

  • Information proofreading method and system and electronic equipment

    CN117669504A

  • Layout file checking method and device

    CN117725886A

  • File verification method and device, electronic equipment and storage medium

    CN117763627A