Calligraphy handwriting cross-environment evaluation method, device, storage medium and electronic device
By acquiring and analyzing the calligraphy handwriting data collected by smart pens, and performing restoration processing during cross-environment evaluation, the problem that the calligraphy system cannot be re-evaluated in different environments is solved, the cross-environment evaluation of handwriting data is realized, and the accuracy of the evaluation is improved. and flexibility.
Patent Information
- Application Number
- CN202410658635.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-27
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2044-05-27
AI Technical Summary
Existing technology cannot effectively re-evaluate student handwriting data in online calligraphy systems under different environments, causing the accuracy and reliability of calligraphy evaluation to be affected.
By obtaining the original handwriting data collected by the smart pen, analyzing and storing it, and performing restoration processing when cross-environment evaluation is required, the evaluation module is reconfigured to achieve cross-environment evaluation of handwriting data and ensure the consistency of evaluation results.
It achieves reliable evaluation of calligraphy handwriting data in different environments, improves the flexibility of evaluation, and reduces storage overhead.
Smart Images

Figure CN118245108B
Abstract
Description
Technical Field
[0001] The present application relates to the field of calligraphy, and specifically, to a calligraphy handwriting cross-environment evaluation method, device, storage medium and electronic device. Background Art
[0002] As all sectors of society attach importance to the development and inheritance of culture, handwriting calligraphy education has been widely popularized, and calligraphy courses have been opened in primary and secondary schools. At present, it is impossible to re-evaluate the handwriting data of students in an online environment, nor is it possible to collect exactly the same handwriting data for re-evaluation. As a result, when the evaluation conditions of calligraphy evaluation are updated, such as when the calligraphy system version is updated, the student handwriting cannot be re-evaluated. Summary of the invention
[0003] The embodiments of the present application provide a calligraphy handwriting cross-environment evaluation method, device, storage medium and electronic device.
[0004] In a first aspect, the present application provides a calligraphy handwriting cross-environment evaluation method, comprising:
[0005] Acquire original handwriting data collected by the smart pen, where the original handwriting data is dot matrix data formed by the user writing with the smart pen;
[0006] Inputting the original handwriting data into a handwriting evaluation module to obtain parsed handwriting data and a first evaluation result;
[0007] storing the analyzed handwriting data and / or the first evaluation result in a database;
[0008] In response to the cross-environment evaluation requirements for the original handwriting data, the parsed handwriting data is restored to obtain restored handwriting data; and,
[0009] Reconfiguring the handwriting evaluation module across environments to obtain a first handwriting evaluation module;
[0010] The restored handwriting data is input into the first handwriting evaluation module to obtain a second evaluation result.
[0011] Optionally, inputting the original handwriting data into a handwriting evaluation module to obtain parsed handwriting data includes:
[0012] Determine the parsed coordinates of each handwriting point in the original handwriting data according to the first lattice coordinates and the second lattice coordinates of each handwriting point in the original handwriting data, the coordinate value range of the lattice coordinates and the coding range, and obtain the parsed handwriting data;
[0013] The resolution of the first dot matrix coordinates is different from the resolution of the second dot matrix coordinates, and the numerical types of the parsed handwriting data obtained by parsing different original handwriting data are the same.
[0014] Optionally, the restoring the parsed handwriting data to obtain restored handwriting data includes:
[0015] According to the parsed coordinates of each handwriting point in the parsed handwriting data, the value range of the lattice coordinates and the coding range, the first lattice coordinates and / or the second lattice coordinates of each handwriting point in the parsed handwriting data are determined to obtain the restored handwriting data.
[0016] Optionally, determining the first lattice coordinates and / or the second lattice coordinates of each handwriting point in the parsed handwriting data according to the parsed coordinates of each handwriting point in the parsed handwriting data, the value range of the lattice coordinates and the coding range includes:
[0017] Determine the dot matrix coordinates and the third dot matrix coordinates of each handwriting point in the analyzed handwriting data according to the analyzed coordinates of each handwriting point in the analyzed handwriting data, the value range of the dot matrix coordinates and the coding range;
[0018] The abscissa and the ordinate of the third lattice coordinate are respectively added by 1 to obtain the second lattice coordinate.
[0019] Optionally, determining the parsed coordinates of each handwriting point in the original handwriting data according to the first lattice coordinates and the second lattice coordinates of each handwriting point in the original handwriting data, the coordinate value range and the coding range of the lattice coordinates, and obtaining the parsed handwriting data includes:
[0020] According to the following after[i] function, the analytical coordinates of each handwriting point in the original handwriting data are determined:
[0021] after[i] = Math.toIntExact(Math.floorDiv(Math.floorDiv((long) (before[i] 100 + beforeF[i]) txArea 100, codeArea), 100);
[0022] Wherein, before[i] represents the horizontal coordinate or vertical coordinate of the first dot matrix coordinate of the first target handwriting point, beforeF[i] represents the horizontal coordinate or vertical coordinate of the second dot matrix coordinate of the first target handwriting point, txArea represents the coordinate value range, codeArea represents the coding range, the long() method is used to convert the numerical type to a long integer, the Math.floorDiv() method is used to calculate the floor value after numerical division, and the Math.toIntExact() method is used to convert the numerical type to an integer value;
[0023] The first target handwriting point is any handwriting point in the original handwriting data, and the resolution of the first dot matrix coordinates is one hundred times the resolution of the second dot matrix coordinates.
[0024] Optionally, determining the first lattice coordinates and / or the second lattice coordinates of each handwriting point in the parsed handwriting data according to the parsed coordinates of each handwriting point in the parsed handwriting data, the value range of the lattice coordinates and the coding range includes:
[0025] According to the following before[i] function, the dot matrix coordinates of each handwriting point in the parsed handwriting data are determined:
[0026] before[i] = int((after[i] 100 txArea / codeArea / 100) / / 100);
[0027] According to the following beforeF[i] function, the floating point coordinates of each handwriting point in the parsed handwriting data are determined:
[0028] beforeF[i] = int((after[i] 100 txArea / codeArea / 100) % 100)+1
[0029] Wherein, after[i] represents the horizontal coordinate or vertical coordinate of the parsed coordinate of the second target handwriting point, txArea represents the coordinate value range, codeArea represents the coding range, and the int() method is used to convert the numerical type into an integer type;
[0030] The second target handwriting point is any handwriting point in the analyzed handwriting data, and the resolution of the first dot matrix coordinates is one hundred times the resolution of the second dot matrix coordinates.
[0031] In a second aspect, the embodiment of the present application provides a calligraphy handwriting cross-environment evaluation device, comprising:
[0032] An acquisition module, used to acquire original handwriting data collected by the smart pen, wherein the original handwriting data is dot matrix data formed by the user writing with the smart pen;
[0033] A parsing module, used for inputting the original handwriting data into a handwriting evaluation module to obtain parsed handwriting data and a first evaluation result;
[0034] A storage module, used for storing the analyzed handwriting data and / or the first evaluation result in a database;
[0035] A restoration module, used for restoring the parsed handwriting data to obtain restored handwriting data in response to the cross-environment evaluation requirements of the original handwriting data;
[0036] A reconfiguration module, used for reconfiguring the handwriting evaluation module across environments to obtain a first handwriting evaluation module;
[0037] The evaluation module is used to input the restored handwriting data into the first handwriting evaluation module to obtain a second evaluation result.
[0038] Optionally, the parsing module is used to:
[0039] Determine the parsed coordinates of each handwriting point in the original handwriting data according to the first lattice coordinates and the second lattice coordinates of each handwriting point in the original handwriting data, the coordinate value range of the lattice coordinates and the coding range, and obtain the parsed handwriting data;
[0040] The resolution of the first dot matrix coordinates is different from the resolution of the second dot matrix coordinates, and the numerical types of the parsed handwriting data obtained by parsing different original handwriting data are the same.
[0041] In a third aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processing device, implements the steps of any one of the methods described in the first aspect.
[0042] In a fourth aspect, an embodiment of the present application provides an electronic device, including:
[0043] a storage device having a computer program stored thereon;
[0044] A processing device is used to execute the computer program in the storage device to implement the steps of the method described in the first aspect.
[0045] The technical solution provided by the embodiments of the present invention may include the following beneficial effects: first, the original handwriting data formed by the user's writing is collected, and after the original handwriting data is input into the handwriting evaluation module, the processed parsed handwriting data and the first evaluation result are stored in the database, so that when there is a need for cross-environment evaluation, the parsed handwriting data can be restored, and the restored handwriting data obtained after restoration is input into the first handwriting evaluation module obtained by cross-environment reconfiguration to obtain the second evaluation result, which can reliably realize the cross-environment evaluation of calligraphy dot matrix handwriting data, effectively improve the flexibility of calligraphy handwriting evaluation, and only store the processed parsed handwriting data, which can effectively reduce storage overhead. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0047] Figure 1 A schematic diagram of the steps of a calligraphy handwriting cross-environment evaluation method provided in an embodiment of the present application;
[0048] Figure 2 It is a block diagram of a calligraphy handwriting cross-environment evaluation device provided in an embodiment of the present application.
[0049] Figure 3 A schematic diagram of the structure of an electronic device provided for the implementation of this application. DETAILED DESCRIPTION
[0050] In order to make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme 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 of 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.
[0051] 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.
[0052] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.
[0053] Furthermore, the terms “first”, “second”, etc. are merely used for distinguishing descriptions and should not be understood as indicating or implying relative importance.
[0054] In the description of this application, it should also be noted that, unless otherwise clearly specified and limited, the terms such as "setting" and "connection" should be understood in a broad sense. For example, "connection" 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 a direct connection, or an indirect connection through an intermediate medium, or it can be the internal connection of two elements. For ordinary technicians in this field, the specific meanings of the above terms in this application can be understood according to specific circumstances.
[0055] In the process of implementing the present application, the inventor discovered that the prior art only takes precautions based on inherent rules, and the defensive effect is not ideal.
[0056] In response to the above problems, a calligraphy handwriting cross-environment evaluation method is provided in an embodiment of the present application.
[0057] The specific implementation methods of the present application are described in detail below in conjunction with the accompanying drawings.
[0058] Please refer to the attached Figure 1 , Figure 1 A schematic flow chart of the steps of a calligraphy handwriting cross-environment evaluation method provided in an embodiment of the present application, the method can be implemented by an electronic device such as a computer device or a server as the main body, and the steps of the calligraphy handwriting cross-environment evaluation method include:
[0059] Step S101, obtaining original handwriting data collected by the smart pen.
[0060] The original handwriting data is the dot matrix data formed by the user writing with the smart pen.
[0061] It is understandable that after the user writes with the smart pen, the dot matrix data formed by the user's writing can be obtained and sent to the server, and the server can obtain the corresponding original handwriting data.
[0062] The original handwriting data may be handwriting formed by a plurality of handwriting points, and the plurality of points may constitute a dot matrix. Each point in the dot matrix data may be a handwriting point, and the position of the handwriting point may be represented by its abscissa and ordinate.
[0063] Step S102, inputting the original handwriting data into the handwriting evaluation module to obtain the analyzed handwriting data and the first evaluation result.
[0064] Among them, the step of inputting the original handwriting data into the handwriting evaluation module can be implemented by calling a preset API. For example, the original handwriting data can be used as a calling parameter of the preset API, and the parsed handwriting data and the first evaluation result can be the return parameters returned by the preset API in response to the calling parameter.
[0065] It is understandable that by calling different APIs, the original handwriting data can be obtained, and the parsed handwriting data corresponding to different handwriting evaluation modules and the first evaluation result can be obtained.
[0066] Step S103, storing the analyzed handwriting data and / or the first evaluation result in a database.
[0067] The parsed handwriting data can be used for cross-environment re-evaluation, and the first evaluation result can be used to verify the result of the cross-environment evaluation. Optionally, when the cross-environment evaluation result is not verified, only the parsed handwriting data can be stored.
[0068] In some embodiments, the parsed handwriting data may be collected and stored according to courses or students. For example, the course identification may be associated with the parsed handwriting data and / or the student identification may be associated with the parsed handwriting data.
[0069] Step S104, in response to the cross-environment evaluation requirement for the original handwriting data, the parsed handwriting data is restored to obtain restored handwriting data.
[0070] The cross-environment evaluation requirement may be generated, for example, when the handwriting evaluation module version is upgraded, or when the processing effect of the first handwriting evaluation module needs to be verified, which is not limited in the present embodiment. For example, after the handwriting evaluation module version is upgraded, when the evaluation result of the user's written content needs to be updated, the corresponding cross-environment evaluation requirement may be generated, and subsequent steps S105 to S106 may be executed.
[0071] Among them, the restoration process can convert the parsed handwriting data obtained after the processing into the original format, which can be achieved by reversing the process of the handwriting evaluation module. It can be understood that the data format of the restored handwriting data and the original handwriting data can be the same, but the data is not necessarily completely consistent. It only needs to ensure that the parsed handwriting data obtained after the handwriting evaluation module is consistent.
[0072] Step S105, reconfigure the handwriting evaluation module across environments to obtain a first handwriting evaluation module.
[0073] The parameters of the handwriting evaluation module may be different from those of the first handwriting evaluation module, the programming languages used may be different, and the servers deployed may be different, which are not limited in the embodiments of the present disclosure.
[0074] It is understandable that the handwriting evaluation module and the first handwriting evaluation module can both be used to evaluate the handwriting or handwriting of the user, such as grading a student's calligraphy homework. When the handwriting evaluation module and the first handwriting evaluation module face the same handwriting data, the evaluation results obtained can be the same or different.
[0075] The parameters of the handwriting evaluation module may be adjusted to achieve cross-environment reconfiguration. For example, a different API from that in step S102 may be called to use a different handwriting evaluation module to evaluate the content written by the user.
[0076] Step S106, inputting the restored handwriting data into the first handwriting evaluation module to obtain a second evaluation result.
[0077] In some embodiments, the restored handwriting data may be input into the first handwriting evaluation module to obtain the first parsed handwriting data. Optionally, the first parsed handwriting data and / or the second evaluation result may be stored in a database.
[0078] In some embodiments, the original handwriting data is input into the handwriting evaluation module to obtain the analyzed handwriting data, including:
[0079] Determine the parsed coordinates of each handwriting point in the original handwriting data according to the first lattice coordinates and the second lattice coordinates of each handwriting point in the original handwriting data, the coordinate value range of the lattice coordinates and the coding range, and obtain the parsed handwriting data;
[0080] The resolution of the first dot matrix coordinates is different from the resolution of the second dot matrix coordinates, and the numerical types of the parsed handwriting data obtained by parsing different original handwriting data are the same.
[0081] In some embodiments, according to the first lattice coordinates and the second lattice coordinates of each handwriting point in the original handwriting data, the coordinate value range and the coding range of the lattice coordinates, the parsed coordinates of each handwriting point in the original handwriting data are determined to obtain the parsed handwriting data, including:
[0082] According to the following after[i] function, the analytical coordinates of each handwriting point in the handwriting original data are determined: after[i] = Math.toIntExact(Math.floorDiv(Math.floorDiv((long) (before[i] 100 +beforeF[i]) txArea 100, codeArea), 100);
[0083] Among them, before[i] represents the horizontal coordinate or vertical coordinate of the first lattice coordinate of the first target handwriting point, beforeF[i] represents the horizontal coordinate or vertical coordinate of the second lattice coordinate of the first target handwriting point, txArea represents the coordinate value range, codeArea represents the coding range, the long() method is used to convert the numerical type to a long integer, the Math.floorDiv() method is used to calculate the floor value after numerical division, and the Math.toIntExact() method is used to convert the numerical type to an integer value; the first target handwriting point is any handwriting point in the original handwriting data, and the resolution of the first lattice coordinate is one hundred times the resolution of the second lattice coordinate.
[0084] In some embodiments, the restoring the parsed handwriting data to obtain the restored handwriting data includes:
[0085] According to the parsed coordinates of each handwriting point in the parsed handwriting data, the value range of the lattice coordinates and the coding range, the first lattice coordinates and / or the second lattice coordinates of each handwriting point in the parsed handwriting data are determined to obtain the restored handwriting data.
[0086] In some embodiments, determining the first lattice coordinates and / or the second lattice coordinates of each handwriting point in the parsed handwriting data according to the parsed coordinates of each handwriting point in the parsed handwriting data, the value range of the lattice coordinates and the coding range includes:
[0087] Determine the dot matrix coordinates and the third dot matrix coordinates of each handwriting point in the analyzed handwriting data according to the analyzed coordinates of each handwriting point in the analyzed handwriting data, the value range of the dot matrix coordinates and the coding range;
[0088] The abscissa and the ordinate of the third lattice coordinate are respectively added by 1 to obtain the second lattice coordinate.
[0089] In some embodiments, determining the first lattice coordinates and / or the second lattice coordinates of each handwriting point in the parsed handwriting data according to the parsed coordinates of each handwriting point in the parsed handwriting data, the value range of the lattice coordinates and the coding range includes:
[0090] According to the following before[i] function, the dot matrix coordinates of each handwriting point in the analyzed handwriting data are determined: before[i]= int((after[i] 100 txArea / codeArea / 100) / / 100);
[0091] According to the following beforeF[i] function, the floating point coordinates of each handwriting point in the parsed handwriting data are determined: beforeF[i] = int((after[i] 100 txArea / codeArea / 100) % 100)+1
[0092] Wherein, after[i] represents the horizontal coordinate or vertical coordinate of the parsed coordinate of the second target handwriting point, txArea represents the coordinate value range, codeArea represents the coding range, and the int() method is used to convert the numerical type into an integer type;
[0093] The second target handwriting point is any handwriting point in the analyzed handwriting data, and the resolution of the first dot matrix coordinates is one hundred times the resolution of the second dot matrix coordinates.
[0094] It is worth noting that the above-mentioned after[i] function, before[i] function and beforeF[i] function can be program codes based on the Java programming language.
[0095] In the disclosed embodiment, the original handwriting data formed by the user's writing is first collected, and after the original handwriting data is input into the handwriting evaluation module, the processed parsed handwriting data and the first evaluation result are stored in the database, so that when there is a need for cross-environment evaluation, the parsed handwriting data can be restored, and the restored handwriting data obtained after restoration is input into the first handwriting evaluation module obtained by cross-environment reconfiguration to obtain a second evaluation result, which can reliably realize the cross-environment evaluation of calligraphy dot matrix handwriting data, effectively improve the flexibility of calligraphy handwriting evaluation, and only store the processed parsed handwriting data, which can effectively reduce storage overhead.
[0096] In order to enable those skilled in the art to better understand the technical solution provided by the embodiments of the present disclosure, the present disclosure also provides the following embodiments, which include a method for evaluating calligraphy handwriting across environments.
[0097] The method can be implemented based on a calligraphy system. The calligraphy system can be a computer technology system used to evaluate and analyze calligraphy works. The calligraphy dot matrix handwriting data can be evaluated to obtain the score of the character and the comments on various dimensions such as strokes, structure, and wording. However, since different environments of the calligraphy system are connected to different algorithm versions, and different algorithm versions may have differences, the performance of the same batch of calligraphy dot matrix handwriting data under different algorithm versions may be different, affecting the accuracy and reliability of the system evaluation. Among them, the handwriting evaluation module involved in the above embodiment can be a part of the calligraphy system. For example, the calligraphy system can include or call one or more handwriting evaluation modules, and different handwriting evaluation modules can correspond to different algorithm versions.
[0098] The handwriting data of students in the online environment cannot be re-evaluated in the calligraphy system, nor can the same handwriting data be collected for re-evaluation. Therefore, a method is needed to ensure that the calligraphy dot matrix handwriting data can be re-evaluated in the calligraphy system. This method can be used for product data analysis and comparison of evaluation results of different algorithm versions, and can be used by testers to quickly test the handwriting data of different students, and also provides diversified and standardized test data for regression testing.
[0099] The purpose of the disclosed embodiment is to restore the handwriting data processed by the calligraphy system to the original handwriting data format, and then resubmit the restored handwriting data to the calligraphy system for evaluation.
[0100] To this end, the method comprises the following steps:
[0101] Step S1, handwriting data collection: The original handwriting data collected by the smart pen is stored in the database after being analyzed and processed by the calligraphy system. These handwriting data are collected according to courses and students, and then stored in the file server as a test data source.
[0102] Step S2, handwriting data standardization processing: After collecting the analyzed handwriting data stored in the calligraphy system in step S1, the collected handwriting data needs to be restored, that is, the data processed by the calligraphy system is converted back to its original format. This is achieved by reversing the method of calligraphy system analysis. The data format of the handwriting data after standardization needs to be consistent with the original data format, but the data does not have to be consistent, as long as the data after analysis and processing by the calligraphy system is consistent.
[0103] In step S2, the process of handwriting data restoration and processing may include the following sub-steps:
[0104] Sub-step S21: first understand the calligraphy system's method of processing original handwriting data:
[0105] Java code: after[i] = Math.toIntExact(Math.floorDiv(Math.floorDiv((long) (before[i] 100 + beforeF[i]) txArea 100, codeArea), 100));
[0106] When before is x, txArea is 13779 and codeArea is 2480;
[0107] When before is y, txArea is 19488 and codeArea is 3510;
[0108] In the above Java code, the following operations can be performed in sequence:
[0109] 1) (before[i] 100 + beforeF[i]) txArea 100:
[0110] 2) before[i] 100: This operation will multiply before[i] by 100.
[0111] 3) before[i] 100 + beforeF[i]: Based on the previous step, add beforeF[i].
[0112] 4) (before[i] 100 + beforeF[i]) txArea 100: Multiply the result of the previous step by txArea 100.
[0113] 5) Math.floorDiv((long) (before[i] 100 + beforeF[i]) txArea 100, codeArea):
[0114] 6) Math.floorDiv() is a method in Java that returns the result of dividing two numbers by the floor. For example, 7 divided by 3 is 2, but 2.3 divided by 3 is rounded down to 2.
[0115] 7)(long) (before[i] 100 + beforeF[i]) txArea 100: First, we assume that the value of this expression is a floating point number. To ensure that subsequent operations will not cause errors due to the precision of the floating point number, we convert it to a long integer (long) data type.
[0116] 8) Math.floorDiv(Math.floorDiv((long) (before[i] 100 + beforeF[i]) txArea 100, codeArea), 100): This expression uses the Math.floorDiv() method again to divide the result of the previous step and round it down. This time the divisor is 100. This means that we are dividing the result of the previous step by 100 and rounding it down.
[0117] 9) Math.toIntExact(): Math.toIntExact() is a method in Java that converts a given integer to a standard integer type (int). If the given number is negative and its absolute value is greater than Integer.MAX_VALUE (i.e. 2147483647), it will throw an ArithmeticException. Otherwise, it will convert the number normally. The purpose here is to convert the result of the above steps to an integer.
[0118] 10) Final assignment: Assign the results of all the above steps to after[i].
[0119] Sub-step S22, studying the handwriting data restoration rules:
[0120] After understanding the calligraphy system's processing method for the original handwriting data, through data comparison, only x, y, xf, yf need to be restored, and the other data remain the original data. For the restoration of x and y, consider using the integer method; for xf and yf, consider using the remainder method.
[0121] (3) Restoration of handwriting data:
[0122] After studying the handwriting data restoration rules above, you can use Python to restore the collected handwriting data:
[0123] before[i] = int((after[i] 100 txArea / codeArea / 100) / / 100);
[0124] beforeF[i] = int((after[i] 100 txArea / codeArea / 100) % 100);
[0125] When after is x, txArea is 13779 and codeArea is 2480;
[0126] When after is y, txArea is 19488 and codeArea is 3510;
[0127] The explanation of the above code is as follows:
[0128] 1) after[i] 100: This multiplies after[i] by 100.
[0129] 2) txArea: This is a variable. When after is x, its value can be 13779; when after is y, its value can be 19488.
[0130] 3) codeArea: This is also a variable. When after is x, its value can be 2480; when after is y, its value can be 3510.
[0131] 4) txArea / codeArea: This will calculate the ratio of two variables.
[0132] 5) after[i] 100 txArea / codeArea: This will after[i] The result of 100 is multiplied by the ratio calculated above.
[0133] 6) / / 100: This divides the above result by 100 and rounds up.
[0134] 7) int(): This rounds the above result and converts it into an integer.
[0135] 8) % 100: This takes the remainder of the above result.
[0136] Step S3, cross-environment configuration: After the handwriting data is standardized as described above, cross-environment configuration can be performed. This step aims to ensure the accuracy and consistency of the handwriting data evaluation results in different environments. In the cross-environment configuration, the standardized handwriting data can be transferred to any environment of the calligraphy system (such as the test environment, the development environment), and evaluated using different versions of the algorithm. In this way, the performance differences and consistency of performance between different versions of the algorithm can be compared. In order to ensure the reliability and accuracy of the evaluation results, we have taken a variety of measures, such as setting up a control group, repeating experiments, etc.
[0137] Step S4, simulate the transmission of restored handwriting data to the calligraphy system: After the handwriting data is standardized in step S2 and configured across environments in step S3, it is possible to simulate the transmission of restored handwriting data to the calligraphy system for re-evaluation. After the calligraphy system receives the restored handwriting data, the re-evaluation process is the same as the calligraphy system's process of processing the original handwriting data. Through such a re-evaluation process, we can better understand the performance and characteristics of the restored handwriting data in the calligraphy system, which also verifies the effectiveness and reliability of the cross-environment configuration and provides more solid support for practical applications.
[0138] Step S5, handwriting data verification and adjustment: by transmitting the restored handwriting data to the calligraphy system through the above simulation, the re-evaluation result can be obtained, and the handwriting data can be verified and adjusted.
[0139] The data verification process can be as follows: by comparing with the original data, it is verified that the restored handwriting data and the original handwriting data after being processed by the calligraphy system have a difference of 1 coordinate in the x and y coordinates, of which x has 2480 coordinates and y has 3510 coordinates, which is equivalent to an error of 0.04% in x and 0.03% in y. According to the verification results, although there are errors, the errors are extremely small and can be ignored. However, by continuing to observe and analyze the data, the handwriting data restoration method was adjusted.
[0140] The data adjustment process can be as follows: x and y coordinates have a difference of 1 coordinate respectively, and the restored x and y are the same, but xf and yf are different. Try to add +1 to xf and yf before verification. You can try to adjust the Python code for restoring handwriting data to:
[0141] before[i] = int((after[i] 100 txArea / codeArea / 100) / / 100);
[0142] beforeF[i] = int((after[i] 100 txArea / codeArea / 100) % 100)+1;
[0143] When after is x, txArea is 13779 and codeArea is 2480;
[0144] When after is y, txArea is 19488 and codeArea is 3510;
[0145] It has been verified that the results of the handwriting data after the above restoration and then analyzed and processed by the calligraphy system are completely consistent with the results of the original handwriting data after being processed by the calligraphy system, so this method can ensure data accuracy.
[0146] Step S6, result evaluation: Through the above verification and adjustment of the handwriting data, it can be seen that the handwriting data restoration result is complete, accurate and consistent, that is, for the same handwriting data, there is no difference in the handwriting display on the calligraphy system. Moreover, after the original handwriting data and the handwriting data after restoration are evaluated by the same version of the algorithm, the evaluation results are consistent, indicating that this method can be used for re-evaluation across environments.
[0147] Step S7, Feedback and Optimization: The final evaluation results can be fed back to the product team of the calligraphy system to further optimize and improve the algorithm. According to the feedback results, the algorithm can be adjusted and improved to improve the reliability of the calligraphy system under the new algorithm version.
[0148] In the disclosed embodiments, the evaluation problems under different algorithm versions can be effectively solved, and the accuracy and reliability of the calligraphy system can be improved. The method ensures the accuracy and reliability of calligraphy dot matrix handwriting data in different algorithm versions through the steps of handwriting data collection, handwriting data standardization processing, cross-environment configuration, simulation of transmitting restored handwriting data to the calligraphy system, handwriting data verification and adjustment, result evaluation, feedback and optimization. The method has broad application prospects and can be applied to various links such as the development, testing and optimization of calligraphy systems. In the development stage, the same batch of handwriting data can be quickly re-evaluated in the development environment to provide developers with accurate test data; in the testing stage, the stability and reliability of the algorithm can be effectively tested, and potential problems can be discovered and solved in advance; in the optimization stage, the algorithm can be continuously improved and optimized through feedback and optimization to improve the user experience of the calligraphy system.
[0149] Figure 2 is a block diagram of a calligraphy handwriting cross-environment evaluation device according to an exemplary embodiment. Figure 2 As shown, the calligraphy handwriting cross-environment evaluation device 200 includes:
[0150] An acquisition module 201 is used to acquire original handwriting data collected by a smart pen, wherein the original handwriting data is dot matrix data formed by a user writing with the smart pen;
[0151] The parsing module 202 is used to input the original handwriting data into the handwriting evaluation module to obtain parsed handwriting data and a first evaluation result;
[0152] A storage module 203, used for storing the analyzed handwriting data and / or the first evaluation result in a database;
[0153] The restoration module 204 is used to restore the parsed handwriting data to obtain restored handwriting data in response to the cross-environment evaluation requirements of the original handwriting data;
[0154] A reconfiguration module 205, configured to reconfigure the handwriting evaluation module across environments to obtain a first handwriting evaluation module;
[0155] The evaluation module 206 is used to input the restored handwriting data into the first handwriting evaluation module to obtain a second evaluation result.
[0156] Optionally, the parsing module is used to:
[0157] Determine the parsed coordinates of each handwriting point in the original handwriting data according to the first lattice coordinates and the second lattice coordinates of each handwriting point in the original handwriting data, the coordinate value range of the lattice coordinates and the coding range, and obtain the parsed handwriting data;
[0158] Optionally, the restore module is used to:
[0159] According to the parsed coordinates of each handwriting point in the parsed handwriting data, the value range of the lattice coordinates and the coding range, the first lattice coordinates and / or the second lattice coordinates of each handwriting point in the parsed handwriting data are determined to obtain the restored handwriting data.
[0160] Optionally, the restore module is used to:
[0161] Determine the dot matrix coordinates and the third dot matrix coordinates of each handwriting point in the analyzed handwriting data according to the analyzed coordinates of each handwriting point in the analyzed handwriting data, the value range of the dot matrix coordinates and the coding range;
[0162] The abscissa and the ordinate of the third lattice coordinate are respectively added by 1 to obtain the second lattice coordinate.
[0163] Optionally, the restoration module is used to determine the analytical coordinates of each handwriting point in the original handwriting data according to the following after[i] function:
[0164] after[i] = Math.toIntExact(Math.floorDiv(Math.floorDiv((long) (before[i] 100 + beforeF[i]) txArea 100, codeArea), 100);
[0165] Wherein, before[i] represents the horizontal coordinate or vertical coordinate of the first dot matrix coordinate of the first target handwriting point, beforeF[i] represents the horizontal coordinate or vertical coordinate of the second dot matrix coordinate of the first target handwriting point, txArea represents the coordinate value range, codeArea represents the coding range, the long() method is used to convert the numerical type to a long integer, the Math.floorDiv() method is used to calculate the floor value after numerical division, and the Math.toIntExact() method is used to convert the numerical type to an integer value;
[0166] The first target handwriting point is any handwriting point in the original handwriting data, and the resolution of the first dot matrix coordinates is one hundred times the resolution of the second dot matrix coordinates.
[0167] Optionally, the restore module is used to:
[0168] According to the following before[i] function, the dot matrix coordinates of each handwriting point in the parsed handwriting data are determined:
[0169] before[i] = int((after[i] 100 txArea / codeArea / 100) / / 100);
[0170] According to the following beforeF[i] function, the floating point coordinates of each handwriting point in the parsed handwriting data are determined:
[0171] beforeF[i] = int((after[i] 100 txArea / codeArea / 100) % 100)+1;
[0172] Wherein, after[i] represents the horizontal coordinate or vertical coordinate of the parsed coordinate of the second target handwriting point, txArea represents the coordinate value range, codeArea represents the coding range, and the int() method is used to convert the numerical type into an integer type;
[0173] The second target handwriting point is any handwriting point in the analyzed handwriting data, and the resolution of the first dot matrix coordinates is one hundred times the resolution of the second dot matrix coordinates.
[0174] The resolution of the first dot matrix coordinates is different from the resolution of the second dot matrix coordinates, and the numerical types of the parsed handwriting data obtained by parsing different original handwriting data are the same.
[0175] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0176] In another aspect of the present application, an embodiment of the present invention provides an electronic device 100, which includes a processor and a non-volatile memory storing computer instructions. When the computer instructions are executed by the processor, the electronic device 100 executes the aforementioned calligraphy handwriting cross-environment evaluation method. Figure 3 As shown, Figure 3 A structural block diagram of an electronic device provided in an embodiment of the present disclosure. The electronic device 100 includes a calligraphy handwriting cross-environment evaluation device 110, a memory 111, a processor 112, and a communication unit 113. The present application is described with reference to a flowchart and / or block diagram of a calligraphy handwriting cross-environment evaluation method, device (system), and computer program product according to an embodiment of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the process Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0177] In another exemplary embodiment, a computer-readable storage medium including program instructions is also provided, and when the program instructions are executed by a processor, the above-mentioned steps of calligraphy handwriting cross-environment evaluation are implemented. For example, the computer-readable storage medium can be the above-mentioned memory 111 including program instructions, and the above-mentioned program instructions can be executed by the processor 112 of the calligraphy handwriting cross-environment evaluation device 200 to complete the above-mentioned calligraphy handwriting cross-environment evaluation.
[0178] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0179] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0180] Although the preferred embodiments of the present application have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications falling within the scope of the present application.
Claims
1. A calligraphy handwriting cross-environment evaluation method, It is characterized in that include: Acquire original handwriting data collected by the smart pen, where the original handwriting data is dot matrix data formed by the user writing with the smart pen; Inputting the original handwriting data into a handwriting evaluation module to obtain parsed handwriting data and a first evaluation result; storing the analyzed handwriting data and / or the first evaluation result in a database; In response to the cross-environment evaluation requirements for the original handwriting data, the parsed handwriting data is restored to obtain restored handwriting data; and, Reconfiguring the handwriting evaluation module across environments to obtain a first handwriting evaluation module; Inputting the restored handwriting data into the first handwriting evaluation module to obtain a second evaluation result; The step of inputting the original handwriting data into a handwriting evaluation module to obtain analyzed handwriting data comprises: Determine the parsed coordinates of each handwriting point in the original handwriting data according to the first lattice coordinates and the second lattice coordinates of each handwriting point in the original handwriting data, the coordinate value range of the lattice coordinates and the coding range, and obtain the parsed handwriting data; Wherein, the resolution of the first dot matrix coordinates is different from the resolution of the second dot matrix coordinates, and the numerical types of the parsed handwriting data obtained by parsing different handwriting original data are the same; The restoring process of the analyzed handwriting data to obtain the restored handwriting data includes: Determine the first lattice coordinate and the second lattice coordinate of each handwriting point in the analyzed handwriting data according to the analyzed coordinate of each handwriting point in the analyzed handwriting data, the value range of the lattice coordinate and the coding range, and obtain the restored handwriting data; Determining the first lattice coordinate and the second lattice coordinate of each handwriting point in the analyzed handwriting data according to the analyzed coordinate of each handwriting point in the analyzed handwriting data, the value range of the lattice coordinate and the coding range, comprises: According to the following before[i] function, the first dot matrix coordinate of each handwriting point in the parsed handwriting data is determined: before[i] = int((after[i] 100 txArea / codeArea / 100) / / 100); According to the following beforeF[i] function, the second dot matrix coordinates of each handwriting point in the parsed handwriting data are determined: beforeF[i] = int((after[i] 100 txArea / codeArea / 100) % 100)+1; Among them, / / 100 means dividing by 100 and rounding, %100 means dividing by 100 and taking the remainder, after[i] means the horizontal coordinate or vertical coordinate of the parsed coordinate of the second target handwriting point, txArea means the coordinate value range, codeArea means the coding range, the int() method is used to convert the numeric type to an integer, after[i] means 100 means multiplying the value of the parsed coordinate of the second target handwriting point by 100, after[i] 100 txArea / codeArea means after[i] The result of 100 is multiplied by the ratio of the coordinate value range to the encoding range; The second target handwriting point is any handwriting point in the analyzed handwriting data, and the resolution of the first dot matrix coordinates is one hundred times the resolution of the second dot matrix coordinates.
2. The method according to claim 1, It is characterized in that Determining the first lattice coordinate and the second lattice coordinate of each handwriting point in the analyzed handwriting data according to the analyzed coordinate of each handwriting point in the analyzed handwriting data, the value range of the lattice coordinate and the coding range, comprises: Determine the dot matrix coordinates and the third dot matrix coordinates of each handwriting point in the analyzed handwriting data according to the analyzed coordinates of each handwriting point in the analyzed handwriting data, the value range of the dot matrix coordinates and the coding range; The abscissa and the ordinate of the third lattice coordinate are respectively added by 1 to obtain the second lattice coordinate.
3. The method according to claim 1, It is characterized in that The step of determining the parsed coordinates of each handwriting point in the original handwriting data according to the first lattice coordinates and the second lattice coordinates of each handwriting point in the original handwriting data, the coordinate value range of the lattice coordinates, and the encoding range, to obtain the parsed handwriting data comprises: According to the following after[i] function, the analytical coordinates of each handwriting point in the original handwriting data are determined: after[i] = Math.toIntExact(Math.floorDiv(Math.floorDiv((long) (before[i] 100 + beforeF[i]) txArea 100, codeArea), 100)); Wherein, before[i] represents the abscissa or ordinate of the first lattice coordinate of the first target handwriting point, beforeF[i] represents the abscissa or ordinate of the second lattice coordinate of the first target handwriting point, txArea represents the coordinate value range, codeArea represents the coding range, the long() method is used to convert the value type to a long integer, the Math.floorDiv() method is used to calculate the floor value after dividing the value, and the Math.toIntExact() method is used to convert the value type to an integer value; The first target handwriting point is any handwriting point in the original handwriting data, and the resolution of the first dot matrix coordinates is one hundred times the resolution of the second dot matrix coordinates.
4. A calligraphy handwriting cross-environment evaluation device, It is characterized in that include: An acquisition module, used to acquire original handwriting data collected by the smart pen, wherein the original handwriting data is dot matrix data formed by the user writing with the smart pen; A parsing module, used for inputting the original handwriting data into a handwriting evaluation module to obtain parsed handwriting data and a first evaluation result; A storage module, used for storing the analyzed handwriting data and / or the first evaluation result in a database; A restoration module, used for restoring the parsed handwriting data to obtain restored handwriting data in response to the cross-environment evaluation requirements of the original handwriting data; A reconfiguration module, used for reconfiguring the handwriting evaluation module across environments to obtain a first handwriting evaluation module; An evaluation module, used for inputting the restored handwriting data into the first handwriting evaluation module to obtain a second evaluation result; The parsing module is used to: Determine the parsed coordinates of each handwriting point in the original handwriting data according to the first lattice coordinates and the second lattice coordinates of each handwriting point in the original handwriting data, the coordinate value range of the lattice coordinates and the coding range, and obtain the parsed handwriting data; Wherein, the resolution of the first dot matrix coordinates is different from the resolution of the second dot matrix coordinates, and the numerical types of the parsed handwriting data obtained by parsing different handwriting original data are the same; The restoration module is also used for: Determine the first lattice coordinate and the second lattice coordinate of each handwriting point in the analyzed handwriting data according to the analyzed coordinate of each handwriting point in the analyzed handwriting data, the value range of the lattice coordinate and the coding range, and obtain the restored handwriting data; The restoration module is also used for: According to the following before[i] function, the first dot matrix coordinate of each handwriting point in the parsed handwriting data is determined: before[i] = int((after[i] 100 txArea / codeArea / 100) / / 100); According to the following beforeF[i] function, the second dot matrix coordinates of each handwriting point in the parsed handwriting data are determined: beforeF[i] = int((after[i] 100 txArea / codeArea / 100) % 100)+1; Among them, / / 100 means dividing by 100 and rounding, %100 means dividing by 100 and taking the remainder, after[i] means the horizontal coordinate or vertical coordinate of the parsed coordinate of the second target handwriting point, txArea means the coordinate value range, codeArea means the coding range, the int() method is used to convert the numeric type to an integer, after[i] means 100 means multiplying the value of the parsed coordinate of the second target handwriting point by 100, after[i] 100 txArea / codeArea means after[i] The result of 100 is multiplied by the ratio of the coordinate value range to the encoding range; The second target handwriting point is any handwriting point in the analyzed handwriting data, and the resolution of the first dot matrix coordinates is one hundred times the resolution of the second dot matrix coordinates.
5. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the program is executed by a processing device, the steps of the method described in any one of claims 1 to 3 are implemented.
6. An electronic device, It is characterized in that include: a storage device having a computer program stored thereon; A processing device, configured to execute the computer program in the storage device to implement the steps of the method according to any one of claims 1 to 3.
Citation Information
Patent Citations
Insurance policy based on optical lattice technology and information entering method and device
CN107369097A
Optical dot matrix technology-based bank sheet and bank sheet information input method and apparatus
CN107491428A
Handwriting content evaluation method and device and electronic equipment
CN112487897A
Calligraphy practicing method and system based on dot matrix codes and computer readable medium
CN112836542A
Calligraphy practicing method and system based on dot matrix codes and computer readable storage medium
CN113641876A
