Expression processing method and device based on table control, equipment and product
By constructing expression variable groups in the expression operation interface of table controls and executing the expression to be calculated, the problem of poor expression expansion in the existing technology is solved, and more flexible and complex business logic support and correct results are achieved. Sex and safety.
Patent Information
- Application Number
- CN202411684221.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-22
- Publication Date
- 2025-02-14
AI Technical Summary
When existing table controls face the needs of complex data processing and dynamic interaction, the expressions are poorly scalable and difficult to adapt to complex business logic requirements.
In the expression operation interface, the expression variable group is constructed through variable parameters, and the expression to be calculated in the table control is input, and the expression operation is performed using the variable values in the expression variable group to display the operation results.
The scalability of expression variables is added, allowing table controls to support complex business logic requirements more flexibly, and ensure the correctness and security of the results by dynamically adding keywords and verifying the calculation results.
Smart Images

Figure CN119440332A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and specifically to an expression processing method, device, equipment and product based on table controls. Background Art
[0002] With the development of information technology, the design and implementation of user interfaces (UI) have become increasingly complex, especially in application scenarios that require the display of large amounts of structured data. Although traditional table controls such as QTableView can effectively organize and display data, they are insufficient when faced with the need for complex data processing and dynamic interaction.
[0003] Specifically, ordinary table controls usually only support the input of ordinary text, numbers, etc., while in some complex table controls, cells can support expression parsing, for example, supporting operation expressions or using pre-defined variable names.
[0004] However, the flexibility and functionality of the above table controls are relatively poor, and the input and parsing of expressions depend on the expression keywords set in the underlying code architecture, which results in poor scalability of the expressions and makes it difficult to adapt to complex business logic requirements. Summary of the invention
[0005] In view of this, an embodiment of the present invention is dedicated to providing an expression processing method based on a table control to solve the problem that the scalability of expressions in the prior art is relatively poor and it is difficult to adapt to complex business logic requirements.
[0006] According to a first aspect of an embodiment of the present application, a method for processing an expression based on a table control is provided, the method comprising:
[0007] In the expression operation interface, an expression variable group is constructed through variable parameters; an expression variable group includes multiple expression variable names and expression variable values;
[0008] Enter the expression to be calculated in the table control; the expression to be calculated includes the variable names of multiple variables and the corresponding variable values;
[0009] When the variable names of the multiple variables of the expression to be operated match the multiple expression variable names in the expression variable group, the operation of the expression to be operated is performed according to the variable values of the multiple variables of the expression to be operated;
[0010] Displays the result of the expression to be operated.
[0011] In a possible design of the first aspect, determining whether the variable names of the multiple variables of the expression to be operated match the multiple expression variable names in the expression variable group includes:
[0012] Determine whether the variable names of multiple variables in the expression to be operated all exist in the expression variable group;
[0013] If the variable names of the multiple variables of the expression to be operated all exist in the expression variable group, then it is determined that the variable name of the expression to be operated matches the multiple expression variable names in the expression variable group;
[0014] If any one of the variable names of the multiple variables of the expression to be operated does not exist in the expression variable group, it is determined that the variable names of the multiple variables of the expression to be operated do not match the multiple expression variable names in the expression variable group.
[0015] In a possible design of the first aspect, performing operation of the expression to be operated according to variable values of multiple variables of the expression to be operated includes:
[0016] Get the variable value corresponding to each variable name in the expression to be operated;
[0017] Replace each variable name in the expression to be operated with the corresponding variable value;
[0018] Execute the operation of the expression to be operated and obtain the calculation result.
[0019] In a possible design of the first aspect, after displaying the operation result of the expression to be operated, the method further includes:
[0020] Through the preset triggering method, the expression to be calculated is triggered and displayed in the expression calculation interface.
[0021] In a possible design of the first aspect, both the expression variable name and the variable value are described by the text of the UI variable parameter.
[0022] In a possible design of the first aspect, both the expression variable name and the variable value are described by a global expression variable descriptor.
[0023] According to a second aspect of an embodiment of the present application, there is provided an expression processing device based on a table control, the device comprising:
[0024] A construction module is used to construct an expression variable group through variable parameters in the expression operation interface; the expression variable group includes multiple expression variable names and expression variable values;
[0025] An input module is used to input the expression to be calculated through a table control in the expression calculation interface; the expression to be calculated includes variable names of multiple variables and corresponding variable values;
[0026] An execution module, used for executing the operation of the expression to be operated according to the variable values of the multiple variables of the expression to be operated when the variable names of the multiple variables of the expression to be operated match the multiple expression variable names in the expression variable group;
[0027] The display module is used to display the calculation results of the expression to be calculated.
[0028] According to a third aspect of an embodiment of the present application, there is provided an electronic device, including a memory and a processor;
[0029] The memory is connected to the processor and is used for storing programs;
[0030] The processor is used to implement an expression processing method based on a table control as described in any one of the first aspects of the embodiments of the present application by running a program in a memory.
[0031] According to a fourth aspect of an embodiment of the present application, a computer program product is provided, comprising computer program instructions. When the computer program instructions are executed by a processor, the processor executes an expression processing method based on a table control as described in any one of the first aspects of the embodiment of the present application.
[0032] According to the fifth aspect of the embodiments of the present application, a chip is provided, including a processor and a data interface, and the processor reads and runs the program stored in the memory through the data interface to execute an expression processing method based on a table control as any one of the first aspects of the embodiments of the present application.
[0033] According to the sixth aspect of the embodiments of the present application, a storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, an expression processing method based on a table control as described in any one of the first aspects of the embodiments of the present application is implemented.
[0034] According to the technical solution of the embodiment of the present application, in the expression operation interface, an expression variable group is constructed through variable parameters; the expression variable group includes multiple expression variable names and expression variable values; the expression to be operated is input in the table control; the expression to be operated includes the variable names of multiple variables and the corresponding variable values; when the variable names of the multiple variables of the expression to be operated match the multiple expression variable names in the expression variable group, the operation of the expression to be operated is performed according to the variable values of the multiple variables of the expression to be operated; and the operation result of the expression to be operated is displayed. According to the present application, the variable parameters in the interface can be input into the table control as expression variables, which increases the extensibility of the expression variables. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.
[0036] Figure 1 A flowchart of an expression processing method based on a table control provided in an embodiment of the present application;
[0037] Figure 2 A reference schematic diagram of the UI window style in the expression processing method based on the table control provided in the embodiment of the present application;
[0038] Figure 3 A reference schematic diagram of an expression variable group structure in an expression processing method based on a table control provided in an embodiment of the present application;
[0039] Figure 4 A reference schematic diagram of a bubble prompt style in an expression processing method based on a table control provided in an embodiment of the present application;
[0040] Figure 5 A schematic diagram of an expression variable group in an example of an expression processing method based on a table control provided in an embodiment of the present application;
[0041] Figure 6 A schematic diagram of the structure of an expression processing device based on a table control provided in an embodiment of the present application;
[0042] Figure 7 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0043] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0044] The technical terms involved in the embodiments of the present application are explained below:
[0045] Table control (QTableView): is an interface control, usually used in applications or software interfaces that need to display structured data.
[0046] UI variable parameters: usually refers to those configurable properties or values that can affect the appearance and behavior of the user interface. These parameters can include but are not limited to color, font size, button style, animation effects, etc.
[0047] QEdit: Its corresponding text is used to describe the expression variable name in the expression variable group.
[0048] QLabel: Its corresponding text is used to describe the expression variable value in the expression variable group.
[0049] With the rapid development of information technology, the design and implementation of user interfaces (UI) have become increasingly complex, especially in application scenarios that require the display of large amounts of structured data. Traditional table controls, such as QTableView, can effectively organize and display data, but they are unable to cope with complex data and dynamic interaction requirements.
[0050] Specifically, ordinary table controls usually only support the input of ordinary text and numbers. In some advanced table controls, although cells can support expression parsing, such as supporting mathematical expressions or using pre-defined variable names, the flexibility and extensibility of these functions are still limited. The input and parsing of expressions rely on the preset expression keywords in the underlying code architecture, which leads to poor extensibility of expressions and difficulty in adapting to complex business logic requirements.
[0051] Based on this, this application proposes a new expression processing method based on table controls to realize the support of table controls for dynamic expressions, so that table controls can directly access and utilize variable parameters in the user interface, dynamically add keywords, and perform verification after obtaining the calculation results to ensure the correctness and security of the results.
[0052] Specifically, in the expression processing method based on the table control proposed in the present application, an expression variable group is constructed through variable parameters in the expression operation interface; the expression variable group includes multiple expression variable names and expression variable values; the expression to be operated is input in the table control; the expression to be operated includes the variable names of multiple variables and the corresponding variable values; when the variable names of the multiple variables of the expression to be operated match the multiple expression variable names in the expression variable group, the operation of the expression to be operated is performed according to the variable values of the multiple variables of the expression to be operated; and the operation result of the expression to be operated is displayed. According to the present application, the variable parameters in the interface can be input into the table control as expression variables, which increases the extensibility of the expression variables.
[0053] The following specific embodiments are used to describe in detail the technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.
[0054] For example, please refer to Figure 1 , Figure 1 A flowchart of an expression processing method based on a table control provided in an embodiment of the present application. Figure 1 In an exemplary embodiment, the provided expression processing method based on a table control may include the following steps 1100 to 1400:
[0055] 1100. In the expression operation interface, an expression variable group is constructed through variable parameters; the expression variable group includes multiple expression variable names and expression variable values.
[0056] 1200. Enter the expression to be calculated in the table control; the expression to be calculated includes the variable names of multiple variables and the corresponding variable values.
[0057] 1300. When the variable names of the multiple variables of the expression to be operated match the multiple expression variable names in the expression variable group, the operation of the expression to be operated is performed according to the variable values of the multiple variables of the expression to be operated.
[0058] 1400. Display the operation result of the expression to be operated.
[0059] Specifically, when constructing a UI window, an expression variable group is dynamically added according to functional requirements. For example, the reference style of a UI window can be as follows: Figure 2 As shown, this embodiment does not specifically limit the style of the UI window.
[0060] It should be noted that because the variable parameters in the table control of the expression operation interface are actually derived from business needs, the variable name does not need to use the UI variable parameter. Each parameter variable can be defined as a global expression variable descriptor, that is, the expression variable name and variable value are described by the global expression variable descriptor, and the variable value is set in the UI window. In this way, the cells in the table no longer rely on the expression variable name and variable value displayed in the UI.
[0061] In this embodiment, the expression variable group needs to be named according to the set naming rules. For example, one naming rule may be "expression (expression) + digital number". The expression variable group includes multiple expression variable name QLabels and expression variable value QLineEdits. Similarly, the naming rule of the expression variable name may be "expression name (expressionName) + digital number", and the naming rule of the expression variable value may be "expression variable value (expressionValue) + digital number".
[0062] The expression variable name and variable value are described by the text of the UI variable parameter. In an example, Figure 3 As shown, create a new QWidget and name it "expression1". Next, add a QLabel and a QLineEdit, name the QLabel (expressionName_1) and the QLineEdit (expressionValue_1). The text displayed by the QLabel is the expression variable name, and the text displayed by the QLineEdit is the expression variable value.
[0063] After constructing the expression variable groups, when the dialog box is displayed, all the expression variable groups in the dialog box are collected, and the expression variable names in all the expression variable groups are passed to the table control, so that the table control can recognize the expression variable names currently supported.
[0064] After that, input the expression to be calculated in the table control, and judge whether the variable names of the multiple variables of the expression to be calculated match the multiple expression variable names in the expression variable group. Specifically, judge whether the variable names of the multiple variables of the expression to be calculated all exist in the expression variable group; if the variable names of the multiple variables of the expression to be calculated all exist in the expression variable group, then judge that the variable name of the expression to be calculated matches the multiple expression variable names in the expression variable group, and then the expression operation can be performed; if any one of the variable names of the multiple variables of the expression to be calculated does not exist in the expression variable group, then judge that the variable names of the multiple variables of the expression to be calculated do not match the multiple expression variable names in the expression variable group, then prompt an exception and exit the expression operation.
[0065] When it is determined that the variable name of the expression to be operated matches multiple expression variable names in the expression variable group, the variable value corresponding to each variable name in the expression to be operated is obtained; each variable name in the expression to be operated is replaced with the corresponding variable value; the operation of the expression to be operated is performed to obtain the calculation result, and the calculation result is displayed.
[0066] Furthermore, if it is necessary to verify whether the calculation result is correct, after displaying the calculation result of the expression to be calculated, the expression to be calculated can be displayed in the expression calculation interface through a preset trigger method. The preset trigger method can be, for example, double-clicking the table control to trigger the display of the complete content of the expression to be calculated, or the preset trigger method can be, for example, moving the mouse over the table control and staying there for a preset time to trigger the display of the content of the expression to be calculated through a bubble prompt, such as Figure 4 shown.
[0067] Combine the following Figure 5 A specific example is given to illustrate the expression processing method based on the table control provided in this embodiment.
[0068] Figure 5 This is a schematic diagram of an expression variable group in an example of an expression processing method based on a table control provided in an embodiment of the present application. Figure 5 As shown, when constructing the UI window, 6 expression variable groups are constructed: the first expression variable group includes: the expression variable name is MET and the corresponding expression variable value is 146.5; the second expression variable group includes: the expression variable name is RGR and the corresponding expression variable value is 3.636; the third expression variable group includes: the expression variable name is FDR and the corresponding expression variable value is 4.294; the fourth expression variable group includes: the expression variable name is FGR and the corresponding expression variable value is 3.462; the fifth expression variable group includes: the expression variable name is STR and the corresponding expression variable value is 2; the sixth expression variable group includes: the expression variable name is MF and the corresponding expression variable value is 1.4.
[0069] Search all expression variable groups in the dialog box according to the command method specific to the expression variable group, and scan all expression variable names in the expression variable group, such as MET, RGR, FDR, FGR, STR, and MF in the figure above. And set these variable names as keywords in QTableView. Enter the expression to be calculated in the QTableView cell, such as 1.4*MET*RGR. The calculation of the expression to be calculated is triggered after the cell loses focus. Substitute the expression variable value corresponding to each keyword (that is, the variable name of the expression to be calculated) into the expression to be calculated for calculation, and the above expression to be calculated becomes 1.4*146.5*3.636. Display the calculated result in the expression calculation interface.
[0070] According to the technical solution of this embodiment, in the expression operation interface, an expression variable group is constructed through variable parameters; the expression variable group includes multiple expression variable names and expression variable values; the expression to be operated is input in the table control; the expression to be operated includes the variable names of multiple variables and the corresponding variable values; when the variable names of the multiple variables of the expression to be operated match the multiple expression variable names in the expression variable group, the operation of the expression to be operated is performed according to the variable values of the multiple variables of the expression to be operated; and the operation result of the expression to be operated is displayed. According to this application, the variable parameters in the interface can be input into the table control as expression variables, which increases the extensibility of the expression variables.
[0071] Exemplary Devices
[0072] Accordingly, the present application also provides a device, such as Figure 6 As shown, the expression processing device 600 based on the table control provided in this embodiment may include: a construction module 610, an input module 620, an execution module 630 and a display module 640.
[0073] The construction module 610 is used to construct an expression variable group through variable parameters in the expression operation interface; the expression variable group includes multiple expression variable names and expression variable values;
[0074] An input module 620 is used to input an expression to be calculated through a table control in the expression calculation interface; the expression to be calculated includes variable names of multiple variables and corresponding variable values;
[0075] An execution module 630, configured to execute the operation of the expression to be operated according to the variable values of the multiple variables of the expression to be operated when the variable names of the multiple variables of the expression to be operated match the multiple expression variable names in the expression variable group;
[0076] The display module 640 is used to display the operation result of the expression to be operated.
[0077] The expression variable name and variable value are described by the text of the UI variable parameter. Alternatively, the expression variable name and variable value are described by the global expression variable descriptor.
[0078] In one implementation, the execution module 630 can be specifically used to determine whether the variable names of multiple variables of the expression to be operated all exist in the expression variable group; if the variable names of multiple variables of the expression to be operated all exist in the expression variable group, then it is determined that the variable name of the expression to be operated matches the multiple expression variable names in the expression variable group; if any one of the variable names of the multiple variables of the expression to be operated does not exist in the expression variable group, then it is determined that the variable names of the multiple variables of the expression to be operated do not match the multiple expression variable names in the expression variable group.
[0079] In one implementation, the execution module 630 can be specifically used to obtain the variable value corresponding to each variable name in the expression to be operated; replace each variable name in the expression to be operated with the corresponding variable value; execute the operation of the expression to be operated to obtain the calculation result.
[0080] In one implementation, the expression processing device based on the table control also includes a trigger module, which is used to trigger the display of the expression to be calculated in the expression calculation interface through a preset trigger method.
[0081] The expression processing device based on table controls provided in this embodiment belongs to the same application concept as the expression processing method based on table controls provided in the above embodiments of this application, and can execute the expression processing method based on table controls provided in any of the above embodiments of this application, and has the corresponding functional modules and beneficial effects of executing the expression processing method based on table controls. For the technical details not fully described in this embodiment, please refer to the specific processing content of the expression processing method based on table controls provided in the above embodiments of this application, which will not be repeated here.
[0082] It should be understood that the modules in the above devices can be implemented in the form of a processor calling software. For example, the device includes a processor, the processor is connected to a memory, and instructions are stored in the memory. The processor calls the instructions stored in the memory to implement any of the above methods or realize the functions of each unit of the device, wherein the processor can be a general-purpose processor, such as a CPU or a microprocessor, etc., and the memory can be a memory in the device or a memory outside the device. Alternatively, the unit in the device can be implemented in the form of a hardware circuit, and the functions of some or all units can be realized by designing the hardware circuit. The hardware circuit can be understood as one or more processors; for example, in one implementation, the hardware circuit is an ASIC, and the functions of some or all of the above units are realized by designing the logical relationship of the components in the circuit; for another example, in another implementation, the hardware circuit can be implemented by PLD, taking FPGA as an example, which can include a large number of logic gate circuits, and the connection relationship between the logic gate circuits is configured by a configuration file, so as to realize the functions of some or all of the above units. All units of the above devices can be implemented in the form of a processor calling software, or in the form of a hardware circuit, or in part by a processor calling software, and the remaining part is implemented in the form of a hardware circuit.
[0083] In an embodiment of the present application, a processor is a circuit with the ability to process signals. In one implementation, the processor may be a circuit with the ability to read and run instructions, such as a CPU, a microprocessor, a GPU, or a DSP; in another implementation, the processor may implement certain functions through the logical relationship of a hardware circuit, and the logical relationship of the hardware circuit is fixed or reconfigurable, such as a hardware circuit implemented by an ASIC or PLD, such as an FPGA. In a reconfigurable hardware circuit, the process of the processor loading a configuration document to implement the hardware circuit configuration can be understood as the process of the processor loading instructions to implement the functions of some or all of the above units. In addition, it can also be a hardware circuit designed for artificial intelligence, which can be understood as an ASIC, such as an NPU, TPU, DPU, etc.
[0084] It can be seen that each unit in the above device can be one or more processors (or processing circuits) configured to implement the above method, such as: CPU, GPU, NPU, TPU, DPU, microprocessor, DSP, ASIC, FPGA, or a combination of at least two of these processor forms.
[0085] In addition, all or part of the units in the above device can be integrated together, or can be implemented independently. In one implementation, these units are integrated together and implemented in the form of a SOC. The SOC may include at least one processor for implementing any of the above methods or implementing the functions of each unit of the device. The type of the at least one processor may be different, for example, including a CPU and an FPGA, a CPU and an artificial intelligence processor, a CPU and a GPU, etc.
[0086] Exemplary Electronic Devices
[0087] The present application embodiment provides an electronic device, see Figure 7 As shown, the electronic device includes a memory 700 and a processor 710 connected to the memory 700 .
[0088] The memory 700 is used to store programs.
[0089] Processor 710 is used to execute any one of the expression processing methods based on table controls of any of the above embodiments, by constructing an expression variable group through variable parameters in the expression operation interface; the expression variable group includes multiple expression variable names and expression variable values; input the expression to be operated in the table control; the expression to be operated includes the variable names of multiple variables and the corresponding variable values; when the variable names of the multiple variables of the expression to be operated match the multiple expression variable names in the expression variable group, perform the operation of the expression to be operated according to the variable values of the multiple variables of the expression to be operated; and display the operation result of the expression to be operated. According to the present application, the variable parameters in the interface can be input into the table control as expression variables, which increases the extensibility of the expression variables.
[0090] The specific processing process of the processor 710 can refer to the introduction of the above method embodiment, and the specific implementation of the processor 710 can also refer to the introduction of the above embodiment.
[0091] Specifically, the electronic device may further include: a bus, a communication interface 720 , an input device 730 and an output device 740 .
[0092] The processor 710, the memory 700, the communication interface 720, the input device 730 and the output device 740 are connected to each other via a bus.
[0093] A bus may include a pathway that transfers information between components of a computer system.
[0094] Processor 710 may be a general-purpose processor, such as a general-purpose central processing unit (CPU), a microprocessor, etc., or an application-specific integrated circuit (ASIC), or one or more integrated circuits for controlling the execution of the program of the scheme of the present invention. It may also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0095] The processor 710 may include a main processor, and may also include a baseband chip, a modem, and the like.
[0096] The memory 700 stores a program for executing the technical solution of the present invention, and may also store an operating system and other key services. Specifically, the program may include a program code, and the program code includes a computer operation instruction. More specifically, the memory 700 may include a read-only memory (ROM), other types of static storage devices that can store static information and instructions, a random access memory (RAM), other types of dynamic storage devices that can store information and instructions, a disk storage, a flash, and the like.
[0097] The input device 730 may include a device for receiving data and information input by a user, such as an error microphone, a keyboard, a mouse, a camera, a scanner, a light pen, a voice input device, a touch screen, a pedometer, or a gravity sensor.
[0098] Output device 740 may include devices that allow information to be output to a user, such as a speaker, display screen, printer, speakers, etc.
[0099] The communication interface 720 may include any transceiver or the like to communicate with other devices or communication networks, such as Ethernet, Radio Access Network (RAN), Wireless Local Area Network (WLAN), etc.
[0100] The processor 710 executes the program stored in the memory 700 and calls other devices, which can be used to implement the various steps of any expression processing method based on the table control provided in the above embodiments of the present application.
[0101] An embodiment of the present application also proposes a chip, which includes a processor and a data interface. The processor reads and runs the program stored in the memory through the data interface to execute the expression processing method based on the table control introduced in any of the above embodiments. The specific processing process and its beneficial effects can be found in the above-mentioned embodiment introduction of the expression processing method based on the table control.
[0102] Exemplary computer program products and storage media
[0103] In addition to the above-mentioned methods and devices, an embodiment of the present application may also be a computer program product, which includes computer program instructions, which, when executed by a processor, enable the processor to execute the steps of the expression processing method based on table controls according to various embodiments of the present application described in any of the above embodiments of this specification.
[0104] The computer program product may be written in any combination of one or more programming languages to write program codes for performing the operations of the embodiments of the present application, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" language or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server.
[0105] In addition, the embodiment of the present application may also be a storage medium on which a computer program is stored. The computer program is executed by a processor to perform the steps of the expression processing method based on the table control according to various embodiments of the present application described in any of the above embodiments of this specification, and specifically the following steps may be implemented:
[0106] 1100. In the expression operation interface, an expression variable group is constructed through variable parameters; the expression variable group includes multiple expression variable names and expression variable values.
[0107] 1200. Enter the expression to be calculated in the table control; the expression to be calculated includes the variable names of multiple variables and the corresponding variable values.
[0108] 1300. When the variable names of the multiple variables of the expression to be operated match the multiple expression variable names in the expression variable group, the operation of the expression to be operated is performed according to the variable values of the multiple variables of the expression to be operated.
[0109] 1400. Display the operation result of the expression to be operated.
[0110] For the aforementioned method embodiments, for the sake of simplicity, they are all described as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the order of the actions described, because according to the present application, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.
[0111] It should be noted that each embodiment in this specification is described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and the same or similar parts between the embodiments can be referred to each other. For the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0112] The steps in the methods of each embodiment of the present application can be adjusted in order, combined and deleted according to actual needs, and the technical features recorded in each embodiment can be replaced or combined.
[0113] The modules and sub-modules in the devices and terminals of the various embodiments of the present application can be combined, divided and deleted according to actual needs.
[0114] In the several embodiments provided in the present application, it should be understood that the disclosed terminals, devices and methods can be implemented in other ways. For example, the terminal embodiments described above are only schematic, for example, the division of modules or submodules is only a logical function division, and there may be other division methods in actual implementation, for example, multiple submodules or modules can be combined or integrated into another module, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or modules, which can be electrical, mechanical or other forms.
[0115] The modules or submodules described as separate components may or may not be physically separated, and the components of the modules or submodules may or may not be physical modules or submodules, that is, they may be located in one place, or they may be distributed on multiple network modules or submodules. Some or all of the modules or submodules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0116] In addition, each functional module or submodule in each embodiment of the present application may be integrated into one processing module, or each module or submodule may exist physically separately, or two or more modules or submodules may be integrated into one module. The above-mentioned integrated modules or submodules may be implemented in the form of hardware or in the form of software functional modules or submodules.
[0117] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0118] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly by hardware, software units executed by a processor, or a combination of the two. The software units may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0119] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0120] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. An expression processing method based on a table control, characterized in that: The method comprises: In the expression operation interface, an expression variable group is constructed through variable parameters; the expression variable group includes multiple expression variable names and expression variable values; Enter an expression to be calculated in the table control; the expression to be calculated includes variable names of multiple variables and corresponding variable values; When the variable names of the multiple variables of the expression to be operated match the multiple expression variable names in the expression variable group, performing operation of the expression to be operated according to the variable values of the multiple variables of the expression to be operated; Display the operation result of the expression to be operated.
2. The method according to claim 1, characterized in that Determining whether the variable names of the multiple variables of the expression to be operated match the multiple expression variable names in the expression variable group includes: Determine whether the variable names of the multiple variables of the expression to be operated all exist in the expression variable group; If the variable names of the multiple variables of the expression to be operated all exist in the expression variable group, then it is determined that the variable name of the expression to be operated matches the multiple expression variable names in the expression variable group; If any one of the variable names of the multiple variables of the expression to be operated does not exist in the expression variable group, it is determined that the variable names of the multiple variables of the expression to be operated do not match the multiple expression variable names in the expression variable group.
3. The method according to claim 1, characterized in that The step of performing the operation of the expression to be operated according to the variable values of the multiple variables of the expression to be operated comprises: Obtain the variable value corresponding to each variable name in the expression to be operated; Replace each variable name in the expression to be operated with the corresponding variable value; Execute the operation of the expression to be operated to obtain the calculation result.
4. The method according to claim 1, characterized in that: After displaying the operation result of the expression to be operated, the method further includes: Through a preset triggering method, the expression to be calculated is triggered and displayed in the expression calculation interface.
5. The method according to claim 1, characterized in that The expression variable name and the variable value are both described by the text of the UI variable parameter.
6. The method according to claim 1, characterized in that The expression variable name and the variable value are both described by a global expression variable descriptor.
7. An expression processing device based on a table control, characterized in that: The device comprises: A construction module is used to construct an expression variable group through variable parameters in an expression operation interface; the expression variable group includes a plurality of expression variable names and expression variable values; An input module, used to input an expression to be calculated through a table control in an expression calculation interface; the expression to be calculated includes variable names of multiple variables and corresponding variable values; An execution module, configured to execute the operation of the expression to be operated according to the variable values of the multiple variables of the expression to be operated when the variable names of the multiple variables of the expression to be operated match the multiple expression variable names in the expression variable group; The display module is used to display the operation result of the expression to be operated.
8. An electronic device, characterized in that: including memory and processor; The memory is connected to the processor and is used to store programs; The processor is used to implement the expression processing method based on table controls as described in any one of claims 1 to 6 by running the program in the memory.
9. A computer program product, characterized in that It comprises computer program instructions, which, when executed by a processor, enable the processor to execute the expression processing method based on a table control as described in any one of claims 1 to 6.
10. A chip, characterized in that: It comprises a processor and a data interface, wherein the processor reads and runs the program stored in the memory through the data interface to execute the expression processing method based on the table control as described in any one of claims 1 to 6.