Handwritten chemical reaction formula identification and balancing system
The handwritten chemical reaction formula identification and balancing system utilizes a chemical reaction formula identification neural network and mathematical programming language to automatically identify and balance handwritten chemical reaction formulas, solving the problems of time-consuming and error-prone processes in existing technologies and achieving efficient and accurate chemical reaction formula balancing.
Patent Information
- Application Number
- CN202510620807.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-14
- Publication Date
- 2026-11-17
AI Technical Summary
Existing technologies cannot automatically identify and balance handwritten chemical reaction formulas, resulting in time-consuming processes and a high risk of errors.
A handwritten chemical reaction formula identification and balancing system is adopted, including an online handwritten chemical reaction formula input unit, an identification unit, a chemical reaction formula component deconstruction unit, a balancing unit, and a balanced chemical reaction formula output unit. The system uses a chemical reaction formula identification neural network and a mathematical programming language to identify and balance chemical reaction formulas.
It achieves automatic identification and balancing of handwritten chemical reaction formulas, improving efficiency, reducing the possibility of errors, maintaining the handwritten style, and saving balancing time.
Smart Images

Figure CN123120076A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to a chemical reaction formula identification system, and more particularly to a handwritten chemical reaction formula identification and balancing system. Background Technology
[0002] Electronic devices with touchscreens, such as tablets and electronic whiteboards, are gradually becoming another commonly used writing medium besides paper, whiteboards, and blackboards. They are widely used in scenarios such as note-taking, teaching, exploration, and meetings. Besides allowing for convenient searching, editing, and sharing, electronic media also enables automated writing assistance functions, saving users time and reducing the chance of human error. For example, the Math Notes app in iPadOS 18 provides calculation capabilities for handwritten arithmetic formulas, and the Notes app in iPadOS 18 provides spell checking and correction functions for handwritten words. Both present the revised content in handwritten rather than printed form, allowing it to coexist harmoniously with other handwritten content in the notes.
[0003] In most cases, people want to see chemical reaction equations in equilibrium. However, current software cannot identify unbalanced chemical reaction equations, so users must balance them manually. This method is not only time-consuming, but also prone to errors due to human calculation, resulting in unbalanced chemical reaction equations. Furthermore, it is quite inconvenient for users to input chemical reaction equations containing subscripts and superscripts using the keyboard.
[0004] Therefore, the present invention aims to provide a novel handwritten chemical reaction formula identification and balancing system to overcome the aforementioned deficiencies in the prior art. Summary of the Invention
[0005] To achieve the above objectives, this invention proposes a handwritten chemical reaction formula identification and balancing system, comprising a host computer, which includes a processor and a memory connected to the processor; the processor is used to perform the operations required by the system; the memory is used to store data or calculation programs of the computer program in the system, related operation results, and related data; wherein all operation results and related data are stored in the memory; the handwritten chemical reaction formula identification and balancing system further includes: an online handwritten chemical reaction formula input unit, used to accept multiple online handwritten chemical reaction formulas, This involves receiving the strokes of chemical symbols and related characters from each online handwritten chemical reaction formula to obtain multiple sampling point data for each stroke in the online handwritten chemical reaction formula; these multiple sampling point data form an online handwritten sample; each online handwritten chemical reaction formula has multiple corresponding sampling point data; each online handwritten chemical reaction formula corresponds to specific program code in a mathematical programming language to represent the online handwritten chemical reaction formula; the program code is compiled and converted into the corresponding online handwritten chemical reaction formula by the mathematical programming language; an identification unit is connected to the online handwritten chemical reaction formula. The reaction input unit receives the sampling point data through an input interface, identifies it, and outputs at least one program code from an output interface. Each program code corresponds to an identified output chemical reaction formula. A chemical reaction element deconstruction unit deconstructs the coefficients, elements, number of elements, and charge of each molecule from the identified output chemical reaction formula represented by the program code. Then, it extracts information useful for balancing the chemical reaction formula from the identified output chemical reaction formula, i.e., it extracts the complete chemical reaction formula from the identified output chemical reaction formula. The reaction consists of reactants and products; a chemical reaction balancing unit is connected to the chemical reaction element deconstruction unit, which obtains the elements in the reaction formula, the number of atoms of each element, the charge of each molecule, and determines whether there are explicit coefficients from the chemical reaction element deconstruction unit; if there are explicit coefficients, their values are determined; that is, used to obtain the equilibrium equation after equilibrium; the chemical reaction balancing unit is used to find the equilibrium coefficients of each reactant and product that do not have explicitly specified coefficients, so that the identified output chemical reaction formula becomes an equilibrium chemical reaction formula.
[0006] Furthermore, it also includes a balancing chemical reaction output unit connected to the chemical reaction equilibrium unit. The balancing chemical reaction output unit is used to present the equilibrium chemical reaction in handwritten form as a handwritten output chemical reaction to maintain the handwritten style of the entire balanced equilibrium chemical reaction as input. For each equilibrium coefficient that is not equal to one calculated by the chemical reaction equilibrium unit, the balancing chemical reaction output unit generates a set of trajectories that can represent the equilibrium coefficient and scales them to match the character size in the input online handwritten chemical reaction, and then inserts them before the corresponding reactant / product trajectory to form the handwritten output chemical reaction.
[0007] Furthermore, the balancing chemical reaction output unit shifts the original strokes of the online handwritten chemical reaction horizontally, so that in the handwritten output chemical reaction, except for the inserted balance coefficient, the trajectories of the other characters all come from the input online handwritten chemical reaction, thus maintaining the user's style.
[0008] Furthermore, when a user uses the device for the first time, the user writes all the digital samples, or obtains digital samples from the user's previous notes, or generates them using a style transfer model, so that the balanced chemical reaction output unit produces the corresponding handwriting style trajectory.
[0009] Furthermore, it also includes a balancing chemical reaction output unit connected to the chemical reaction equilibrium unit. The balancing chemical reaction output unit is used to present the equilibrium chemical reaction in handwritten form as a handwritten output chemical reaction. The balancing chemical reaction output unit is connected to a handwritten handwriting database. The balancing chemical reaction output unit finds the corresponding handwritten handwriting in the handwritten handwriting database based on the identified output chemical reaction output by the identification unit and the equilibrium coefficient obtained by the chemical reaction equilibrium unit. This handwriting includes the equilibrium coefficient, atom type, charge number, and number of atoms in the chemical reaction. Then, it integrates these symbols according to the positional relationship of the original chemical reaction to form the handwritten output chemical reaction.
[0010] Furthermore, the identification unit is a chemical reaction-based identification neural network.
[0011] Furthermore, the data for each sampling point includes time, x-axis, and y-axis; the data for each sampling point also includes other information such as pen pressure sensitivity, the tilt angle between the pen and the writing surface, or the direction angle of the pen relative to the given coordinates.
[0012] Furthermore, the coordinates of each stroke in this online handwriting sample are stored in InkML format.
[0013] Furthermore, the mathematical programming language is selected from either LaTeX or MathML.
[0014] Furthermore, the program code is used to train the chemical reaction recognition neural network; during training, the output value of the chemical reaction recognition neural network is set to the printed chemical reaction formula or its program code corresponding to the online handwritten chemical reaction formula, while the online handwritten chemical reaction formula is used as the input value of the chemical reaction recognition neural network.
[0015] Furthermore, during the training phase, a large number of online handwritten chemical reaction formulas are used for training. The sampling data of each online handwritten chemical reaction formula is input into multiple input interfaces of the chemical reaction formula recognition neural network, and the output result of the output interface of the chemical reaction formula recognition neural network is set as the program code corresponding to the online handwritten chemical reaction formula. After repeated training, the bond weights in the chemical reaction formula recognition neural network are adjusted during the training process, so that the chemical reaction formula recognition neural network can recognize the input online handwritten chemical reaction formula.
[0016] Furthermore, the sampling point data includes at least time, horizontal axis, and vertical axis, but also other information such as pen pressure sensitivity, the tilt angle between the pen and the writing surface, or the direction angle of the pen relative to the given coordinates.
[0017] Furthermore, in this chemical reaction balancing unit, if there is a unique solution, and some components in that unique solution are negative or all components are zero, then the input chemical reaction cannot be balanced; otherwise, it can be successfully balanced.
[0018] Furthermore, in the chemical reaction balancing unit, when the equation has multiple solutions, the general solution is found, and after setting all free variables to one, all components of the obtained solution are non-negative, thus successfully balancing the equation and obtaining a set of solutions. In other cases, balancing is directly declared a failure or further analysis is required. When there exists a unique set of non-negative and not all zero equilibrium coefficients that make the identified chemical reaction equation balanced, this set of equations has a unique solution, and the algorithm can successfully balance it.
[0019] Furthermore, in this chemical reaction balancing unit, when there are no explicitly specified coefficients in the input identification output chemical reaction, the listed linear equation system is homogeneous. Thus, multiplying all components of the solution by a number still yields a solution. Since the components of the solution obtained after successful balancing are all rational numbers, which are represented by reduced fractions, multiplying them by the least common multiple of these denominators yields a set of solutions where all components are integers.
[0020] The beneficial effects of this invention are as follows:
[0021] This invention provides a method, system, or apparatus for converting unbalanced handwritten chemical reaction equations into balanced handwritten chemical reaction equations. This assists students and chemistry professionals in taking notes or analyzing problems more efficiently on touchscreen devices, saving time required for manual or external tool balancing and reducing the possibility of errors. Furthermore, the superscripts and subscripts of the original chemical reaction equation can be expressed by handwriting, eliminating the need for keyboard or toolbar switching and saving overall balancing time.
[0022] The features and advantages of the invention will be further understood from the following description, and please refer to the accompanying drawings while reading. Attached Figure Description
[0023] Figure 1 A block diagram showing the main component combination of the present invention.
[0024] Figure 2 This diagram shows the input and output of the chemical reaction recognition neural network of the present invention.
[0025] Figure 3 This invention displays a hardware architecture diagram.
[0026] Figure 4 This invention displays a block diagram showing the online handwritten chemical reaction formula.
[0027] Figure 5 A block diagram showing the online handwriting sample of the present invention.
[0028] Figure 6 This invention displays a block diagram showing the online handwritten chemical reaction formula.
[0029] Figure 7 This diagram illustrates the online handwritten chemical reaction formula and its stroke encoding according to the present invention.
[0030] Figure 8 This diagram shows the identification and output of chemical reaction formulas according to the present invention, which includes the corresponding program code and stroke encoding.
[0031] Figure 9 This invention displays a schematic diagram of the chemical reaction element deconstruction unit, chemical reaction balancing unit, and balanced chemical reaction output unit of the present invention.
[0032] Figure 10 This invention illustrates the online handwritten chemical reaction formula and the handwritten output chemical reaction formula.
[0033] Figure 11 A block diagram showing the balanced chemical reaction output unit and handwritten handwriting database of the present invention. Detailed Implementation
[0034] The following is a detailed description of a preferred embodiment of the present invention, in conjunction with the accompanying drawings, regarding its structural composition, effects, and advantages.
[0035] Please refer to Figure 3 The handwritten chemical reaction formula recognition and balancing system of the present invention includes: a host 300, which includes a processor 2 and a memory 6 connected to the processor 2. The processor 2 is used to perform the operations required by the system 1. The memory 6 is used to store the data or calculation program of the computer program in the system 1, related operation results, and related data. All operation results and related data are stored in the memory 6.
[0036] Please refer to Figures 1 to 11 As shown, the handwritten chemical reaction formula recognition and balancing system of the present invention includes the following components:
[0037] An online handwritten chemical equation input unit 10 is used to accept multiple online handwritten chemical equations 100, that is, to receive the chemical symbols and strokes of related characters in each online handwritten chemical equation 100, so as to obtain multiple sampling point data 110 of each stroke in the online handwritten chemical equation 100 (e.g., Figure 4 Each sampling point data 110 includes time, x-axis, and y-axis. This sampling point data 110 also includes other information such as pen pressure sensitivity, the tilt angle between the pen and the writing surface, or the pen's orientation angle relative to a predetermined coordinate system. These multiple sampling point data 110 form an online handwriting sample 12 (e.g., ...). Figure 5 Preferably, the coordinates of each stroke in the online handwritten sample 12 are stored in InkML (Ink Markup Language) format. Each online handwritten chemical reaction formula 100 has multiple corresponding sampling point data 110.
[0038] The online handwritten chemical reaction formula 100 corresponds to specific program code 200 in a mathematical programming language, such as LaTeX or MathML (Mathematical Markup Language). In fact, this invention can use any mathematical programming language to represent the online handwritten chemical reaction formula 100; therefore, the program code 200 can be compiled into the corresponding online handwritten chemical reaction formula 100 using that mathematical programming language.
[0039] The program code 200 of this invention can be used to train a neural network. During training, the output value of the neural network is set to the printed chemical reaction formula (or its program code 200) corresponding to the online handwritten chemical reaction formula 100, while the online handwritten chemical reaction formula 100 is used as the input value of the neural network.
[0040] During the training phase, tens of thousands or hundreds of thousands of online handwritten samples 12 can be used for training. The sampling point data 110 of the online handwritten chemical reaction formula 100 is input into multiple input interfaces 51 of a chemical reaction formula recognition neural network 50. The sampling point data 110 includes at least time, horizontal axis, and vertical axis, but may also include other information such as pen pressure sensitivity, the tilt angle of the pen relative to the writing surface, or the direction angle of the pen relative to a predetermined coordinate system. The output result of the output interface 55 of the chemical reaction formula recognition neural network 50 is set as the program code 200 corresponding to the online handwritten chemical reaction formula 100. After repeated training, the bond weights in the chemical reaction formula recognition neural network 50 are adjusted during the training process, enabling the chemical reaction recognition neural network 50 to recognize the input online handwritten chemical reaction formula 100.
[0041] During the prediction phase, the sampling point data 110 of each online handwritten chemical reaction formula 100 is input into the input interface 51 of the chemical reaction formula recognition neural network 50, which then performs the recognition and outputs at least one program code 200 from the output interface 55. Each program code 200 corresponds to a recognized output chemical reaction formula 400.
[0042] The handwritten chemical reaction formula recognition of the present invention can be trained using a neural network, which is executed using a physical electronic computing system.
[0043] Please refer to Figure 6 , 7 As shown in Figures 8 and 9, among which Figure 6 This displays a block diagram illustrating the online handwritten chemical reaction formula 100. Figure 7 This is a schematic diagram showing the online handwritten chemical reaction formula and its stroke code. Figure 8 This diagram shows the chemical reaction formula output after being identified by the chemical reaction formula recognition neural network 50, including the corresponding program code 200 and stroke codes. In this example, the program code 200 is represented in LaTeX form, and the identified chemical reaction formula 400 includes the symbols of the LaTeX representation and their corresponding stroke codes.
[0044] A chemical reaction element deconstruction unit 30 is used to deconstruct the coefficients, elements, number of elements, and charge of each molecule in the identified output chemical reaction formula 400 represented by the program code 200. Then, it extracts information useful for balancing the chemical reaction formula from the identified output chemical reaction formula 400, that is, it extracts all reactants and products from the identified output chemical reaction formula 400. For each reactant / product, the following is required:
[0045] (1) Determine which elements make up the chemical reaction formula 400 and the number of atoms of each element;
[0046] (2) Determine the charge number of the chemical reaction formula 400 output by the identification;
[0047] (3) Determine whether the output chemical reaction formula 400 has an explicit coefficient. If so, determine its value.
[0048] In one possible instance, the recognition result is represented using a formatted string such as LaTeX, and a context-free syntax description is written to represent the LaTeX sub-language of the recognized output chemical reaction formula 400. The recognition result can then be parsed into a syntax tree using conventional parsing methods, and the desired information can be easily obtained by traversing the syntax tree.
[0049] The following example illustrates this for chemical reaction formulas. We can obtain:
[0050] (1) Reactants The number of hydrogen atoms is 0, the number of oxygen atoms is 3, the number of iodine atoms is 1, the charge number is -1, and there are no explicit coefficients;
[0051] (2) Reactant I - The number of hydrogen atoms is 0, the number of oxygen atoms is 0, the number of iodine atoms is 1, the charge number is -1, and there are no explicit coefficients;
[0052] (3) Reactant H + It has 1 hydrogen atom, 0 oxygen atoms, 0 iodine atoms, a charge of +1, and no explicit coefficients.
[0053] (4) The product I2 has 0 hydrogen atoms, 0 oxygen atoms, 2 iodine atoms, and 0 charge, and has no explicit coefficients;
[0054] (5) The product H2O has 2 hydrogen atoms, 1 oxygen atom, 0 iodine atoms, 0 charge, and an explicit coefficient of 3.
[0055] A chemical reaction balancing unit 40 is connected to the chemical reaction element deconstruction unit 30. The chemical reaction balancing unit 40 obtains the elements in the reaction formula, the number of atoms of each element, the charge of each molecule, and determines whether there are explicit coefficients from the chemical reaction element deconstruction unit 30. If there are explicit coefficients, their values are determined. This is used to obtain the equilibrium equation after equilibrium is reached. The chemical reaction balancing unit 40 is used to calculate the equilibrium coefficients of reactants and products that do not have explicitly specified coefficients, so that the identified output chemical reaction formula 400 becomes a balanced equilibrium chemical reaction formula 500 (e.g., ...). Figure 9 ).
[0056] For a chemical reaction equation to be meaningful, all coefficients must be non-negative rational numbers and not all zero. A trivial solution with all zero coefficients, while satisfying the laws of conservation of mass and charge, is meaningless. When a unique solution exists, if any component in that solution is negative or all components are zero, it can be determined that the input chemical reaction equation 400 cannot be balanced. Conversely, it can be successfully balanced, and since all coefficients in the equation system are rational, all components of this solution must also be rational. When the equation has multiple solutions, a general solution can be found. If setting all free variables to one results in all components of the solution being non-negative, then the equation system can be successfully balanced, yielding a meaningful solution. In other cases, balancing can be declared a failure, or further analysis is required. When a unique set of non-negative coefficients, not all zero, balances the input chemical reaction equation 400, the equation system has a unique solution, and the algorithm can successfully balance it.
[0057] If the input identification output chemical reaction formula 400 does not contain any explicitly specified coefficients, the listed linear equation system is homogeneous. Therefore, multiplying all components of the solution by a number will still yield a solution. Since the components of the solution obtained by this method are all rational numbers after successful balancing, they can be expressed as reduced fractions. Multiplying all of these fractions by the least common multiple of the denominators will yield a set of solutions with all components being integers.
[0058] The following example illustrates this for chemical reaction formulas. Assuming this reactant / product I - H + Given the equilibrium coefficients of I₂ and H₂O as a, b, c, d, and e respectively, and considering the number of hydrogen atoms, oxygen atoms, iodine atoms, and charge in that order, the following system of linear equations can be established according to the law of conservation of mass.
[0059] By common knowledge in linear algebra, the solution space of this system of equations has one degree of freedom, and the general solution is given by e as a free variable. Specifically, by taking e = 1, one set of solutions can be obtained. Note that the input chemical reaction equations have no explicit coefficients, making the system of equations homogeneous. Multiplying all the equations by the least common multiple of the denominators expressed as reduced fractions of these coefficients (3) yields a set of integer solutions. In other words, the balanced chemical reaction formula is:
[0060] A balanced chemical reaction output unit 60 is connected to the chemical reaction equilibrium unit 40. The balanced chemical reaction output unit 60 is used to present the equilibrium chemical reaction 500 in handwritten form as a handwritten output chemical reaction 600 (e.g., Figure 9 , 10 To maintain the handwritten style when inputting the balanced chemical reaction formula 500, the entire balanced chemical reaction formula is used. Figure 7 As shown, for each equilibrium coefficient not equal to one calculated by the chemical reaction equilibrium unit 40, the balanced chemical reaction output unit 60 generates a set of trajectories representing the equilibrium coefficient and scales them to match the character size in the input online handwritten chemical reaction formula 100. This is then inserted before the corresponding reactant / product trajectory to form the handwritten output chemical reaction formula 600. Figure 10 As shown. To avoid the balance coefficient overlapping with the trajectory of the reactant / product, the original strokes of the online handwritten chemical reaction formula 100 are shifted horizontally. Thus, in the handwritten output chemical reaction formula 600, except for the inserted balance coefficient, the trajectories of the remaining characters all originate from the input online handwritten chemical reaction formula 100, thereby essentially maintaining the user's handwriting style.
[0061] When generating the trajectory corresponding to the balance coefficient, a template made from the user's past handwriting numbers is used to imitate the user's handwriting style. For example, when the user uses it for the first time, a sample of all ten numbers written by the user is used, or a sample of numbers is obtained from the user's past handwritten notes, or a style transfer model is used to generate the corresponding handwriting style trajectory so that the balancing chemical reaction output unit 60 produces the corresponding handwriting style trajectory.
[0062] In another embodiment, such as Figure 11As shown, the balanced chemical reaction formula output unit 60 is connected to a handwriting database 65, which stores numerous handwritten handwriting samples for chemical formulas. Based on the recognized output chemical reaction formula 400 output by the chemical reaction formula recognition neural network 50 and the balance coefficient obtained by the chemical reaction formula balancing unit 40, the balanced chemical reaction formula output unit 60 finds the corresponding handwritten handwriting sample in the handwriting database 65. This handwriting sample includes the balance coefficient, atom type, charge number, and number of atoms in the chemical reaction formula. Then, these symbols are integrated according to the positional relationships of the original chemical reaction formula to generate the handwritten output chemical reaction formula 600. This method can output a handwritten chemical reaction formula 600 that differs from the original handwriting sample. This allows users to select the desired handwriting sample or avoid situations where the original handwriting sample is unrecognizable.
[0063] This invention provides a method, system, or apparatus for converting unbalanced handwritten chemical reaction equations into balanced handwritten chemical reaction equations. This assists students and chemistry professionals in taking notes or analyzing problems more efficiently on touchscreen devices, saving time required for manual or external tool balancing and reducing the possibility of errors. Furthermore, the superscripts and subscripts of the original chemical reaction equation can be expressed by handwriting, eliminating the need for keyboard or toolbar switching and saving overall balancing time.
[0064] The foregoing detailed description pertains to a feasible embodiment of the present invention. However, this embodiment is not intended to limit the scope of the patent of the present invention. All equivalent implementations or modifications that do not depart from the spirit of the present invention should be included within the scope of the patent of the present invention.
Claims
1. A handwritten chemical reaction formula identification and balancing system, characterized in that, The system includes a host computer, which includes a processor and a memory connected to the processor; the processor is used to perform operations required by the system; the memory is used to store data or calculation programs of computer programs in the system, related operation results and related data. All operation results and related data are stored in this memory; The handwritten chemical reaction formula recognition and balancing system also includes: An online handwritten chemical reaction formula input unit is used to accept multiple online handwritten chemical reaction formulas, that is, to receive the chemical symbols and related text strokes in each online handwritten chemical reaction formula, so as to obtain multiple sampling point data of each stroke in the online handwritten chemical reaction formula; the multiple sampling point data form an online handwritten sample; wherein each online handwritten chemical reaction formula has multiple corresponding sampling point data. Each online handwritten chemical reaction formula corresponds to a specific program code in a mathematical programming language to represent that online handwritten chemical reaction formula; the program code is compiled by the mathematical programming language to generate the corresponding online handwritten chemical reaction formula; An identification unit is connected to the online handwritten chemical reaction formula input unit. An input interface of the identification unit is used to receive the sampling point data, which is then identified by the identification unit. At least one program code is output from an output interface, and each program code corresponds to an identification output chemical reaction formula. A chemical reaction element deconstruction unit is used to deconstruct the coefficients, elements, number of elements, and charge of each molecule in the identified output chemical reaction represented by the program code, and then extract information useful for balancing the chemical reaction from the identified output chemical reaction, that is, extract all reactants and products from the identified output chemical reaction. A chemical reaction balancing unit is connected to the chemical reaction element deconstruction unit. The chemical reaction balancing unit obtains the elements in the reaction formula, the number of atoms of each element, the charge of each molecule, and determines whether there are explicit coefficients from the chemical reaction element deconstruction unit. If there are explicit coefficients, their values are determined; that is, used to obtain the equilibrium equation after equilibrium. The chemical reaction balancing unit is used to calculate the equilibrium coefficients of each reactant and product that do not have explicitly specified coefficients, so that the identified output chemical reaction formula becomes an equilibrium chemical reaction formula.
2. The system as described in claim 1, characterized in that, It also includes a balanced chemical reaction output unit connected to the chemical reaction equilibrium unit. The balanced chemical reaction output unit is used to present the equilibrium chemical reaction in handwritten form as a handwritten output chemical reaction to maintain the handwritten style of the entire balanced equilibrium chemical reaction as input. For each equilibrium coefficient that is not equal to one calculated by the chemical reaction equilibrium unit, the balanced chemical reaction output unit generates a set of trajectories that can represent the equilibrium coefficient and scales them to match the character size in the input online handwritten chemical reaction. Then, it is inserted before the corresponding reactant / product trajectory to form the handwritten output chemical reaction.
3. The system as described in claim 2, characterized in that, The balancing chemical reaction output unit shifts the original strokes of the online handwritten chemical reaction horizontally, so that in the handwritten output chemical reaction, except for the inserted balance coefficient, the trajectories of the other characters all come from the input online handwritten chemical reaction, thus maintaining the user's style.
4. The system as described in claim 2, characterized in that, When a user uses the product for the first time, the user writes all the digital samples, or obtains digital samples from the user's past notes, or generates them using a style transfer model, so that the balanced chemical reaction output unit produces the corresponding handwriting style trajectory.
5. The system as described in claim 1, characterized in that, It also includes a balancing chemical reaction output unit connected to the chemical reaction equilibrium unit. The balancing chemical reaction output unit is used to present the equilibrium chemical reaction in handwritten form as a handwritten output chemical reaction. The balancing chemical reaction output unit is connected to a handwritten handwriting database. The balancing chemical reaction output unit finds the corresponding handwritten handwriting in the handwritten handwriting database based on the identified output chemical reaction output by the identification unit and the equilibrium coefficient obtained by the chemical reaction equilibrium unit. This handwriting includes the equilibrium coefficient, atom type, charge number, and number of atoms in the chemical reaction. Then, it integrates these symbols according to the positional relationship of the original chemical reaction to form the handwritten output chemical reaction.
6. The system as described in claim 1, characterized in that, The identification unit is a chemical reaction recognition neural network.
7. The system as described in claim 1, characterized in that, The data for each sampling point includes time, x-axis, and y-axis; the data for each sampling point also includes other information such as pen pressure sensitivity, the tilt angle between the pen and the writing surface, or the direction angle of the pen relative to the given coordinates.
8. The system as described in claim 1, characterized in that, The coordinates of each stroke in this online handwriting sample are stored in InkML format.
9. The system as described in claim 1, characterized in that, The mathematical programming language is chosen from either LaTeX or MathML.
10. The system as described in claim 6, characterized in that, The program code is used to train the chemical reaction recognition neural network. During training, the output value of the chemical reaction recognition neural network is set to the printed chemical reaction formula or its program code corresponding to the online handwritten chemical reaction formula, while the online handwritten chemical reaction formula is used as the input value of the chemical reaction recognition neural network.
11. The system as described in claim 6, characterized in that, During the training phase, a large number of online handwritten chemical reaction formulas are used for training. The sampling data of each online handwritten chemical reaction formula is input into multiple input interfaces of the chemical reaction formula recognition neural network, and the output result of the output interface of the chemical reaction formula recognition neural network is set as the program code corresponding to the online handwritten chemical reaction formula. After repeated training, the bond weights in the chemical reaction formula recognition neural network are adjusted during the training process, so that the chemical reaction formula recognition neural network can recognize the input online handwritten chemical reaction formula.
12. The system as claimed in claim 11, characterized in that, The sampling point data includes at least time, x-axis, and y-axis, but also other information such as pen pressure sensitivity, the tilt angle between the pen and the writing surface, or the direction angle of the pen relative to the given coordinates.
13. The system as described in claim 1, characterized in that, In this chemical reaction balancing unit, if there is a unique solution, and some components in the unique solution are negative or all components are zero, then the input chemical reaction cannot be balanced; otherwise, it can be successfully balanced.
14. The system as claimed in claim 1, characterized in that, In this chemical reaction balancing unit, when the equation has multiple solutions, the general solution is found. After setting all free variables to one, all components of the solution are non-negative, and the equation can be successfully balanced and a set of solutions is obtained. In other cases, the balancing is directly declared a failure or further analysis is required. When there exists a unique set of non-negative and not all zero equilibrium coefficients that make the identified chemical reaction equation balanced, the equation set has a unique solution, and the algorithm can successfully balance it.
15. The system as claimed in claim 1, characterized in that, In this chemical reaction balancing unit, when there are no explicitly specified coefficients in the input identification output chemical reaction, the listed linear equation system is homogeneous. Thus, multiplying all components of the solution by a number still yields a solution. Since the components of the solution obtained after successful balancing are all rational numbers, they are represented as reduced fractions. Multiplying all of these fractions by the least common multiple of the denominators yields a set of solutions with all components being integers.
