Electronic signature positioning method and device

By storing the title and official seal data of the electronic document in the database and determining the coordinates of the signature field in the two-dimensional coordinate system, the automatic positioning and stamping of the electronic seal is realized, solving the problems of inaccurate positioning and low efficiency in the prior art.

CN114708186BActive Publication Date: 2025-03-25SHANDONG INSPUR AIGOU CLOUD CHAIN INFORMATION TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202111391130.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-23
Publication Date
2025-03-25
Estimated Expiration
2041-11-23

AI Technical Summary

Technical Problem

The existing electronic signature positioning methods cannot automatically determine the position where the electronic signature should be stamped, which is low in accuracy and low in efficiency.

Method used

By storing the title of the electronic document and the corresponding electronic official seal data into the database in a key-value pair, identifying the title of the document to be signed, extracting the official seal data in the database, and determining the coordinates of the signature field in the two-dimensional coordinate system, the official seal data is automatically stamped in the document to be signed.

Benefits of technology

Automatic positioning and stamping of electronic signatures is realized, efficiency is improved, staff operation is reduced, and positioning accuracy is enhanced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114708186B_ABST
    Figure CN114708186B_ABST
Patent Text Reader

Abstract

The embodiment of the present application discloses an electronic signature positioning method and system. The method includes: storing the title of the electronic document and the corresponding electronic official seal data in a key-value pair database in the form of a key-value pair; receiving the document to be signed and identifying the title of the document to be signed; searching the corresponding electronic official seal data in the key-value pair database according to the title of the document to be signed, and extracting the text in the electronic official seal data; establishing a two-dimensional coordinate system with the lower boundary of the document to be signed as the horizontal axis and the left boundary of the document to be signed as the vertical axis, and determining the coordinates of the signature field in the two-dimensional coordinate system; wherein the signature field is a field in the document to be signed that is exactly the same as the text in the electronic official seal data; based on the coordinates of the signature field, adding the electronic official seal data to the document to be signed to obtain a signed document. The technical problem that the existing electronic signature positioning method cannot automatically determine the position where the electronic signature should be stamped 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 transaction data management, and in particular to a method and device for locating an electronic signature. Background Art

[0002] In the current situation where online transactions are more popular, in order to save paper costs and improve transaction efficiency, both parties of online transactions will transmit transaction data or transaction contracts in the form of electronic documents. Transaction data or transaction contracts often need to be stamped with the company's official seal to ensure the authenticity and validity of the transaction data or transaction contract. If it is a paper document, it is generally stamped with a physical official seal to mark the legal validity of the document, while electronic documents need to be stamped with an electronic signature, which is generally stamped on the name of the party or the name of the unit.

[0003] The existing methods of stamping electronic signatures on electronic documents mostly pre-set multiple signature templates, specify the signature position of each template, and then the stamping program obtains the signature position by identifying which signature template the document to be signed corresponds to. This method has great limitations and requires staff to do a lot of setup work in advance. It cannot automatically determine the position where the electronic signature should be stamped, and the positioning efficiency is low. Therefore, some methods have emerged to automatically identify the position where the electronic signature should be stamped, but these methods have low recognition accuracy and the official seal is easily stamped off-center, affecting the smooth progress of the transaction process. Summary of the invention

[0004] The embodiments of the present application provide an electronic signature positioning method and device, which are used to solve the technical problems that the existing electronic signature positioning method cannot automatically determine the position where the electronic signature should be stamped, and has low accuracy and low efficiency.

[0005] The present application embodiment adopts the following technical solutions:

[0006] On the one hand, the embodiment of the present application provides an electronic signature positioning method. The method includes: storing the title of an electronic document and the corresponding electronic official seal data in a key-value pair database in the form of a key-value pair; wherein the title of the electronic document is the primary key, and the electronic official seal data is the key value corresponding to the primary key; receiving a document to be signed and identifying the title of the document to be signed; searching for the corresponding electronic official seal data in the key-value pair database according to the title of the document to be signed, and extracting the text in the electronic official seal data; establishing a two-dimensional coordinate system with the lower boundary of the document to be signed as the horizontal axis and the left boundary of the document to be signed as the vertical axis, and determining the coordinates of the signature field in the two-dimensional coordinate system; wherein the signature field is a field in the document to be signed that is completely identical to the text in the electronic official seal data; based on the coordinates of the signature field, adding the electronic official seal data to the document to be signed to obtain a signed document.

[0007] The embodiment of the present application locates and identifies the title in the document to be signed, extracts the official seal data corresponding to the document in the key-value pair database, and then automatically identifies the signature in the official seal, thereby finding the location of the signature in the document to be signed, stamping the official seal data, and completing the stamping. The whole process is completed automatically, and there is no need to preset the signature template in advance, which reduces the workload of the staff. In addition, this method has a wide range of applications and is not limited to several specific electronic documents. As long as the title of the document and the official seal data that should be stamped on the document are stored in the database, the electronic official seal can be automatically stamped on the document without changing the settings.

