CN112118017B - Serial number encoding and decoding methods and devices and electronic equipment - Google Patents

Serial number encoding and decoding methods and devices and electronic equipment Download PDF

Info

Publication number
CN112118017B
CN112118017B CN202011292944.2A CN202011292944A CN112118017B CN 112118017 B CN112118017 B CN 112118017B CN 202011292944 A CN202011292944 A CN 202011292944A CN 112118017 B CN112118017 B CN 112118017B
Authority
CN
China
Prior art keywords
serial number
character
sequence
error correction
target
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202011292944.2A
Other languages
Chinese (zh)
Other versions
CN112118017A (en
Inventor
王凤宇
饶丰
陈利兵
公骁
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Yiyi Education Technology Co ltd
Original Assignee
Beijing Yiyi Education Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Yiyi Education Technology Co ltd filed Critical Beijing Yiyi Education Technology Co ltd
Priority to CN202011292944.2A priority Critical patent/CN112118017B/en
Publication of CN112118017A publication Critical patent/CN112118017A/en
Application granted granted Critical
Publication of CN112118017B publication Critical patent/CN112118017B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H03ELECTRONIC CIRCUITRY
    • H03MCODING; DECODING; CODE CONVERSION IN GENERAL
    • H03M13/00Coding, decoding or code conversion, for error detection or error correction; Coding theory basic assumptions; Coding bounds; Error probability evaluation methods; Channel models; Simulation or testing of codes
    • H03M13/03Error detection or forward error correction by redundancy in data representation, i.e. code words containing more digits than the source words
    • H03M13/05Error detection or forward error correction by redundancy in data representation, i.e. code words containing more digits than the source words using block codes, i.e. a predetermined number of check bits joined to a predetermined number of information bits
    • H03M13/13Linear codes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/22Image preprocessing by selection of a specific region containing or referencing a pattern; Locating or processing of specific regions to guide the detection or recognition
    • G06V10/225Image preprocessing by selection of a specific region containing or referencing a pattern; Locating or processing of specific regions to guide the detection or recognition based on a marking or identifier characterising the area
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • G06V20/60Type of objects
    • G06V20/62Text, e.g. of license plates, overlay texts or captions on TV images
    • G06V20/63Scene text, e.g. street names
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/10Character recognition

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Probability & Statistics with Applications (AREA)
  • Character Discrimination (AREA)

Abstract

The invention provides a serial number encoding and decoding method, a serial number encoding and decoding device and electronic equipment, wherein the method comprises the following steps: obtaining a serial number to be coded; coding the serial number to be coded according to a preset error correction coding algorithm to obtain an error correction coded serial number; aiming at each number in the serial number after error correction coding, finding out the character corresponding to the number in the generated character table and replacing the number; the character table comprises N different characters, and each character is uniquely corresponding to a digital code in a carry system applied by the serial number after error correction coding; and after the replacement of each digit number in the error correction coded serial number is completed, obtaining the serial number coded into a character sequence. By the serial number encoding and decoding method and device and the electronic equipment, provided by the embodiment of the invention, the identification accuracy of the serial number can be improved.

Description

Serial number encoding and decoding methods and devices and electronic equipment
Technical Field
The invention relates to the technical field of coding and decoding, in particular to a serial number coding and decoding method, a serial number coding and decoding device, electronic equipment and a computer readable storage medium.
Background
Currently, most answer sheets are printed with serial numbers (abbreviated as ACID). The answer sheet identification system can identify the serial number printed on the answer sheet so as to acquire the relevant description information of the answer sheet, such as the page layout of the answer sheet, the identification area of the answer sheet required to be subjected to text identification and the like, and further facilitate the subsequent execution of various identification tasks aiming at the answer sheet.
However, the serial number is often encoded into a two-dimensional code at present, and if the serial number is encoded into the two-dimensional code, the success rate of identifying the serial number is maintained at 90-95% for a long time because the two-dimensional code identification process itself is easily affected by the paper quality and the printing precision of the two-dimensional code.
Disclosure of Invention
Based on this, embodiments of the present invention provide a serial number encoding method, a serial number decoding device, an electronic device, and a computer-readable storage medium, which solve the problem of low recognition rate in the conventional technology.
In a first aspect, an embodiment of the present invention provides a method for encoding a sequence number, including:
obtaining a serial number to be coded;
coding the serial number to be coded according to a preset error correction coding algorithm to obtain an error correction coded serial number;
aiming at each number in the serial number after error correction coding, finding out the character corresponding to the number in the generated character table and replacing the number; the character table comprises N characters which are different and have low similarity, and each character is uniquely corresponding to a digital code in a carry system applied by the serial number after error correction coding;
and after the replacement of each digit number in the error correction coded serial number is completed, obtaining the serial number coded into a character sequence.
In a second aspect, an embodiment of the present invention provides a method for decoding a sequence number, including:
identifying a character sequence from a target image to be identified, wherein the character sequence is obtained by coding a serial number to be determined;
aiming at each character in the character sequence, finding out a digital code corresponding to the character in the generated digital code table and replacing the character; the number table comprises each number in a carry system applied by the serial number, and each number uniquely corresponds to one character;
and after the replacement of each bit of character in the character sequence is finished, obtaining a digital sequence, and decoding the digital sequence according to a preset error correction decoding algorithm to obtain the serial number before being coded into the digital sequence.
In a third aspect, an embodiment of the present invention provides a serial number encoding apparatus, including:
an obtaining unit, configured to obtain a serial number to be encoded.
And the error correction coding unit is used for coding the serial number to be coded according to a preset error correction coding algorithm to obtain the serial number subjected to error correction coding.
A character replacing unit, configured to, for each digit number in the error-correction-coded serial number, find a character corresponding to the number in a generated character table and replace the number; the character table comprises N characters which are different and have low similarity, and each character is uniquely corresponding to a digital code in a carry system applied by the serial number after error correction coding; and after the replacement of each digit number in the error correction coded serial number is completed, obtaining the serial number coded into a character sequence.
In a fourth aspect, an embodiment of the present invention provides a serial number decoding apparatus, including:
the identification unit is used for identifying a character sequence from a target image to be identified, wherein the character sequence is obtained by coding a serial number to be determined;
a digital code replacing unit, configured to search, for each character in the character sequence, a digital code corresponding to the character in the generated digital code table and replace the character; the digital code table comprises each digital code in a carry system applied by the serial number, and each digital code is uniquely corresponding to one character;
and the error correction decoding unit is used for obtaining a digital sequence after finishing the replacement of each character in the character sequence, and decoding the digital sequence according to a preset error correction decoding algorithm to obtain the serial number before being coded into the digital sequence.
In a fifth aspect, an embodiment of the present invention provides an electronic device, including a bus, a transceiver, a memory, a processor, and a computer program stored on the memory and executable on the processor, where the transceiver, the memory, and the processor are connected via the bus, and when executed by the processor, the electronic device implements the steps in the serial number encoding method.
In a sixth aspect, an embodiment of the present invention provides an electronic device, including a bus, a transceiver, a memory, a processor, and a computer program stored on the memory and executable on the processor, where the transceiver, the memory, and the processor are connected via the bus, and when executed by the processor, the electronic device implements the steps in the serial number decoding method as described above.
According to the serial number encoding and decoding method and device, the electronic device and the computer readable storage medium provided by the embodiment of the invention, the serial number is not encoded into the two-dimensional code, the error correction encoding algorithm is firstly utilized to carry out error correction encoding on the serial number, and then the character table with lower overall similarity between characters is utilized to replace the serial number subjected to error correction encoding one by one, so that the serial number encoded into the character sequence is obtained. Therefore, in the process of identifying the serial number coded into the character sequence by adopting the computer vision technology, on one hand, the probability of error identification is reduced due to lower similarity among the characters; on the other hand, even if the misrecognition occurs in the process of recognizing the character sequence, the wrong recognition result can be corrected through an error correction decoding algorithm to obtain a correct serial number after the replacement from the character to the digital code is completed, and the recognition accuracy of the serial number is further improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments or the background art of the present invention, the drawings required to be used in the embodiments or the background art of the present invention will be described below.
Fig. 1 is a flowchart illustrating a method for encoding a serial number according to an embodiment of the present invention;
FIG. 2 is a flow chart of the character table generation provided by the embodiment of the invention;
fig. 3 is a schematic diagram illustrating an answer sheet according to an embodiment of the present invention;
fig. 4 is a flowchart illustrating a serial number decoding method according to an embodiment of the present invention;
fig. 5 shows a flowchart of an implementation of S201 according to an embodiment of the present invention;
fig. 6 shows a flowchart of an implementation of S301 according to an embodiment of the present invention;
fig. 7 shows a flowchart of an implementation of S302 provided in the embodiment of the present invention;
fig. 8 shows a flowchart of another implementation of S302 according to the present invention;
fig. 9 is a schematic structural diagram of a serial number encoding apparatus according to an embodiment of the present invention;
fig. 10 is a schematic structural diagram of a serial number decoding apparatus provided in an embodiment of the present invention;
fig. 11 shows a schematic structural diagram of an electronic device provided in an embodiment of the present invention.
Detailed Description
For clarity and conciseness of description of embodiments of the present invention, a brief introduction to the relevant concepts or technologies is first given:
those skilled in the art will appreciate that embodiments of the present invention may be implemented as serial number encoding and decoding methods, apparatuses, electronic devices, and computer-readable storage media. Thus, embodiments of the invention may be embodied in the form of: entirely hardware, entirely software (including firmware, resident software, micro-code, etc.), a combination of hardware and software. Furthermore, in some embodiments, embodiments of the invention may also be embodied in the form of a computer program product in one or more computer-readable storage media having computer program code embodied in the medium.
The computer-readable storage media described above may take any combination of one or more computer-readable storage media. The computer-readable storage medium includes: an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of the computer-readable storage medium include: a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only Memory (ROM), an erasable programmable read-only Memory (EPROM), a Flash Memory, an optical fiber, a compact disc read-only Memory (CD-ROM), an optical storage device, a magnetic storage device, or any combination thereof. In embodiments of the invention, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, device, or apparatus.
The computer program code embodied on the computer readable storage medium may be transmitted using any appropriate medium, including: wireless, wire, fiber optic cable, Radio Frequency (RF), or any suitable combination thereof.
Computer program code for carrying out operations for embodiments of the present invention may be written in one or more programming languages, including an object oriented programming language such as: java, Smalltalk, C + +, and also include conventional procedural programming languages, such as: c or a similar programming language. The computer program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be over any of a variety of networks, including: a Local Area Network (LAN) or a Wide Area Network (WAN), which may be connected to the user's computer, may be connected to an external computer.
Embodiments of the present invention are described below with reference to flowchart illustrations and/or block diagrams of serial number encoding and decoding methods, apparatuses, electronic devices, and computer-readable storage media according to embodiments of the invention.
It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer-readable program instructions. These computer-readable program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions/acts specified in the flowchart and/or block diagram block or blocks.
These computer-readable program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing apparatus to function in a particular manner. Thus, the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means which implement the function/act specified in the flowchart and/or block diagram block or blocks.
The computer readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other devices to cause a series of operational steps to be performed on the computer, other programmable apparatus or other devices to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide processes for implementing the functions/acts specified in the flowchart and/or block diagram block or blocks.
Before describing the present invention in further detail, the technical terms related to the present invention are explained herein:
carry system: carry system is a kind of counting method, so it is also called carry counting method/bit value counting method, and can use limited number symbols to represent all the numerical values. The number of the usable digital symbols is called radix (en), and the radix is n, namely an n-carry system, which is called n-ary system for short.
Number: the carry system refers to the finite number symbols used to represent each value as a number, and the n-carry system corresponds to n numbers. For example, decimal numbers are used with the number symbols 0 to 9, and the 0 to 9 are referred to as decimal numbers.
In order to make the aforementioned objects, features and advantages of the present invention comprehensible, embodiments accompanied with figures are described in detail below.
Fig. 1 shows a flowchart of a serial number encoding method according to an embodiment of the present invention. As shown in fig. 1, the method includes:
s101, obtaining a serial number to be coded.
As an example, the serial number to be encoded in the embodiment of the present invention may be an identifier of an article such as a document, a commodity, a ticket, or the like. For example, when the serial number to be encoded is used to print on a ticket, the serial number to be encoded is a serial number that uniquely identifies the identity of the ticket. For another example, when the serial number to be encoded is used for printing on a document such as an answer sheet, the serial number to be encoded may be a layout information identifier for identifying a page layout to which the answer sheet is applied. The specific function of the serial number to be encoded in the embodiment of the present invention in practical application may be set according to practical situations, which is not limited in the present invention.
In the embodiment of the present invention, the serial number to be encoded may have a plurality of implementation manners according to actual situations, and two different implementation manners are exemplified below:
in a possible implementation manner, the serial number to be encoded may be a sequence of numbers which are composed of pure numbers and adopt an arbitrary carry system. That is, in this implementation, the carry system adopted by the serial number to be encoded is not limited, and the serial number encoding method can encode the serial number to be encoded adopting any carry system.
In another possible implementation, the sequence number to be encoded may be a sequence of numbers that consists of pure numbers but employs some specified carry system. That is, in the present embodiment, the carry system adopted for the serial number to be encoded, which can execute the present serial number encoding method, is restricted. It can be understood that, in practical scenarios, the carry mechanism applied by the serial number is various. In order to enable the serial number (marked as the initial serial number) adopting other carry systems (i.e. carry systems different from the specified carry system) to meet the requirement of the carry system applied to the serial number to be encoded in the present implementation, S101 may implement the conversion of the carry system by the following steps: if the carry system adopted by the initial serial number is different from the specified carry system, the carry system adopted by the initial serial number is converted into the specified carry system to obtain the serial number to be coded.
Here, a simple example is given to describe the carry system conversion process described above. Assuming that the limited carry system in this implementation is 16 bits, if the decimal initial sequence number 46253 is obtained at this time, in this implementation, the decimal initial sequence number 46253 needs to be converted into a 16-ary sequence number b4ad, and then the sequence number b4ad to be encoded is obtained.
Two different serial number implementations are described in detail above.
It should be noted that the base number of the carry designation system may be selected according to actual situations, and the base number of the carry designation system is not limited in the present invention.
It should be noted that the serial number to be encoded may be represented in various ways. As one of the expression ways, the serial number to be encoded may be expressed in a numerical form. As another way of representation, the sequence number to be encoded may be represented in an array form. Of course, two representation forms are described here by way of example only, and in specific implementation, an appropriate representation form may be selected to represent the serial number to be encoded according to actual situations.
S102, coding the serial number to be coded according to a preset error correction coding algorithm to obtain the serial number subjected to error correction coding.
In S102, the reason why the serial number to be encoded is encoded by the error correction coding algorithm is that, even if misrecognition (recognition of a certain number or numbers in the error-correction-coded serial number as other numbers, characters, or symbols) occurs in a process of subsequently recognizing the serial number by using a computer vision technique, the misrecognition can be corrected by using an error correction decoding algorithm corresponding to the error correction coding algorithm. Therefore, the error correction coding algorithm is adopted to code the serial number to be coded, so that the influence of false recognition on the recognition result in the subsequent recognition process can be reduced.
Alternatively, the error correction coding algorithm may adopt a forward error correction coding algorithm, such as an RS coding algorithm. Here, taking the serial number to be encoded [2,0,0,12,57] whose expression is in array form and whose carry system applied is 16-ary as an example, if RS encoding is performed on the serial number to be encoded, the error-correction encoded serial number [2,0,0,12,57, A8, 4B, CE, F5, FD, 70, CF, 6A, 91, D9, 29, D6] can be obtained.
It should be noted that, besides the RS coding algorithm illustrated in the above-mentioned error correction coding algorithm, other error correction coding algorithms may be adopted according to actual situations, and the present invention is not limited to this.
It should be further noted that the error correction coding algorithm described above does not change the carry system applied to the serial number to be coded during the coding process. That is, the carry system applied by the sequence number encoded by the error correction coding algorithm and the sequence number to be encoded is the same.
S103, aiming at each digit number in the serial number after error correction coding, finding the character corresponding to the number in the generated character table and replacing the number; the character table comprises N characters with different and low similarity, and each character uniquely corresponds to one digital code in a carry system applied by the serial number after error correction coding.
Before S103 is executed, a character table may be generated according to the serial number after error correction coding or a carry system applied by the serial number to be coded, where each character of the N characters in the character table uniquely corresponds to one digital code in the carry system. Here, as a simple example, it is assumed that the carry system applied to the serial number to be encoded is 16-ary, and the 16 digits are 0,1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F. Then the 16 characters in the generated character table may be H, J, K, #, 4, M, S, T, V, X, A, B, C, D, Y, Z. Wherein H corresponds to 0, J corresponds to 1, K corresponds to 2, Z corresponds to F, and so on. The specific correspondence can be seen in the following table:
TABLE 1
H-0 4-4 V-8 C-12
J-1 M-5 X-9 D-13
K-2 S-6 A-10 Y-14
#-3 T-7 B-11 Z-15
Taking the cell at the upper left corner of the above table 1 as an example, there is recorded "H-0". Here, "H" represents a character in the character table, "0" represents a number in the carry system applied to the serial number to be encoded, and "-" represents the correspondence. Other cells are similar to the cell and are not described in detail herein.
As for how to generate the above character table, the following will list specific implementation manners for detailed description, and will not be repeated here.
As an example, finding the character corresponding to the number in the generated character table and replacing the number may include: and using the number as a keyword, searching a character corresponding to the keyword in the generated character table, and replacing the number by using the searched character.
Here, the character table including the characters H, J, K, #, 4, M, S, T, V, X, A, B, C, D, Y, Z generated by the aforementioned error correction coded serial numbers [2,0,0,12,57, A8, 4B, CE, F5, FD, 70, CF, 6A, 91, D9, 29, D6] is also taken as an example. Then, if the character table is used to replace the character of the sequence number after error correction coding, the character sequence obtained after replacement is HKHHHHJKMTAV4 bcyzimzdthczszaxjdxkxds.
Note that, the error-correction-encoded serial number has one digit such as 2 and 0. In order to make 2 and 0 both two bits as well as their remainder, when character replacement is performed, 2 and 0 are complemented with 0. That is, the 2 complement is 02 and the 0 complement is 00. Therefore, the 2 mentioned above is replaced by HK after being complemented and the 0 mentioned above is replaced by HH after being complemented. Of course, the bit padding operation is not required in the execution step, and the implementation of the embodiment of the present invention is not affected by the bit padding.
S104, after the replacement of each digit number in the serial number after error correction coding is completed, the serial number coded into the character sequence is obtained.
S104, for the serial number coded into the character sequence, on one hand, the probability of error recognition in the process of recognizing the serial number by adopting a computer vision technology is reduced due to lower similarity among the characters; on the other hand, even if the error recognition occurs in the process of recognizing the character sequence, the error recognition result can be corrected through an error correction decoding algorithm to obtain a correct serial number, so that the recognition accuracy of the serial number is improved.
Thus, the flow shown in fig. 1 is completed.
According to the serial number encoding method provided by the embodiment of the invention, the serial number is not encoded into the two-dimensional code, but the serial number is encoded by using an error correction encoding algorithm, and then the error-correction encoded serial number is replaced one by using the character table with lower overall similarity between characters, so that the serial number encoded into the character sequence is obtained. Therefore, in the process of identifying the serial number coded into the character sequence by adopting the computer vision technology, on one hand, the probability of error identification is reduced due to lower similarity among the characters; on the other hand, even if the misrecognition occurs in the process of recognizing the character sequence, the wrong recognition result can be corrected through an error correction decoding algorithm to obtain a correct serial number after the replacement from the character to the digital code is completed, and the recognition accuracy of the serial number is further improved.
How the character table in S103 described above is generated will be described below.
Referring to fig. 2, fig. 2 shows a flowchart of generating a character table according to an embodiment of the present invention, where the flowchart may include:
and S1031, determining the number N of the characters required by the character table according to the cardinal number of the carry system applied by the serial number after error correction coding.
As an example, S1031 may directly determine the error-correction-encoded serial number, or a base number to which a carry system is applied to the serial number to be encoded, as the number of characters required by the character table. In a simple example, assuming that the base number of the carry system applied to the error-correction-coded serial number is 16, the number of characters required for the character table is also 16. Thus, each character can be conveniently uniquely associated with a number.
S1032, calculating the similarity between every two characters in a preset candidate character set, and selecting N target characters with the number of the characters according to the calculated similarity; and the similarity between every two target characters in the selected N target characters is smaller than the determined similarity threshold.
In the embodiment of the present invention, the preset candidate character set may be manually set by a human. Here, an example of a setting manner of the candidate character set is as follows: 10 numbers 0 to 9 and 26 english alphabets a to z are selected as a preset candidate character set for a total of 36 characters. Of course, in addition to the above-listed setting manners, the characters accommodated in the preset candidate character set may be selected according to actual situations, and the present application is not limited to this specifically.
In calculating the similarity between every two characters in a preset candidate character set (for example, the above-mentioned candidate character set selected manually), a similarity calculation algorithm known to those skilled in the art, for example, a cosine similarity algorithm, an euclidean distance algorithm, etc., may be used. Since the calculation method of the similarity between characters is not a main improvement of the present invention, it will not be described in detail.
In the embodiment of the invention, after the similarity between every two characters is calculated, N target characters can be selected through various implementation modes. Two of these implementations are described below by way of example.
As one implementation, all similarities smaller than the determined similarity threshold may be selected from the calculated similarities. And then, sequencing the selected similarity according to a sequence from small to large to obtain a similarity sequence. Based on the similarity sequence, N candidate characters corresponding to the first N/2 similarities in the similarity sequence are selected from a preset candidate character set.
And if no repeated candidate character exists in the selected N candidate characters, directly determining the N candidate characters as N target characters in the character table to generate the character table.
If repeated candidate characters exist in the N candidate characters, deleting one or more candidate characters causing the repetition, and continuing to select the candidate character which is not selected in the similarity sequence and corresponds to the minimum similarity from a preset candidate character set. And then, further judging whether repeated characters exist in all the selected candidate characters and whether the number of the non-repeated characters is equal to N or not until N non-repeated candidate characters are selected, and determining the N candidate characters as target characters to generate the character table.
As another implementation, all similarities smaller than the determined similarity threshold may be selected from all similarities. And then, randomly selecting N candidate characters from all the candidate characters corresponding to the selected similarity as target characters to generate the character table.
As another implementation manner, if the number of similarities smaller than the determined similarity threshold among all the calculated similarities is smaller than N/2, all M similarities smaller than the determined similarity threshold may be selected from all the similarities, and T similarities larger than the determined similarity threshold are selected, where the sum of M and T is equal to N/2. If there is no repeated character in the N candidate characters corresponding to the M similarity and the T similarity, and the overall similarity of the M similarity and the T similarity is smaller than the determined similarity threshold, the N candidate characters corresponding to the M similarity and the T similarity may be determined as the target character to generate the character table.
Optionally, the above calculation manner for calculating the overall similarity may be: and calculating the mean, the variance or the standard deviation of all the similarities to be calculated, and taking the obtained result as the overall similarity.
Three implementations of selecting N target characters are described above. As to how the above-mentioned determined similarity threshold is determined, the embodiments of the present invention provide various implementation manners, which are described below separately.
As one of the implementations, it may be determined empirically, manually.
As another implementation, the method may include the following steps:
step a, calculating the similarity between every two digital codes in each digital code of a carry system applied by the serial number after error correction coding;
and b, setting and calculating all the similarity degrees obtained in the step a to obtain the overall similarity degree between the numbers of the carry system applied by the error correction coded serial number.
Optionally, the setting calculation may be: and calculating the mean, variance or standard deviation of all the obtained similarities.
And c, determining a similarity threshold value based on the overall similarity determined in the step b.
In step c, a positive number lower than the overall similarity determined in step b may be selected as the similarity threshold. Specifically, a similarity adjustment value, for example, 5%, may be preset, and the similarity threshold may be obtained by subtracting the similarity adjustment value from the overall similarity determined in step b. Of course, a specific implementation manner is illustrated here only by way of example, and in actual implementation, the similarity threshold may also be determined according to actual situations, and it is only necessary to ensure that the similarity threshold is lower than the overall similarity determined in step b and is a positive number.
How the character table in S103 described above is generated is described above.
Once the serial number is obtained, which is encoded as a sequence of characters, the serial number can be applied to a document, article or ticket that needs to be identified by the serial number. Taking the application of the serial number to the answer sheet as an example, an application process of the serial number is described below, and the application process may include the following steps:
and d, adding the serial number to a target area of the answer sheet.
The target region in step d may be set manually in advance. In the case of the answer sheet shown in fig. 3, the target area may be the left side of the answer sheet, and/or the central position of the blank area on the right side. I.e. the first target area and the second target area shown in fig. 3.
And e, setting positioning identification areas at two ends of the target area, wherein the positioning identification areas are used for identifying the target area.
The positioning mark area in step e may be manually set in advance. In the case of the answer sheet shown in fig. 3, the positioning mark area is square. Of course, the specific shape of the positioning mark area can be set according to the actual situation, which is not limited in this application.
The above description is made on how the serial number is applied to the answer sheet.
In the embodiment of the present invention, in addition to the above-described serial number encoding method, an embodiment of the present invention further provides a serial number decoding method. As shown in fig. 4, the method for decoding a sequence number according to the embodiment of the present invention may include the following steps:
s201, recognizing a character sequence from the target image to be recognized, wherein the character sequence is obtained by coding a serial number to be determined.
In the embodiment of the present invention, the target image is an image containing a character sequence, and the target image can be obtained by shooting a paper document printed with the character sequence through a shooting device. It should be noted that the paper document may be an answer sheet, a bill, etc., and the present invention is not limited thereto.
As to how to recognize the character sequence from the target image to be recognized, the following will be described in detail with reference to the flow shown in fig. 5, and details thereof are not repeated here.
In addition, how to obtain the character sequence after the sequence number is encoded is described in detail in advance, and reference may be specifically made to the foregoing description of S101 to S104, which is not described herein again.
S202, aiming at each character in the character sequence, finding out a digital code corresponding to the character in the generated digital code table and replacing the character; the number table comprises each number in a carry system applied by the serial number, and each number uniquely corresponds to one character.
In S202, each number in the carry system applied by the serial number is included in the number table, and each number uniquely corresponds to one character. The correspondence here may be formed in the aforementioned encoding process of the serial number. It is understood that, if the correspondence between the numbers and the characters is recorded in the same table, the number table is the same table as the character table. In this case, the different names are merely used to distinguish the decoding process from the encoding process.
Since S202 and S102 are corresponding steps, the corresponding relationship between the characters in the character table and the numbers in the number table is not described again.
The specific implementation of S202 is described here by way of example, and it is assumed that the generated digital table includes 0,1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F, and the correspondence relationship between the digital table and each character is as shown in the following table:
TABLE 2
H-0 4-4 V-8 C-12
J-1 M-5 X-9 D-13
K-2 S-6 A-10 Y-14
#-3 T-7 B-11 Z-15
Taking the cell at the upper left corner of the above table 2 as an example, there is recorded "H-0". Here, "H" represents a character in the character table, "0" represents a number in the carry system applied to the serial number to be encoded, and "-" represents the correspondence. Other cells are similar to the cell and are not described in detail herein.
Then, if the recognized character sequence is HKHHHHJKMTAV4 bcyzmzdthczsaaxjdxkxds as an example, the sequence number obtained after substitution is [2,0,0,12,57, A8, 4B, CE, F5, FD, 70, CF, 6A, 91, D9, 29, D6 ]. Note that the replacement operation here has deleted 0 for the complement. The specific content of the padding operation is described previously, and is not described herein again.
S203, after the replacement of each bit of character in the character sequence is completed, a digital sequence is obtained, and the digital sequence is decoded according to a preset error correction decoding algorithm to obtain a serial number before being encoded into the digital sequence.
In S203, the error correction decoding algorithm is an algorithm corresponding to the error correction encoding algorithm used in the process of encoding the serial number into the character sequence. Therefore, by decoding the replaced character sequence (i.e., the digital code sequence) by using the error correction decoding algorithm, the serial number before being encoded into the digital code sequence can be obtained.
Here, also taking the replaced sequence numbers [2,0,0,12,57, A8, 4B, CE, F5, FD, 70, CF, 6A, 91, D9, 29, D6] as an example, if the sequence numbers are decoded by using an RS decoding algorithm, the sequence numbers [2,0,0,12,57] can be obtained.
The flow shown in fig. 4 is completed.
How to recognize a character sequence from the target image to be recognized in S201 described above is described below.
Referring to fig. 5, fig. 5 shows a flowchart of implementing S201 provided in the embodiment of the present invention, where the flowchart may include:
s301, identifying a positioning identification area in the target image.
In the embodiment of the invention, the positioning identification area is recognized in the target image in various ways. The following will be described in detail with reference to the flow shown in fig. 6, which is not repeated herein.
S302, determining a target area where the character sequence is located based on the positioning identification area, and identifying the target area according to a preset text identification algorithm to obtain the character sequence.
In the embodiment of the invention, the target area where the character sequence is located is determined based on the positioning identification area, and various implementation modes are provided. The following will be described in detail with reference to the flow shown in fig. 7, which is not repeated herein.
In addition, in the embodiment of the present invention, there are also various implementation manners for recognizing the target area according to a preset text recognition algorithm. As one implementation manner, the target area may be directly identified according to a preset text recognition algorithm. That is, the recognition is performed directly without changing the image direction of the target image. But this may result in poor recognition accuracy due to the image being in a direction that is not consistent with the image direction required by the text recognition algorithm. Therefore, another implementation manner is provided in the embodiment of the present invention, which will be described below with reference to the flow shown in fig. 8, and will not be described herein again.
It should be noted that the preset text recognition algorithm may be an OCR recognition algorithm. Of course, other text recognition algorithms may be used to recognize the target region, such as CRNN (Convolutional Recurrent Neural Network), and the present invention is not limited to this.
The above describes how the character sequence on the target paper document is recognized in the target image in S201.
How to identify the location indicator area in the target image in S301 described above is described below.
Referring to fig. 6, fig. 6 shows a flowchart of implementing S301 provided in the embodiment of the present invention, where the flowchart may include:
s401, carrying out binarization processing on the target image to obtain a binarized target image.
The process of binarizing the target image can be implemented in a manner well known to those skilled in the art, and will not be described in detail here.
S402, aiming at each connected region in the binarized target image, if the geometric data of the connected region is matched with the geometric data of the existing positioning identification region, determining the connected region as the positioning identification region.
For the binarized target image, a plurality of connected regions are generated in the image, and the plurality of connected regions also comprise the positioning identification region. Therefore, for each connected region, the geometric data of the connected region can be counted and compared with the geometric data of the existing positioning identification region to determine the positioning identification region.
The geometric data of the positioning identification area may be an aspect ratio, a length of each side, and the like of the positioning identification area, and may be determined according to an actual shape of the positioning identification area, which is not limited in this application.
If the geometric data of the connected region is matched with the geometric data of the existing positioning identification region, the connected region can be determined as the positioning identification region.
The above describes how the positioning identification area is recognized in the target image in S301.
How to identify the target area according to the preset text recognition algorithm in S302 is described below.
Referring to fig. 7, fig. 7 is a flowchart illustrating an implementation of S302 according to an embodiment of the present invention, where the flowchart may include:
s501, based on the original image direction of the target image, the target area is recognized according to a preset text recognition algorithm, and a first character sequence and a first confidence coefficient corresponding to the first character sequence are obtained.
In S501, the target region is directly identified according to a preset text recognition algorithm without changing the image direction of the target image, so as to obtain the first character sequence and a first confidence corresponding to the first character sequence. Here, the first confidence is used to indicate the degree of coincidence between the recognized first character sequence and the character sequence displayed in the actual target image.
S502, rotating the target image according to a preset rotation angle, and identifying the target area in the rotated target image according to a preset text identification algorithm to obtain a second character sequence and a second confidence coefficient corresponding to the second character sequence.
S502 is different from S501, and it is necessary to rotate the target image according to a preset rotation angle, and then recognize the target image to obtain the second character sequence and the second confidence corresponding to the second character sequence.
The preset rotation angle may be set according to actual conditions, for example, set to 180 degrees, 90 degrees, and the like, and the present application does not limit this.
S503, comparing the first confidence coefficient with the second confidence coefficient, and determining the character sequence corresponding to the larger confidence coefficient as the recognized character sequence.
It can be seen from the above S501 and S502 that there must be a recognition process in S501 and S502 based on the image direction required by the text recognition algorithm, or the recognition process is performed closer to the image direction required by the text recognition algorithm. And the confidence of the recognition result is higher because the recognition is carried out on the image side closer to the text recognition algorithm than the recognition based on the image side farther from the text recognition algorithm. Therefore, a more accurate recognition result can be obtained by comparing and comparing the first confidence coefficient and the second confidence coefficient and selecting the character sequence corresponding to the larger confidence coefficient to determine as the recognized character sequence.
The above describes how to identify the target area according to the preset text recognition algorithm in S302.
Next, how to determine the target area where the character sequence is located based on the positioning identification area in S302 is described.
Referring to fig. 8, fig. 8 shows another implementation flowchart of S302 provided in the embodiment of the present invention, where the flowchart may include:
s601, if two positioning identification areas are identified in the target image, determining two area vertexes of the target area according to each positioning identification area.
As an example, each target area may be provided with a positioning identification area at each of two ends. That is, one character sequence is located in one target area, and one target area corresponds to two location identification areas. Based on this, if two positioning identification regions are identified, which means that no identification omission of the positioning identification regions occurs, the region vertex of the target region can be determined based on the two positioning identification regions.
Optionally, before determining the region vertices, a number of vertices closer to each other on the two positioning identification regions may be artificially preset as the region vertices. Accordingly, in the process of determining the region vertex, the preset vertex may be directly determined as the region vertex. As shown in fig. 3, two vertices of the positioning indicator region a on the side close to the serial number may be set as region vertices, two vertices of the positioning indicator region B on the side close to the serial number may be set as region vertices, and each vertex may be determined as a region vertex in accordance with the determination.
S602, connecting the determined four region vertexes into a quadrilateral region, and determining the quadrilateral region as a target region.
After the region vertices are determined, the region vertices may be connected to form a closed quadrilateral region using the connecting lines. It should be noted that the connecting lines in S602 are not connected between every two region vertices, but each region vertex is regarded as an intersection of each edge of the finally enclosed quadrilateral region, so that the connecting lines between the region vertices do not intersect and a closed region can be formed.
The above describes how to determine the target region where the character sequence is located based on the positioning identification region in S302.
The serial number encoding method and the serial number decoding method provided by the embodiments of the present invention are described above in detail, and the methods can also be implemented by corresponding apparatuses.
Fig. 9 is a schematic structural diagram illustrating a serial number encoding apparatus according to an embodiment of the present invention. As shown in fig. 9, the serial number encoding apparatus includes:
an obtaining unit, configured to obtain a serial number to be encoded.
And the error correction coding unit is used for coding the serial number to be coded according to a preset error correction coding algorithm to obtain the serial number subjected to error correction coding.
A character replacing unit, configured to, for each digit number in the error-correction-coded serial number, find a character corresponding to the number in the generated character table and replace the number; the character table comprises N different characters, and each character is uniquely corresponding to a digital code in a carry system applied by the serial number after error correction coding; and after the replacement of each digit number in the serial number subjected to error correction coding is completed, obtaining the serial number coded into the character sequence.
In one possible implementation, the overall similarity between the N different characters included in the character table is lower than the overall similarity between the numbers in the carry system applied to the error correction coded serial number.
In one possible implementation, the character table is generated by: determining the number N of the characters required by the character table according to the cardinal number of the carry system applied by the serial number after error correction coding; calculating the similarity between every two characters in a preset candidate character set, and selecting N target characters with the number of characters from the candidate character set according to the calculated similarity; and the similarity between every two target characters in the selected N target characters is smaller than the determined similarity threshold.
The serial number encoding apparatus shown in fig. 9 was described above.
The serial number decoding apparatus is described in detail below:
fig. 10 is a schematic structural diagram illustrating a serial number decoding apparatus according to an embodiment of the present invention. As shown in fig. 10, the serial number decoding apparatus includes:
the identification unit is used for identifying a character sequence from a target image to be identified, wherein the character sequence is obtained by coding a serial number to be determined;
a digital code replacing unit, which is used for searching the digital code corresponding to the character in the generated digital code table and replacing the character aiming at each character in the character sequence; the digital table comprises each digital in a carry system applied by the serial number, and each digital uniquely corresponds to one character;
and the error correction decoding unit is used for obtaining a digital sequence after the replacement of each bit of character in the character sequence is completed, and decoding the digital sequence according to a preset error correction decoding algorithm to obtain a serial number before the serial number is coded into the digital sequence.
In a possible implementation manner, the target image includes a positioning identification area, and the positioning identification area is used for identifying a target area where the character sequence is located in the target image; the recognition unit recognizes a character sequence from a target image to be recognized, and comprises: identifying a positioning identification area in a target image; and determining a target area where the character sequence is located based on the positioning identification area, and identifying the target area according to a preset text identification algorithm to obtain the character sequence.
In a possible implementation manner, the recognizing unit recognizes the target area according to a preset text recognition algorithm, including: identifying a target region according to a preset text identification algorithm based on the original image direction of a target image to obtain a first character sequence and a first confidence coefficient corresponding to the first character sequence; rotating the target image according to a preset rotation angle, and identifying a target region in the rotated target image according to a preset text identification algorithm to obtain a second character sequence and a second confidence coefficient corresponding to the second character sequence; and comparing the first confidence coefficient with the second confidence coefficient, and determining the character sequence corresponding to the higher confidence coefficient as the recognized character sequence.
In one possible implementation manner, the identifying unit identifies a location identification area in the target image, including: carrying out binarization processing on the target image to obtain a binarized target image; and for each connected region in the binarized target image, if the geometric data of the connected region is matched with the existing geometric data of the positioning identification region, determining the connected region as the positioning identification region.
In a possible implementation manner, the determining, by the recognition unit, a target area where the character sequence is located based on the positioning identification area includes: if two positioning identification areas are identified in the target image, determining two area vertexes of the target area according to each positioning identification area; and connecting the determined four region vertexes into a quadrilateral region, and determining the quadrilateral region as the target region.
The serial number decoding apparatus shown in fig. 10 was described above.
In addition, an embodiment of the present invention further provides an electronic device, which includes a bus, a transceiver, a memory, a processor, and a computer program stored in the memory and capable of running on the processor, where the transceiver, the memory, and the processor are connected via the bus, and when the computer program is executed by the processor, the processes of the serial number encoding method embodiment are implemented, and the same technical effect can be achieved, and details are not described here to avoid repetition.
Specifically, referring to fig. 11, an embodiment of the present invention further provides an electronic device, which includes a bus 71, a processor 72, a transceiver 73, a bus interface 74, a memory 75, and a user interface 76.
In an embodiment of the present invention, the electronic device further includes: a computer program stored on the memory 75 and executable on the processor 72, the computer program, when executed by the processor 72, implementing the steps of the serial number encoding method described above.
A transceiver 73 for receiving and transmitting data under the control of the processor 72.
In FIG. 11, a bus architecture (represented by bus 71), bus 71 may include any number of interconnected buses and bridges, bus 71 connecting various circuits including one or more processors, represented by processor 72, and memory, represented by memory 75.
Bus 71 represents one or more of any of several types of bus structures, including a memory bus, and memory controller, a peripheral bus, an Accelerated Graphics Port (AGP), a processor, or a local bus using any of a variety of bus architectures. By way of example, and not limitation, such architectures include: an Industry Standard Architecture (ISA) bus, a Micro Channel Architecture (MCA) bus, an Enhanced ISA (EISA) bus, a Video Electronics Standards Association (VESA), a Peripheral Component Interconnect (PCI) bus.
The processor 72 may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method embodiments may be performed by integrated logic circuits in hardware or instructions in software in a processor. The processor described above includes: general purpose processors, Central Processing Units (CPUs), Network Processors (NPs), Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs), Complex Programmable Logic Devices (CPLDs), Programmable Logic Arrays (PLAs), Micro Control Units (MCUs) or other Programmable Logic devices, discrete gates, transistor Logic devices, discrete hardware components. The various methods, steps and logic blocks disclosed in embodiments of the present invention may be implemented or performed. For example, the processor may be a single core processor or a multi-core processor, which may be integrated on a single chip or located on multiple different chips.
The processor 72 may be a microprocessor or any conventional processor. The steps of the serial number encoding method disclosed by the embodiment of the invention can be directly executed and completed by a hardware decoding processor, or can be executed and completed by the combination of hardware and software modules in the decoding processor. The software modules may be located in a Random Access Memory (RAM), a Flash Memory (Flash Memory), a Read-Only Memory (ROM), a Programmable ROM (PROM), an Erasable PROM (EPROM), a register, and other readable storage media known in the art. The readable storage medium is located in the memory, and the processor reads the information in the memory and combines the hardware to complete the steps of the above method.
The bus 71 may also connect various other circuits such as peripherals, voltage regulators, or power management circuits to one another, and a bus interface 74 provides an interface between the bus 71 and the transceiver 73, as is well known in the art. Therefore, the embodiments of the present invention will not be further described.
The transceiver 73 may be one element or a plurality of elements, such as a plurality of receivers and transmitters, providing a means for communicating with various other devices over a transmission medium. For example: the transceiver 73 receives external data from other devices, and the transceiver 73 is used to transmit data processed by the processor 72 to other devices. Depending on the nature of the computer system, a user interface 76 may also be provided, such as: touch screen, physical keyboard, display, mouse, speaker, microphone, trackball, joystick, stylus.
It should be appreciated that in embodiments of the present invention, the memory 75 may further include memory remotely located from the processor 72, which may be connected to a server over a network. One or more portions of the above-described networks may be an ad hoc network (ad hoc network), an intranet (intranet), an extranet (extranet), a Virtual Private Network (VPN), a Local Area Network (LAN), a Wireless Local Area Network (WLAN), a Wide Area Network (WAN), a Wireless Wide Area Network (WWAN), a Metropolitan Area Network (MAN), the Internet (Internet), a Public Switched Telephone Network (PSTN), a plain old telephone service network (POTS), a cellular telephone network, a wireless fidelity (Wi-Fi) network, and combinations of two or more of the above. For example, the cellular telephone network and the wireless network may be a global system for Mobile Communications (GSM) system, a Code Division Multiple Access (CDMA) system, a Worldwide Interoperability for Microwave Access (WiMAX) system, a General Packet Radio Service (GPRS) system, a Wideband Code Division Multiple Access (WCDMA) system, a Long Term Evolution (LTE) system, an LTE Frequency Division Duplex (FDD) system, an LTE Time Division Duplex (TDD) system, a long term evolution-advanced (LTE-a) system, a Universal Mobile Telecommunications (UMTS) system, an enhanced Mobile Broadband (eMBB) system, a mass Machine Type Communication (mtc) system, an Ultra Reliable Low Latency Communication (urrllc) system, or the like.
It will be appreciated that memory 75 in embodiments of the invention may be either volatile memory or nonvolatile memory, or may include both volatile and nonvolatile memory. Wherein the nonvolatile memory includes: Read-Only Memory (ROM), Programmable ROM (PROM), Erasable PROM (EPROM), Electrically Erasable PROM (EEPROM), or Flash Memory.
The volatile memory includes: random Access Memory (RAM), which acts as an external cache. By way of example, and not limitation, many forms of RAM are available, such as: static random access memory (Static RAM, SRAM), Dynamic random access memory (Dynamic RAM, DRAM), Synchronous Dynamic random access memory (Synchronous DRAM, SDRAM), Double Data Rate Synchronous Dynamic random access memory (Double Data Rate SDRAM, DDRSDRAM), Enhanced Synchronous DRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), and Direct memory bus RAM (DRRAM). The memory 75 of the electronic device described in the embodiments of the present invention includes, but is not limited to, the above and any other suitable types of memory.
In an embodiment of the present invention, memory 75 stores the following elements of operating system 751 and application programs 752: an executable module, a data structure, or a subset thereof, or an expanded set thereof.
Specifically, the operating system 751 comprises various system programs, such as: a framework layer, a core library layer, a driver layer, etc. for implementing various basic services and processing hardware-based tasks. Applications 752 include various applications such as: media Player (Media Player), Browser (Browser), for implementing various application services. A program implementing the method of an embodiment of the present invention may be included in the application 752. The application programs 752 include: applets, objects, components, logic, data structures, and other computer system executable instructions that perform particular tasks or implement particular abstract data types.
In addition, an embodiment of the present invention further provides a computer-readable storage medium, where a computer program is stored, and when being executed by a processor, the computer program implements each process of the above serial number encoding method embodiment, and can achieve the same technical effect, and is not described herein again to avoid repetition.
The computer-readable storage medium includes: permanent and non-permanent, removable and non-removable media may be tangible devices that retain and store instructions for use by an instruction execution apparatus. The computer-readable storage medium includes: electronic memory devices, magnetic memory devices, optical memory devices, electromagnetic memory devices, semiconductor memory devices, and any suitable combination of the foregoing. The computer-readable storage medium includes: 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), non-volatile random access memory (NVRAM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic tape cartridge storage, magnetic tape disk storage or other magnetic storage devices, memory sticks, mechanically encoded devices (e.g., punched cards or raised structures in a groove having instructions recorded thereon), or any other non-transmission medium useful for storing information that may be accessed by a computing device. As defined in embodiments of the present invention, the computer-readable storage medium does not include transitory signals per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through a waveguide or other transmission medium (e.g., optical pulses traveling through a fiber optic cable), or electrical signals transmitted through a wire.
In addition, an embodiment of the present invention further provides an electronic device, which includes a bus, a transceiver, a memory, a processor, and a computer program stored in the memory and capable of running on the processor, where the transceiver, the memory, and the processor are connected via the bus, and when the computer program is executed by the processor, the processes of the serial number decoding method embodiment are implemented, and the same technical effect can be achieved, and details are not described here to avoid repetition.
In addition, an embodiment of the present invention further provides a computer-readable storage medium, where a computer program is stored, and when being executed by a processor, the computer program implements each process of the above serial number decoding method embodiment, and can achieve the same technical effect, and is not described herein again to avoid repetition.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Those of ordinary skill in the art will appreciate that the elements and algorithm steps of the examples described in connection with the embodiments disclosed in the embodiments disclosed herein may be embodied in electronic hardware, computer software, or combinations of both, and that the components and steps of the examples have been described in a functional general in the foregoing description for the purpose of illustrating the interchangeability of hardware and software. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer program instructions. The computer program instructions include: assembly instructions, Instruction Set Architecture (ISA) instructions, machine-related instructions, microcode, firmware instructions, state setting data, integrated circuit configuration data, or source or object code written in any combination of one or more programming languages, including an object oriented programming language such as: smalltalk, C + + and procedural programming languages, such as: c or a similar programming language.
When the computer program instructions are loaded and executed on a computer, which may be a computer, a special purpose computer, a network of computers, or other editable apparatus, all or a portion of the procedures or functions performed in accordance with the embodiments of the invention. The computer instructions may be stored in or transmitted from one computer-readable storage medium to another computer-readable storage medium, such as: computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by wire (e.g., coaxial cable, twisted pair, fiber optics, Digital Subscriber Line (DSL)), or wirelessly (e.g., infrared, wireless, microwave). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device including one or more available media integrated servers, data centers, and the like. The usable medium may be a magnetic medium (e.g., floppy disk, magnetic tape), an optical medium (e.g., optical disk), or a semiconductor medium (e.g., Solid State Drive (SSD)), among others. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present embodiments.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing embodiments of the method of the present invention, and are not described herein again.
In the several embodiments provided in the present invention, it should be understood that the disclosed apparatus, electronic device and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, a division of a unit is merely a logical division, and an actual implementation may have another division, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may also be an electrical, mechanical or other form of connection.
Units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one position, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to solve the problem to be solved by the embodiment of the invention.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the embodiments of the present invention may be substantially or partially contributed by the prior art, or all or part of the technical solutions may be embodied in a software product stored in a storage medium and including instructions for causing a computer device (including a personal computer, a server, a data center, or other network devices) to execute all or part of the steps of the methods of the embodiments of the present invention. And the storage medium includes various media that can store the program code as listed in the foregoing.
The above description is only a specific implementation of the embodiments of the present invention, but the scope of the embodiments of the present invention is not limited thereto, and any person skilled in the art can easily think of the changes or substitutions within the technical scope of the embodiments of the present invention, and all the changes or substitutions should be covered within the scope of the embodiments of the present invention. Therefore, the protection scope of the embodiments of the present invention shall be subject to the protection scope of the claims.

Claims (9)

1. A method for encoding a serial number, comprising:
obtaining a serial number to be coded, wherein the serial number to be coded is used for identifying the page layout applied by the answer sheet;
coding the serial number to be coded according to a preset error correction coding algorithm to obtain an error correction coded serial number;
aiming at each number in the serial number after error correction coding, finding out the character corresponding to the number in the generated character table and replacing the number; the character table comprises N different characters, each character is uniquely corresponding to one digital code in a carry system applied by the error correction coded serial number, and the overall similarity among the N different characters is lower than that among the digital codes in the carry system applied by the error correction coded serial number;
and after the replacement of each digit number in the error correction coded serial number is completed, obtaining a serial number coded into a character sequence, wherein the serial number coded into the character sequence is used for replacing the serial number to be coded so as to identify the page layout applied to the answer sheet.
2. The method of claim 1, wherein the character table is generated by:
determining the number N of the characters required by the character table according to the cardinal number of the carry system applied by the serial number after error correction coding;
calculating the similarity between every two characters in a preset candidate character set, and selecting N target characters with the number of the characters from the candidate character set according to the calculated similarity; and the similarity between every two target characters in the selected N target characters is smaller than the determined similarity threshold.
3. A method for decoding a sequence number, comprising:
identifying a character sequence from a target image to be identified, wherein the character sequence is obtained by coding a serial number to be determined;
aiming at each character in the character sequence, finding out a digital code corresponding to the character in the generated digital code table and replacing the character; wherein the number table comprises each number in a carry system to which the serial number applies, each number uniquely corresponding to a character,
the overall similarity between the characters corresponding to the numbers is lower than that between the numbers;
and after the replacement of each bit of character in the character sequence is finished, obtaining a digital sequence, and decoding the digital sequence according to a preset error correction decoding algorithm to obtain the serial number before being coded into the digital sequence.
4. The method according to claim 3, wherein the target image includes a positioning identification area, and the positioning identification area is used for identifying a target area where the character sequence is located in the target image;
the character sequence is recognized from the target image to be recognized, and the character sequence recognition method comprises the following steps:
identifying the positioning identification area in the target image;
and determining the target area where the character sequence is located based on the positioning identification area, and identifying the target area according to a preset text identification algorithm to obtain the character sequence.
5. The method according to claim 4, wherein the recognizing the target region according to a preset text recognition algorithm to obtain the character sequence comprises:
identifying the target region according to a preset text identification algorithm based on the original image direction of the target image to obtain a first character sequence and a first confidence coefficient corresponding to the first character sequence; and
rotating the target image according to a preset rotation angle, and identifying the target region in the rotated target image according to a preset text identification algorithm to obtain a second character sequence and a second confidence coefficient corresponding to the second character sequence;
and comparing the first confidence coefficient with the second confidence coefficient, and determining the character sequence corresponding to the larger confidence coefficient as the recognized character sequence.
6. The method of claim 4, wherein the identifying the location-marker region in the target image comprises:
carrying out binarization processing on the target image to obtain a binarized target image;
and for each connected region in the binarized target image, if the geometric data of the connected region is matched with the existing geometric data of the positioning identification region, determining the connected region as the positioning identification region.
7. The method of claim 5, wherein the determining the target region where the character sequence is located based on the location-based identification region comprises:
if two positioning identification areas are identified in the target image, determining two area vertexes of the target area according to each positioning identification area;
and connecting the determined four region vertexes into a quadrilateral region, and determining the quadrilateral region as the target region.
8. An electronic device comprising a bus, a transceiver, a memory, a processor and a computer program stored on the memory and executable on the processor, the transceiver, the memory and the processor being connected via the bus, characterized in that the computer program realizes the steps in the method for encoding a serial number as claimed in claim 1 or 2 when executed by the processor.
9. An electronic device comprising a bus, a transceiver, a memory, a processor and a computer program stored on the memory and executable on the processor, the transceiver, the memory and the processor being connected via the bus, characterized in that the computer program realizes the steps in the serial number decoding method according to any of claims 3 to 7 when executed by the processor.
CN202011292944.2A 2020-11-18 2020-11-18 Serial number encoding and decoding methods and devices and electronic equipment Active CN112118017B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011292944.2A CN112118017B (en) 2020-11-18 2020-11-18 Serial number encoding and decoding methods and devices and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011292944.2A CN112118017B (en) 2020-11-18 2020-11-18 Serial number encoding and decoding methods and devices and electronic equipment

Publications (2)

Publication Number Publication Date
CN112118017A CN112118017A (en) 2020-12-22
CN112118017B true CN112118017B (en) 2021-02-19

Family

ID=73794491

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011292944.2A Active CN112118017B (en) 2020-11-18 2020-11-18 Serial number encoding and decoding methods and devices and electronic equipment

Country Status (1)

Country Link
CN (1) CN112118017B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115361454B (en) * 2022-10-24 2023-03-24 北京智芯微电子科技有限公司 Message sequence coding, decoding and transmitting method and coding and decoding equipment
CN116260681B (en) * 2023-05-15 2023-07-21 北京一起教育科技发展有限公司 Shop code printing gateway

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106022151A (en) * 2016-05-31 2016-10-12 北京小米移动软件有限公司 Information transmission method and device
CN110517051A (en) * 2019-08-26 2019-11-29 北京太和互邦科技有限公司 A kind of two dimension code generation method, coding/decoding method, two dimensional code and readable storage medium storing program for executing

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
FR2993074B1 (en) * 2012-07-03 2014-08-29 Viaccess Sa METHOD FOR TATOOTING DIGITAL BOOKS
CN109284803B (en) * 2018-11-19 2022-04-05 南通大学 Commodity anti-counterfeiting two-dimensional code generation method

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106022151A (en) * 2016-05-31 2016-10-12 北京小米移动软件有限公司 Information transmission method and device
CN110517051A (en) * 2019-08-26 2019-11-29 北京太和互邦科技有限公司 A kind of two dimension code generation method, coding/decoding method, two dimensional code and readable storage medium storing program for executing

Also Published As

Publication number Publication date
CN112118017A (en) 2020-12-22

Similar Documents

Publication Publication Date Title
KR102079860B1 (en) Text address processing method and device
CN112118017B (en) Serial number encoding and decoding methods and devices and electronic equipment
CN110704634B (en) Knowledge graph link error checking and repairing method, device and storage medium
US11429632B2 (en) Data validation and/or data conversion using smart contracts in distributed ledger systems
CN107729935B (en) The recognition methods of similar pictures and device, server, storage medium
RU2580797C1 (en) Method of soft decoding of block codes
CN112398838B (en) Authentication method, device, equipment and storage medium based on privacy protection
US10474872B2 (en) Fingerprint matching using virtual minutiae
US20170140193A1 (en) Minutiae Grouping for Distorted Fingerprint Matching
US11847019B2 (en) Polar code construction method and apparatus
US10757227B2 (en) Security-oriented compression
US11636285B2 (en) Memory including examples of calculating hamming distances for neural network and data center applications
EP3640851B1 (en) Two-dimensional code error correction decoding
CN116034337A (en) Memory system for neural networks and data center applications including instances of computing hamming distances
CN116134414A (en) Memory controller including an instance of computing a hamming distance for neural network and data center applications
CN107220689A (en) Position encoded method for generating pattern, device, equipment and readable storage medium storing program for executing
US20130166985A1 (en) Method of determining at least one parameter of an error-correcting code implemented on transmission, corresponding device and computer program
WO2022156609A1 (en) Keyboard encryption method, and device, storage medium and computer program product
US20240121029A1 (en) Data processing method and apparatus based on data coding, and device
US20140258706A1 (en) Gesture-initiated encryption using error correction coding
CN113420699A (en) Face matching method and device and electronic equipment
US10915344B2 (en) Computer architecture for emulating coding in a correlithm object processing system
CN105718214A (en) Access method and device for fingerprint mask image
CN117713839B (en) RM decoding and result checking method, device, equipment and storage medium
CN115984302B (en) Multi-mode remote sensing image processing method based on sparse hybrid expert network pre-training

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant