Information processing methods, devices, equipment and storage media
By optimizing and simplifying computation using multi-way trees and Monte Carlo tree search algorithms, the complexity problem of binary tree representation is solved, enabling efficient computation and intelligent teaching.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- GUANGZHOU SHIYUAN ELECTRONICS CO LTD
- Filing Date
- 2021-06-04
- Publication Date
- 2026-07-31
AI Technical Summary
In the existing technology, the simplified calculation method based on binary tree representation of operation expressions has the problem of low processing efficiency, especially when the binary tree has complex shape changes with multiple identical operators, and it fails to effectively consider the combination of various simplified calculation rules.
Multi-branch trees are used to represent computational expressions, and Monte Carlo tree search algorithm is combined with selection, expansion, simulation and backpropagation steps to optimize the simplified computation process and select the optimal combination of simplified computation rules.
It improves the processing efficiency of simple calculations, simplifies the calculation logic, and is suitable for intelligent teaching in grades four to six of primary school, thus improving the efficiency of AI teaching.
Smart Images

Figure CN115437688B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to an information processing method, apparatus, device and storage medium. Background Technology
[0002] To achieve the goals of Artificial Intelligence (AI) teaching, simplified calculations need to be used for intelligent calculations and teaching prompts, which requires simplified calculations to be implemented through computer programs.
[0003] Currently, to facilitate electronic devices in processing and calculating expressions entered by users on the screen, the computer program implementation logic is as follows: The expression is converted into a postfix expression using Reverse Polish Notation, then converted into a binary tree recognizable by the electronic device, and finally simplified calculations are performed based on the binary tree. There is a one-to-one correspondence between the expression and the binary tree.
[0004] During their research on the above implementation logic, the inventors discovered that using binary trees to represent operational expressions has at least the following drawbacks: the numerous forms of binary trees make the implementation of simplified operations quite complex and result in low processing efficiency. Summary of the Invention
[0005] This application provides an information processing method, apparatus, device, and storage medium to simplify the implementation of computation and improve processing efficiency.
[0006] In a first aspect, this application provides an information processing method applied to a server, the information processing method comprising:
[0007] In response to receiving the operation expression sent by the terminal device, determine the multi-branch tree to be processed corresponding to the operation expression;
[0008] Simplified calculations are performed based on the multi-way tree to be processed and the Monte Carlo tree search algorithm to obtain the simplified calculation process and results.
[0009] Send the simplified calculation process and results to the terminal device.
[0010] Optionally, a simplified calculation is performed based on the multi-way tree to be processed and the Monte Carlo tree search algorithm to obtain the simplified calculation process and results, including: determining the multi-way tree to be processed as the starting node of the Monte Carlo tree search algorithm; determining the preset simplified calculation rules as the action space of the Monte Carlo tree search algorithm; based on the starting node and the action space, executing the steps of the Monte Carlo tree search algorithm to obtain the target search tree, the steps including selection, expansion, simulation and backpropagation, the values contained in the nodes of the target search tree are used to represent the cumulative reward value and the number of visits, and the edges of the target search tree point from the parent node to the child node; and obtaining the simplified calculation process and results based on the target search tree.
[0011] Optionally, based on the starting node and action space, the Monte Carlo tree search algorithm is executed to obtain the target search tree, including: determining the starting node as the current node; determining whether the loop variable i is less than the preset total number of explorations; if the loop variable i is less than the preset total number of explorations, determining whether the current node contains an operator; if the current node contains an operator, determining whether the current node's exploration count is less than or equal to the exploration count threshold; if the exploration count is less than or equal to the exploration count threshold, performing a simplified operation in the action space on the current node to obtain a child node of the current node, and recording the access count of the child node as a first preset value, with a one-to-one correspondence between the simplified operation and the child node; determining whether the child node can execute the simplified operation; if it is determined that the child node can execute the simplified operation, performing an operation simulation on the child node to obtain the child node's first reward value; performing backpropagation on the child node; performing the process of accumulating a second preset value on the exploration count, performing the process of accumulating a third preset value on the loop variable i, and executing the step of determining whether the loop variable i is less than the preset total number of explorations; if the loop variable i is greater than or equal to the preset total number of explorations, the target search tree containing the starting node and each child node is obtained.
[0012] Optionally, the information processing method further includes: if the current node does not contain an operator, then performing backpropagation on the current node; and performing the process of accumulating a third preset value on the loop variable i; and performing the step of determining whether the loop variable i is less than the preset total number of explorations.
[0013] Optionally, the information processing method further includes: if the number of explorations is not less than or equal to the number of explorations threshold, then the child node with the largest upper confidence interval (UCB) value among the child nodes of the current node is determined as the current node, and the step of determining whether the current node contains an operator is performed.
[0014] Optionally, the information processing method further includes: if it is determined that the child node cannot perform a simplified operation, then backpropagation is performed on the child node.
[0015] Optionally, if the loop variable i is greater than or equal to the preset total number of explorations, a target search tree containing the starting node and each child node is obtained, including: if the loop variable i is greater than or equal to the preset total number of explorations, determining whether the child node with the highest number of visits contains an operator; if the child node with the highest number of visits does not contain an operator, obtaining a target search tree containing the starting node and each child node; or, if the child node with the highest number of visits contains an operator, using the child node with the highest number of visits as the current node, performing the step of determining whether the loop variable i is less than the preset total number of explorations.
[0016] Optionally, the computation simulation is performed on the child nodes to obtain the first reward value of the child nodes, including: performing a simplified computation action on the child nodes to obtain the first reward value corresponding to the child nodes.
[0017] Optionally, backpropagation is performed on the child nodes, including: if it is determined that the child node can perform a simplified calculation action, then the cumulative reward value of all nodes on the path from the child node to the starting node is updated according to the preset node cumulative reward value update method, and the number of visits to each node is added to the first preset value; if it is determined that the child node cannot perform a simplified calculation action, then the number of visits to all nodes on the path from the child node to the starting node is added to the first preset value.
[0018] Optionally, the information processing method further includes: obtaining the UCB value according to the following formula:
[0019]
[0020] Where Q represents the cumulative reward value corresponding to the child nodes of the current node, N represents the number of times the current node has been visited, and n represents the number of times the child nodes of the current node have been visited.
[0021] Optionally, based on the target search tree, the simplified calculation process and calculation results are obtained, including: performing a depth-first search on the target search tree according to the number of visits to obtain the target decision path; and based on the target decision path, traversing the multi-branch trees corresponding to the root node of the target search tree and the nodes that do not contain operators to output the step-by-step equation, thereby obtaining the simplified calculation process and calculation results.
[0022] Secondly, this application provides an information processing apparatus for use on a server, the information processing apparatus comprising:
[0023] The determination module is used to determine the multi-branch tree to be processed corresponding to the operation expression received from the terminal device.
[0024] The acquisition module is used to perform simplified calculations based on the multi-way tree to be processed and the Monte Carlo tree search algorithm, and to obtain the process and results of the simplified calculations.
[0025] The sending module is used to send the simplified calculation process and results to the terminal device.
[0026] Optionally, the acquisition module is specifically used for: determining the multi-way tree to be processed as the starting node of the Monte Carlo Tree Search algorithm; determining the preset simplified calculation rules as the action space of the Monte Carlo Tree Search algorithm; based on the starting node and the action space, executing the steps of the Monte Carlo Tree Search algorithm to obtain the target search tree, the steps including selection, expansion, simulation and backpropagation, the numerical values contained in the nodes of the target search tree are used to represent the cumulative reward value and the number of visits, and the edges of the target search tree point from the parent node to the child node; and obtaining the simplified calculation process and calculation results based on the target search tree.
[0027] Optionally, when the acquisition module is used to obtain the target search tree by executing the Monte Carlo tree search algorithm based on the starting node and the action space, it specifically performs the following steps: determining that the starting node is the current node; determining whether the loop variable i is less than the preset total number of explorations; if the loop variable i is less than the preset total number of explorations, determining whether the current node contains an operator; if the current node contains an operator, determining whether the number of explorations of the current node is less than or equal to the number of explorations threshold; if the number of explorations is less than or equal to the number of explorations threshold, performing a simplified operation in the action space on the current node to obtain a child node of the current node. The system records the number of visits to child nodes as a first preset value, and assigns a simplified calculation action to each child node. It then determines whether a child node can perform a simplified calculation action. If a child node can perform a simplified calculation action, it performs a calculation simulation on the child node to obtain its first reward value. It then performs backpropagation on the child node. It accumulates the number of explorations by a second preset value and the loop variable i by a third preset value. It then determines whether the loop variable i is less than the preset total number of explorations. If the loop variable i is greater than or equal to the preset total number of explorations, it obtains the target search tree containing the starting node and all child nodes.
[0028] Optionally, the acquisition module is also used for: if the current node does not contain an operator, then performing backpropagation on the current node; and performing the process of accumulating a third preset value on the loop variable i; and performing the step of determining whether the loop variable i is less than the preset total number of explorations.
[0029] Optionally, the acquisition module is also used to: if the number of explorations is not less than or equal to the number of explorations threshold, determine the child node with the largest UCB value among the child nodes of the current node as the current node, and perform the step of determining whether the current node contains an operator.
[0030] Optionally, the acquisition module is also used to: if it is determined that the child node cannot perform a simplified operation, then perform backpropagation on the child node.
[0031] Optionally, when the acquisition module is used to obtain the target search tree containing the starting node and each child node if the loop variable i is greater than or equal to the preset total number of explorations, it is specifically used to: if the loop variable i is greater than or equal to the preset total number of explorations, determine whether the child node with the largest number of visits contains an operator; if the child node with the largest number of visits does not contain an operator, obtain the target search tree containing the starting node and each child node; or, if the child node with the largest number of visits contains an operator, use the child node with the largest number of visits as the current node and execute the step of determining whether the loop variable i is less than the preset total number of explorations.
[0032] Optionally, when the acquisition module is used to perform calculation simulation on the child node and obtain the first reward value of the child node, it is specifically used to: perform a simplified calculation action on the child node and obtain the first reward value corresponding to the child node.
[0033] Optionally, when the acquisition module is used to perform backpropagation on child nodes, it is specifically used to: if it is determined that the child node can perform a simplified calculation action, then update the cumulative reward value of all nodes on the path from the child node to the starting node according to the preset node cumulative reward value update method, and the number of visits to each node is added to the first preset value; if it is determined that the child node cannot perform a simplified calculation action, then add the number of visits to all nodes on the path from the child node to the starting node to the first preset value.
[0034] Optionally, the acquisition module is also used to: obtain the UCB value according to the following formula:
[0035]
[0036] Where Q represents the cumulative reward value corresponding to the child nodes of the current node, N represents the number of times the current node has been visited, and n represents the number of times the child nodes of the current node have been visited.
[0037] Optionally, when the acquisition module is used to obtain the simplified calculation process and calculation result based on the target search tree, it is specifically used to: perform a depth search on the target search tree according to the number of visits to obtain the target decision path; and based on the target decision path, traverse the multi-branch tree corresponding to the root node of the target search tree to the node that does not contain the operator and output the step-by-step equation to obtain the simplified calculation process and calculation result.
[0038] Thirdly, this application provides a server, comprising:
[0039] Memory, used to store program instructions;
[0040] A processor is used to call and execute program instructions in memory to perform the information processing method as described in the first aspect of this application.
[0041] Fourthly, this application provides an information processing system, comprising:
[0042] The server as described in the third aspect;
[0043] A terminal device is used to respond to user input by sending a calculation expression to the server and displaying the calculation process and result.
[0044] Fifthly, this application provides a computer-readable storage medium storing program instructions; when the program instructions are executed, they implement the information processing method as described in the first aspect of this application.
[0045] Sixthly, this application provides a computer program product comprising program instructions; when the program instructions are executed, they implement the information processing method as described in the first aspect of this application.
[0046] The information processing method, apparatus, device, and storage medium provided in this application involve a server responding to a computational expression sent by a terminal device, determining the multi-way tree to be processed corresponding to the computational expression, performing simplified computation based on the multi-way tree to be processed and a Monte Carlo tree search algorithm, obtaining the simplified computation process and result, and sending the simplified computation process and result to the terminal device. Because this application performs simplified computation based on the multi-way tree to be processed corresponding to the computational expression and a Monte Carlo tree search algorithm, it simplifies the implementation of simplified computation, thereby improving processing efficiency. Attached Figure Description
[0047] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0048] Figures 1(a) to 1(d) This is a schematic diagram of the multi-way tree structure corresponding to different operational expressions in Table 1;
[0049] Figures 2(a) to 2(f) This is a schematic diagram of the multi-way tree structure corresponding to different operational expressions in Table 2;
[0050] Figures 3(a) to 3(e) This is a schematic diagram of the multi-way tree structure corresponding to different operational expressions in Table 3;
[0051] Figures 4(a) to 4(d) This is a schematic diagram of the multi-way tree structure corresponding to different operational expressions in Table 4;
[0052] Figure 5 This is a schematic diagram illustrating an application scenario provided in one embodiment of this application;
[0053] Figure 6 A flowchart illustrating an information processing method provided in an embodiment of this application;
[0054] Figure 7 A flowchart of an information processing method provided in another embodiment of this application;
[0055] Figure 8 A schematic diagram of a Monte Carlo tree search algorithm provided in an embodiment of this application;
[0056] Figure 9 This is a simplified schematic diagram of the Monte Carlo tree search algorithm provided in an embodiment of this application;
[0057] Figure 10 A flowchart illustrating an information processing method provided in yet another embodiment of this application;
[0058] Figure 11 A flowchart illustrating an information processing method provided in yet another embodiment of this application;
[0059] Figure 12 A flowchart for obtaining the optimal decision path based on the target search tree is provided as an embodiment of this application;
[0060] Figure 13 A schematic diagram illustrating the calculation process of a complex arithmetic expression provided in an embodiment of this application;
[0061] Figure 14 A schematic diagram of the application interface corresponding to the "intelligent calculation" algorithm provided in one embodiment of this application;
[0062] Figure 15 A schematic diagram of the application interface corresponding to the "intelligent calculation" algorithm provided in another embodiment of this application;
[0063] Figure 16 This is a schematic diagram of the structure of an information processing apparatus provided in an embodiment of this application;
[0064] Figure 17 This is a schematic diagram of the structure of a server provided in an embodiment of this application. Detailed Implementation
[0065] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0066] First, the technical terms used in this application will be explained:
[0067] The multi-branch tree representation of mathematical expressions means that mathematical expressions can be represented using a multi-branch tree data structure. As shown in Table 1, its characteristics are as follows: (1) There are two or more leaf nodes under the same operator node; (2) In the multi-branch tree formed by the four arithmetic mixed operation expression, there are only two independent operator nodes: "+" and "×" (which can also be represented by "*"). The representation of the "-" and "÷" operators will be distinguished by prefix symbols.
[0068] Table 1
[0069] Serial Number Operational expressions Multi-way tree representation 1 672-25-72 Figure 1(a) 2 25*360*4 / 36 Figure 1(b) 3 32 / 5+33 / 5+35 / 5 Figure 1(c) 4 (99+88+77)*2 / (5+6) Figure 1(d)
[0070] The simplified calculation rules currently include the following: (1) the commutative and associative laws of addition; (2) the properties of subtraction (commutative and associative laws of subtraction); (3) the commutative, associative, distributive, and inverse operations of the distributive laws of multiplication; and (4) the properties of division (commutative, associative, distributive, and inverse operations of the distributive laws of division and the property of unchanged quotient). In addition, there is a basic operation, namely, direct calculation based on the calculation priority of the multi-way tree. The calculation process based on the simplified calculation rules of the multi-way tree is shown in Table 2. By analyzing the child nodes of the "+" node in the multi-way tree, it can be found that "25+75" can be rounded for simplified calculation. Therefore, the commutative and associative laws of addition can be applied to perform step-by-step calculation to obtain "37+(25+75)+33"; then, direct calculation can be performed to obtain the new step-by-step calculation "37+100+33". At this point, analyzing the child nodes under the "+" node in the multi-way tree reveals that "37+33" can be rounded up. Therefore, by applying the associative law of addition, a simplified calculation process can be achieved. Finally, the original result of 170 can be obtained by directly calculating in two steps.
[0071] Table 2
[0072]
[0073] Monte Carlo Tree Search (MCTS) is a technique for exploring and utilizing optimal decision-making strategies. Originally applied to board games, it defines the Go board position as a state, where actions can be performed through "imagination" (i.e., placing a piece) to transition to the next state. This process is repeated to change the board position to a state with a higher or lower probability of winning. This information can be used to guide the initial action to maximize the winning probability. Assuming we have implemented all the simplified calculation rules, an easily conceived simplified calculation algorithm (i.e., the basic deduction algorithm) is as follows: (1) First, perform a preorder traversal of the multi-branch tree's operator nodes; (2) Analyze each operator node and determine if a simplified calculation rule can be executed. If yes, execute the simplified calculation rule; otherwise, continue traversing and analyzing the multi-branch tree nodes; (3) If no simplified calculation operation is found after traversing all nodes, perform direct calculation. This basic deduction algorithm can be used to process the calculation expressions shown in Table 2, but it cannot be used to process all calculation expressions. As shown in Table 3, a method for simplified calculation by splitting the product is presented, and the simplified calculation process is relatively straightforward.
[0074] Table 3
[0075]
[0076] However, assuming the multi-way tree shown in Table 3 is a subtree of a larger multi-way tree, as shown in Table 4, the expected calculation flow for the operational expression in Table 4 should be as shown in Table 4, applying the distributive property of multiplication. However, when applying the basic deduction algorithm described above, if iterates to "25*32", the basic deduction algorithm will use product splitting for simplified calculation, which actually makes the calculation logic more complex. The key issue here is that a multi-way tree expression may involve multiple simplified calculation logics. To achieve the optimal simplified calculation process, a Monte Carlo tree search algorithm is needed to compare different simplified calculation methods. This method can score different simplified calculation rules, thereby selecting the optimal simplified calculation process.
[0077] Table 4
[0078]
[0079] Simplified calculation is a crucial knowledge point in elementary school from fourth to sixth grade, involving the four basic arithmetic operations and simplified calculations. Elementary school students need extensive practice and feedback to fully absorb and master this knowledge. To achieve the goals of AI-driven teaching, simplified calculation needs to be used for intelligent deduction and teaching prompts, which requires implementing simplified calculation through computer programs. In simplified calculation problems, the traditional method of representing operational expressions using binary trees has the following drawbacks:
[0080] 1) Binary trees with multiple identical operators have many forms. Their form changes with the length of the operation expression and the parentheses, which is not conducive to achieving simplified calculations.
[0081] 2) For binary trees composed of the same-origin operators “+” and “-”, “*” and “÷”, the binary tree shape changes with the length of the operation expression, the parentheses, and the position of the same-origin operators, which makes the implementation of simplified operations more complicated.
[0082] Furthermore, current simplified calculation methods only consider that an expression can only apply one simplified calculation rule in each step of the iteration, without considering the possibility of executing multiple simplified calculation rules simultaneously. This leads to the concept of "exploring" the simplified calculation process, meaning that the optimal simplified calculation process may be the optimal combination of various simplified calculation rules rather than the application of a single rule. In this case, the space of various simplified calculation rule combinations may be very large, making its implementation logic impossible to achieve through exhaustive enumeration.
[0083] To address the aforementioned issues, this application provides an information processing method, apparatus, device, and storage medium that, based on predefined simplified calculation rules and patterns, performs simplified calculations using multi-branch trees and Monte Carlo tree search algorithms corresponding to the calculation expressions. This makes the simplified calculation process more efficient and improves processing efficiency.
[0084] The following section provides examples illustrating the application scenarios of the solution provided in this application.
[0085] Figure 5 This is a schematic diagram illustrating an application scenario provided by an embodiment of this application. For example... Figure 5 As shown, this application scenario may include: terminal device 51 and server 52. The terminal device 51 and server 52 communicate via a network.
[0086] Optionally, when a user inputs a calculation expression on the screen of terminal device 51, terminal device 51 sends the calculation expression to server 52 via the network. Upon receiving the calculation expression, server 52 determines the multi-way tree corresponding to the calculation expression, performs a simplified calculation based on the multi-way tree and the Monte Carlo tree search algorithm, and sends the simplified calculation process and result to the terminal device 51 used by the user via the network. Terminal device 51 then displays the simplified calculation process and result to achieve the goal of AI teaching.
[0087] Figure 5 In the example shown, terminal device 51 is an interactive whiteboard, but this application is not limited to this. The interactive whiteboard integrates any one or more functions such as a projector, electronic whiteboard, screen, audio system, television, and video conferencing terminal. It should be noted that... Figure 5 This is merely a schematic diagram illustrating one application scenario provided by an embodiment of this application. This embodiment does not necessarily represent... Figure 5 The included equipment is not limited, nor is it restricted. Figure 5 The positional relationships between devices are defined. For example, in Figure 5 The application scenario shown may also include a data storage device, which may be an external storage device relative to server 52 or an internal storage device integrated into server 52.
[0088] Next, the technical solution of this application will be described in detail through specific embodiments. It should be noted that the following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments.
[0089] Figure 6 This is a flowchart illustrating an information processing method according to an embodiment of this application. The information processing method can be executed by an information processing device, which can be implemented in software and / or hardware. Figure 5 In the application scenario shown, the information processing device can be a server chip or circuit.
[0090] It should also be noted that the information processing method provided in this application can also be executed by a terminal device. If the information processing method provided in this application is executed by a terminal device, after determining the operational expression, the terminal device determines the multi-way tree to be processed corresponding to the operational expression, performs a simplified calculation based on the multi-way tree and the Monte Carlo tree search algorithm, and displays the simplified calculation process and results. For example, in response to an operational expression input by the user, the terminal device determines the multi-way tree to be processed corresponding to the operational expression. The specific processing procedure is similar to that of a server; the following description only uses a server as the execution entity. Figure 6As shown, the method in this application embodiment includes:
[0091] S601. In response to receiving the operation expression sent by the terminal device, determine the multi-branch tree to be processed corresponding to the operation expression.
[0092] For example, the terminal device can be any electronic device that interacts with the server. Optionally, the terminal device has a display function to display the calculation expression, as well as a simplified calculation process and result from the server.
[0093] In practical applications, such as during AI teaching, a teacher manually inputs a computational expression on an interactive whiteboard. In response to this input, the whiteboard displays the expression and sends it to the server. Alternatively, the teacher selects a currently displayed expression by clicking on it; in response, the whiteboard sends the expression to the server. Correspondingly, upon receiving the computational expression from the terminal device, the server determines the corresponding multi-way tree to be processed.
[0094] The process by which the server determines the multi-way tree to be processed corresponding to the operation expression can be found in relevant technologies and will not be elaborated here. For example, the server receives the operation expression corresponding to serial number 1 in Table 1, and the determined multi-way tree to be processed is shown in Figure 1(a).
[0095] S602. Perform simplified calculations based on the multi-way tree to be processed and the Monte Carlo tree search algorithm, and obtain the simplified calculation process and results.
[0096] In this step, after obtaining the multi-way tree to be processed corresponding to the operational expression, a simplified calculation can be performed based on the multi-way tree to be processed and the Monte Carlo tree search algorithm to obtain the simplified calculation process and results. For details on how to obtain the simplified calculation process and results, please refer to relevant technologies or subsequent embodiments; they will not be elaborated here.
[0097] S603, Send the simplified calculation process and calculation results to the terminal device.
[0098] After performing simplified calculations based on the multi-way tree to be processed and the Monte Carlo tree search algorithm, the server sends the simplified calculation process and results to the terminal device so that the terminal device can display the simplified calculation process and results. For example, if the calculation expression is 25×32+68×25, its corresponding simplified calculation process and results can be as follows:
[0099] 25×32+68×25
[0100] = (32 + 68) × 25
[0101] =100×25
[0102] =2500
[0103] Optionally, while displaying the above content, the terminal device can also display the calculation rules used in the simplified calculation process described above. Using the example above, the terminal device can also display:
[0104] 25×32+68×25
[0105] Inverse operation of the distributive property of multiplication
[0106] = (32 + 68) × 25
[0107] =100×25
[0108] =2500
[0109] The information processing method provided in this application embodiment involves a server responding to a computational expression sent by a terminal device, determining the multi-way tree to be processed corresponding to the computational expression, performing simplified computation based on the multi-way tree to be processed and a Monte Carlo tree search algorithm, obtaining the simplified computation process and result, and sending the simplified computation process and result to the terminal device. Since this application embodiment performs simplified computation based on the multi-way tree to be processed corresponding to the computational expression and a Monte Carlo tree search algorithm, the implementation of simplified computation can be simplified, thereby improving processing efficiency.
[0110] Figure 7 This is a flowchart illustrating an information processing method provided in another embodiment of this application. Based on the above embodiments, this application further explains how to perform simplified calculations using the multi-way tree to be processed and the Monte Carlo tree search algorithm, and how to obtain the simplified calculation process and results. For example... Figure 7 As shown, the information processing method in this application embodiment may include:
[0111] S701. In response to receiving the operation expression sent by the terminal device, determine the multi-branch tree to be processed corresponding to the operation expression.
[0112] For a detailed description of this step, please refer to [link / reference]. Figure 6 The relevant description of S601 in the illustrated embodiment will not be repeated here.
[0113] S702. Determine the starting node of the multi-way tree to be processed as the Monte Carlo tree search algorithm.
[0114] For example, the multi-branch tree to be processed, as shown in Figure 1(a), is determined as the starting node of the Monte Carlo tree search algorithm.
[0115] Optionally, the multi-way tree expression can be used as a state in the Monte Carlo tree search algorithm, and a corresponding simplified operation can be performed in each state. For example, the multi-way tree to be processed shown in Figure 1(a) can be used as a state in the Monte Carlo tree search algorithm, and a corresponding simplified operation can be performed in this state.
[0116] S703. Determine the preset simplified calculation rules as the action space of the Monte Carlo tree search algorithm.
[0117] For example, the preset simplified operation rules include: inverse operation of the distributive property of multiplication, property of division (associative property), commutative property of addition, associative property of addition, property of quotient invariance, distributive property of multiplication, direct calculation, rounding method of addition, property of division (commutative property), property of division (distributive property), rounding method of multiplication, commutative property of multiplication, and associative property of multiplication. These preset simplified operation rules constitute the action space of the Monte Carlo tree search algorithm.
[0118] S704. Based on the starting node and action space, execute the Monte Carlo tree search algorithm to obtain the target search tree. The steps include selection, expansion, simulation, and backpropagation.
[0119] In the target search tree, the nodes contain numerical values to represent the cumulative reward value and the number of visits, and the edges of the target search tree point from the parent node to the child node.
[0120] After determining the starting node and action space, the Monte Carlo tree search algorithm can be executed based on the starting node and action space to obtain the target search tree. The steps include selection, expansion, simulation, and backpropagation. For details on how to obtain the target search tree, please refer to relevant technologies or subsequent embodiments; they will not be elaborated here. For example, Figure 8 This is a schematic diagram of a Monte Carlo tree search algorithm provided in an embodiment of this application, as shown below. Figure 8 As shown, assuming the action space has 11 simplified operation rules corresponding to 11 simplified operation actions, including various commutative, associative, and distributive laws of addition, subtraction, multiplication, and division, the Monte Carlo tree search algorithm is executed on the multi-way tree to be processed corresponding to the operation expression "25*32+68*25" in Table 4 above to obtain the target search tree. Node 801 is the starting node. Nodes 801 to 807 can all perform simplified operation actions and can be considered feasible nodes, each storing a multi-way tree expression. Nodes 808 and 809 represent nodes whose multi-way trees are single nodes, i.e., storing operands; that is, the multi-way tree is the operand, indicating that the Monte Carlo tree search algorithm has ended. Nodes other than 801 to 809 cannot perform simplified operation actions (the corresponding node values are 0 / 1), and can be considered infeasible nodes, meaning that a certain simplified operation action of their parent node cannot be executed. Figure 8It can also be seen that the value on each node represents the cumulative reward value and the number of visits. For example, if the value on a node is 3.7 / 150, it means that the cumulative reward value is 3.7 and the number of visits is 150. The edges of the target search tree represent the action of a simplified calculation performed by the parent node. They are directed edges, pointing from the parent node to the child node. Figure 9 This is a simplified schematic diagram of a Monte Carlo tree search algorithm provided in an embodiment of this application, as shown below. Figure 9 As shown, in Figure 8 The Monte Carlo tree search algorithm was simplified based on the previous one, retaining only the initial nodes 801 to 809 and removing infeasible nodes. The initial node 801 stores the multi-way tree to be processed corresponding to the expression "25*32+68*25". After performing 11 simplified operations at this node, three operations were successfully executed: "inverse operation of the distributive property of multiplication", "direct calculation", and "commutative and associative properties of multiplication", resulting in three new child nodes 802, 804, and 806 respectively. Repeating this process, searching based on child nodes 802, 804, and 806, and continuously expanding, yields the tree as shown below. Figure 9 The image shows a relatively complete search tree.
[0121] S705. Based on the target search tree, obtain the simplified calculation process and calculation results.
[0122] After obtaining the target search tree, a simplified calculation process and results can be derived from it. For details on how to obtain the simplified calculation process and results from the target search tree, please refer to relevant technologies or subsequent embodiments; these will not be elaborated upon here.
[0123] S706. Send the simplified calculation process and calculation results to the terminal device.
[0124] For a detailed description of this step, please refer to [link / reference]. Figure 6 The relevant description of S603 in the illustrated embodiment will not be repeated here.
[0125] The information processing method provided in this application embodiment, in response to receiving an operational expression sent by a terminal device, determines the multi-way tree to be processed corresponding to the operational expression, determines the multi-way tree to be processed as the starting node of the Monte Carlo tree search algorithm, determines a preset simplified operation rule as the action space of the Monte Carlo tree search algorithm, and executes the steps of the Monte Carlo tree search algorithm based on the starting node and the action space to obtain the target search tree. The steps include selection, expansion, simulation, and backpropagation. Based on the target search tree, the simplified operation process and operation result are obtained. Since this application embodiment executes the steps of the Monte Carlo tree search algorithm based on the starting node corresponding to the multi-way tree to be processed and the action space corresponding to the preset simplified operation rule to obtain the target search tree, and obtains the simplified operation process and operation result based on the target search tree, it can simplify the implementation of simplified operation and thus improve processing efficiency.
[0126] Figure 10 This is a flowchart illustrating an information processing method provided in another embodiment of this application. Based on the above embodiments, this application further explains how to obtain the target search tree by executing the Monte Carlo tree search algorithm based on the starting node and action space. Figure 10 As shown, step S704 may further include:
[0127] S1001. Determine the starting node as the current node.
[0128] It can be understood that the starting node is the root node of the target search tree, that is, the current node at the beginning. For example, at the beginning, the target search tree has only one root node, which is the calculation expression to be performed using simplified operations. This expression contains three basic pieces of information: a multi-way tree expression, the number of times it has been visited, and the cumulative reward value. This root node can be denoted as S1, where the subscript 1 represents the exploration round number, and each simplified operation increments the round number by 1. For example, refer to... Figure 8 If the multi-branch tree to be processed corresponding to the operation expression "25*32+68*25" in Table 4 above is taken as the starting node 801, then the starting node 801 is the current node.
[0129] It can be understood that step S1001 corresponds to the selection step of the Monte Carlo tree search algorithm.
[0130] S1002. Determine whether the loop variable i is less than the preset total number of explorations.
[0131] The initial value of the loop variable i is, for example, 1. For instance, if the preset total number of explorations is 2048, after performing the step of incrementing the loop variable i by the third preset value, it is necessary to determine whether the number of explorations has reached the preset total number of explorations. If the loop variable i is less than the preset total number of explorations, then step S1003 is executed; if the loop variable i is greater than or equal to the preset total number of explorations, then step S1011 is executed.
[0132] S1003. Determine whether the current node contains operators.
[0133] This step is optional. It can be omitted if the current node is the root node of the target search tree.
[0134] For example, if the current node contains an operator, it means that the multi-way tree corresponding to the current node is an operand. The state of this node can be understood as a node where the state terminates. Accordingly, this node can be defined as a computation termination node.
[0135] It can be understood that step S1003 corresponds to the selection step of the Monte Carlo tree search algorithm.
[0136] If the current node contains an operator, then proceed to step S1004; if the current node does not contain an operator, then proceed to step S1012 to perform backpropagation on the current node; and proceed to step S1013 to perform the process of accumulating the third preset value on the loop variable i; and return to S1002. For example, the third preset value is, for example, 1.
[0137] S1004. Determine whether the number of explorations for the current node is less than or equal to the exploration number threshold.
[0138] The exploration count threshold is the number of simplified computation actions contained in the action space. For each current node, the initial exploration count is, for example, 1. Each time a simplified computation action is executed, the exploration count is incremented by, for example, 1. When the exploration count exceeds the exploration count threshold, the expansion phase corresponding to the current node is completed.
[0139] For example, the threshold for the number of explorations is 11, see reference. Figure 8Assuming the current node is 801, the process involves determining whether all simplified computation actions in the action space corresponding to the current node 801 have been expanded. Specifically, it involves determining whether the starting node 801 has executed all 11 candidate actions (i.e., 11 simplified computation actions). If all 11 candidate actions have been executed, it indicates that the actions in the action space corresponding to the root node have been expanded. If not all 11 candidate actions have been executed (e.g., only 10 actions have been executed, leaving one unexecuted), it indicates that the actions in the action space corresponding to the root node have not been expanded. If the number of explorations is less than or equal to the exploration threshold, then step S1005 is executed; if the number of explorations is not less than or equal to the exploration threshold, then step S1010 is executed.
[0140] S1005. Perform a simple operation in the action space on the current node to obtain a child node of the current node, and record the number of visits to the child node as a first preset value.
[0141] Each simplified calculation action corresponds one-to-one with a child node.
[0142] For example, the first preset value is, for instance, 1. For example, taking the current node as the node to be expanded, the current node is expanded by randomly selecting a simplified operation (e.g., denoted by A) that has not been executed before from the action space. After executing A, a new node can be obtained as a child node of the current node, and the access count of the child node is recorded as 1. The state of this child node is the multi-way tree after executing A. It should be noted that the state of the child node may be empty, meaning the child node cannot execute simplified operations, because the randomly selected simplified operation may not be applicable to the multi-way tree of the node to be expanded.
[0143] It can be understood that step S1005 corresponds to the extended steps of the Monte Carlo tree search algorithm.
[0144] S1006. Determine whether the child node can perform simplified calculation actions.
[0145] For example, a child node cannot perform a simplified operation, that is, the node's state is empty, and the child node is an infeasible node; a child node can perform a simplified operation, that is, the child node is a feasible node. If it is determined that the child node can perform a simplified operation, then step S1007 is executed; if it is determined that the child node cannot perform a simplified operation, then step S1008 is executed.
[0146] S1007. Perform calculation simulation on the child nodes to obtain the first reward value of the child nodes.
[0147] After determining that the child node can perform simple calculations, the child node can be simulated to obtain the corresponding first reward value. For details on how to obtain the first reward value of the child node, please refer to relevant technologies or subsequent embodiments; these will not be elaborated upon here.
[0148] It can be understood that step S1007 corresponds to the simulation steps of the Monte Carlo tree search algorithm.
[0149] S1008, Perform backpropagation on child nodes.
[0150] For instructions on how to perform reverse propagation on child nodes, please refer to relevant technologies or subsequent implementations; these will not be elaborated upon here.
[0151] It can be understood that step S1008 corresponds to the backpropagation step of the Monte Carlo tree search algorithm.
[0152] S1009, Perform the process of accumulating the second preset value for the number of explorations, perform the process of accumulating the third preset value for the loop variable i, and return to execute S1002.
[0153] For example, the second preset value is 1. The number of explorations is incremented by 1, the loop variable i is incremented by 1, and the process returns to step S1002.
[0154] S1010: Determine the child node with the largest UCB value among all child nodes of the current node as the current node, and return to execute S1003.
[0155] In this step, each child node of the current node can obtain a corresponding UCB value. Therefore, by comparing the UCB values of each child node, the child node with the largest UCB value can be selected as the current node.
[0156] Furthermore, step S704 may also include: obtaining the UCB value according to the following formula:
[0157]
[0158] Where Q represents the cumulative reward value corresponding to the child nodes of the current node, N represents the number of times the current node has been visited, and n represents the number of times the child nodes of the current node have been visited.
[0159] For example, assuming the starting node (corresponding to the current node in the above formula) is visited N times, and the starting node has three child nodes with visit counts of n1, n2, and n3 respectively, and cumulative reward values of Q1, Q2, and Q3 respectively, then the UCB values of the three child nodes are as follows:
[0160] It should be noted that in the above formula, The exploitation component can be understood as the average reward estimate (i.e., the cumulative reward value divided by the number of times the current node has been visited). For the Exploration component, this component tends to select nodes that are less frequently explored. This is because the UCB value increases as the number of visits (n) to a child node decreases. Furthermore, nodes that cannot perform simplified calculations are not included in the UCB value calculation; therefore, their UCB value can be defined as negative infinity, meaning they will never be selected.
[0161] It can be understood that step S1010 corresponds to the selection step of the Monte Carlo tree search algorithm.
[0162] S1011. Obtain the target search tree containing the starting node and each child node.
[0163] For example, refer to Figure 9 The target search tree contains the starting node 801 and its child nodes 802, 803, and 809.
[0164] The information processing method provided in this application obtains the target search tree by executing the Monte Carlo tree search algorithm steps: selection, expansion, simulation, and backpropagation. Therefore, it can accurately obtain the target search tree for use in obtaining the process and results of simplified calculations.
[0165] Optionally, if the loop variable i is greater than or equal to the preset total number of explorations, a target search tree containing the starting node and each child node is obtained. This may include: if the loop variable i is greater than or equal to the preset total number of explorations, determining whether the child node with the highest number of visits contains an operator; if the child node with the highest number of visits does not contain an operator, obtaining a target search tree containing the starting node and each child node; or, if the child node with the highest number of visits contains an operator, using the child node with the highest number of visits as the current node, and executing steps S1002 to S1013.
[0166] For example, after determining that the loop variable i is greater than or equal to a preset total number of explorations, such as 2048, the child node with the highest number of visits can be obtained by comparing the number of visits to each child node. Then, it is determined whether the child node with the highest number of visits contains an operator, that is, whether the multi-way tree corresponding to the child node with the highest number of visits is an operand. If the child node with the highest number of visits does not contain an operator, the target search tree containing the starting node and each child node is obtained, which also indicates that the Monte Carlo tree search algorithm has ended. If the child node with the highest number of visits contains an operator, it means that no node whose result is an operand has been explored. In order to obtain the operation result corresponding to the operation expression, the number of explorations needs to be increased. Therefore, the loop variable i is reinitialized to its initial value (for example, 1), and the child node with the highest number of visits is taken as the current node, and steps S1002 to S1013 are executed.
[0167] Optionally, S1007, performing a calculation simulation on the child node to obtain the first reward value of the child node, may include: performing a simplified calculation action on the child node to obtain the first reward value corresponding to the child node.
[0168] For example, to obtain the first reward value of a child node, one can start from the child node, perform a direct calculation action, and record the returned reward value as the first reward value corresponding to the child node. It should be noted that the process of obtaining the reward value by performing the direct calculation action is obtained by comprehensively considering various features, such as whether the operation process involves rounding, the number of carry and borrow in addition and subtraction, and the number of calculations in multiplication and division, etc. For details, please refer to relevant technologies, which will not be elaborated here.
[0169] In some embodiments, S1008, performing backpropagation on the child node, may include: if it is determined that the child node can perform a simplified calculation action, then update the cumulative reward value of all nodes on the path from the child node to the starting node according to a preset node cumulative reward value update method, and add a first preset value to the access count of each node; if it is determined that the child node cannot perform a simplified calculation action, then add a first preset value to the access count of all nodes on the path from the child node to the starting node.
[0170] For example, the method for updating the cumulative reward value of a preset node is as follows: if it is determined that a child node can perform a simplified calculation action, then the cumulative reward value of that child node is updated to the first reward value, and the cumulative reward values of all nodes on the path from the child node's parent node to the starting node are updated sequentially in reverse. That is, the reward value of each node on the path is summed with the maximum cumulative reward value among all child nodes contained in each node to obtain the cumulative reward value of each node. For example, suppose the reward value of a node on the backpropagation path is R. j Furthermore, this node has three child nodes, and the cumulative reward values corresponding to the three child nodes are Q. 11 Q 12 Q 13 If Q 12 If the maximum value is 'R', then the cumulative reward value corresponding to that node is R. j +Q 12 At the same time, the number of visits to all nodes on the path from the child node to the starting node is accumulated to a first preset value, such as 1.
[0171] For example, if the child node is a feasible node, suppose the child node is S. m Then from the starting node S1 to S m There are m nodes in the path between them. The calculation logic of backpropagation is as follows: First, the simulated reward value R is... m Used to update child node S m Cumulative reward value Q m Then from child node s mStarting from the root node, we backtrack and update the accumulated reward value of each node in the path sequentially. Simultaneously, we increment the visit count of all nodes on the path from the child node to the starting node, for example, by 1. Let's define the nodes in the path as S. t S t The corresponding reward value is R t S t The corresponding cumulative reward value is Q t When different actions 'a' are performed, the cumulative reward value of the child nodes is Q(S). t If a), then the cumulative reward value can be updated in the backpropagation step according to the following formula:
[0172]
[0173] Where t is the independent variable. For example, if the child node is an infeasible node, the number of visits to all nodes on the path from the child node to the starting node is accumulated, for example, to 1.
[0174] Figure 11 This is a flowchart illustrating an information processing method provided in another embodiment of this application. Based on the above embodiments, this application further explains how to obtain the process and results of a simplified calculation based on a target search tree. Figure 11 As shown, step S705 may further include:
[0175] S1101. Perform a depth search on the target search tree according to the number of visits to obtain the target decision path.
[0176] It can be understood that the target decision path is the action decision path with the highest reward. For example, refer to... Figure 9 After obtaining the target search tree, a depth-first search based on the number of visits yields the action decision path with the highest reward. For example, for the starting node 801, the optimal action decision is the "inverse operation of the distributive property of multiplication," corresponding to node 802. This node has the highest number of visits, and correspondingly, its cumulative reward value is also the highest. Subsequent actions for node 802 are the only feasible "direct calculation" actions, corresponding to nodes 803 and 809 respectively. Therefore, the simplified calculation process for the expression "25*32+68*25" is "inverse operation of the distributive property of multiplication --> direct calculation --> direct calculation," which is the action decision path with the highest reward. The final result is 2500, and this operand is stored in a multi-way tree, corresponding to... Figure 9 Node 809 is shown.
[0177] S1102. Based on the target decision path, traverse the multi-branch tree from the root node of the target search tree to the node that does not contain operators, output the stepwise equation, and obtain the simplified calculation process and calculation result.
[0178] For example, nodes that do not contain operators, i.e., the multi-way tree corresponding to the node, are operands. For example, refer to... Figure 9 The action decision path with the highest reward corresponds to the simplified calculation process "inverse operation of the distributive property of multiplication --> direct calculation --> direct calculation", and the corresponding nodes include: 801, 802, 803, and 809. By traversing the multi-way tree corresponding to these nodes and outputting the step-by-step equation, the simplified calculation process and result can be obtained. For example, if the calculation expression is "25*32+68*25", the simplified calculation process and result are as follows:
[0179] 25×32+68×25
[0180] = (32 + 68) × 25
[0181] =100×25
[0182] =2500
[0183] The above examples demonstrate that the simplified calculation algorithm based on the Monte Carlo tree search algorithm (also known as the "intelligent calculation" algorithm) can weigh different action choices and thus select the best calculation path.
[0184] Figure 12 This is a flowchart illustrating the process of obtaining the optimal decision path based on a target search tree, as provided in one embodiment of this application. Figure 12 As shown, methods for obtaining the optimal decision path based on the target search tree can include:
[0185] S1201, take the root node of the target search tree as the current node.
[0186] S1202. Determine whether the current node is the calculation termination node.
[0187] If the current node is determined to be the termination node of the calculation, then proceed to step S1205; if the current node is determined not to be the termination node of the calculation, then proceed to step S1203.
[0188] S1203. Select the child node with the highest number of visits based on the current node;
[0189] S1204: Record the child node with the highest number of visits.
[0190] Take the child node with the highest number of visits as the current node and repeat the corresponding steps in steps S1202 to S1204.
[0191] S1205: Obtain the child nodes of all records.
[0192] After obtaining the child nodes of all records, the root node of the target search tree and the child nodes of all records constitute the optimal decision path of the target search tree.
[0193] Based on the above embodiments, according to Figure 10 The calculation process is derived by examining the expression "25*32+68*25", resulting in the following: Figure 9 The diagram illustrates this. In this example, the algorithm's preset total number of searches is set to 64. Because the algorithm continues to search deeper along the nodes with the highest number of visits, the total number of searches reaches 384. A higher number of searches helps in deriving more complex simplified arithmetic expressions. Figure 13 This is a schematic diagram illustrating the calculation process of a complex arithmetic expression provided in an embodiment of this application. The corresponding arithmetic expression is "25*4000 / 125*4 / 8", as shown below. Figure 13 As shown, (1) the calculation process of this expression conforms to the human intuition of using simplified calculation methods to solve problems; (2) the derivation process of this expression is relatively complex. In each step of the Monte Carlo tree search algorithm, multiple simplified calculation rules can often be executed, which makes the candidate simplified calculation space of this expression very large; (3) the search tree does not traverse all possible action spaces. For example, many decision branches do not continue to calculate to the calculation termination node, but only explore the path with the highest possible cumulative reward value. This shows that the simplified calculation algorithm based on the Monte Carlo tree search algorithm can balance limited computing power and high calculation accuracy, thereby achieving simplified calculation; (4) finally, the optimal decision path can be searched according to the search tree, and the multi-branch tree from the root node to the calculation termination node is traversed to output the iterative equation, and the result of simplified calculation can be obtained. Specifically, the simplified calculation process and calculation result are as follows:
[0194] 25*4000 / 125*4 / 8
[0195] =25*4000*4 / (125*8)
[0196] =25*4000*4 / 1000
[0197] = (25*4)*4000 / 1000
[0198] = (25*4)*(4000 / 1000)
[0199] =100*(4000 / 1000)
[0200] =100*4
[0201] =400
[0202] Based on the above embodiments, the technical solution proposed in this application can serve as the basic framework for implementing the "intelligent calculation" algorithm. "Intelligent calculation" is an algorithm technology used to automatically solve the "simplified calculation" knowledge points in primary schools, and will be used as an application of AI teaching. Figure 14 This is a schematic diagram of the application interface corresponding to the "intelligent calculation" algorithm provided in one embodiment of this application. Figure 15 This is a schematic diagram of the application interface corresponding to the "intelligent calculation" algorithm provided in another embodiment of this application. For example... Figure 14 and Figure 15 As shown, the "Smart Calculator" application interface corresponding to the "Smart Calculation" algorithm can display the simplified calculation process of the calculation expression, the calculation result, and the calculation rules used in the simplified calculation process.
[0203] The following are embodiments of the apparatus described in this application, which can be used to execute the embodiments of the method described in this application. For details not disclosed in the apparatus embodiments of this application, please refer to the embodiments of the method described in this application.
[0204] Figure 16 This is a schematic diagram of the structure of an information processing apparatus provided in one embodiment of this application, applied to a server. For example... Figure 16 As shown, the information processing apparatus 1600 of this application embodiment includes: a determining module 1601, an acquiring module 1602, and a sending module 1603. Wherein:
[0205] The determination module 1601 is used to determine the multi-branch tree to be processed corresponding to the operation expression in response to receiving the operation expression sent by the terminal device, wherein the operator nodes in the multi-branch tree to be processed only contain addition operators and / or multiplication operators.
[0206] The acquisition module 1602 is used to perform simplified calculations based on the multi-way tree to be processed and the Monte Carlo tree search algorithm, and to obtain the simplified calculation process and calculation results.
[0207] The sending module 1603 is used to send the simplified calculation process and calculation results to the terminal device.
[0208] In some embodiments, the acquisition module 1602 may be specifically used to: determine the multi-way tree to be processed as the starting node of the Monte Carlo tree search algorithm; determine the preset simplified calculation rules as the action space of the Monte Carlo tree search algorithm; based on the starting node and the action space, execute the steps of the Monte Carlo tree search algorithm to obtain the target search tree, the steps including selection, expansion, simulation and backpropagation, the numerical values contained in the nodes in the target search tree are used to represent the cumulative reward value and the number of visits, and the edges of the target search tree point from the parent node to the child node; and obtain the simplified calculation process and calculation results according to the target search tree.
[0209] Optionally, when obtaining the target search tree by executing the Monte Carlo tree search algorithm based on the starting node and the action space, the acquisition module 1602 can specifically be used to: determine that the starting node is the current node; determine whether the loop variable i is less than the preset total number of explorations; if the loop variable i is less than the preset total number of explorations, determine whether the current node contains an operator; if the current node contains an operator, determine whether the number of explorations of the current node is less than or equal to the number of explorations threshold; if the number of explorations is less than or equal to the number of explorations threshold, perform a simplified operation in the action space on the current node to obtain a child node of the current node. The system identifies nodes and records the number of visits to their child nodes as a first preset value. Simplified calculation actions are assigned one-to-one with each child node. It determines whether a child node can perform a simplified calculation action. If a child node can perform a simplified calculation action, a calculation simulation is performed on the child node to obtain its first reward value. Backpropagation is then performed on the child node. The number of explorations is incremented by a second preset value, and the loop variable i is incremented by a third preset value. The system then determines whether the loop variable i is less than the preset total number of explorations. If the loop variable i is greater than or equal to the preset total number of explorations, a target search tree containing the starting node and all its child nodes is obtained.
[0210] Optionally, the acquisition module 1602 can also be used for: if the current node does not contain an operator, then backpropagating to the current node; and performing the process of accumulating a third preset value on the loop variable i; and performing the step of determining whether the loop variable i is less than the preset total number of explorations.
[0211] Optionally, the acquisition module 1602 can also be used to: if the number of explorations is not less than or equal to the number of explorations threshold, determine the child node with the largest UCB value among the child nodes of the current node as the current node, and perform the step of determining whether the current node contains an operator.
[0212] Optionally, the acquisition module 1602 can also be used to: if it is determined that the child node cannot perform a simplified calculation action, then backpropagate the child node.
[0213] Optionally, when the acquisition module 1602 is used to obtain a target search tree containing the starting node and each child node if the loop variable i is greater than or equal to the preset total number of explorations, it can be specifically used to: if the loop variable i is greater than or equal to the preset total number of explorations, determine whether the child node with the largest number of visits contains an operator; if the child node with the largest number of visits does not contain an operator, obtain a target search tree containing the starting node and each child node; or, if the child node with the largest number of visits contains an operator, use the child node with the largest number of visits as the current node and execute the step of determining whether the loop variable i is less than the preset total number of explorations.
[0214] Optionally, when the acquisition module 1602 is used to perform calculation simulation on the child node and obtain the first reward value of the child node, it can be specifically used to: perform a simplified calculation action on the child node and obtain the first reward value corresponding to the child node.
[0215] Optionally, when the acquisition module 1602 is used to perform backpropagation on child nodes, it can be specifically used to: if it is determined that the child node can perform a simplified calculation action, then update the cumulative reward value of all nodes on the path from the child node to the starting node according to the preset node cumulative reward value update method, and the number of visits to each node is accumulated by a first preset value; if it is determined that the child node cannot perform a simplified calculation action, then accumulate the number of visits to all nodes on the path from the child node to the starting node by a first preset value.
[0216] Optionally, module 1602 can also be used to: obtain the UCB value according to the following formula:
[0217]
[0218] Where Q represents the cumulative reward value corresponding to the child nodes of the current node, N represents the number of times the current node has been visited, and n represents the number of times the child nodes of the current node have been visited.
[0219] Optionally, when obtaining the simplified calculation process and calculation result based on the target search tree, the acquisition module 1602 can be specifically used to: perform a depth search on the target search tree according to the number of visits to obtain the target decision path; and based on the target decision path, traverse the multi-branch tree corresponding to the root node of the target search tree to the node that does not contain the operator and output the step-by-step equation to obtain the simplified calculation process and calculation result.
[0220] The apparatus of this embodiment can be used to execute the technical solutions of any of the method embodiments shown above. Its implementation principle and technical effect are similar, and will not be repeated here.
[0221] Figure 17 This is a schematic diagram of the structure of a server provided in one embodiment of this application. Figure 17 As shown, server 1700 includes: processor 1701, and memory 1702 and communication module 1703 connected to processor 1701.
[0222] Processor 1701 may include one or more processing units, such as a Central Processing Unit (CPU), a Digital Signal Processor (DSP), or an Application Specific Integrated Circuit (ASIC). A general-purpose processor may be a microprocessor or any conventional processor. The steps of the method disclosed in this application can be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules within the processor.
[0223] Memory 1702 can be used to store program instructions. Memory 1702 may include a program storage area and a data storage area. The program storage area may store the operating system, application programs required for at least one function (such as sound playback), etc. The data storage area may store data created during the use of server 1700 (such as audio data), etc. Furthermore, memory 1702 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, universal flash storage (UFS), etc. Processor 1701 executes various functional applications and data processing of server 1700 by running program instructions stored in memory 1702.
[0224] The communication module 1703 can provide wireless communication solutions, including 2G / 3G / 4G / 5G, for use on the server 1700. The communication module 1703 can receive electromagnetic waves via an antenna, filter and amplify the received electromagnetic waves, and then transmit them to a modem processor for demodulation. The communication module 1703 can also amplify the signal modulated by the modem processor and radiate it as electromagnetic waves via the antenna. In some embodiments, at least some functional modules of the communication module 1703 can be housed in the processor 1701. In some embodiments, at least some functional modules of the communication module 1703 and at least some modules of the processor 1701 can be housed in the same device.
[0225] It should be noted that the number of memory 1702 and processor 1701 is not limited in this embodiment; each can be one or more. The memory 1702 and processor 1701 can be connected via wired or wireless means, such as a bus connection. In practical applications, the server 1700 can also be replaced by a server cluster, etc.
[0226] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of illustration, the buses shown in the accompanying drawings are not limited to a single bus or a single type of bus.
[0227] The server in this embodiment can be used to execute the technical solutions in the above method embodiments. Its implementation principle and technical effect are similar, and will not be repeated here.
[0228] This application also provides an information processing system, including: a server and a terminal device as described above. The terminal device is used to respond to user input by sending a computational expression to the server; and to display the simplified computation process and result corresponding to the computational expression. For example, the information processing system can be as follows: Figure 5 As shown.
[0229] This application also provides a computer-readable storage medium storing program instructions, which, when executed, implement the information processing method as described in any of the above embodiments.
[0230] This application provides a computer program product, including program instructions, which, when executed, implement the information processing method as described in any of the above embodiments.
[0231] The aforementioned computer-readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The readable storage medium can be any available medium accessible to a general-purpose or special-purpose computer.
[0232] An exemplary readable storage medium is coupled to a processor, enabling the processor to read information from and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can reside in an Application Specific Integrated Circuit (ASIC). Alternatively, the processor and the readable storage medium can exist as discrete components in an information processing device.
[0233] Those skilled in the art will understand that all or part of the steps of the above-described method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above-described method embodiments; and the aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.
[0234] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.
Claims
1. An information processing method characterized by comprising: Applied to a server, the information processing method includes: In response to receiving an operational expression sent by a terminal device, determine the multi-branch tree to be processed corresponding to the operational expression; A simplified calculation is performed based on the multi-way tree to be processed and the Monte Carlo tree search algorithm to obtain the simplified calculation process and calculation results. Send the simplified calculation process and calculation results to the terminal device; The process of performing simplified calculations based on the multi-way tree to be processed and the Monte Carlo tree search algorithm, and obtaining the simplified calculation results, includes: The multi-way tree to be processed is determined as the starting node of the Monte Carlo tree search algorithm; The preset simplified calculation rules are determined as the action space of the Monte Carlo tree search algorithm; Based on the starting node and the action space, the Monte Carlo tree search algorithm is executed to obtain the target search tree. The steps include selection, expansion, simulation and backpropagation. The numerical values contained in the nodes of the target search tree are used to represent the cumulative reward value and the number of visits. The edges of the target search tree point from the parent node to the child node. A depth-first search is performed on the target search tree according to the number of visits to obtain the target decision path, which is the action decision path with the highest reward. Based on the target decision path, the multi-branch tree corresponding to the root node of the target search tree and the node that does not contain operators is traversed and the iterative equation is output to obtain the simplified calculation process and calculation result.
2. The information processing method according to claim 1, characterized by, The step of executing the Monte Carlo tree search algorithm based on the starting node and the action space to obtain the target search tree includes: The starting node is determined to be the current node; Determine if the loop variable is less than the preset total number of explorations; If the loop variable is less than the preset total number of explorations, then determine whether the current node contains an operator; If the current node contains an operator, then determine whether the number of explorations of the current node is less than or equal to the number of explorations threshold; If the number of explorations is less than or equal to the number of explorations threshold, a simplified operation in the action space is performed on the current node to obtain a child node of the current node, and the number of visits to the child node is recorded as a first preset value. The simplified operation corresponds one-to-one with the child node. Determine whether the child node can perform a simplified calculation action; If it is determined that the child node can perform a simplified calculation action, then the calculation simulation is performed on the child node to obtain the first reward value of the child node; then backpropagation is performed on the child node; The process of accumulating a second preset value on the number of explorations is performed, the process of accumulating a third preset value on the loop variable is performed, and the step of determining whether the loop variable is less than the preset total number of explorations is performed. If the loop variable is greater than or equal to the preset total number of explorations, then a target search tree containing the starting node and each child node is obtained.
3. The information processing method according to claim 2, characterized by, Also includes: If the current node does not contain an operator, then backpropagation is performed on the current node; And perform the process of accumulating the third preset value on the loop variable; Perform the step of determining whether the loop variable is less than the preset total number of explorations.
4. The information processing method according to claim 2, characterized by, Also includes: If the number of explorations is not less than or equal to the exploration number threshold, then the child node with the largest upper bound UCB value of the confidence interval among the child nodes of the current node is determined as the current node, and the step of determining whether the current node contains an operator is executed.
5. The information processing method according to claim 2, characterized by, Also includes: If it is determined that the child node cannot perform a simplified operation, then backpropagation is performed on the child node.
6. The information processing method according to claim 2, characterized in that, If the loop variable is greater than or equal to the preset total number of explorations, then a target search tree containing the starting node and each child node is obtained, including: If the loop variable is greater than or equal to the preset total number of explorations, then determine whether the child node with the highest number of visits contains an operator; If the child node with the highest number of visits does not contain an operator, then a target search tree containing the starting node and all its child nodes is obtained; Alternatively, if the child node with the highest number of visits contains an operator, then the child node with the highest number of visits is used as the current node, and the step of determining whether the loop variable is less than the preset total number of explorations is executed.
7. The information processing method according to claim 2, characterized in that, The step of performing computational simulations on the child nodes to obtain the first reward value of the child nodes includes: Perform a simplified calculation on the child node to obtain the first reward value corresponding to the child node.
8. The information processing method according to claim 2, characterized in that, The backpropagation of the child nodes includes: If it is determined that the child node can perform a simplified calculation action, then the cumulative reward value of all nodes on the path from the child node to the starting node is updated according to the preset node cumulative reward value update method, and the number of visits to each node is accumulated by the first preset value. If it is determined that the child node cannot perform a simplified calculation action, then the number of visits to all nodes on the path from the child node to the starting node is accumulated by a first preset value.
9. The information processing method according to claim 4, characterized in that, Also includes: The UCB value is obtained according to the following formula: in, This represents the cumulative reward value corresponding to the child nodes of the current node. This indicates the number of times the current node has been visited. This indicates the number of visits to the child nodes of the current node.
10. An information processing device, characterized in that, The information processing device, applied to a server, includes: The determination module is used to determine the multi-branch tree to be processed corresponding to the operation expression in response to receiving the operation expression sent by the terminal device; The acquisition module is used to perform simplified calculations based on the multi-way tree to be processed and the Monte Carlo tree search algorithm, and to acquire the simplified calculation process and calculation results. The sending module is used to send the simplified calculation process and calculation result to the terminal device; The acquisition module is specifically used for: The multi-way tree to be processed is determined as the starting node of the Monte Carlo tree search algorithm; The preset simplified calculation rules are determined as the action space of the Monte Carlo tree search algorithm; Based on the starting node and the action space, the Monte Carlo tree search algorithm is executed to obtain the target search tree. The steps include selection, expansion, simulation and backpropagation. The numerical values contained in the nodes of the target search tree are used to represent the cumulative reward value and the number of visits. The edges of the target search tree point from the parent node to the child node. A depth-first search is performed on the target search tree according to the number of visits to obtain the target decision path, which is the action decision path with the highest reward. Based on the target decision path, the multi-branch tree corresponding to the root node of the target search tree and the node that does not contain operators is traversed and the iterative equation is output to obtain the simplified calculation process and calculation result.
11. A server, characterized in that, include: Memory, used to store program instructions; A processor is configured to call and execute program instructions in the memory to perform the information processing method as described in any one of claims 1 to 9.
12. An information processing system, characterized in that, include: The server as described in claim 11; A terminal device is used to send the computational expression to the server in response to a user's input operation; In addition, it displays the simplified calculation process and the calculation results.
13. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores program instructions; when the program instructions are executed, they implement the information processing method as described in any one of claims 1 to 9.
14. A computer program product, characterized in that, The computer program product includes program instructions; when the program instructions are executed, they implement the information processing method as described in any one of claims 1 to 9.