[0008] In a feasible implementation, before adding the electronic official seal data to the document to be signed based on the coordinates of the signature field to obtain the signed document, the method also includes: determining that the signature field does not exist in the document to be signed; determining the coordinates of a preset field in the document to be signed in the two-dimensional coordinate system; wherein the preset field includes at least one or more of the following: name, unit name, signature; adding a preset value to the horizontal coordinate of the preset field to obtain the seal coordinates; based on the seal coordinates, adding the electronic official seal data to the document to be signed to obtain the signed document.

[0009] The embodiment of the present application identifies preset fields such as "name", "unit name", and "seal" in the document to be signed, and when the signature or the time stamp has not been added to the document to be signed, the official seal is stamped on the right side of the "name" or "unit name" to ensure successful stamping of the official seal.

[0010] In a feasible implementation manner, the identifying the title of the document to be signed specifically includes: determining the surrounding boundaries of each line of text in a preset area of ​​the document to be signed; wherein the surrounding boundaries include an upper boundary, a lower boundary, a left boundary and a right boundary; in the two-dimensional coordinate system, determining the title area of ​​the document to be signed based on the horizontal coordinate of the right boundary of each line of text; wherein the title area is a line of text with the smallest horizontal coordinate of the right boundary in each line of text; when there are more than one line of text with the smallest horizontal coordinate of the right boundary, determining the title area of ​​the document to be signed based on the difference between the vertical coordinate of the upper boundary and the vertical coordinate of the lower boundary of each line of text; wherein the title area is a line of text with the largest difference between the vertical coordinate of the upper boundary and the vertical coordinate of the lower boundary in each line of text; identifying the text in the title area to obtain the title of the document to be signed.

[0011] In a feasible implementation, the boundaries of each line of text are determined within a preset area of ​​the document to be signed, specifically including: performing edge feature extraction on the document to be signed to obtain an edge image; generating a plurality of horizontal lines within the preset area; determining the number of intersections between each horizontal line and the edge lines in the edge image; determining the area where the horizontal lines with zero intersections with the edge lines are located as a blank area; between two adjacent blank areas, determining the two horizontal lines with the least number of intersections with the edge lines as the upper and lower boundaries of each line of text; in the two-dimensional coordinate system, determining the minimum horizontal coordinate and the maximum horizontal coordinate of the intersections of the plurality of horizontal lines with the edge lines between the upper and lower boundaries of each line of text; determining the vertical line corresponding to the minimum horizontal coordinate as the left boundary of each line of text, and determining the vertical line corresponding to the maximum horizontal coordinate as the right boundary of each line of text.

[0012] Based on the characteristics that most titles are centered and the font is larger than the main text, the embodiment of the present application calculates the horizontal and vertical coordinates of the four boundaries of each line of text in the preset area of ​​the document to be signed, and determines the line of text with the smallest horizontal coordinate on the right boundary as the title. If there are more than one line of text with the smallest horizontal coordinate on the right boundary, that is, the title is too long and the right boundary is just flush with the right boundary of the main text, the line of text with the largest difference in vertical coordinates between the upper and lower boundaries is determined as the title. It should be noted here that the title of a transaction contract is generally not as long as a paper, and the default title in this method is only one line.

[0013] In a feasible implementation manner, the identifying of the text in the title area to obtain the title of the document to be signed specifically includes: segmenting the text in the title area to obtain a number of title text images; performing feature extraction on the number of title text images to obtain a first feature vector; performing data dimension reduction on the first feature vector to obtain a second feature vector; inputting the second feature vector into a neural network classifier for first-level classification to obtain a third feature vector; and inputting the third feature vector into a KNN classifier for second-level classification to identify the text in the title area.

[0014] When recognizing text, if feature vectors with too many dimensions are used, in fact, the information of some dimensions is redundant, and does not contribute much to text recognition. Instead, it will increase the recognition time. Therefore, the embodiment of the present application first reduces the dimension of the image feature vector, and then performs two-level classification on the reduced-dimensional image feature vector, so that the text recognition result is more accurate and the recognition time is shortened.

[0015] In a feasible implementation manner, the extracting of text from the electronic official seal data specifically includes: determining the coordinates of the positioning center corresponding to each text in the electronic official seal data in the two-dimensional coordinate system; fitting any two of the positioning centers into a straight line, and counting the number of positioning centers falling within the adjacent area of ​​each straight line; wherein the adjacent area is an area within a preset distance on both sides of the straight line; when the number of positioning centers falling within the adjacent area of ​​each straight line is less than or equal to a first preset threshold, determining that only arc-shaped text exists in the electronic official seal, and no horizontal text exists; when the number of positioning centers falling within the adjacent area of ​​any straight line is greater than the first preset threshold, determining that both arc-shaped text and horizontal text exist in the electronic official seal.

