Data operation method and device, electronic equipment and storage medium
Through structured processing and generation of unified data operation statements, the problem of low data analysis efficiency in the existing technology is solved, the code is readable and scalable, and the database data operation efficiency is improved.
Patent Information
- Application Number
- CN202411365252.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-27
- Publication Date
- 2025-01-03
AI Technical Summary
Due to the different writing styles of code developers, the existing data analysis methods make the code difficult to read, poor scalability, low efficiency, and the use scenarios of existing program components are fixed, which are only suitable for specific data analysis problems, resulting in low data operation and analysis efficiency.
By determining the business template based on the topics in data operation requirements, structuring the parameters, querying field information in the database, generating data operation statements based on pre-stored mapping relationships, and parsing the statements in the database to obtain operation results, ensuring the parameter structure Unify and improve maintenance and operation efficiency.
The structural unification of different user input parameters is realized, the maintenance efficiency of data operation statements and database data operation efficiency is improved, and the need for different code developers to develop data operation statements separately for different needs is avoided.
Smart Images

Figure CN119248835A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of data analysis, and in particular to a data operation method, device, electronic device and storage medium. Background Art
[0002] In recent years, due to the rise of data science and the gradual maturity of big data processing technology, data analysis technology has received widespread attention. At present, in the process of implementing data analysis methods, code developers usually write data analysis codes and directly splice the data analysis codes into the business code of the application. However, data analysis codes developed by different code developers may have different formats. This method of implementing data analysis based on multiple different styles of codes has the problem of difficult to read codes and poor scalability. Although some program components for specific data analysis tasks have been developed, the usage scenarios are fixed and are limited to a few specific data analysis problems, resulting in low efficiency of data operation and analysis. Summary of the invention
[0003] In view of the above, it is necessary to provide a data operation method, device and storage medium to solve the problem of low efficiency of existing data analysis and operation.
[0004] In a first aspect, an embodiment of the present application provides a data operation method, the method comprising: determining a business template according to a subject in a data operation requirement; performing structured processing on parameters in the data operation requirement based on the business template to obtain structured data, the structured data including parameter names of the parameters; querying corresponding field information in a database according to the parameters, and obtaining a first code based on the parameters and the field information; determining a second code from a pre-stored mapping relationship according to the parameter name; combining the first code and the second code to obtain a data operation statement; parsing the data operation statement in the database to obtain an operation result corresponding to the data operation requirement.
[0005] In a second aspect, an embodiment of the present application provides a data operation device, which includes: a determination module, which is used to determine a business template according to a subject in a data operation requirement; a structuring module, which is used to perform structured processing on parameters in the data operation requirement based on the business template to obtain structured data, wherein the structured data includes parameter names of the parameters; a generation module, which is used to query corresponding field information in a database according to the parameters, and obtain a first code based on the parameters and the field information; the generation module is also used to determine a second code from a pre-stored mapping relationship according to the parameter name; the generation module is also used to combine the first code and the second code to obtain a data operation statement; the generation module is also used to parse the data operation statement in the database to obtain an operation result corresponding to the data operation requirement.
[0006] In a third aspect, an embodiment of the present application further provides an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps in the method provided in the first aspect when executing the computer program.
[0007] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps in the method provided in the first aspect are implemented.
[0008] In a fifth aspect, an embodiment of the present application further provides a computer program product comprising instructions, wherein the computer program product stores instructions that, when executed on a computer, enable the computer to implement the method provided in the first aspect above.
[0009] In the data operation method of this embodiment, the parameters input by the user are first structured based on the business template corresponding to the data operation requirements, and the first code and the second code are determined from the database according to the parameters and parameter names. The first code and the second code are combined to obtain the data operation statement, which can ensure that the parameters input by different users into the electronic device can maintain a unified structure, thereby ensuring that the structure and encoding method of the data operation statement generated subsequently are the same, so as to improve the efficiency of maintaining the data operation statement. The data operation statement is parsed in the database according to the grammatical rules of the data operation statement, so as to obtain the operation result corresponding to the data operation requirement, without the need for different code developers to develop data operation statements separately for different data operation requirements, thereby improving the efficiency of operating the data in the database. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments of the present application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0011] Figure 1 It is an application scenario diagram of the data operation method provided in the embodiment of the present application;
[0012] Figure 2 is a flow chart of a data operation method provided in an embodiment of the present application;
[0013] Figure 3 It is a schematic diagram of the front-end page for inputting data operation requirements provided by this implementation;
[0014] Figure 4 is a flow chart of a method for obtaining structured data provided by this implementation;
[0015] Figure 5 is a logic diagram for determining a first code provided in an embodiment of the present application;
[0016] Figure 6 is a flowchart of a method for determining a first code provided by an embodiment of the present application;
[0017] Figure 7 is a flowchart of a method for generating a data operation statement according to a first code provided by an embodiment of the present application;
[0018] Figure 8 is a flowchart of a method for determining an operation result corresponding to a data operation requirement according to a second code provided in an embodiment of the present application;
[0019] Fig. 9 is a structural schematic diagram of a data operation device provided in an embodiment of the present application;
[0020] Fig.10 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0021] 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 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.
[0022] In the following, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of indicated technical features. Thus, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a concrete way.
[0023] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those generally understood by technicians in the technical field in this application. The terms used in the specification of this application are only for the purpose of describing specific embodiments and are not intended to limit this application. It should be understood that, unless otherwise specified in this application, " / " means or. For example, A / B can represent A or B. "And / or" in this application is only a description of the association relationship of associated objects, indicating that three relationships can exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. "At least one" means one or more. "Multiple" means two or more than two. For example, at least one of a, b or c can represent: a, b, c, a and b, a and c, b and c, a, b and c seven situations.
[0024] At present, in the process of program code development, due to the different coding habits of different program developers, the styles and structures of the codes written by different program developers are also different. When multiple parties cooperate to perform code development tasks, problems such as low code writing efficiency and difficult code maintenance will arise. Usually, in order to complete the development task more quickly, the program code can be directly spliced into the business processing code using the splicing writing method. However, this method will make the code difficult to read, have poor scalability, and high later maintenance costs.
[0025] Based on the above problems, the embodiment of the present application provides a data operation method, which can perform structured processing on the parameters input by the user through the business template corresponding to the data operation requirements, and then query the corresponding field information in the database according to the parameters, and obtain the first code based on the parameters and the field information; determine the second code from the pre-stored mapping relationship according to the parameter name; combine the first code and the second code to obtain a data operation statement, which can ensure that the parameters input by different users into the electronic device can maintain a unified structure, thereby ensuring that the structure and encoding method of the subsequent generated data operation statements are the same, so as to improve the efficiency of maintaining the data operation statements. And according to the grammatical rules of the data operation statements, the data operation statements are parsed in the database to obtain the operation results corresponding to the data operation requirements, without the need for different code developers to develop data operation statements separately for different data operation requirements, thereby improving the efficiency of operating the data in the database. Among them, the second code can be a code with default functions pre-set in the programming language used to write data operation statements. For example, when the programming language used to write data operation statements is SQL language, the second code can be SQL keywords, such as SQL keywords such as SELECT, FROM, WHERE and HAVE; when the programming language used to write data operation statements is PYTHON language, the second code can be PYTHON keywords, such as PYTHON keywords such as main, def, print and num.
[0026] See also Figure 1 , Figure 1 : is an application scenario diagram of the data operation method provided in the embodiment of the present application. Figure 1 As shown, the data operation method provided in the embodiment of the present application can be applied to Figure 1 In the electronic device 100 shown. The electronic device 100 includes a human-computer interaction device 101 and a database 102. The human-computer interaction device is used to maintain information interaction between the user 10 and the electronic device 100, and the user 100 can input data operation requirements into the electronic device 100 through the human-computer interaction device. The database 102 is used to store business templates and data tables to be operated. Exemplarily, when the electronic device 100 is a computer, the human-computer interaction device 101 can be a computer display, mouse, keyboard and other devices; when the electronic device 100 is a mobile phone including a touch screen, the human-computer interaction device 101 can be a touch screen in the mobile phone. The database 102 can be a built-in memory of the electronic device 100, or it can be an external memory connected to the electronic device 100 for communication, and this application does not limit this.
[0027] In an embodiment of the present application, the user 10 inputs a data operation requirement to the electronic device 100 through the human-computer interaction device 101, wherein the data operation requirement includes parameters. The electronic device 100 generates a data operation statement corresponding to the data operation requirement according to the parameters and the business template stored in the database 102, and operates the data in the database 102 based on the data operation statement to obtain an operation result corresponding to the data operation requirement.
[0028] See also Figure 2 , Figure 2 is a flow chart of the data operation method provided in the embodiment of the present application. Figure 2 The data operation method shown can be applied to a device having a data processing function, and the data operation method includes:
[0029] S20, determining a business template according to the subject in the data operation requirement.
[0030] In an embodiment of the present application, the data operation requirement may be a requirement provided by a database user to operate data in the database. For example, the data operation requirement may be an operation such as adding, deleting, modifying or searching data in the database.
[0031] In an embodiment of the present application, the data operation requirement includes parameters, and the parameters are used to represent the screening conditions when the user operates the data in the database through the data operation requirement. For example, the parameter can be the table name in the database, the validity period of the data, the field name of the data, etc., and the present application does not limit this.
[0032] In an embodiment of the present application, the data operation requirement corresponds to the user's demand for database operation, and different data operation requirements correspond to different topics, which are used to characterize the purpose of the user's database operation. For example, the topic of the data operation requirement can be "funnel analysis", "attribution analysis" or "query the number of active users".
[0033] For example, Figure 3 A schematic diagram of a front-end page for a user to input data operation requirements into an electronic device is shown. For example, "Number of active users" in text box 301 is used to indicate that the subject of the data operation requirement is "query the number of active users"; for example, "2024-02-27" in text box 302 is used to indicate that one of the screening conditions is that the start date of querying the number of active users is "February 27, 2024"; for example, "2024-03-11" in text box 303 is used to indicate that another screening condition is that the end date of querying the number of active users is "March 11, 2024".
[0034] In this way, the various parameters in the data operation requirements input by the user are received through the front-end page, which provides a data basis for the subsequent unified structured processing of the data operation requirements, making it easier for the electronic device to understand the data operation requirements input by the user, thereby improving the accuracy of the subsequent generation of data operation statements.
[0035] S21, performing structured processing on the parameters in the data operation requirement based on the business template to obtain structured data, wherein the structured data includes parameter names of the parameters.
[0036] In one embodiment of the present application, in order to convert the parameters input by the user in the front-end page into data that can be processed by the electronic device, so as to improve the accuracy of the electronic device in parsing the information contained in the data operation requirements, thereby improving the generalization ability of understanding the data operation requirements, the parameters in the data operation requirements can be structured to obtain structured data corresponding to the data operation requirements. The structured data includes parameter names, and each parameter name corresponds to a parameter in the data operation requirements.
[0037] In one embodiment of the present application, the parameters in the data operation requirements can be structured through pre-stored business templates to obtain structured data. Data operation requirements of different themes correspond to different business templates. For example, when the subject of the data operation requirement is "funnel analysis", the corresponding business template is used to convert the parameters related to funnel analysis into structured data; when the subject of the data operation requirement is "querying the number of active users", the corresponding business template is used to convert the relevant parameters required to query the number of active users into structured data. The pre-stored business template can be a file in JSON format, a file in XML format, or a file in PROPERTIES format. The present application does not limit the specific format of the business template. For specific methods of obtaining structured data, please refer to Figure 4 The corresponding detailed description.
[0038] Exemplarily, when the theme of the data operation requirement corresponding to the business template is "funnel analysis", the parameter names in the business template include: software startup items, software browsing pages, button click items, payment result items, calculation methods, window periods, time granularity, grouping dimensions, etc.; when the theme of the data operation requirement corresponding to the business template is "query the number of active users", the parameter names in the business template include: user operation options, user filtering conditions, browser language, time granularity, grouping dimensions, etc.
[0039] In one embodiment of the present application, the pre-stored business template can be a file in JSON format, and the content of the business template in JSON format includes: parameter name filter, used to represent the filtering conditions in the data operation requirements; parameter name whereList, used to represent the splicing conditions in the data operation requirements; parameter name byFieldList, used to represent the grouping fields in the data operation requirements, and the parameters corresponding to the parameter name are used to splice the parameters corresponding to the parameter name fieldList and the parameters corresponding to the parameter name groupList; parameter name filedInfo, used to represent the aggregation operation in the data operation requirements, used to obtain the number of users, average, etc.; some parameter names are used to represent the filtering range on the time dimension in the data operation requirements, for example, the parameter name fromDate is used to represent the start time of the data operation requirements, and the parameter name toDate is used to represent the end time of the data operation requirements, etc.
[0040] S22, querying corresponding field information in a database according to the parameter, and obtaining a first code based on the parameter and the field information.
[0041] In one embodiment of the present application, since the data operation statement is a combination of the parameters in the data operation requirements and the default code in the syntax corresponding to the preset SQL programming language, in order to improve the efficiency of determining the data operation statement that meets the data operation requirements, the corresponding field information can be queried in the database according to the parameters in the data operation requirements, and the first code corresponding to the parameter can be obtained based on the parameters and the field information. Among them, the field information of the parameter is used to characterize the descriptive information corresponding to the parameter. Exemplarily, the field information includes the field name corresponding to the parameter, the field alias corresponding to the parameter, and the name of the data table to which the parameter belongs. The parameters and the corresponding field information can be combined later to obtain the first code corresponding to the parameter.
[0042] For example, Figure 5 FIG. 1 is a logic diagram of determining a first code provided by an embodiment of the present application. Figure 5The relationship between the parameters in the data operation requirement, the parameter names in the business template, the structured data and the first code is shown. Among them, the theme of the data operation requirement 510 is "funnel analysis", and the parameters in the data operation requirement 510 include parameter A, parameter B, parameter C, parameter D and parameter E; the theme of the business template 520 is "funnel analysis", and the parameter names in the business template 520 include parameter name 1, parameter name 2 and parameter name 3; after the parameters in the data operation requirement 510 are structured using the business template 520, the structured data 530 is obtained; among them, parameter A and parameter B correspond to parameter name 1, parameter C and parameter D correspond to parameter name 2, and parameter E corresponds to parameter name 3; according to parameter A, the field information A corresponding to parameter A is obtained by querying in the database, according to parameter B, the field information B corresponding to parameter B is obtained by querying in the database, according to parameter C, the field information C corresponding to parameter C is obtained by querying in the database, according to parameter D, the field information D corresponding to parameter D is obtained by querying in the database, and according to parameter E, the field information E corresponding to parameter E is obtained by querying in the database. The first code can be obtained by combining the parameters and the corresponding field information according to the parameter names, such as Figure 5 As shown, the first code 540 is determined according to the parameter A and the parameter B corresponding to the parameter name 1, wherein the first code 540 includes the parameter A and the corresponding field information A, and the parameter B and the corresponding field information B; the first code 550 is determined according to the parameter C and the parameter D corresponding to the parameter name 2, wherein the first code 550 includes the parameter C and the corresponding field information C, and the parameter D and the corresponding field information D; the first code 560 is determined according to the parameter E corresponding to the parameter name 3, wherein the first code 560 includes the parameter E and the corresponding field information E.
[0043] In one embodiment of the present application, the field information includes the field name, field alias, and data table name corresponding to the parameter.
[0044] Exemplarily, parameter A may be "value A", then the field information A corresponding to parameter A includes "field name A", "field name a" and "data table A", where "field name A" may be the field name in the field information corresponding to parameter A, "field name a" may be the field alias in the field information corresponding to parameter A, and "data table A" may be the name of the data table to which parameter A belongs. Parameter B may be "value B", then the field information B corresponding to parameter B includes "field name B", "field name b" and "data table B", where "field name B" may be the field name in the field information corresponding to parameter B, "field name b" may be the field alias in the field information corresponding to parameter B, and "data table B" may be the name of the data table to which parameter B belongs.
[0045] In an embodiment of the present application, the correspondence between the parameter name and the parameter can be used to determine the position of the parameter in the structured data in the data operation statement. Therefore, determining the corresponding first code according to the parameter and the corresponding field information can improve the efficiency of generating the data operation statement. Specifically, according to the parameter, the corresponding field information is queried in the database, and the method of obtaining the first code based on the parameter and the field information is shown in Figure 6 The corresponding detailed description.
[0046] S23: Determine a second code from a pre-stored mapping relationship according to the parameter name.
[0047] In one embodiment of the present application, the pre-stored mapping relationship is used to store the correspondence between the parameter name and the second code. The second code may be a default code with data operation function in the syntax corresponding to the preset programming language. For example, when the preset programming language is SQL language, the second code may be an SQL keyword, for example, the SQL keyword may be SELECT, FROM, or WHERE; when the preset programming language is PYTHON language, the second code may be a PYTHON keyword, for example, PYTHON keywords such as main, def, print, and num.
[0048] In one embodiment of the present application, determining the second code from a pre-stored mapping relationship according to the parameter name includes: traversing the pre-stored mapping relationship according to the parameter name; wherein the pre-stored mapping relationship is used to record the correspondence between the parameter name and the second code; and when the parameter name is the same as the parameter name recorded in the mapping relationship, determining that the second code corresponding to the parameter name recorded in the mapping relationship is the second code corresponding to the parameter.
[0049] Exemplarily, when the parameter name is "tableName", it indicates that the parameter corresponding to the parameter name is the name of the data table in the database. Since the keyword used to filter the data table in the data operation statement is FROM, the second code corresponding to the parameter name can be determined to be FROM; for another example, when the parameter name is "filter", it indicates that the parameter corresponding to the parameter name is used to characterize the filtering conditions in the data operation requirements. Since the keyword used to execute the data screening conditions or data filtering conditions in the data operation statement is WHERE, the second code corresponding to the parameter name is WHERE; for another example, when the parameter name is "fieldID", it indicates that the parameter corresponding to the parameter name is the ID of certain fields in the database. Since the field ID in the data operation statement can be used to group query the data, and the keyword used to group query the data in the data operation statement is GROUP BY, the second code corresponding to the parameter name can be determined to be GROUP BY.
[0050] S24, combining the first code and the second code to obtain a data operation statement.
[0051] In an embodiment of the present application, after determining the first code and the second code corresponding to the parameter, the first code and the second code can be combined to obtain a data operation statement corresponding to the data operation requirement. For example, Figure 5 The first code 540 shown includes parameter A and corresponding field information A and parameter B and corresponding field information B. Since the first code 540 corresponds to parameter name 1, the first code 540 and the second code corresponding to parameter name 1 can be combined to obtain the data operation statement corresponding to the first code 540. For example, when Figure 5 If the parameter A shown is "value A", the field information A corresponding to parameter A includes "field name A"; if parameter B can be "value B", the field information B corresponding to parameter B includes "field name B"; when the second code corresponding to the first parameter name is SELECT, the second code and the first code can be combined to obtain the data operation statement: SELECT (value A) AS (field name A) AND (value B) AS (field name B).
[0052] In one embodiment of the present application, when there are multiple parameters in the data operation requirement, since the second code in the data operation statement must meet the default arrangement order of the SQL syntax, the data operation statement corresponding to the data operation requirement can be determined according to the arrangement order of the second code in the data operation statement. For specific methods of determining data operation statements, please refer to Figure 7 The corresponding detailed description.
[0053] S25, parsing the data operation statement in the database to obtain the operation result corresponding to the data operation requirement.
[0054] In one embodiment of the present application, each second code and the corresponding first code in the data operation statement can be traversed according to the execution order of each second code in the data operation statement, and the data operation statement can be parsed based on the grammatical rules of the data operation statement, so as to obtain the operation result corresponding to the data operation requirement. Among them, the execution order of each keyword in the data operation statement is different from the arrangement order. Exemplarily, when the programming language used to write the data operation statement is SQL language, the arrangement order of each keyword in the data operation statement from front to back is: SELECT, FROM, JOIN, ON, WHERE, GROUP BY, HAVING, UNION, ORDER BY, LIMIT; the execution order of each keyword in the data operation statement from front to back is: FROM, ON, JOIN, WHERE, GROUP BY, HAVING, SELECT, UNION, ORDERBY, LIMIT.
[0055] In one embodiment of the present application, the grammatical rules of data operation statements are used to describe the grammatical structure of data operation statements. Exemplarily, when the data operation statement is a statement written in SQL language, and the data operation statement is "SELECT field FROM table 1 GROUP BY field 1", the order of traversing the second code in the data operation statement according to the SQL execution order is from front to back: "FROM table 1", "GROUP BY field 1", "SELECT field". Therefore, when parsing the traversed sub-statements based on the SQL grammar rules, the code logic of "selecting table 1" corresponding to "FROM table 1" is executed first, and then the code logic of "grouping according to field 1" corresponding to "GROUP BY field 1" is executed, and finally the code logic of "selecting field" corresponding to "SELECT field" is executed.
[0056] In this way, the codes corresponding to each keyword are executed in sequence according to the grammatical rules of the data operation statement, so as to obtain the operation results corresponding to the data operation requirements, and different code developers do not need to develop data operation statements separately for different data operation requirements, thereby improving the efficiency of operating the data in the database. And because the data operation statements are all determined based on the pre-set business templates and the correspondence between parameter names and keywords, the structure and encoding method of the data operation statements are the same, which can improve the efficiency of maintaining the data operation statements.
[0057] See also Figure 4 , Figure 4 is a flow chart of a method for obtaining structured data provided by an embodiment of the present application. Figure 4 The method for obtaining structured data shown can be applied to a device having a data processing function. The method for obtaining structured data includes:
[0058] S30, constructing a structure corresponding to the data operation requirement based on the first instruction in the business template, the structure comprising a first container and a second container, the first container being used to store the parameter name, and the second container being used to store the parameters corresponding to the parameter name.
[0059] In one embodiment of the present application, the first instruction in the business template can be any code for constructing a structure. For example, the first instruction can be a JAVA code or a Python code, which is not limited in the present application. Among them, the first container and the second container can be in a key-value pair format, the first container represents the key in the key-value pair, and the second container represents the value in the key-value pair. Specifically, the first container is used to store parameter names, and the second container is used to store parameters corresponding to the parameter names. Using key-value pairs to store parameter names and parameters in this way can ensure that the correspondence between parameter names and parameters remains unchanged, thereby maintaining the stability of the correspondence between parameters and parameter names during data operations, thereby improving the accuracy of data operations.
[0060] S31, traversing the parameters based on the second instruction in the business template, and determining parameter names corresponding to the traversed parameters.
[0061] In one embodiment of the present application, the second instruction in the business template is used to traverse each parameter in the data operation requirement and determine the parameter name corresponding to the traversed parameter. The structured data can be determined later based on the parameter name and the parameter name in the structure. Exemplarily, when the subject of the data operation requirement corresponding to the business template is "funnel analysis", the parameter names in the business template include: software startup items, software browsing pages, button click items, payment result items, calculation methods, window periods, time granularity, grouping dimensions, etc.; when the subject of the data operation requirement corresponding to the business template is "query the number of active users", the parameter names in the business template include: user operation options, user filtering conditions, browser language, time granularity, grouping dimensions, etc.
[0062] S32: When the parameter name corresponding to the traversed parameter is the same as the parameter name recorded in the structure, fill the parameter into the second container.
[0063] In one embodiment of the present application, when the parameter name corresponding to the traversed parameter is the same as the parameter name recorded in the structure, it indicates that the parameter corresponding to the traversed parameter name should be stored in the second container in the corresponding structure.
[0064] S33, when all the parameters in the data operation requirement are filled into the structure, the structured data is obtained.
[0065] In one embodiment of the present application, when all parameters in the data operation requirements are filled into the structure, it indicates that all parameters in the data operation requirements have completed structured processing, so it can be determined that structured data is obtained, and subsequently the data operation statement corresponding to the data operation requirements can be determined based on the structured data.
[0066] Exemplarily, when the subject of the data operation demand input by the user into the electronic device is "query the number of active users", it is determined that the business template can be a JSON file for querying the number of active users; when the parameters input by the user into the electronic device include "2024 / 02 / 27" and "2024 / 03 / 31", it can be determined that the parameter name corresponding to "2024 / 02 / 27" is "fromDate", and the parameter name corresponding to "2024 / 03 / 31" is "toDate". Therefore, the parameter name can be traversed in the structure of the business template according to "fromDate", and when the parameter name stored in the traversed first container is the same as "fromDate", the parameter "2024 / 02 / 27" can be filled into the second container corresponding to the first container. In this way, the parameters included in the data operation demand input by the user in the front-end page can be passed to the electronic device, and it is ensured that the electronic device can receive structured data, which is convenient for the subsequent generation of corresponding data operation statements based on the structured data, thereby improving the efficiency of generating data operation statements.
[0067] See also Figure 6 , Figure 6 is a flow chart of a method for determining a first code provided in an embodiment of the present application. Figure 6 The method shown in FIG. 10 is to query the corresponding field information in the database according to the parameter and obtain the corresponding first code based on the parameter and the field information, including:
[0068] S40, traversing each data in the database according to the parameter.
[0069] In one embodiment of the present application, each data in the database can be continuously traversed according to the parameters, and during the traversal process, it is determined whether the traversed data is consistent with the parameters in the data operation requirements.
[0070] S41, when the traversed data is the same as the parameter, determining that the field information corresponding to the traversed data in the database is the field information corresponding to the parameter.
[0071] In one embodiment of the present application, when the traversed data is the same as the parameter, it indicates that the data is data stored in the database. Therefore, the pre-stored data query logic can be executed in the database to determine that the field information corresponding to the traversed data in the database is the field information corresponding to the parameter.
[0072] S42: Concatenate the parameter and the field information corresponding to the parameter to obtain the first code.
[0073] In one embodiment of the present application, the first code can be obtained by concatenating the parameters with the corresponding field information. Figure 5 As shown, the first code 540 is determined according to the parameter A and the parameter B corresponding to the parameter name 1, wherein the first code 540 includes the parameter A and the corresponding field information A, and the parameter B and the corresponding field information B; the first code 550 is determined according to the parameter C and the parameter D corresponding to the parameter name 2, wherein the first code 550 includes the parameter C and the corresponding field information C, and the parameter D and the corresponding field information D; the first code 560 is determined according to the parameter E corresponding to the parameter name 3, wherein the first code 560 includes the parameter E and the corresponding field information E.
[0074] See also Figure 7 , Figure 7 1 is a flow chart of a method for generating a data operation statement according to a first code provided by an embodiment of the present application. Figure 7 The method for generating a data operation statement according to the first code shown can be applied to a device having a data processing function. The method for generating a data operation statement includes:
[0075] S50: When there are multiple parameters, combine the first code and the second code corresponding to each parameter to obtain a corresponding sub-statement.
[0076] In one embodiment of the present application, the first code and the corresponding second code may be combined to generate a sub-statement, wherein the second code in the sub-statement is in front and the corresponding first code is in the back.
[0077] For example, when Figure 5 If the parameter A shown is "value A", the field information A corresponding to parameter A includes "field name A"; if parameter B can be "value B", the field information B corresponding to parameter B includes "field name B"; when the second code corresponding to the first parameter name is SELECT, the second code and the first code can be combined to obtain the data operation statement: SELECT (value A) AS (field name A) AND (value B) AS (field name B).
[0078] S51, determining an arrangement order of the second codes in the data operation language according to the grammar of the data operation language.
[0079] In one embodiment of the present application, the data operation statement corresponding to the data operation requirement can be determined according to the default arrangement order of the second code in the data operation statement. When the data operation language is SQL language, the default arrangement order of each second code in the data operation statement from front to back is: SELECT, FROM, JOIN, ON, WHERE, GROUP BY, HAVING, UNION, ORDER BY, LIMIT.
[0080] S52, combining sub-statements corresponding to the second code according to the arrangement order to obtain the data operation statement.
[0081] In one embodiment of the present application, after determining the arrangement order of the second code in the data operation statement, the sub-statements can be sorted according to the arrangement order to obtain the data operation statement corresponding to the data operation requirement. Exemplarily, when the sub-statement includes "SELECT field", "FROM table 1" and "GROUP BY field 1", it can be determined that the data operation statement corresponding to the data operation requirement is "SELECT field FROM table 1 GROUP BY field 1".
[0082] In an embodiment of the present application, after obtaining the data operation statement, the execution order of the second code in the data operation statement can be determined according to the grammar of the data operation language, and the data operation statement can be parsed according to the execution order to obtain the operation result. For a specific method of determining the operation result corresponding to the data operation requirement according to the second code, please refer to Figure 8 The corresponding detailed description.
[0083] See also Figure 8 , Figure 8 1 is a flow chart of a method for determining an operation result corresponding to a data operation requirement according to a second code provided in an embodiment of the present application. Figure 8 The method for determining the operation result corresponding to the data operation requirement according to the second code shown can be applied to a device having a data processing function. The method for determining the operation result corresponding to the data operation requirement according to the second code includes:
[0084] S60: Determine the execution order of the second code in the data operation statement according to the grammar of the data operation language.
[0085] In one embodiment of the present application, when the data operation language is SQL language, the execution order of each second code in the data operation statement is: FROM, ON, JOIN, WHERE, GROUP BY, HAVING, SELECT, UNION, ORDER BY, LIMIT.
[0086] S61, parsing the sub-statements corresponding to the second code according to the execution order, to obtain the operation results corresponding to the data operation requirements.
[0087] In one embodiment of the present application, the sub-statement corresponding to each second code in the data operation statement can be parsed according to the execution order to obtain the data operation result. For example, when the data operation statement is "SELECT field FROM table 1 GROUP BY field 1", the order of traversing the second code in the data operation statement according to the SQL execution order is from front to back: "FROM table 1", "GROUP BY field 1", "SELECT field". Therefore, when parsing the traversed sub-statements based on the SQL grammar rules, the code logic of "selecting table 1" corresponding to "FROM table 1" is executed first, and then the code logic of "grouping according to field 1" corresponding to "GROUP BY field 1" is executed, and finally the code logic of "selecting field" corresponding to "SELECT field" is executed. The operation result obtained in this way is the field data grouped according to "field 1" in "table 1".
[0088] See also Fig. 9 , Fig. 9 1 is a structural diagram of a data operation device provided in an embodiment of the present application, which can implement the details of the data operation method in the above embodiment and achieve the same effect. Fig. 9 As shown, the data operation device 800 can be applied to a device having a data processing function, and the device 800 includes:
[0089] The determination module 801 is used to determine a business template according to a subject in the data operation requirement.
[0090] The structuring module 802 is used to perform structural processing on the parameters in the data operation requirement based on the business template to obtain structured data, where the structured data includes parameter names of the parameters.
[0091] The generating module 803 is used to query the corresponding field information in the database according to the parameter, and obtain the first code based on the parameter and the field information.
[0092] The generating module 803 is further configured to determine a second code from a pre-stored mapping relationship according to the parameter name.
[0093] The generating module 803 is further used to combine the first code and the second code to obtain a data operation statement.
[0094] The generating module 803 is further configured to parse the data operation statement in the database to obtain the operation result corresponding to the data operation requirement.
[0095] In one embodiment, the generation module 803 is also used to: traverse each data in the database according to the parameter; when the traversed data is the same as the parameter, determine that the field information corresponding to the traversed data in the database is the field information corresponding to the parameter; splice the parameter with the field information corresponding to the parameter to obtain the first code.
[0096] In one embodiment, the generation module 803 is also used to: traverse the pre-stored mapping relationship according to the parameter name; wherein the pre-stored mapping relationship is used to record the correspondence between the parameter name and the second code; when the parameter name is the same as the parameter name recorded in the mapping relationship, determine that the second code corresponding to the parameter name recorded in the mapping relationship is the second code corresponding to the parameter.
[0097] In one embodiment, the generation module 803 is also used for: when there are multiple parameters, combining the first code and the second code corresponding to each parameter to obtain a corresponding sub-statement; determining the arrangement order of the second code in the data operation language according to the grammar of the data operation language; and combining the sub-statements corresponding to the second code according to the arrangement order to obtain the data operation statement.
[0098] In one embodiment, the generation module 803 is also used to: determine the execution order of the second code in the data operation statement according to the syntax of the data operation language; parse the sub-statements corresponding to the second code according to the execution order to obtain the operation result corresponding to the data operation requirement.
[0099] In one embodiment, the generation module 803 is also used to: construct a structure corresponding to the data operation requirement based on the first instruction in the business template, the structure including a first container and a second container, the first container being used to store the parameter name, and the second container being used to store the parameters corresponding to the parameter name; traverse the parameters based on the second instruction in the business template, and determine the parameter names corresponding to the traversed parameters; when the parameter names corresponding to the traversed parameters are the same as the parameter names recorded in the structure, fill the parameters into the second container; when all the parameters in the data operation requirement are filled into the structure, the structured data is obtained.
[0100] Fig.10 A schematic diagram of the hardware structure of an electronic device for implementing various embodiments of the present application.
[0101] The electronic device 900 includes but is not limited to: a radio frequency unit 901, a network module 902, an audio output unit 903, an input unit 904, a sensor 905, a display unit 906, a user input unit 907, an interface unit 908, a memory 909, a processor 910, and a power supply 911. Those skilled in the art will appreciate that Fig.10 The electronic device structure shown in the figure does not constitute a limitation on the electronic device, and the electronic device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently. In the embodiments of the present application, the electronic device includes but is not limited to a mobile phone, a tablet computer, a laptop computer, a PDA, a vehicle-mounted terminal, a server, a wearable device, and a pedometer.
[0102] Among them, processor 910 is used to: determine a business template according to a subject in a data operation requirement; perform structured processing on parameters in a data operation requirement based on the business template to obtain structured data, wherein the structured data includes parameter names of the parameters; query corresponding field information in a database according to the parameters, and obtain a first code based on the parameters and the field information; determine a second code from a pre-stored mapping relationship according to the parameter name; combine the first code and the second code to obtain a data operation statement; parse the data operation statement in the database to obtain an operation result corresponding to the data operation requirement.
[0103] In one embodiment, the processor 910 is also used to: traverse each data in the database according to the parameter; when the traversed data is the same as the parameter, determine that the field information corresponding to the traversed data in the database is the field information corresponding to the parameter; splice the parameter with the field information corresponding to the parameter to obtain the first code.
[0104] In one embodiment, the processor 910 is further used to: traverse the pre-stored mapping relationship according to the parameter name; wherein the pre-stored mapping relationship is used to record the correspondence between the parameter name and the second code; when the parameter name is the same as the parameter name recorded in the mapping relationship, determine that the second code corresponding to the parameter name recorded in the mapping relationship is the second code corresponding to the parameter.
[0105] In one embodiment, the processor 910 is further used to: when there are multiple parameters, combine the first code and the second code corresponding to each parameter to obtain a corresponding sub-statement; determine the arrangement order of the second code in the data operation language according to the grammar of the data operation language; and combine the sub-statements corresponding to the second code according to the arrangement order to obtain the data operation statement.
[0106] In one embodiment, the processor 910 is further used to: determine the execution order of the second code in the data operation statement according to the syntax of the data operation language; parse the sub-statements corresponding to the second code according to the execution order to obtain the operation result corresponding to the data operation requirement.
[0107] In one embodiment, the processor 910 is further used to: construct a structure corresponding to the data operation requirement based on the first instruction in the business template, the structure including a first container and a second container, the first container being used to store the parameter name, and the second container being used to store the parameters corresponding to the parameter name; traverse the parameters based on the second instruction in the business template to determine the parameter names corresponding to the traversed parameters; fill the parameters into the second container when the parameter names corresponding to the traversed parameters are the same as the parameter names recorded in the structure; and obtain the structured data when all the parameters in the data operation requirement are filled into the structure.
[0108] The embodiment of the present application also has the same Figure 2 The same beneficial technical effects as those of the illustrated embodiments are not described in detail here.
[0109] It should be understood that in the embodiment of the present application, the radio frequency unit 901 can be used for receiving and sending signals during information transmission or calls. Specifically, after receiving downlink data from the base station, it is sent to the processor 910 for processing; in addition, uplink data is sent to the base station. Generally, the radio frequency unit 901 includes but is not limited to an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier, a duplexer, etc. In addition, the radio frequency unit 901 can also communicate with the network and other devices through a wireless communication system.
[0110] The electronic device provides users with wireless broadband Internet access through the network module 902, such as helping users to send and receive emails, browse web pages, and access streaming media.
[0111] The audio output unit 903 can convert the audio data received by the RF unit 901 or the network module 902 or stored in the memory 909 into an audio signal and output it as sound. Moreover, the audio output unit 903 can also provide audio output related to a specific function performed by the electronic device 900 (for example, a call signal reception sound, a message reception sound, etc.). The audio output unit 903 includes a speaker, a buzzer, a receiver, etc.
[0112] The input unit 904 is used to receive audio or video signals. The input unit 904 may include a graphics processor (GPU) 9041 and a microphone 9042, and the graphics processor 9041 processes the image data of a static picture or video obtained by an image capture device (such as a camera) in a video capture mode or an image capture mode. The processed image frame can be displayed on the display unit 906. The image frame processed by the graphics processor 9041 can be stored in the memory 909 (or other storage medium) or sent via the radio frequency unit 901 or the network module 902. The microphone 9042 can receive sound and can process such sound into audio data. The processed audio data can be converted into a format output that can be sent to a mobile communication base station via the radio frequency unit 901 in the case of a telephone call mode.
[0113] The electronic device 900 also includes at least one sensor 905, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor includes an ambient light sensor and a proximity sensor, wherein the ambient light sensor can adjust the brightness of the display panel 9061 according to the brightness of the ambient light, and the proximity sensor can turn off the display panel 9061 and / or the backlight when the electronic device 900 is moved to the ear. As a type of motion sensor, the accelerometer sensor can detect the magnitude of acceleration in each direction (generally three axes), and can detect the magnitude and direction of gravity when stationary, which can be used to identify the posture of the electronic device (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer, tapping), etc.; the sensor 905 can also include a fingerprint sensor, a pressure sensor, an iris sensor, a molecular sensor, a gyroscope, a barometer, a hygrometer, a thermometer, an infrared sensor, etc., which will not be repeated here.
[0114] The display unit 906 is used to display information input by the user or information provided to the user. The display unit 906 may include a display panel 9061, which may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), or the like.
[0115] The user input unit 907 can be used to receive input digital or character information, and to generate key signal input related to user settings and function control of the electronic device. Specifically, the user input unit 907 includes a touch panel 9071 and other input devices 9072. The touch panel 9071, also known as a touch screen, can collect the user's touch operation on or near it (such as the user's operation on the touch panel 9071 or near the touch panel 9071 using any suitable object or accessory such as a finger, stylus, etc.). The touch panel 9071 may include two parts: a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch orientation, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into the contact point coordinates, and then sends it to the processor 910, receives the command sent by the processor 910 and executes it. In addition, the touch panel 9071 can be implemented using various types such as resistive, capacitive, infrared and surface acoustic waves. In addition to the touch panel 9071, the user input unit 907 may also include other input devices 9072. Specifically, other input devices 9072 may include but are not limited to a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which will not be repeated here.
[0116] Furthermore, the touch panel 9071 may be overlaid on the display panel 9061. When the touch panel 9071 detects a touch operation on or near it, it transmits the information to the processor 910 to determine the type of the touch event. Then, the processor 910 provides a corresponding visual output on the display panel 9061 according to the type of the touch event. Fig.10 In the figure, the touch panel 9071 and the display panel 9061 are used as two independent components to realize the input and output functions of the electronic device. However, in some embodiments, the touch panel 9071 and the display panel 9061 can be integrated to realize the input and output functions of the electronic device, which is not limited here.
[0117] The interface unit 908 is an interface for connecting an external device to the electronic device 900. For example, the external device may include a wired or wireless headset port, an external power supply (or battery charger) port, a wired or wireless data port, a memory card port, a port for connecting a device with an identification module, an audio input / output (I / O) port, a video I / O port, a headphone port, etc. The interface unit 908 may be used to receive input (e.g., data information, power, etc.) from an external device and transmit the received input to one or more elements within the electronic device 900 or may be used to transmit data between the electronic device 900 and an external device.
[0118] The memory 909 can be used to store software programs and various data. The memory 909 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area can store data created according to the use of the mobile phone (such as audio data, a phone book, etc.), etc. In addition, the memory 909 can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.
[0119] The processor 910 is the control center of the electronic device. It uses various interfaces and lines to connect various parts of the entire electronic device. It executes various functions of the electronic device and processes data by running or executing software programs and / or modules stored in the memory 909, and calling data stored in the memory 909, so as to monitor the electronic device as a whole. The processor 910 may include one or more processing units; preferably, the processor 910 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 910.
[0120] The electronic device 900 may also include a power supply 911 (such as a battery) for supplying power to each component. Preferably, the power supply 911 may be logically connected to the processor 910 through a power management system, thereby implementing functions such as charging, discharging, and power consumption management through the power management system.
[0121] In addition, the electronic device 900 includes some functional modules not shown, which will not be described in detail here.
[0122] Preferably, an embodiment of the present application also provides an electronic device, including a processor 910, a memory 909, and a computer program stored in the memory 909 and executable on the processor 910. When the computer program is executed by the processor 910, the computer program implements the various processes of the above-mentioned data operation method embodiment or implements the various processes of the above-mentioned data operation method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0123] The embodiment of the present application also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by the processor, each process of the above-mentioned data operation method embodiment or each process of the above-mentioned network training method embodiment can be implemented, and the same technical effect can be achieved. In order to avoid repetition, it is not repeated here. Among them, the computer-readable storage medium is such as a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, etc.
[0124] The embodiment of the present application further provides a computer program product. When the computer program product is run on a computer or a processor, the computer or the processor executes one or more steps in any of the above methods.
[0125] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted through the computer-readable storage medium. The computer instructions may be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid state drive (SSD)), etc. It should be noted that, in this article, the terms "include", "comprises" or any other variations 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, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.
[0126] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present application.
[0127] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.
Claims
1. A data operation method, characterized in that: The method comprises: Determine business templates based on themes in data operation requirements; Based on the business template, the parameters in the data operation requirement are structured to obtain structured data, where the structured data includes parameter names of the parameters; According to the parameter, corresponding field information is searched in a database, and a first code is obtained based on the parameter and the field information; Determine a second code from a pre-stored mapping relationship according to the parameter name; combining the first code and the second code to obtain a data operation statement; The data operation statement is parsed in the database to obtain an operation result corresponding to the data operation requirement.
2. The data operation method according to claim 1, characterized in that: The querying corresponding field information in a database according to the parameter, and obtaining a first code based on the parameter and the field information comprises: Traverse each data in the database according to the parameter; In the case where the traversed data is the same as the parameter, determining that the field information corresponding to the traversed data in the database is the field information corresponding to the parameter; The parameter and the field information corresponding to the parameter are concatenated to obtain the first code.
3. The data operation method according to claim 2, characterized in that: The field information includes the field name, field alias, and data table name corresponding to the parameter.
4. The data operation method according to claim 1, characterized in that: Determining the second code from a pre-stored mapping relationship according to the parameter name includes: Traversing the pre-stored mapping relationship according to the parameter name; wherein the pre-stored mapping relationship is used to record the corresponding relationship between the parameter name and the second code; In the case where the parameter name is the same as the parameter name recorded in the mapping relationship, the second code corresponding to the parameter name recorded in the mapping relationship is determined to be the second code corresponding to the parameter.
5. The data operation method according to claim 1, characterized in that: The method further comprises: In the case where there are multiple parameters, combining the first code and the second code corresponding to each parameter to obtain a corresponding sub-statement; Determining the arrangement order of the second codes in the data manipulation language according to the grammar of the data manipulation language; The sub-statements corresponding to the second code are combined according to the arrangement order to obtain the data operation statement.
6. The data operation method according to claim 5, characterized in that: The step of parsing the data operation statement in the database to obtain the operation result corresponding to the data operation requirement includes: Determining the execution order of the second code in the data operation statement according to the grammar of the data operation language; The sub-statements corresponding to the second code are parsed according to the execution order to obtain the operation results corresponding to the data operation requirements.
7. The data operation method according to claim 1, characterized in that: The structural processing of the parameters in the data operation requirements based on the business template to obtain structured data includes: Building a structure corresponding to the data operation requirement based on the first instruction in the business template, the structure comprising a first container and a second container, the first container being used to store the parameter name, and the second container being used to store the parameter corresponding to the parameter name; Traversing the parameters based on the second instruction in the business template, and determining parameter names corresponding to the traversed parameters; When the parameter name corresponding to the traversed parameter is the same as the parameter name recorded in the structure, fill the parameter into the second container; When all parameters in the data operation requirement are filled into the structure, the structured data is obtained.
8. A data operation device, characterized in that: The device is used to implement the method according to any one of claims 1 to 7, and the device includes: A determination module is used to determine a business template according to the subject in the data operation requirement; A structuring module, configured to perform structural processing on the parameters in the data operation requirement based on the business template to obtain structured data, wherein the structured data includes parameter names of the parameters; A generating module, configured to query corresponding field information in a database according to the parameter, and obtain a first code based on the parameter and the field information; The generating module is further used to determine the second code from a pre-stored mapping relationship according to the parameter name; The generating module is further used to combine the first code and the second code to obtain a data operation statement; The generating module is further used to parse the data operation statement in the database to obtain the operation result corresponding to the data operation requirement.
9. An electronic device, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps in the data operation method according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the data operation method according to any one of claims 1 to 7 are implemented.
11. A computer program product comprising instructions, characterized in that The computer program product stores instructions, and when the computer program product is executed on a computer, the computer is enabled to implement the data operation method according to any one of claims 1 to 7.
