Image structure encoding, data entry and reading method for a stylus pen
Through image structure encoding and data entry and reading methods, the problem of slow printing speed and prone to errors in smart point reading is solved, and the efficient and accurate printing process is realized, and the error correction process is simplified.
Patent Information
- Application Number
- CN202210455270.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-24
- Publication Date
- 2025-05-02
- Estimated Expiration
- 2042-04-24
AI Technical Summary
In the prior art, when making smart dot reading, digital information needs to be printed bit by bit, resulting in slow printing speed and easy errors, and difficulty in correcting errors, resulting in low printing efficiency.
An image structure encoding, data entry and reading method for dot pen is adopted. By obtaining the image template to be configured, it is divided into multiple field code block groups, encoding and coordinate code generation are performed, and the configured image template is directly printed to avoid errors and improve efficiency.
It effectively improves the printing efficiency of smart dot reading, avoids printing errors, and simplifies the error correction process. Users can directly modify error data in the database without reprinting.
Smart Images

Figure CN114627473B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of stylus pens, and in particular to an image structure coding, data entry and reading method for stylus pens. Background Art
[0002] With the development of science and technology, point reading pens have become popular. At present, there are various point reading pens on the market, which have brought great convenience to people's learning and assisted parents and children in reading and learning books.
[0003] The principle of the pronunciation of the point reading pen is that the point reading pen can recognize the invisible QR code on ordinary paper to mobilize the program in the pen to play the corresponding audio file, thereby realizing point reading. A small scanner has an optical identifier (OID) inside, which can sense the digital information on the picture. The QR code information is read by touching the book with the pen tip and transmitted to the CPU in the point reading pen for processing.
[0004] Books that can be used with a reading pen are generally smart reading books or homemade reading books that contain digital information. When the reading pen clicks on the text on the smart reading book, the reading machine will read the text immediately through coordinate recognition. However, at present, in order to make a smart reading book, it is necessary to print the digital information on the smart reading book bit by bit, and it must be ensured that the digital information is consistent with the printed book. Therefore, not only does the printing speed of the smart reading book is very slow, but it also often has printing errors. Even after printing errors, the errors cannot be corrected and can only be reprinted, which undoubtedly leads to lower printing efficiency. Summary of the invention
[0005] The object of the present invention is to provide an image structure encoding, data entry and reading method for a stylus pen, so as to improve the problem in the prior art that the printing speed of the smart dot book is very slow and printing errors are often made due to the need to print digital information little by little on the smart dot book and to ensure that the digital information is consistent with the printed book. Even after printing errors, the errors cannot be corrected and can only be reprinted, resulting in lower printing efficiency.
[0006] The embodiment of the present invention is achieved as follows:
[0007] In a first aspect, an embodiment of the present application provides an image structure encoding method for a stylus pen, which comprises the following steps:
[0008] S110: Obtain a rectangular image template to be configured;
[0009] S120: Take any vertex of the image template to be configured as a reference point, and successively take four adjacent code blocks arranged in a cross shape on the image template to be configured as a code block group to be encoded, so as to divide the image template to be configured into multiple code block groups to be encoded, and any code block group to be encoded is a cross-shaped code block group;
[0010] S130: Encode the four code blocks of any code block group to be encoded in a preset direction, and obtain that the encoded code values of the four code blocks are 0, 1, 2, and 3 respectively;
[0011] S140: Taking the previous code block group to be encoded as a reference, successively take four adjacent previous code block groups arranged in a cross shape on the image template to be configured as a current code block group to be encoded, so as to reconstruct a cross-shaped code block group on the outer layer of the previous code block group to be encoded;
[0012] S150: Encode the four previous code block groups of any current code block group to be encoded in a preset direction, and obtain that the current encoded code values of the four previous code block groups are 0, 1, 2, and 3 respectively;
[0013] S160: Obtain the encoding of a code block according to all the encoded code values of the code block;
[0014] S170: According to the size of the image template to be configured and the code value range of the code blocks on the image template to be configured, repeat steps S140 to S170 until all the cross-shaped code block groups on the image template to be configured are constructed, so as to obtain the final encoding of each code block;
[0015] S180: Obtain the coordinate code of a code block according to the final encoding of the code block;
[0016] S190: Obtain the configured image template according to the coordinate codes and the final encodings of all the code blocks of the image template to be configured.
[0017] In some embodiments of the present invention, the step of obtaining the coordinate code of a code block according to the final encoding of the code block includes:
[0018] Obtain all the encoded code values in the final encoding, and obtain the encoding times corresponding to any encoded code value;
[0019] According to the formula x=(A0%2)+(A1%2)2+(A2%2)2 2 +...+(A n %2)2 n calculate the abscissa value of the code block, where x is the abscissa value of the code block, A0 is the encoded code value of the first encoding of the code block, A1 is the encoded code value of the second encoding of the code block, A2 is the encoded code value of the third encoding of the code block, n is the (n + 1)th encoding of the code block, A nis the code value of the code block encoded for the n+1th time;
[0020] According to the formula y = (A0 / 2) + (A1 / 2)2 + (A2 / 2)2 2 +...+(A n / 2)2 n Calculate the ordinate value of the code block, where y is the ordinate value of the code block;
[0021] The coordinate code of the code block is obtained according to the abscissa value and the ordinate value of the code block.
[0022] In some embodiments of the present invention, before the above S170, the method further includes:
[0023] Get the code value range of the code block on the image template to be configured. The code value range is 32 bits.
[0024] In a second aspect, an embodiment of the present application provides a data entry method for a stylus pen, which comprises the following steps:
[0025] Obtain user demand data, which includes user demand templates and data to be entered;
[0026] Determine the configured target image template according to the user requirement template;
[0027] Using a preset selection box to sequentially select on the target image template to determine a plurality of marked areas, the code block of any marked area having a corresponding coordinate code;
[0028] The execution behavior of each code block in any marked area is determined according to the data to be entered, and the coordinate code and the corresponding execution behavior of any code block are stored in the database to complete the data entry.
[0029] In a third aspect, an embodiment of the present application provides a data reading method for a stylus, which comprises the following steps:
[0030] In response to a user reading operation, determining an area to be read;
[0031] Get all coordinate codes of the area to be read;
[0032] Input any coordinate code into the database for matching to obtain the execution behavior corresponding to the coordinate code;
[0033] All execution behaviors of the area to be read are executed in sequence according to the preset order to complete the data reading.
[0034] In some embodiments of the present invention, the step of obtaining all coordinate codes of the area to be read includes:
[0035] Get all code block information in the area to be read;
[0036] According to all the code block information, all the code blocks in the area to be read are decoded to determine the coordinate code of each code block.
[0037] In some embodiments of the present invention, the step of decoding all code blocks in the to-be-read area according to all code block information includes:
[0038] Acquire known code values of all code blocks in the area to be read, and compare all encoded code values of each code block according to the encoding order based on the known code values of all code blocks;
[0039] If A of all code blocks in the area to be read k equal, and A of all code blocks k-1 If the internal adjacent condition of the Tianzi-shaped code block value or the external adjacent condition of the Tianzi-shaped code block value is satisfied, the encoding code values of all code blocks in the area to be read are calculated according to the internal adjacent condition of the Tianzi-shaped code block value or the external adjacent condition of the Tianzi-shaped code block value to obtain a calculation result, wherein A k is the code value of the k+1th encoding, and 0≤A k ≤3.
[0040] In some embodiments of the present invention, after the step of comparing all the encoded code values of each code block in the encoding order based on the known code values of all the code blocks, the method further comprises:
[0041] If A of all code blocks in the area to be read k If the parts are not equal, then based on the known code values of all code blocks, the encoded code values of each code block in the k+1th encoding are obtained;
[0042] If more than half of the code blocks have a code value of V in the k+1th encoding k , then replace all the encoded code values of the k+1th encoding of all code blocks in the area to be read with V k , and if more than half of the code blocks in the area to be read have A j Yes V j , then replace all the j+1th encoded code values of all code blocks in the area to be read with V j , where A j is the encoding code value of the j+1th encoding, and j>k.
[0043] In some embodiments of the present invention, after the step of comparing all the encoded code values of each code block in the encoding order based on the known code values of all code blocks, the method further comprises:
[0044] If A of all code blocks in the area to be read k equal, and A of all code blocks k-1If the internal adjacent condition or the external adjacent condition of the cross-shaped code block value is not satisfied, discard the current decoding and issue an instruction to obtain the area to be read again.
[0045] In some embodiments of the present invention, all the code block information in the area to be read includes that there is only one complete code block with all the encoded code values in the area to be read or the area to be read contains 4 incomplete code blocks.
[0046] Compared with the prior art, the embodiments of the present invention have at least the following advantages or beneficial effects:
[0047] The present invention provides an image structure encoding, data entry, and reading method for a point writing pen, which includes the following steps: S110: Obtain a rectangular image template to be configured. S120: Use any vertex of the image template to be configured as a reference point, and sequentially take four adjacent code blocks arranged in a cross shape on the image template to be configured as a code block group to be encoded, so as to divide the image template to be configured into multiple code block groups to be encoded, and any code block group to be encoded is a cross-shaped code block group. S130: Encode the four code blocks of any code block group to be encoded in a preset direction, and obtain that the encoded code values of the four code blocks are 0, 1, 2, and 3 respectively. S140: Take the previous code block group to be encoded as a reference, and sequentially take four adjacent previous code block groups arranged in a cross shape on the image template to be configured as a current code block group to be encoded, so as to reconstruct a cross-shaped code block group on the outer layer of the previous code block group to be encoded. S150: Encode the four previous code block groups of any current code block group to be encoded in a preset direction, and obtain that the current encoded code values of the four previous code block groups are 0, 1, 2, and 3 respectively. S160: Obtain the encoding of a code block according to all the encoded code values of the code block. S170: According to the size of the image template to be configured and the code value range of the code blocks on the image template to be configured, repeat steps S140 to S170 until all the cross-shaped code block groups on the image template to be configured are constructed, so as to obtain the final encoding of each code block. S180: Obtain the coordinate code of a code block according to the final encoding of the code block. S190: Obtain the configured image template according to the coordinate codes and the final encodings of all the code blocks of the image template to be configured. When the user performs book printing, directly print the configured image template on the book, which not only effectively improves the printing efficiency, but also, since each code block on the configured image template only contains a code value and a coordinate code, can effectively avoid printing errors. When in use, the user sets the execution behavior corresponding to each coordinate code in advance and saves it in the database. When the user uses the point writing pen to read a certain coordinate code, the corresponding execution behavior in the database is called to execute. If a data error occurs, the user can directly modify the error data in the database without reprinting the printed book, which further improves the printing efficiency. Description of the Drawings
[0048] To more clearly illustrate the technical solutions of the embodiments of the present invention, the following will briefly introduce the drawings required in the embodiments. It should be understood that the following drawings only show some embodiments of the present invention, and therefore should not be regarded as a limitation of the scope. For those of ordinary skill in the art, without creative efforts, other related drawings can also be obtained based on these drawings.
[0049] Figure 1 It is a flowchart of an image structure encoding method for a dot pen provided by an embodiment of the present invention;
[0050] Figure 2 It is a flowchart of a data entry method for a dot pen provided by an embodiment of the present invention;
[0051] Figure 3 It is a flowchart of a data reading method for a dot pen provided by an embodiment of the present invention;
[0052] Figure 4 It is a schematic diagram of a cross-shaped code block group composed of four adjacent code blocks arranged in a cross shape provided by an embodiment of the present invention;
[0053] Figure 5 It is another schematic diagram of a cross-shaped code block group provided by an embodiment of the present invention;
[0054] Figure 6 It is yet another schematic diagram of a cross-shaped code block group provided by an embodiment of the present invention;
[0055] Figure 7 It is a schematic diagram of a box selection provided by an embodiment of the present invention;
[0056] Figure 8 It is four cases of the internal adjacent conditions of the cross-shaped code block value provided by an embodiment of the present invention;
[0057] Fig. 9 It is a schematic diagram of code value calculation under the internal adjacent conditions of the cross-shaped code block value provided by an embodiment of the present invention;
[0058] Fig.10 It is four cases of the external adjacent conditions of the cross-shaped code block value provided by an embodiment of the present invention;
[0059] Fig.11 It is a schematic diagram of code value calculation under the external adjacent conditions of the cross-shaped code block value provided by an embodiment of the present invention;
[0060] Fig.12 It is a schematic structural block diagram of an electronic device provided by an embodiment of the present invention.
[0061] Icon: 101 - memory; 102 - processor; 103 - communication interface. DETAILED DESCRIPTION
[0062] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. The components of the embodiments of the present application described and shown in the drawings here can be arranged and designed in various different configurations.
[0063] Therefore, the following detailed description of the embodiments of the present application provided in the accompanying drawings is not intended to limit the scope of the present application for which protection is sought, but merely represents selected embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present application.
[0064] It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in the subsequent drawings. At the same time, in the description of this application, if the terms "first", "second", etc. appear, they are only used to distinguish the description and cannot be understood as indicating or implying relative importance.
[0065] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, if the terms "include", "comprise" or any other variant thereof appear, it is intended to cover non-exclusive inclusion, so that the process, method, article or equipment including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or equipment. In the absence of further restrictions, if an element defined by the sentence "comprises a..." appears, it does not exclude the presence of other identical elements in the process, method, article or equipment including the element.
[0066] In the description of the present application, it should be noted that if the terms "upper", "lower", "inside", "outside", etc. appear to indicate an orientation or position relationship, they are based on the orientation or position relationship shown in the drawings, or are the orientation or position relationship in which the product of the application is usually placed when used. This is only for the convenience of describing the present application and simplifying the description, and does not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on the present application.
[0067] In the description of the present application, it should also be noted that unless otherwise clearly specified and limited, if the terms "set" and "connected" are used, they should be understood in a broad sense. For example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be directly connected or indirectly connected through an intermediate medium, and it can be the communication inside two components. For those of ordinary skill in the art, the specific meanings of the above terms in the present application can be understood according to specific situations.
[0068] The following will describe in detail some embodiments of the present application with reference to the accompanying drawings. Without conflict, the following embodiments and the features in each embodiment can be combined with each other.
[0069] Embodiment
[0070] Please refer to Figure 1 , Figure 1 shown in the flowchart of an image structure encoding method for a dot pen provided by an embodiment of the present application. An embodiment of the present application provides an image structure encoding method for a dot pen, which includes the following steps:
[0071] S110: Obtain a to-be-configured image template in a rectangular shape;
[0072] Among them, the size of the to-be-configured image template may include the size of A4 paper, the size of A5 paper, or the size of B5 paper. And the to-be-configured image template in a rectangular shape includes four vertices.
[0073] S120: Take any vertex of the to-be-configured image template as a reference point, and sequentially take four adjacent code blocks arranged in a cross shape on the to-be-configured image template as a to-be-encoded code block group, so as to divide the to-be-configured image template into multiple to-be-encoded code block groups, and any to-be-encoded code block group is a cross-shaped code block group;
[0074] Please refer to Figure 4 , Figure 4 shown in the schematic diagram of a cross-shaped code block group composed of four adjacent code blocks arranged in a cross shape provided by an embodiment of the present invention. Among them, the 4 code blocks are arranged in a cross shape, taking the leftmost code block as the encoding starting point, and encoding the 4 code blocks in the "Z" shape direction to obtain encoding code values of 0, 1, 2, and 3 respectively, and the corresponding coordinates are (0, 0), (1, 0), (0, 1), and (1, 1). Since the lens reads pictures restricted by the picture size, and the picture size will directly affect the running speed of the system, therefore, using code blocks can make the lens read relatively small pictures as much as possible.
[0075] S130: Encode the four code blocks of any to-be-encoded code block group in a preset direction to obtain encoding code values of 0, 1, 2, and 3 for the four code blocks respectively;
[0076] Exemplarily, the preset direction may be taking the leftmost code block as the coding starting point, and coding the four code blocks in the code block group to be coded in a clockwise direction.
[0077] S140: Taking the last code block group to be coded as a reference, successively taking four adjacent last code block groups arranged in a cross shape on the image template to be configured as a current code block group to be coded, so as to construct a cross-shaped code block group again on the outer layer of the last code block group;
[0078] Specifically, taking the second construction of the cross-shaped code block group as an example, based on the cross-shaped code block group constructed for the first time, using four adjacent cross-shaped code block groups arranged in a cross shape to form the cross-shaped code block group constructed for the second time, thus achieving the purpose of constructing a cross-shaped code block group again on the outer layer of the cross-shaped code block group constructed for the first time, that is, achieving the purpose that each code block can construct a cross-shaped code block for the second time, and also adding an extra layer of cross grid for each code block.
[0079] S150: Coding the four last code block groups of any current code block group to be coded according to the preset direction, and obtaining that the current coding code values of the four last code block groups are 0, 1, 2, and 3 respectively;
[0080] Specifically, taking the second construction of the cross-shaped code block group as an example, when each code block constructs a cross-shaped code block for the second time, which is equivalent to adding an extra layer of cross grid, coding the cross-shaped code block group constructed for the first time, and obtaining that the coding code values of each cross-shaped code block group constructed for the first time are 0, 1, 2, and 3 respectively. Then, for any cross-shaped code block group constructed for the first time, the coding code values of the second coding of all the code blocks it contains are the same as the coding code value of this cross-shaped code block group constructed for the first time.
[0081] Exemplarily, if the coding code value of the cross-shaped code block group constructed for the first time is 1, then the coding code values of the second coding of all the code blocks it contains are all 1.
[0082] S160: Obtaining the coding of a code block according to all the coding code values of the code block;
[0083] Please refer to Figure 5 and Figure 6 , Figure 5 Another schematic diagram of a cross-shaped code block group provided by an embodiment of the present invention is shown in Figure 6The figure shows a schematic diagram of another type of field-shaped code block group provided by an embodiment of the present invention. First, the image template to be configured is divided into a plurality of code block groups to be encoded according to step S12O, and then the four code blocks of any code block group to be encoded are encoded according to step S130 to obtain the first encoded code value A0 of each code block in the image template to be configured. Then, based on the field-shaped code block group constructed for the first time, a field-shaped code block group is reconstructed on the outer layer of the field-shaped code block group constructed for the first time according to step S140, and each first constructed field-shaped code block group in the second constructed field-shaped code block group is encoded according to step S150 to obtain the second encoded code value A1 of each code block in the image template to be configured. The third encoded code value A2 of each code block is obtained again according to steps S140 and S150. After the third encoding is completed, the code of any code block is A0 A1 A2. For Figure 6 For any code block in , from left to right, the first bit is A0, the second bit is A1, and the third bit is A2. Figure 6 The code block with the encoding code value of "210", in which A0 is 2, A1 is 1, and A2 is 0.
[0084] It should be noted that the first encoding code value A0 represents the encoding code value when the code block first constructs the Tianzi-shaped code block group, that is, the code block only has one layer of Tianzi grid. The second encoding code value A1 represents the encoding code value when the code block secondly constructs the Tianzi-shaped code block group, that is, the code block has one more layer of Tianzi grid.
[0085] S170: Repeating steps S140 to S170 according to the size of the image template to be configured and the code value range of the code block on the image template to be configured, until all the code block groups in the shape of a square on the image template to be configured are constructed, so as to obtain the final code of each code block;
[0086] The code value range can be 32 bits. If the code value range is 32 bits and the size of the image template to be configured just meets the code value range of the code block, then each code block on the image template to be configured can be set in 16 layers of grids, with a total of (2 16 ) 2 code blocks, and the code value corresponding to each code block is A0 A1 A2...A n , where n is 32.
[0087] S180: Obtaining a coordinate code of any code block according to the final encoding of the code block;
[0088] Specifically, using the formula x = (A0%2) + (A1%2)2 + (A2%2)2 2 +...+(A n %2)2 nCalculate the horizontal coordinate value of any code block, using the formula y = (A0 / 2) + (A1 / 2)2 + (A2 / 2)2 2 +...+(A n / 2)2 n Calculate the ordinate value of the code block, where x is the abscissa value of the code block, A0 is the coded value of the first encoding of the code block, A1 is the coded value of the second encoding of the code block, A2 is the coded value of the third encoding of the code block, n is the n+1th encoding of the code block, A n is the coded code value of the code block encoded for the n+1th time, and y is the ordinate value of the code block, thereby obtaining the coordinate code (x, y) of the code block.
[0089] S190: Obtain a configured image template according to the coordinate codes and final codes of all code blocks of the image template to be configured.
[0090] Specifically, the coordinate code and final code of any code block are used to configure the code value and coordinate code of the code block in the image template to be configured. When the code values and coordinate codes of all code blocks are configured, a configured image template is obtained. When the user prints a book, the configured image template is directly printed on the book, which not only effectively improves the printing efficiency, but also effectively avoids printing errors because each code block on the configured image template only contains code values and coordinate codes. When in use, the user sets the execution behavior corresponding to each coordinate code in advance and saves it to the database. When the user uses the stylus pen to read a coordinate code, the corresponding execution behavior in the database is called up for execution. If a data error occurs, the user can directly modify the erroneous data in the database without having to reprint the printed book, which is further beneficial to printing efficiency.
[0091] In some implementations of this embodiment, the step of obtaining the coordinate code of any code block according to the final encoding of the code block includes:
[0092] Get all the encoding code values in the final encoding, and get the encoding times corresponding to any encoding code value;
[0093] According to the formula x = (A0%2) + (A1%2)2 + (A2%2)2 2 +...+(A n %2)2 n Calculate the horizontal coordinate value of the code block, where x is the horizontal coordinate value of the code block, A0 is the code value of the first encoding of the code block, A1 is the code value of the second encoding of the code block, A2 is the code value of the third encoding of the code block, n is the n+1th encoding of the code block, A n is the code value of the code block encoded for the n+1th time;
[0094] According to the formula y = (A0 / 2) + (A1 / 2)2 + (A2 / 2)2 2 +...+(A n / 2)2 n Calculate the ordinate value of the code block, where y is the ordinate value of the code block;
[0095] The coordinate code of the code block is obtained according to the horizontal coordinate value and the vertical coordinate value of the code block, thereby achieving the purpose of converting the final code of any code into the coordinate code (x, y).
[0096] In some implementations of this embodiment, before the above S170, the method further includes:
[0097] Get the code value range of the code block on the image template to be configured. The code value range is 32 bits.
[0098] It should be noted that the code value range of the code block is 32 bits, which is only an option in the implementation of this embodiment and does not limit the above code value range.
[0099] Please refer to Figure 2 , Figure 2 The flowchart of a data entry method for a stylus provided in an embodiment of the present invention is shown. The present application embodiment provides a data entry method for a stylus, which comprises the following steps:
[0100] Obtain user demand data, which includes user demand templates and data to be entered;
[0101] Exemplarily, the user requirement template may include A4 paper size, A5 paper size or B5 paper size.
[0102] Determine the configured target image template according to the user requirement template;
[0103] For example, if the template required by the user is in the size of A4 paper, the configured image template in the size of A4 paper is used as the target template image.
[0104] Using a preset selection box to sequentially select on the target image template to determine a plurality of marked areas, the code block of any marked area having a corresponding coordinate code;
[0105] Specifically, the user can select a preset selection box according to actual conditions. The preset selection box can be a rectangle, a circle or a polygon. Figure 7 , Figure 7 Shown is a schematic diagram of a box selection provided by an embodiment of the present invention.
[0106] The execution behavior of each code block in any marked area is determined according to the data to be entered, and the coordinate code and the corresponding execution behavior of any code block are stored in the database to complete the data entry.
[0107] In the above implementation process, the data entry method first determines the target image template according to the user's required template, then uses the preset circle selection box to select the marked area on the target image template, determines the execution behavior of each code block in the marked area according to the data to be entered, and simultaneously enters the coordinate code and the corresponding execution behavior of any code block into the database. After the configured target image template is printed on the book, when the user reads a coordinate code with the stylus pen, the corresponding execution behavior in the database can be directly called.
[0108] Please refer to Figure 3 , Figure 3 The flowchart of a data reading method for a stylus provided by an embodiment of the present invention is shown. The present application embodiment provides a data reading method for a stylus, which comprises the following steps:
[0109] In response to a user reading operation, determining an area to be read;
[0110] Specifically, the stylus pen is provided with a lens, and when the user uses the stylus pen to read, the lens captures the area to be read.
[0111] Get all coordinate codes of the area to be read;
[0112] Input any coordinate code into the database for matching to obtain the execution behavior corresponding to the coordinate code;
[0113] All execution behaviors of the area to be read are executed in sequence according to the preset order to complete the data reading.
[0114] In the above implementation process, the data reading method inputs all the coordinate codes in the area to be read into the database for one-to-one matching, thereby retrieving the corresponding execution behavior in the database and executing all the execution behaviors in sequence, thereby achieving the purpose of data reading. Since the read data is the execution behavior in the database retrieved according to the coordinate code, when a data error occurs, the erroneous data can be directly modified in the database without reprinting the printed books, which facilitates the work of the printer.
[0115] In some implementations of this embodiment, the step of obtaining all coordinate codes of the area to be read includes:
[0116] Get all code block information in the area to be read;
[0117] According to all the code block information, all the code blocks in the area to be read are decoded to determine the coordinate code of each code block.
[0118] Please refer to Figure 8 and Fig. 9 , Figure 8 Four cases of the internal adjacent conditions of the cross-shaped code block values provided by the embodiments of the present invention are shown. Fig. 9 A schematic diagram of code value calculation under the internal adjacent conditions of the cross-shaped code block values provided by the embodiments of the present invention is shown. If the A of all code blocks in the area to be read k are equal and the A of all code blocks k-1 satisfies the internal adjacent conditions of the cross-shaped code block values, and the internal adjacent conditions of the cross-shaped code block values mean that the code blocks in the area to be read belong to the same cross-shaped code block group. For example, given the A0 of the U code block, find the A0 of the V, X, and Y code blocks, where 0 ≤ U ≤ 3. Here, U, V, X, and Y respectively represent the A0 values of each code block. The V code block = (U % 2!= 1)? U + 1 : U - 1. The specific meaning is: if (U mod 2) is not equal to 1, then V = U + 1; otherwise, V = U - 1. The X code block = (U < 2)? U + 2 : U - 2. The specific meaning is: if (U < 2), then X = U + 2; otherwise, X = U - 2. The Y code block = (X % 2!= 1)? X + 1 : X - 1. The specific meaning is: if (X mod 2) is not equal to 1, then Y = X + 1; otherwise, Y = X - 1. Fig. 9 In the case where the A0 of the U code block is known to be 0, the A0 of the V code block can be obtained as 1, the A0 of the X code block can be obtained as 2, and the A0 of the Y code block can be obtained as 3.
[0119] Please refer to Fig.10 and Fig.11 , Fig.10 Four cases of the external adjacent conditions of the cross-shaped code block values provided by the embodiments of the present invention are shown. Fig.11 A schematic diagram of code value calculation under the external adjacent conditions of the cross-shaped code block values provided by the embodiments of the present invention is shown. If the A of all code blocks in the area to be read k are equal and the A of all code blocks k-1 satisfies the external adjacent conditions of the cross-shaped code block values, and the external adjacent conditions of the cross-shaped code block values mean that although the code blocks in the area to be read are adjacent, they do not belong to the same cross-shaped code block group. If the X code block and the Y code block are horizontally adjacent, then X - Y = 1, and X % 2 = 1, and the X code block is on the left. If the X code block and the Y code block are vertically adjacent, then X - Y = 2, and 2 ≤ X ≤ 3, and the X code block is on the top. For example, given the A1 of the X code block, find the A1 of the Y code block, where 0 ≤ X ≤ 3. Here, X and Y respectively represent the A1 values of each code block. According to the formula: if the X code block and the Y code block are vertically adjacent, then X - Y = 2, and 2 ≤ X ≤ 3. It can be seen that when 2 ≤ X ≤ 3 is satisfied, it is deduced that X - Y = 2, and Y = X - 2. Fig.11 In the case where the A1 of the X code block is known to be 2, the A1 of the Y code block can be obtained as 0.
[0120] In some embodiments of this embodiment, the step of decoding all code blocks in the area to be read according to all code block information includes:
[0121] Acquire known code values of all code blocks in the area to be read, and compare all encoded code values of each code block according to the encoding order based on the known code values of all code blocks;
[0122] If A of all code blocks in the area to be read k equal, and A of all code blocks k-1 If the internal adjacent condition of the Tianzi-shaped code block value or the external adjacent condition of the Tianzi-shaped code block value is satisfied, the encoding code values of all code blocks in the area to be read are calculated according to the internal adjacent condition of the Tianzi-shaped code block value or the external adjacent condition of the Tianzi-shaped code block value to obtain a calculation result, wherein A k is the code value of the k+1th encoding, and 0≤A k ≤3.
[0123] In some implementations of this embodiment, after the step of comparing all the encoded code values of each code block in the encoding order based on the known code values of all code blocks, the method further includes:
[0124] If A of all code blocks in the area to be read k If the parts are not equal, then based on the known code values of all code blocks, the encoded code values of each code block in the k+1th encoding are obtained;
[0125] If more than half of the code blocks have a code value of V in the k+1th encoding k , then replace all the encoded code values of the k+1th encoding of all code blocks in the area to be read with V k , and if more than half of the code blocks in the area to be read have A j Yes V j , then replace all the j+1th encoded code values of all code blocks in the area to be read with V j , where A j is the code value of the j+1th encoding, and j>k. This takes into account the fact that the code blocks in A are not clear due to printing or unclear images. k Not all are equal.
[0126] In some implementations of this embodiment, after the step of comparing all the encoded code values of each code block in the encoding order based on the known code values of all code blocks, the method further includes:
[0127] If A of all code blocks in the area to be read k equal, and A of all code blocks k-1 If the internal adjacent condition of the Tianzi code block value or the external adjacent condition of the Tianzi code block value is not met, the current decoding is abandoned and an instruction to obtain the area to be read again is issued.
[0128] In some implementations of this embodiment, all the code block information in the area to be read includes only one complete code block with all the coded code values in the area to be read or 4 incomplete code blocks in the area to be read. Specifically, the lens only needs to read the following two situations a and b at a time: a. One complete code block and 1 to 3 incomplete code blocks; b. Read 4 incomplete code blocks. If only one complete code block is read, the other code blocks can be inferred, and this calculation can be used to compare and verify the partial information of the other code blocks that are read in, or to correct the errors caused by printing or the lens. If only the code values of multiple adjacent incomplete code blocks are read, as long as it exceeds a certain amount of information (such as 9 internal code points), the code value of the main code block can be inferred and the code values of other adjacent code blocks can be inferred and then verified.
[0129] See also Fig.12 , Fig.12 A schematic structural block diagram of an electronic device provided in an embodiment of the present application. The electronic device includes a memory 101, a processor 102 and a communication interface 103, and the memory 101, the processor 102 and the communication interface 103 are electrically connected to each other directly or indirectly to realize data transmission or interaction. For example, these elements can be electrically connected to each other through one or more communication buses or signal lines. The memory 101 can be used to store software programs and modules, and the processor 102 executes various functional applications and data processing by executing the software programs and modules stored in the memory 101. The communication interface 103 can be used to communicate signaling or data with other node devices.
[0130] Among them, the memory 101 can be, but is not limited to, a random access memory (RAM), a read only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable read-only memory (EEPROM), etc.
[0131] The processor 102 may be an integrated circuit chip with signal processing capability. The processor 102 may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it may also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0132] Understandably, Fig.12 The structure shown is for illustration only. The electronic device may also include Fig.12 More or fewer components as shown, or with Fig.12 Different configurations are shown. Fig.12 Each component shown in the figure can be implemented by hardware, software or a combination thereof.
[0133] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to the multiple embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of a code contains one or more executable behaviors for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.
[0134] In addition, the functional modules in the various embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
[0135] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0136] The above description is only the preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
[0137] It will be apparent to those skilled in the art that the present application is not limited to the details of the exemplary embodiments described above, and that the present application can be implemented in other specific forms without departing from the spirit or essential features of the present application. Therefore, the embodiments should be considered exemplary and non-limiting in all respects, and the scope of the present application is defined by the appended claims rather than the above description, and it is intended that all changes falling within the meaning and scope of the equivalent elements of the claims be included in the present application. Any reference numeral in a claim should not be considered as limiting the claim to which it relates.
Claims
1. An image structure encoding method for a point reading pen, characterized in that: It includes the following steps: S110: Obtain a to-be-configured image template in a rectangular shape; S120: Take any vertex of the to-be-configured image template as a reference point, and successively take four adjacent code blocks arranged in a cross shape on the to-be-configured image template as a to-be-encoded code block group, so as to divide the to-be-configured image template into multiple to-be-encoded code block groups, and any to-be-encoded code block group is a cross-shaped code block group; S130: Encode the four code blocks of any to-be-encoded code block group in a preset direction, and obtain that the encoded code values of the four code blocks are 0, 1, 2, and 3 respectively; S140: Taking the previous to-be-encoded code block group as a reference, successively take four adjacent previous to-be-encoded code block groups arranged in a cross shape on the to-be-configured image template as a current to-be-encoded code block group, so as to reconstruct a cross-shaped code block group on the outer layer of the previous to-be-encoded code block group; S150: Encode the four previous to-be-encoded code block groups of any current to-be-encoded code block group in a preset direction, and obtain that the current encoded code values of the four previous to-be-encoded code block groups are 0, 1, 2, and 3 respectively; S160: Obtain the encoding of a code block according to all the encoded code values of the code block; S170: According to the size of the to-be-configured image template and the code value range of the code blocks on the to-be-configured image template, repeat steps S140 to S170 until all the cross-shaped code block groups on the to-be-configured image template are constructed, so as to obtain the final encoding of each code block; S180: Obtain the coordinate code of a code block according to the final encoding of the code block; S190: Obtain the configured image template according to the coordinate codes and final encodings of all the code blocks of the to-be-configured image template; The step of obtaining the coordinate code of a code block according to the final encoding of the code block includes: Obtain all the encoded code values in the final encoding, and obtain the encoding times corresponding to any encoded code value; According to the formula x = (A0%2) + (A1%2)2 + (A2%2)2 2 +...+(A n %2)2 n Calculate the horizontal coordinate value of the code block, where x is the horizontal coordinate value of the code block, A0 is the code value of the first encoding of the code block, A1 is the code value of the second encoding of the code block, A2 is the code value of the third encoding of the code block, n is the n+1th encoding of the code block, A n is the code value of the code block encoded for the n+1th time; According to the formula y = (A0 / 2) + (A1 / 2)2 + (A2 / 2)2 2 +...+(A n / 2)2 n Calculate the ordinate value of the code block, where y is the ordinate value of the code block; Obtain the coordinate code of the code block according to the abscissa value and ordinate value of the code block.
2. The image structure encoding method for a point reading pen according to claim 1, characterized in that: Before S170, it further includes: Obtain the code value range of the code blocks on the to-be-configured image template, and the code value range is 32 bits.
3. A data entry method for a point reading pen, characterized in that: It includes the following steps: Obtain user requirement data, and the user requirement data includes a user requirement template and data to be entered; Use the image structure encoding method described in claim 1 or 2 and determine the configured target image template according to the user requirement template; Use a preset selection box to successively select on the target image template to determine multiple marked areas, and the code blocks of any marked area have corresponding coordinate codes; Determine the execution behavior of each code block of any marked area according to the data to be entered, and store the coordinate code and the corresponding execution behavior of any code block in a database to complete data entry.
4. A data reading method for a point reading pen, characterized in that: It includes the following steps: When responding to a user reading operation, determine the area to be read; Use the image structure encoding method described in claim 1 or 2 to obtain all the coordinate codes of the area to be read; Input any coordinate code into the database for matching to obtain the execution behavior corresponding to the coordinate code; Execute all the execution behaviors of the area to be read in a preset order to complete data reading.
5. The data reading method for a point reading pen according to claim 4, characterized in that: The step of obtaining all coordinate codes of the area to be read comprises: Get all code block information in the area to be read; According to all the code block information, all the code blocks in the to-be-read area are decoded to determine the coordinate code of each code block.
6. The data reading method for a point reading pen according to claim 5, characterized in that: The step of decoding all code blocks in the to-be-read area according to all code block information includes: Acquire known code values of all code blocks in the to-be-read area, and compare all encoded code values of each code block according to the encoding order based on the known code values of all code blocks; If A of all code blocks in the area to be read k equal, and A of all code blocks k-1 If the internal adjacent condition of the Tianzi-shaped code block value or the external adjacent condition of the Tianzi-shaped code block value is satisfied, the encoding code values of all code blocks in the area to be read are calculated according to the internal adjacent condition of the Tianzi-shaped code block value or the external adjacent condition of the Tianzi-shaped code block value to obtain a calculation result, wherein A k is the code value of the k+1th encoding, and 0≤A k ≤3.
7. The data reading method for a point reading pen according to claim 6, characterized in that: After the step of comparing all the coded code values of each code block according to the coding order based on the known code values of all the code blocks, the method further includes: If A of all code blocks in the area to be read k If the parts are not equal, then based on the known code values of all code blocks, the encoded code values of each code block in the k+1th encoding are obtained; If more than half of the code blocks have a code value of V in the k+1th encoding k , then replace all the encoded code values of the k+1th encoding of all code blocks in the area to be read with V k , and if more than half of the code blocks in the area to be read have A j Yes V j , then replace all the j+1th encoded code values of all code blocks in the area to be read with V j , where A j is the encoding code value of the j+1th encoding, and j>k.
8. The data reading method for a point reading pen according to claim 6, characterized in that: After the step of comparing all the coded code values of each code block according to the coding order based on the known code values of all the code blocks, the method further includes: If A of all code blocks in the area to be read k equal, and A of all code blocks k-1 If the internal adjacent condition of the Tianzi code block value or the external adjacent condition of the Tianzi code block value is not met, the current decoding is abandoned and an instruction to obtain the area to be read again is issued.
9. The data reading method for a point reading pen according to claim 5, characterized in that: The information of all code blocks in the area to be read includes that the area to be read contains only one complete code block with all encoding code values or that the area to be read contains 4 incomplete code blocks.
Citation Information
Patent Citations
Printed matter, and production method and production system for point-to-read content of printed matter
CN108470474A