[0016] In a feasible implementation, the method also includes: when there are curved characters and horizontal characters in the electronic official seal, based on the number of positioning centers in the adjacent area of ​​any straight line, determining a fitting straight line for the positioning center of the horizontal characters; wherein the fitting straight line for the positioning center of the horizontal characters is the straight line with the largest number of positioning centers in the adjacent area; determining that a number of characters corresponding to each positioning center in the adjacent area of ​​the fitting straight line for the horizontal character positioning center are horizontal characters, and determining that other characters present in the electronic official seal are curved characters; performing tilt correction on the horizontal characters, and identifying the horizontal characters after tilt correction.

[0017] The embodiment of the present application cleverly distinguishes between horizontal text and curved text in the official seal by fitting straight lines between the text in the official seal, so as to facilitate tilt correction for the two types of text areas using different methods.

[0018] In a feasible implementation manner, after the tilt correction is performed on the horizontal text and the tilt-corrected horizontal text is identified, the method further includes: dividing the arc-shaped text to obtain a plurality of arc-shaped texts; taking the center of the circle of the electronic official seal as the pole, drawing a ray from the pole to the top of the electronic official seal as the polar axis, and establishing a polar coordinate system in the electronic official seal; wherein the counterclockwise direction of the polar coordinate system is the positive direction; determining the polar coordinates of the plurality of arc-shaped texts in the polar coordinate system; sorting the arc-shaped texts on the left side of the polar axis and the arc-shaped texts on the right side of the polar axis in order of decreasing polar angle; arranging the sorted arc-shaped texts on the left side of the polar axis in front, and arranging the sorted arc-shaped texts on the right side of the polar axis in the back, to obtain a complete order of the plurality of arc-shaped texts; based on the polar angles of the plurality of arc-shaped texts, rotating the plurality of arc-shaped texts clockwise by corresponding angles to perform tilt correction on the plurality of arc-shaped texts; and identifying the sorted and tilt-corrected arc-shaped texts.

[0019] The embodiment of the present application determines the order and tilt angle of each character by establishing a polar coordinate system in the official seal, and performs sorting and tilt correction. This correction method has accurate correction results and small calculation amount.

[0020] In a feasible implementation, in the two-dimensional coordinate system, the coordinates of the signature field are determined, specifically including: identifying all the characters in the document to be signed; determining that a first text string in the document to be signed that is exactly the same in content and order as the arc-shaped characters is the signature field; and if the first text string does not exist in the document to be signed, determining that a second text string in the document to be signed that is exactly the same in content and order as the horizontal characters is the signature field.

[0021] On the other hand, an embodiment of the present application provides an electronic signature positioning system, including: a key-value pair database, used to save the title of the electronic document and the corresponding electronic official seal data in the form of a key-value pair; an identification unit, used to identify the title of the document to be signed and to identify the text in the electronic official seal data; a determination unit, used to determine the coordinates of the signature field; wherein the signature field is a field in the document to be signed that is exactly the same as the text in the electronic official seal data; an execution unit, used to add the electronic official seal data to the document to be signed based on the coordinates of the signature field to obtain a signed document.

[0022] At least one of the above technical solutions adopted in the embodiments of the present application can achieve the following beneficial effects:

[0023] The embodiment of the present application designs an electronic signature positioning system to automatically identify the title of the document to be signed that is input into the system, and then automatically extracts the official seal data that should be stamped on this document from the database based on the title. The system automatically extracts the signature text in the official seal, and then searches for the same signature text in the document to be signed, stamps the official seal on the signature text, and completes the signature. This solution only needs to pre-store the titles of different documents that need to be stamped and the official seal images corresponding to the documents in the key-value pair database, and the remaining steps are fully automated, thereby improving the efficiency of electronic signatures. In addition, this solution does not require staff to perform any operations during the signing process, which not only reduces the workload of staff and simplifies operations, but also avoids the situation where the official seal is stamped incorrectly due to staff errors, thereby improving the accuracy of electronic signature positioning. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative labor.

[0025] In the figure:

[0026] Figure 1 A flowchart of an electronic signature positioning method provided in an embodiment of the present application;

[0027] Figure 2 A schematic diagram of text area boundary positioning provided in an embodiment of the present application;

[0028] Figure 3 A schematic diagram of an official seal with arc-shaped text provided in an embodiment of the present application;

[0029] Figure 4 A schematic diagram of an electronic signature positioning system provided in an embodiment of the present application. DETAILED DESCRIPTION

[0030] The embodiments of the present application provide a method and system for locating an electronic signature.

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

[0032] like Figure 1 As shown, an electronic signature positioning method provided in an embodiment of the present application specifically includes steps S101-S105:

[0033] S101, receiving a document to be signed, and identifying the title of the document to be signed.

[0034] Specifically, the staff member transfers the electronic document to be signed into the electronic signature system, and the electronic signature system establishes a two-dimensional coordinate system with the lower boundary of the electronic document to be signed as the horizontal axis and the left boundary as the vertical axis, and then identifies the title of the electronic document according to a preset program.

[0035] As a feasible implementation method, the preset procedure for identifying the title of an electronic document is as follows: first, edge features of the electronic document to be signed are extracted by an image edge feature extraction algorithm to obtain an edge image. Then, a preset area is selected in the edge image, and several horizontal lines are generated in the preset area to cross the edge image. The number of intersections between each horizontal line and the edge line in the edge image is counted. The area where the horizontal line with zero intersections with the edge line is located is a blank area, and the area between two adjacent blank areas is a text area.

[0036] As a feasible implementation, the upper boundary, left boundary, and right boundary of the preset area are the upper boundary, left boundary, and right boundary of the document to be signed, and the width of the preset area can be set. Since the title of a formal document is generally located at the top of the document, the preset area can be set as the upper half or the upper one-third of the document to be signed, or the width of the preset area can be modified by the staff according to the actual situation of the company's working documents. Searching for the title area only within the preset area can reduce the computational effort for identifying the title area of the document to be signed.

[0037] Furthermore, in the edge image, the number of intersection points between the horizontal lines in the middle of the text and the text edge line is more than the number of intersection points between the horizontal lines at the edge of the text and the text edge line. Therefore, determine the two horizontal lines with the fewest intersection points with the text edge line in the text area as the upper and lower boundaries of each line of the text area. Among the two horizontal lines, the one with the larger ordinate is the upper boundary, and the one with the smaller ordinate is the lower boundary.

[0038] In one embodiment, as Figure 2 shown, taking the edge image of the four characters "electronic signature" as an example, first count the number of intersection points of each horizontal line that intersects with the edge line of the four characters "electronic signature". Assume Figure 2 the number of intersection points of the three horizontal lines from top to bottom with the edge line of "electronic signature" are 5, 8, and 4 respectively. Then the two horizontal lines with 5 and 4 intersection points are the upper and lower boundaries of the line of the characters "electronic signature". Assume the horizontal line with 5 intersection points is represented as y = 4, and the horizontal line with 4 intersection points is represented as y = 2. Then the horizontal line y = 4 is the upper boundary, and the horizontal line y = 2 is the lower boundary.

[0039] Furthermore, after determining the upper and lower boundaries of each line of the text area, between the upper and lower boundaries of a certain line of the text area, determine the minimum abscissa and the maximum abscissa of the intersection points of several horizontal lines with the edge line of this line of text. The vertical line where the minimum abscissa is located is the left boundary of this line of the text area, and the vertical line where the maximum abscissa is located is the right boundary of this line of the text area. The four boundaries of each line of the text area within the preset area are determined by the above method, and the four boundaries are the upper boundary, lower boundary, left boundary, and right boundary.

[0040] In one embodiment, as Figure 2As shown, among all the intersections of the horizontal lines passing through the four characters "Electronic Signature" and the four characters, find the intersection with the smallest horizontal coordinate and the intersection with the largest horizontal coordinate. The vertical lines where these two intersections are located are the left and right boundaries of "Electronic Signature". Assuming that the coordinates of the intersection with the smallest horizontal coordinate are (1,2) and the coordinates of the intersection with the largest horizontal coordinate are (7,3), then the left boundary is the vertical line with x=1, and the right boundary is the vertical line with x=7. The rectangular frame composed of the upper boundary, lower boundary, left boundary, and right boundary of "Electronic Signature" is the text area of ​​"Electronic Signature".

[0041] Furthermore, after determining the boundaries of each line of text in the preset area, common sense tells us that the title format of a formal document is centered and the font size is larger than the text. Therefore, first determine the horizontal coordinate of the right boundary of each line of text in the two-dimensional coordinate system. Among all the lines of text in the preset area, the line of text with the smallest horizontal coordinate of the right boundary is the title area. Since there is a situation where the title is too long and the horizontal coordinate of the right boundary of the title is the same as that of the right boundary of the text, when there are more than one line of text areas with the smallest horizontal coordinate of the right boundary, determine the difference between the upper boundary vertical coordinate and the lower boundary vertical coordinate of each line of text. Among all the lines of text in the preset area, the line of text with the largest difference between the upper boundary vertical coordinate and the lower boundary vertical coordinate is the title area.

[0042] Furthermore, after determining the title area, the text in the title area is divided into individual characters by projection method to obtain several title text images. Feature extraction is performed on the above several title text images to obtain a first eigenvector. Then, the first eigenvector is subjected to data dimension reduction by linear discriminant analysis (LDA) technology to obtain a second eigenvector with lower dimension. Since the neural network classifier has a high tolerance for noise data and a strong classification ability for untrained data, the second eigenvector is input into the neural network classifier for first-level classification to obtain a third eigenvector. The third eigenvector is input into the K-NearestNeighbor (KNN) classifier for second-level classification to obtain the title content of the electronic document to be signed. The neural network classifier preferably uses a feed-forward backpropagation (BP) network.

[0043] S102: According to the title of the document to be signed, the corresponding electronic official seal data is searched in the key-value pair database, and the text in the electronic official seal data is extracted.

[0044] First, the staff stores the title of the electronic document that needs to be stamped at work and the electronic seal data that should be stamped on the electronic document in the key-value pair database in advance, with the title of the electronic document as the primary key and the corresponding electronic seal data as the key value. For example, the electronic seal corresponding to the electronic document titled "Transaction Contract" is the company's seal, and the electronic seal corresponding to the electronic document titled "Financial Statements" is the financial department's seal, etc. In this way, the corresponding electronic seal data can be directly extracted from the key-value pair database through the title of the electronic document. It should be noted that the electronic seal data in this application refers to the scanned image of the electronic seal.

[0045] Specifically, after the electronic signature positioning system identifies the title of the document to be signed, it searches and extracts the corresponding electronic seal image data in the key-value pair database according to the title content, and performs binarization processing on the extracted electronic seal image data to obtain a binary image. In a binary image, the pixel clustering area is the area where the text is located. Therefore, the electronic signature positioning system determines several pixel clustering areas in the binary image through multi-layer window filtering technology, and determines the center point of each pixel clustering area as the positioning center corresponding to each text in the electronic seal image data.

[0046] Furthermore, the official seal generally includes arc-shaped characters arranged in an arc shape along the edge of the official seal, and horizontal characters at the bottom of the official seal. The biggest difference between the arc-shaped characters and the horizontal characters is that the straight lines obtained by fitting the positioning centers of the horizontal characters in pairs basically overlap, while the straight lines obtained by fitting the positioning centers of the arc-shaped characters in pairs will form an arc around the center of the official seal. Therefore, in view of this feature, the electronic signature positioning system fits any two positioning centers determined in the electronic official seal image data into a straight line, and counts the number of positioning centers that fall within the preset distance on both sides of each straight line. In the case where the number of positioning centers that fall within the preset distance on both sides of each straight line is less than or equal to the first preset threshold, there are only arc-shaped characters in the electronic official seal image data, and there are no horizontal characters. In the case where the number of positioning centers that fall within the preset distance on both sides of any straight line is greater than the first preset threshold, there are both arc-shaped characters and horizontal characters in the electronic official seal image data. At this time, the characters corresponding to all positioning centers within the preset distance on both sides of the straight line belong to horizontal characters. Except for the horizontal characters, other characters in the electronic official seal image data are arc-shaped characters.

[0047] As a feasible implementation method, if there is horizontal text in the electronic official seal image data, the entire line of horizontal text is extracted from the binary image, the horizontal text is tilt-corrected using optical character recognition technology, and the content of the horizontal text after tilt correction is recognized.

[0048] Further, the electronic signature positioning system takes the center of the electronic official seal image as the pole, draws a ray from the pole directly above the electronic official seal image as the polar axis, and establishes a polar coordinate system in the electronic official seal image. The counterclockwise direction of the polar coordinate system is the positive direction. The above polar coordinate system is as shown in Figure 3 In the figure, the circular pattern represents the border of the electronic official seal image, point O is the pole, OP is the polar axis, and the square pattern in the figure represents a single arc-shaped character.

[0049] Further, the arc-shaped characters in the electronic official seal image data are segmented into single characters through an adaptive border search technology to obtain a number of arc-shaped characters. At this time, the cut characters have different inclination angles and are not arranged correctly in order. Determine the polar coordinates corresponding to the positioning centers of the number of arc-shaped characters in the polar coordinate system respectively. Sort the arc-shaped characters on the left side of the polar axis and the arc-shaped characters on the right side of the polar axis in the order of decreasing polar angle respectively, and then place the sorted arc-shaped characters on the left side of the polar axis in the front and the sorted arc-shaped characters on the right side of the polar axis in the back to obtain the complete order of the number of arc-shaped characters.

[0050] In one embodiment, if there are three arc-shaped characters A, B, and C on the left side of the polar axis, the polar coordinates of A are (1, 30°), the polar coordinates of B are (1, 60°), and the polar coordinates of C are (1, 90°), and there are three arc-shaped characters D, E, and F on the right side of the polar axis, the polar coordinates of D are (1, 330°), the polar coordinates of E are (1, 300°), and the polar coordinates of F are (1, 270°). Then the arc-shaped characters on the left side of the polar axis are arranged in the order of decreasing polar angle as: CBA, and the arc-shaped characters on the right side of the polar axis are arranged in the order of decreasing polar angle as: DEF. According to the rule of left first and right second, the final complete order of the arc-shaped characters is CBADEF.

[0051] Further, rotate the number of arc-shaped characters clockwise by the angles corresponding to their respective polar angles to correct the inclination of the number of arc-shaped characters. Finally, identify the content of the arc-shaped characters after sorting and inclination correction through optical character recognition technology.

[0052] In one embodiment, as shown in Figure 3 In the figure, the polar angle of the character "签" is θ. Rotate the character "签" clockwise by θ degrees, and the character "签" can be corrected to the horizontal direction. Assume that the polar angle of the character "章" is 330 degrees, then rotating the character "章" clockwise by 330 degrees can also correct it to the horizontal direction.

[0053] S103. After identifying the characters in the electronic official seal data, in the two-dimensional coordinate system, determine the coordinates of the signature field, and based on the coordinates of the signature field, add the electronic official seal data to the document to be signed to obtain the signed document.

[0054] Specifically, all the characters in the document to be signed are identified by optical character recognition technology. The first character string in the document to be signed, which has the same content and order as the arc-shaped characters identified in the electronic official seal data, is determined as the signature field. If the first character string cannot be found in the document to be signed, the second character string in the document to be signed, which has the same content and order as the horizontal characters identified in the electronic official seal data, is determined as the signature field. The coordinates of the signature field are determined, and the electronic official seal data is added to the coordinates in the document to be signed to obtain the signed document.

[0055] In one embodiment, assuming that the arc-shaped text content identified in the electronic official seal data is "XXX Co., Ltd." and the horizontal text content is "Business Special Seal", the electronic signature positioning system first searches for the "XXX Co., Ltd." field in the document to be signed. If the field is found, "XXX Co., Ltd." is the signature field. If the field is not found, the "Business Special Seal" field is searched. If the field is found, the "Business Special Seal" field is the signature field.

[0056] S104: Determine that there is no signature field in the document to be signed, and determine the coordinates of a preset field in the document to be signed in a two-dimensional coordinate system.

[0057] Specifically, if neither the first text string nor the second text string is found in the document to be signed, a preset field is searched in the document to be signed, and the coordinates of the preset field are determined in a two-dimensional coordinate system.

[0058] In one embodiment, it is assumed that the arc-shaped text content identified in the electronic official seal data is "XXX Co., Ltd." and the horizontal text content is "Business-specific Seal". If the electronic signature system finds neither "XXX Co., Ltd." nor "Business-specific Seal" in the document to be signed, it proves that the document has not been signed. In this case, the electronic signature positioning system searches for fields such as "Name:", "Unit Name:", "(Signature)" in the document to be signed, because these fields often indicate the signature location.

[0059] S105. After determining the coordinates of the preset field in the two-dimensional coordinate system, add the preset value to the horizontal coordinate of the preset field to obtain the stamping coordinates, and based on the stamping coordinates, add the electronic official seal data to the document to be signed to obtain the signed document.

[0060] Specifically, since the signature position is located on the right side of the preset fields such as "Name:", "Unit Name:", "(Signature)", etc., the preset value is added to the horizontal axis of the preset field to obtain the seal coordinates. The electronic official seal data is added to the seal coordinates in the document to be signed to obtain the signed document.

[0061] In one embodiment, the preset value can be set as the radius of the electronic official seal image. If the field "Unit Name:" is found in the document to be signed, the coordinates of the right border of the field are (5, 20), and the radius of the official seal image is 2, then the stamping coordinates are (5, 22). Align the center of the electronic official seal image with the stamping coordinates, and add the electronic official seal image to the document to be signed.

[0062] In addition, the present application embodiment also provides an electronic signature positioning system. Figure 4 As shown, the electronic signature positioning system 400 at least includes a key-value pair database 410 , an identification unit 420 , a determination unit 430 , and an execution unit 440 .

[0063] Among them, the key-value pair database 410 is used to store the title of the electronic document and the corresponding electronic official seal data in the form of key-value pairs. The identification unit 420 is used to identify the title of the document to be signed and the text in the electronic official seal data. The determination unit 430 is used to determine the coordinates of the signature field. The execution unit 440 is used to add the electronic official seal data to the document to be signed based on the coordinates of the signature field to obtain the signed document.

[0064] In a feasible implementation, the staff needs to store the titles of all electronic documents that need to be stamped during work and the electronic official seal data that should be stamped on the electronic document into the key-value pair database 410. If there is a new electronic document that needs to be stamped, the title of the new electronic document is used as the primary key, and the electronic official seal image corresponding to the electronic document is stored in the key-value pair database 410 as the key value. The electronic signature positioning system 400 can then automatically stamp the new electronic document.

[0065] In a feasible implementation, when using the electronic signature positioning system 400, the staff only needs to upload the document to be signed to the electronic signature positioning system 400, and then click the stamp button. The electronic signature positioning system 400 can automatically run the algorithm to complete the stamp on the document to be signed without the staff having to perform any other operations.

[0066] The electronic signature positioning method and system provided in the embodiment of the present application are mainly used for electronic signatures of electronic transaction documents, but are not limited to electronic transaction documents. Any document can be electronically signed through the electronic signature positioning method and system provided in the present application. It only needs to adjust the width of the above-mentioned preset area according to the document situation, and it can be applied to various forms of electronic documents. This solution determines the position where the seal should be affixed in the electronic document through an accurate and fast algorithm, which reduces the operating requirements of the staff, improves the positioning accuracy of the electronic signature position, and expands the scope of application.

[0067] Each embodiment in this application is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device, equipment, and non-volatile computer storage medium embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0068] The above describes specific embodiments of the present application. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0069] The above is only an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the embodiments of the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the embodiments of the present application should be included in the scope of the claims of the present application.

Claims

1. An electronic signature positioning method, characterized in that: The method comprises: The title of the electronic document and the corresponding electronic official seal data are stored in a key-value pair database in the form of a key-value pair; wherein the title of the electronic document is a primary key, and the electronic official seal data is a key value corresponding to the primary key; Receiving a document to be signed, and identifying the title of the document to be signed; According to the title of the document to be signed, searching for the corresponding electronic official seal data in the key-value pair database, and extracting the text in the electronic official seal data, specifically including: A two-dimensional coordinate system is established with the lower boundary of the document to be signed as the horizontal axis and the left boundary of the document to be signed as the vertical axis; In the two-dimensional coordinate system, determine the coordinates of the positioning center corresponding to each character in the electronic official seal data; Fit any two positioning centers into a straight line, and count the number of positioning centers that fall into the adjacent area of ​​each straight line; wherein the adjacent area is an area within a preset distance on both sides of the straight line; When the number of positioning centers falling into each straight line adjacent area is less than or equal to a first preset threshold, it is determined that only arc-shaped characters exist in the electronic official seal, and no horizontal characters exist; When the number of positioning centers falling into the adjacent area of ​​any straight line is greater than a first preset threshold, it is determined that there are arc-shaped characters and horizontal characters in the electronic official seal; In the two-dimensional coordinate system, the coordinates of the signature field are determined; wherein the signature field is a field in the document to be signed that is completely identical to the text in the electronic official seal data; Based on the coordinates of the signature field, the electronic official seal data is added to the document to be signed to obtain a signed document.

2. The electronic signature positioning method according to claim 1, characterized in that: Before adding the electronic official seal data to the document to be signed based on the coordinates of the signature field to obtain the signed document, the method further includes: Determining that the signature field does not exist in the document to be signed; In the two-dimensional coordinate system, coordinates of preset fields in the document to be signed are determined; wherein the preset fields include at least one or more of the following: name, unit name, signature; Adding a preset value to the horizontal coordinate of the preset field to obtain the stamping coordinate; Based on the seal coordinates, the electronic official seal data is added to the document to be signed to obtain a signed document.

3. The electronic signature positioning method according to claim 1, characterized in that: The step of identifying the title of the document to be signed specifically includes: In the preset area of ​​the document to be signed, determine the four boundaries of each line of text; wherein the four boundaries include an upper boundary, a lower boundary, a left boundary and a right boundary; In the two-dimensional coordinate system, based on the right boundary horizontal coordinate of each line of text, the title area of ​​the document to be signed is determined; wherein the title area is a line of text with the smallest right boundary horizontal coordinate among each line of text; In the case that there are more than one text lines with the smallest horizontal coordinate of the right boundary, the title area of ​​the document to be signed is determined based on the difference between the upper boundary vertical coordinate and the lower boundary vertical coordinate of each line of text; wherein the title area is the line of text with the largest difference between the upper boundary vertical coordinate and the lower boundary vertical coordinate in each line of text; The text in the title area is identified to obtain the title of the document to be signed.

4. The electronic signature positioning method according to claim 3, characterized in that: Determining the boundaries of each line of text in the preset area of ​​the document to be signed specifically includes: Extracting edge features of the document to be signed to obtain an edge image; In the preset area, generating a plurality of horizontal lines; determining the number of intersections of each horizontal line with edge lines in the edge image; Determine that the area where the horizontal line with the number of intersections with the edge line is located is a blank area; Between two adjacent blank areas, two horizontal lines having the least number of intersections with the edge line are determined as the upper and lower boundaries of each line of text; In the two-dimensional coordinate system, between the upper and lower boundaries of each line of text, determine the minimum horizontal coordinate and the maximum horizontal coordinate of the intersection points of the plurality of horizontal lines and the edge line; The vertical line corresponding to the minimum horizontal coordinate is determined as the left boundary of each line of text, and the vertical line corresponding to the maximum horizontal coordinate is determined as the right boundary of each line of text.

5. The electronic signature positioning method according to claim 3, characterized in that: The identifying of the text in the title area to obtain the title of the document to be signed specifically includes: Segmenting the text in the title area to obtain a plurality of title text images; Extracting features of the plurality of title text images to obtain a first feature vector; Performing data dimension reduction on the first eigenvector to obtain a second eigenvector; Inputting the second feature vector into a neural network classifier for first-level classification to obtain a third feature vector; The third feature vector is input into a KNN classifier for second-level classification to identify the text in the title area.

6. The electronic signature positioning method according to claim 1, characterized in that: The method further comprises: In the case where there are curved characters and horizontal characters in the electronic official seal, a horizontal character positioning center fitting straight line is determined based on the number of positioning centers in the adjacent area of ​​any straight line; wherein the horizontal character positioning center fitting straight line is the straight line with the largest number of positioning centers in the adjacent area; Determine that a number of characters corresponding to each positioning center in the vicinity of the horizontal character positioning center fitting straight line are horizontal characters, and determine that other characters in the electronic official seal are arc characters; The horizontal text is tilt-corrected, and the horizontal text after tilt-correction is recognized.

7. The electronic signature positioning method according to claim 6, characterized in that: After the tilt correction is performed on the horizontal text and the horizontal text after the tilt correction is recognized, the method further includes: Slicing the arc-shaped characters to obtain a plurality of arc-shaped characters; Taking the center of the electronic official seal as the pole, drawing a ray from the pole to the top of the electronic official seal as the polar axis, and establishing a polar coordinate system in the electronic official seal; wherein the counterclockwise direction of the polar coordinate system is the positive direction; Determine the polar coordinates of the plurality of arc-shaped characters in the polar coordinate system respectively; Arrange the arc characters on the left side of the polar axis and the arc characters on the right side of the polar axis in order of decreasing polar angles; Arrange the sorted arc characters on the left side of the polar axis in front, and arrange the sorted arc characters on the right side of the polar axis in the back, to obtain a complete order of the arc characters; Based on the polar angles of the plurality of arc-shaped characters, the plurality of arc-shaped characters are respectively rotated clockwise by corresponding angles to perform tilt correction on the plurality of arc-shaped characters; The arc-shaped characters are identified, sorted and tilt-corrected.

8. The electronic signature positioning method according to claim 7, characterized in that: In the two-dimensional coordinate system, the coordinates of the signature field are determined, specifically including: Identify all the characters in the document to be signed; Determine the first character string in the document to be signed that is completely identical in content and order to the arc-shaped characters as the signature field; When the first text string does not exist in the document to be signed, a second text string in the document to be signed that is completely identical in content and order to the horizontal text is determined as the signature field.

9. An electronic signature positioning system based on an electronic signature positioning method according to any one of claims 1 to 8, comprising: A key-value pair database, used to store the title of the electronic document and the corresponding electronic official seal data in the form of key-value pairs; The identification unit is used to identify the title of the document to be signed and the text in the electronic official seal data, specifically comprising: establishing a two-dimensional coordinate system with the lower boundary of the document to be signed as the horizontal axis and the left boundary of the document to be signed as the vertical axis; in the two-dimensional coordinate system, determining the coordinates of the positioning center corresponding to each text in the electronic official seal data; fitting any two of the positioning centers into a straight line, and counting the number of positioning centers falling into the adjacent area of ​​each straight line; wherein the adjacent area is the area within a preset distance on both sides of the straight line; when the number of positioning centers falling into the adjacent area of ​​each straight line is less than or equal to a first preset threshold, it is determined that only arc-shaped text exists in the electronic official seal, and no horizontal text exists; when the number of positioning centers falling into the adjacent area of ​​any straight line is greater than the first preset threshold, it is determined that there are arc-shaped text and horizontal text in the electronic official seal; A determination unit, used to determine the coordinates of the signature field; wherein the signature field is a field in the document to be signed that has the same text as that in the electronic official seal data; The execution unit is used to add the electronic official seal data to the document to be signed based on the coordinates of the signature field to obtain the signed document.

Citation Information

Patent Citations

  • Electronic seal method and electronic seal device

    CN107133312A

  • PDF document title structure tress generating method and device, terminal and system

    CN107291677A

  • Text image correction method and device, computer device and storage medium

    CN110866871A