Data calculation method, electronic device, storage medium and program product

By parsing and generating the second definition function in the database device of the second database, the problem of different syntax of creating custom aggregation functions in different databases is solved, and data calculation across databases is realized, which improves efficiency and compatibility.

CN120011407APending Publication Date: 2025-05-16CETC JINCANG (BEIJING) TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510073010.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-16
Publication Date
2025-05-16

AI Technical Summary

Technical Problem

Different databases have different syntaxes for creating custom aggregation functions, which leads to database administrators need to learn multiple syntaxes, which increases learning costs and workload, and reduces the efficiency of data calculation and compatibility between different databases.

Method used

By obtaining the pre-stored second function in the database device of the second database, analyzing the first definition function based on the function, generating the second definition function, and then performing data calculation, thereby realizing data calculation operations across the database.

Benefits of technology

It reduces learning costs and workload, improves the efficiency of data calculation, and improves compatibility between different databases, allowing database managers to calculate data in other databases based on mastering the rules for creating functions of a certain database.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120011407A_ABST
    Figure CN120011407A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a data calculation method, electronic equipment, a storage medium and a program product, and is applied to the technical field of computers. The method comprises the steps of obtaining a pre-stored second function in response to a first definition function for a target data set; the first definition function is defined according to a function creation rule of the first database, and the function creation rule of the first database is different from that of the second database; analyzing the first definition function according to the second function, and inserting a first definition function name, a first input parameter and a first object obtained through analysis into the second function to obtain a second definition function; the first input parameter is used for representing target data of each iterative calculation, and the first object is used for representing an accumulated calculation state; calculating the target data set by adopting a second definition function to obtain a final calculation result; and outputting a final calculation result. And the learning cost and workload are reduced, so that the data calculation efficiency is improved, and the compatibility between different databases is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a data calculation method, electronic equipment, storage medium and program product. Background Art

[0002] Aggregation functions are powerful tools for summarizing and analyzing a set of data, allowing users to quickly obtain statistical information about a data set. In database systems, such as relational database systems, there are built-in aggregation functions. However, as business needs continue to change, built-in aggregation functions may not meet all specific computing needs. As a result, custom aggregation functions have emerged. Custom aggregation functions allow database administrators to create specific aggregation calculation methods based on specific business logic and requirements. This flexibility enables users to implement more complex aggregation calculation operations, such as calculating weighted averages and generating custom statistics.

[0003] Currently, custom aggregate functions are used for data calculation. Generally, a database administrator creates the syntax of the custom aggregate function based on the database that needs to be calculated, and forms a calculation command based on the creation result, thereby instructing the database to calculate the data it contains.

[0004] However, different databases have different syntaxes for creating custom aggregate functions. When database administrators need to maintain multiple databases, they are required to learn multiple syntaxes, which increases manual learning costs and workload, thereby reducing the efficiency of data calculation and the compatibility between different databases. Summary of the invention

[0005] The embodiments of the present application provide a data calculation method, an electronic device, a storage medium, and a program product to reduce learning costs and workload, thereby improving the efficiency of data calculation and improving the compatibility between different databases.

[0006] In a first aspect, an embodiment of the present application provides a data calculation method, wherein a first database and a second database have different function creation rules, and the method is applied to a database device of the second database, and the method includes: in response to a first definition function for a target data set, obtaining a pre-stored second function; the first definition function is defined according to the function creation rule of the first database;

[0007] Parsing the first definition function according to the second function, and inserting the parsed first definition function name, first input parameter and first object into the second function to obtain the second definition function; the first input parameter is used to represent the target data of each iterative calculation, and the first object is used to represent the accumulated calculation state;

[0008] Using the second definition function to calculate the target data set to obtain a final calculation result;

[0009] The final calculation result is output.

[0010] In a possible implementation, parsing the first definition function according to the second function includes: according to the position to be embedded in the second function, searching in the first definition function for content having a mapping relationship with the position to be embedded, so as to obtain the first definition function name, the first input parameter and the first object.

[0011] In a possible implementation, the second definition function includes: an iterative sub-function name and a final sub-function name; the use of the second definition function to calculate the target data set to obtain a final calculation result includes: obtaining an iterative sub-function and a final sub-function according to the iterative sub-function name and the final sub-function name; using the first input parameter and the first object as input parameters of the iterative sub-function to obtain an iterative definition sub-function, and performing iterative calculation based on the iterative definition sub-function to obtain a calculated first object; using the calculated first object as an input parameter of the final sub-function to obtain a final definition sub-function, and outputting the final calculation result of the target data set based on the final definition sub-function.

[0012] In a possible implementation, after using the first input parameter and the first object as input parameters of the iterative sub-function, it also includes: determining whether the object instance of the first object is empty; if so, based on the second link contained in the iterative definition sub-function, calling the initialization method in the first definition function to initialize the first object to obtain the object instance of the first object.

[0013] In a possible implementation, the iterative calculation based on the iterative definition sub-function to obtain the calculated first object includes: based on the first link contained in the iterative definition sub-function, calling the iterative calculation method in the first definition function; using the iterative calculation method, using the object instance of the first object to process each input target data one by one, and in each processing, updating the calculation state reflected by the object instance of the first object; in response to the termination of iteration, obtaining the calculated first object based on the object instance of the currently updated first object.

[0014] In a possible implementation, outputting the final calculation result of the target data set based on the final definition sub-function includes: calling the final calculation method in the first definition function based on the link contained in the final definition sub-function; using the final calculation method, obtaining the calculation value of each processing according to the object instance of the currently updated first object, and performing a final calculation on each calculation value to obtain the final calculation result.

[0015] In a possible implementation, after parsing the first definition function according to the second function, it also includes: building a strong association relationship between the first definition function name and the iterative sub-function name, and between the first definition function name and the final sub-function name; the method also includes: receiving a deletion instruction; the deletion instruction includes the first definition function name; performing deletion processing on the first definition function corresponding to the first definition function name, and the iterative definition sub-function and the final definition sub-function that have a strong association relationship with the first definition function name.

[0016] In a second aspect, an embodiment of the present application provides a data computing device, comprising: an acquisition module, configured to acquire a pre-stored second function in response to a first definition function for a target data set; the first definition function is defined according to a function creation rule of a first database;

[0017] A parsing module, used for parsing the first defined function according to the second function;

[0018] An insertion module, used for inserting the parsed first definition function name, the first input parameter and the first object into the second definition function to obtain the second definition function; the first input parameter is used to represent the target data of each iterative calculation, and the first object is used to represent the accumulated calculation state;

[0019] A calculation module, configured to calculate the target data set using the second definition function to obtain a final calculation result;

[0020] An output module is used to output the final calculation result.

[0021] In a possible implementation manner, the parsing module, when parsing the first definition function according to the second function, is specifically configured to:

[0022] According to the position to be embedded in the second function, in the first definition function, search for content having a mapping relationship with the position to be embedded to obtain a first definition function name, a first input parameter and a first object.

[0023] In a possible implementation, the second definition function includes: an iterative sub-function name and a final sub-function name; and the calculation module, when using the second definition function to calculate the target data set to obtain a final calculation result, is specifically used to:

[0024] According to the iterative sub-function name and the final sub-function name, an iterative sub-function and a final sub-function are obtained; the first input parameter and the first object are used as input parameters of the iterative sub-function to obtain an iterative definition sub-function, and an iterative calculation is performed based on the iterative definition sub-function to obtain a calculated first object; the calculated first object is used as an input parameter of the final sub-function to obtain a final definition sub-function, and a final calculation result of the target data set is output based on the final definition sub-function.

[0025] In a possible implementation, the data computing device further includes: a judgment module, a calling module;

[0026] The judgment module is used to judge whether the object instance of the first object is empty after the calculation module uses the first input parameter and the first object as input parameters of the iterative sub-function; the calling module is used to, if so, call the initialization method in the first definition function based on the second link contained in the iterative definition sub-function to initialize the first object so as to obtain the object instance of the first object.

[0027] In a possible implementation manner, the calculation module, when performing iterative calculation based on the iterative definition sub-function to obtain the calculated first object, is specifically configured to:

[0028] Based on the first link contained in the iterative definition sub-function, the iterative calculation method in the first definition function is called; using the iterative calculation method, each input target data is processed one by one using the object instance of the first object, and in each processing, the calculation state reflected by the object instance of the first object is updated; in response to the termination of the iteration, the calculated first object is obtained based on the object instance of the currently updated first object.

[0029] In a possible implementation manner, the calculation module, when outputting the final calculation result of the target data set based on the final definition sub-function, is specifically configured to:

[0030] Based on the link contained in the final definition sub-function, the final calculation method in the first definition function is called; using the final calculation method, the calculation value of each processing is obtained according to the object instance of the currently updated first object, and the final calculation is performed on each calculation value to obtain the final calculation result.

[0031] In a possible implementation, the data computing device further includes: a construction module, a receiving module, and a processing module;

[0032] The construction module is used to build a strong association relationship between the first definition function name and the iterative sub-function name, and between the first definition function name and the final sub-function name, respectively, after the parsing module parses the first definition function according to the second function; the receiving module is used to receive a deletion instruction; the deletion instruction includes the first definition function name; the processing module is used to perform deletion processing on the first definition function corresponding to the first definition function name, as well as the iterative definition sub-function and the final definition sub-function that have a strong association relationship with the first definition function name.

[0033] In a third aspect, an embodiment of the present application provides an electronic device, including: a memory, a processor;

[0034] The memory stores computer-executable instructions;

[0035] The processor executes the computer-executable instructions stored in the memory, so that the processor executes the above first aspect and / or various possible implementations of the first aspect.

[0036] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement the first aspect above and / or various possible implementations of the first aspect.

[0037] In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the above first aspect and / or various possible implementation methods of the first aspect.

[0038] The data calculation method, electronic device, storage medium and program product provided by the embodiments of the present application are as follows: since, when the function creation rules of the first database and the second database are different, a first definition function is obtained in advance according to the function creation rules of the first database, and the calculation operation is triggered for the target data set in the second database by using the function, the database device of the second database responds to the first definition function, and by obtaining the pre-stored second function, the first definition function can be parsed according to the second function, and the parsed first definition function name, the first input parameter for representing the target data of each iterative calculation, and the first object for representing the accumulated calculation state can be inserted into the second function to obtain the second definition function, so as to obtain the second definition function, and then by using the second definition function to calculate the target data set, the final calculation result can be successfully obtained and output, so that on the basis of the function creation rules of a certain database, its corresponding function can be used to perform calculation operations on the data in other databases, thereby reducing the learning cost and workload, thereby improving the efficiency of data calculation and improving the compatibility between different databases. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0040] Figure 1 A schematic diagram of a scenario for the data calculation method provided in this application;

[0041] Figure 2 Schematic diagram of the data calculation method provided for this application Figure 1 ;

[0042] Figure 3 Schematic diagram of the data calculation method provided for this application Figure 2 ;

[0043] Figure 4 A schematic diagram of the structure of the data computing device provided in this application;

[0044] Figure 5 Schematic diagram of the electronic structure provided for this application.

[0045] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION

[0046] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.

[0047] First, the terms involved in this application are explained:

[0048] Aggregate function: is a function used to perform calculations on a set of values ​​and return a single value. Common aggregate functions include sum (SUM), average (AVG), count (COUNT), maximum (MAX), and minimum (MIN). These functions are often used in SQL queries to summarize and analyze data sets. For example, in a table containing sales data, you can use the SUM function to calculate the total sales, or use the AVG function to calculate the average sales.

[0049] Custom aggregate functions: These are aggregate functions that users create based on specific needs to perform complex calculations that cannot be satisfied by standard aggregate functions. For example, a user may need a function to calculate a weighted average or complex statistical indicators.

[0050] At present, when using custom aggregate functions for data calculation, generally, a database administrator creates the syntax of a custom aggregate function based on the database where the data to be calculated is located, creates a corresponding custom aggregate function, and forms a calculation command based on the created custom aggregate function, thereby instructing the database to calculate the data it contains. However, different databases have different syntaxes for creating custom aggregate functions. When database administrators need to maintain multiple databases, they are required to learn multiple syntaxes, which increases manual learning costs and workload, thereby reducing the efficiency of data calculation and compatibility between different databases.

[0051] In the face of the problems in the prior art, in order to reduce the learning cost and workload, improve the efficiency of data calculation, and improve the compatibility between different databases, instead of using the syntax of the database to which the data to be calculated belongs to create a custom aggregation function and create a corresponding custom aggregation function, it is based on the database function creation rules mastered by the database administrator to create a custom aggregation function using the database function creation rules, and based on the custom aggregation function, trigger the calculation operation for the database to which the data to be calculated belongs. Then, the above-mentioned database responds to the triggered custom aggregation function, obtains the function stored in itself, and parses the above-mentioned custom aggregation function according to the function stored in itself to obtain the necessary information for data calculation, such as the name of the above-mentioned custom aggregation function, the input parameters used to characterize the data to be calculated, and the object used to characterize the iterative process, and embeds these necessary information into the function stored in itself, so as to use the embedded self-stored function to perform data calculation, and then obtain the final calculation result and output it, so that the database administrator can use its corresponding function on the basis of mastering the function creation rules of a certain database to perform calculation operations on the data in other databases, reduce the learning cost and workload, thereby improving the efficiency of data calculation and improving the compatibility between different databases.

[0052] Figure 1 A schematic diagram of a scenario of the data calculation method provided in this application, such as Figure 1 As shown, the data computing system provided in this scenario includes: a user terminal 1, a database device 2, and a storage component 3. Among them, the user terminal 1 is the terminal where the database administrator is located, the database device 2 is the database device corresponding to the second database, and the storage component 3 is the storage component corresponding to the database device 2. Among them, the database device 2 is connected to the user terminal 1 and the storage component 3 in communication. First, the database administrator enters the first definition function based on the function creation rule of the first database in the user terminal 1, and triggers the calculation operation for the target data set in the second database based on the first definition function. Then, the database device 2 responds to the first definition function for the target data set, obtains the pre-stored second function from the storage component 3, and parses the first definition function according to the second function, and then inserts the parsed first definition function name, the first input parameter for representing the target data of each iterative calculation, and the first object for representing the accumulated calculation state into the second function to obtain the second definition function, and uses the second definition function to calculate the target data set to obtain the final calculation result, thereby outputting the final calculation result. Among them, the function creation rules of the first database and the second database are different.

[0053] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. 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] Figure 2 Schematic diagram of the data calculation process provided for this application Figure 1 ,like Figure 2 As shown, the execution subject of the method is a data computing device, which may be located in an electronic device, specifically in a database device of a second database, and the method includes:

[0055] S201 . In response to a first defined function for a target data set, obtain a pre-stored second function; the first defined function is defined according to a function creation rule of a first database.

[0056] In this embodiment, the function creation rules of the first database and the second database are different. Among them, the function creation rules are rules for creating custom aggregate functions. The first database is a database to which the function creation rules known by the database administrator belong. The second database is a database that the database administrator needs to manage but does not know its function creation rules. This embodiment does not limit the specific first database and second database.

[0057] The target data set is a data set that the database administrator needs to calculate, and specifically includes a plurality of target data. The target data is data belonging to the target data set.

[0058] The first defined function is a custom aggregation function created by a database administrator according to the function creation rules of the first database.

[0059] The second function is a function that is pre-stored based on the function creation rule of the second database and is not formally created.

[0060] In this embodiment, the database administrator may use the function creation rule of the first database in advance to create a first definition function, and trigger a computing operation for the target data set in the second database based on the creation result. Then, the database device corresponding to the second database obtains the second function pre-stored locally in response to the first definition function for the target data set.

[0061] S202. Parse the first defined function according to the second function, and insert the parsed first defined function name, first input parameter and first object into the second function to obtain the second defined function; the first input parameter is used to represent the target data of each iterative calculation, and the first object is used to represent the accumulated calculation state.

[0062] The first definition function name is the name of the first definition function, which is specifically defined by the database administrator when creating the first definition function. This embodiment does not limit the specific content of the first definition function name.

[0063] The first input parameter is a parameter of a specific calculation process, which is specifically used to characterize the target data of each iterative calculation. The first object is an object type that characterizes a specific calculation process, which is specifically used to characterize the accumulated calculation state.

[0064] The second defined function is a custom aggregation function created according to the function creation rule of the second database.

[0065] It is understandable that when using a custom aggregation function to calculate data, for the first database and the second database with different function creation rules, although the way of constructing the function and the specific calculation process are different, both include two processes: iterative calculation and final calculation, and both involve input parameters and object types. Then, in order to apply the first definition function written by the database administrator according to the creation definition rule of the first database to the second database, it is necessary to insert the relevant content in the first definition function into the second function corresponding to the second database, and obtain the second definition function created according to the function creation rule of the second database.

[0066] Based on this, in this embodiment, after obtaining the first definition function and the second function, the content in the first definition function is parsed to obtain the first definition function name, first input parameter and first object defined by the database administrator in the first definition function, and the above-mentioned first definition function name, first input parameter and first object are inserted into the second function to obtain the second definition function.

[0067] For example, a database administrator may create the following first definition function in advance according to the function creation rule of the first database:

[0068] CREATE TYPE 'first object' AS object (

[0070] cat_string 'first input parameter',

[0071] STATIC FUNCTION ODCIAggregateInitialize(sctx IN OUT 'first object')return number,

[0072] MEMBER FUNCTION ODCIAggregateIterate(self IN OUT 'first object', value IN'first input parameter') RETURN number,

[0073] MEMBER FUNCTION ODCIAggregateTerminate(self IN 'first object',returnValue OUT 'final calculation result', flags IN number) RETURN number );

[0075] CREATE TYPE BODY 'first object' IS

[0076] ......(Specific gathering content)

[0077] END;

[0078] CREATE OR REPLACE FUNCTION 'first defined function name' (input 'first input parameter') RETURN 'data format'

[0079] AGGREGATE USING 'first object';

[0080] in,

[0081] ODCIAggregateInitialize is a function that implements initialization in the first defined function.

[0082] ODCIAggregateIterate is a function that implements iterative calculation in the first defined function.

[0083] ODCIAggregateTerminate is a function that implements the final calculation in the first definition function.

[0084] Furthermore, according to the function creation rule of the second database, the following second function is created:

[0085] CREATE OR REPLACE AGGREGATE ***(***) (

[0087] stype = ***, ...... )

[0090] Among them, *** is the specific position to be inserted. Then, based on the above first definition function and the above second function, according to the specific position to be inserted in the second function, the first definition function name associated with the first position, the first input parameter associated with the second position, and the first object associated with the third position are parsed in the above first definition function to obtain the following second definition function:

[0091] CREATE OR REPLACE AGGREGATE 'first defined function name' ('first input parameter') (

[0093] stype = 'First object', ...... )

[0096] S203: Calculate the target data set using the second defined function to obtain a final calculation result.

[0097] The final calculation result is the result obtained after iterative calculation and final calculation.

[0098] In this embodiment, after the second definition function is obtained, the second definition function is used to calculate the target data in the target data set to obtain a final calculation result.

[0099] Specifically, according to the order of each target data in the target data set, each target data is taken as the first input parameter in turn, and then iterative calculation is performed for each first input parameter, and after each iteration, the first object is updated using a specific calculation process until all target data are traversed. Further, the calculation result of each iteration is obtained in the finally updated first object, and the final calculation is performed for the above calculation result to obtain the final calculation result.

[0100] It can be understood that, based on the example in S202, after obtaining the second definition function, the second definition function can perform iterative calculation and final calculation by calling ODCIAggregateIterate and ODCIAggregateTerminate in the first definition function, thereby obtaining the final calculation result.

[0101] S204: Output the final calculation result.

[0102] In this embodiment, after the final calculation result is obtained, a calculation response for the target data set is formed based on the final calculation result and output to the operation interface where the database administrator is located, so that the database administrator can know the final calculation result through the operation interface.

[0103] In the data calculation method provided by the embodiment of the present application, since the first database and the second database have different function creation rules, a first definition function is obtained in advance according to the function creation rule of the first database, and the calculation operation is triggered for the target data set in the second database by using the function, so the database device of the second database responds to the first definition function, and by obtaining the pre-stored second function, the first definition function can be parsed according to the second function, and the parsed first definition function name, the first input parameter for representing the target data of each iterative calculation, and the first object for representing the accumulated calculation state can be inserted into the second function to obtain the second definition function, so as to obtain the second definition function, and then by using the second definition function to calculate the target data set, the final calculation result can be successfully obtained and output, so that the database administrator can use the corresponding function to perform calculation operations on the data in other databases based on mastering the function creation rules of a certain database, thereby reducing the learning cost and workload, thereby improving the efficiency of data calculation and improving the compatibility between different databases.

[0104] As an optional embodiment, based on the above embodiment, this embodiment further refines the parsing of the first defined function according to the second function. When the first defined function is parsed according to the second function, this embodiment specifically includes the following steps:

[0105] According to the position to be embedded in the second function, in the first definition function, search for content having a mapping relationship with the position to be embedded to obtain the first definition function name, the first input parameter and the first object.

[0106] The position to be embedded is a specific position to be inserted in the second function.

[0107] In this embodiment, the database administrator may reserve a position to be embedded for the first defined function name, the first input parameter, and the first object in the second function in advance, and establish a mapping relationship between the corresponding position to be embedded and the first defined function name, the first input parameter, and the first object, respectively. Then, in response to parsing the first defined function according to the second function, the position to be embedded in the second function is obtained, and according to the above mapping relationship, the content having a mapping relationship with the corresponding position to be embedded is searched in the first defined function, so as to obtain the first defined function name, the first input parameter, and the first object, thereby completing the parsing of the first defined function.

[0108] The data calculation method provided in the embodiment of the present application has reserved a position to be embedded in the second function in advance. Therefore, by searching for content with a mapping relationship with the position to be embedded in the first defined function according to the position to be embedded in the second function, the first defined function name, the first input parameter and the first object can be successfully obtained, thereby improving the accuracy of the parsing result.

[0109] As an optional embodiment, based on the above embodiment, this embodiment further refines the content included in the second definition function and the use of the second definition function to calculate the target data set to obtain the final calculation result. In this embodiment, the second definition function includes: an iterative sub-function name and a final sub-function name. When the second definition function is used to calculate the target data set to obtain the final calculation result, the following steps are specifically included:

[0110] Step a1: Obtain the iterative subfunction and the final subfunction according to the iterative subfunction name and the final subfunction name.

[0111] In this embodiment, the second definition function includes an iterative sub-function name and a final sub-function name. The iterative sub-function name is the name of the iterative sub-function, which is a sub-function in the custom aggregation function that implements iterative calculation. The final sub-function name is the name of the final sub-function, which is a sub-function in the custom aggregation function that implements final calculation.

[0112] Specifically, the database administrator may create an iterative sub-function based on the first definition function in advance, and create a final sub-function based on the first definition function, and then establish an association between the iterative sub-function and the position where the iterative sub-function name is located in the second definition function, and establish an association between the final sub-function and the position where the final sub-function name is located in the second definition function. Then, in response to using the second definition function to calculate the target data set to obtain the final calculation result, according to the iterative sub-function name in the second definition function, the iterative sub-function associated with it is obtained, and according to the final sub-function name in the second definition function, the final sub-function associated with it is obtained.

[0113] It should be noted that, based on the example in S202, the database administrator may create the following iterator function based on the first definition function mentioned in the example:

[0114] CREATE OR REPLACE FUNCTION 'Iterator function name' (***, ***) RETURNS 'The first object after calculation' as

[0115] BEGIN

[0116] IF $1 IS NULL THEN

[0117] PERFORM ***.ODCIAggregateInitialize($1);

[0118] END IF;

[0119] PERFORM $1.ODCIAggregateIterate($2);

[0120] RETURN $1;

[0121] END

[0122] And create the following final subfunction:

[0123] CREATE OR REPLACE FUNCTION 'final sub-function name' (***) RETURNS 'final calculation result' as

[0124] DECLARE

[0125] returnValue 'final calculation result;

[0126] BEGIN

[0127] PERFORM $1.ODCIAggregateTerminate(returnValue,0);

[0128] RETURN returnValue;

[0129] END

[0130] It can be understood that the above *** is the specific insertion position in the iterative sub-function and the final sub-function.

[0131] Furthermore, in the second definition function,

[0132] CREATE OR REPLACE AGGREGATE 'first defined function name' ('first input parameter') (

[0134] stype = 'First object',

[0135] sfunc = 'Iterator function name',

[0136] finalfunc = 'Final sub-function name' )

[0138] Based on this, by determining the iterative sub-function name in the second definition function, the iterative sub-function associated therewith can be obtained, and by determining the final sub-function name in the second definition function, the final sub-function associated therewith can be obtained.

[0139] Step a2: Using the first input parameter and the first object as input parameters of the iterative sub-function to obtain an iterative definition sub-function, and performing iterative calculation based on the iterative definition sub-function to obtain the calculated first object.

[0140] In this embodiment, after obtaining the iterative sub-function and the final sub-function, the obtained first input parameter and the first object are used as input parameters of the iterative sub-function, that is, the first input parameter and the first object are inserted into the positions corresponding to the input parameters and the object types in the iterative sub-function to obtain the iterative definition sub-function, and then based on the iterative definition sub-function, the target data in the target data set are iteratively calculated to obtain the calculated first object.

[0141] It should be noted that, based on the example in step a1, the iterative definition subfunction obtained is:

[0142] CREATE OR REPLACE FUNCTION 'iterator function name'('first object','first input parameter') RETURNS 'first object after calculation' as

[0143] BEGIN

[0144] IF $1 IS NULL THEN

[0145] PERFORM 'first object'.ODCIAggregateInitialize($1);

[0146] END IF;

[0147] PERFORM $1.ODCIAggregateIterate($2);

[0148] RETURN $1;

[0149] END

[0150] It can be understood that based on the above iterative definition sub-function, the 'calculated first object' can be returned.

[0151] Step a3: Using the calculated first object as an input parameter of the final sub-function to obtain a final definition sub-function, and outputting a final calculation result of the target data set based on the final definition sub-function.

[0152] In this embodiment, after obtaining the calculated first object, it is used as the input parameter of the final sub-function, that is, the calculated first object is inserted into the corresponding position in the final sub-function to obtain the final defined sub-function, thereby obtaining the final calculation result of the target data set based on the final defined sub-function.

[0153] It should be noted that based on the example in step a1, the final defined sub-function is:

[0154] CREATE OR REPLACE FUNCTION 'final sub-function name' ('first object') RETURNS 'final calculation result' as

[0155] DECLARE

[0156] returnValue 'final calculation result';

[0157] BEGIN

[0158] PERFORM $1.ODCIAggregateTerminate(returnValue,0);

[0159] RETURN returnValue;

[0160] END

[0161] It can be understood that based on the above-mentioned final definition sub-function, the 'final calculation result' after calculation can be returned.

[0162] In the data calculation method provided by the embodiment of the present application, since the second definition function includes the iterative sub-function name and the final sub-function name, and the iterative sub-function and the final sub-function are created in advance based on the first definition function, the iterative sub-function and the final sub-function can be obtained according to the iterative sub-function name and the final sub-function name, and the first input parameter and the first object can be used as the input parameters of the iterative sub-function to obtain the iterative definition sub-function, thereby performing iterative calculation based on the iterative definition sub-function to obtain the calculated first object. The calculated first object can be used as the input parameter of the final sub-function to obtain the final definition sub-function, thereby outputting the final calculation result of the target data set based on the final definition sub-function, thereby calling the iterative calculation algorithm and the final calculation algorithm in the first definition function through the function name, thereby improving the efficiency of data calculation.

[0163] As an optional embodiment, based on the above embodiment, after the first input parameter and the first object are used as input parameters of the iterator function, this embodiment further includes the following steps:

[0164] Step b1: Determine whether the object instance of the first object is empty.

[0165] The object instance is the specific content represented by the first object.

[0166] It is understandable that if the object instance of the first object is empty, it means that it has not been initialized and needs to assign values ​​to parameters based on the initialization method. Based on this, the object instance of the first object is obtained and it is queried whether it contains actual fields. If it does, it is not empty, and if it does not, it is empty.

[0167] Step b2: If yes, then based on the second link included in the iterative definition sub-function, call the initialization method in the first definition function to initialize the first object to obtain an object instance of the first object.

[0168] The second link is a link associated with the initialization process in the first definition function, that is, the link connected to ODCIAggregateInitialize in step a1.

[0169] In this embodiment, if the object instance is empty, it means that it has not been initialized, then based on the second link contained in the iterative definition subfunction, it is connected to ODCIAggregateInitialize in the first definition function, and the initialization method is called based on the ODCIAggregate interface, so that the first object is initialized using the above initialization method to obtain the object instance of the first object. The initialization method is a specific strategy or logic for executing initialization.

[0170] The data calculation method provided in the embodiment of the present application needs to ensure that the object instance of the first object is not empty. Therefore, by judging whether the object instance of the first object is empty, when it is determined to be empty, based on the second link included in the iterative definition subfunction, the initialization method in the first definition function is called to initialize the first object and obtain the object instance of the first object, so that the subsequent iterative calculation process can be smoothly executed, thereby improving the success rate of data calculation.

[0171] As an optional embodiment, based on the above embodiment, this embodiment further refines the iterative calculation based on the iterative definition sub-function to obtain the calculated first object. When the iterative calculation is performed based on the iterative definition sub-function to obtain the calculated first object, this embodiment specifically includes the following steps:

[0172] Step c1: Based on the first link included in the iterative definition sub-function, call the iterative calculation method in the first definition function.

[0173] In this embodiment, based on the result that the object instance of the first object is not empty, in response to performing iterative calculation based on the iterative definition sub-function to obtain the calculated first object, the iterative calculation method in the first definition function is called based on the first link included in the iterative definition sub-function. The first link is a link associated with the iterative calculation process in the first definition function, that is, the link connected to ODCIAggregateIterate in step a1.

[0174] Specifically, based on the first link included in the iteration definition sub-function, it is connected to ODCIAggregateIterate in the first definition function, and the iterative calculation method is called based on the ODCIAggregate interface. The iterative calculation method is a specific strategy or logic for performing iterative calculation.

[0175] Step c2: adopting an iterative calculation method, using the object instance of the first object to process each input target data one by one, and in each processing, updating the calculation state reflected by the object instance of the first object.

[0176] In this embodiment, based on the result of calling the iterative calculation method, the iterative calculation method is adopted, and the object instance of the first object is used to process the input target data to obtain the iterative calculation result of this time, and based on the above calculation process and the above iterative calculation result, the calculation state reflected by the object instance of the first object is updated. Further, the next input target data is processed to obtain the next iterative calculation result, and based on this calculation process and this iterative calculation result, the calculation state reflected by the object instance of the first object is updated again, and so on, until all target data are traversed.

[0177] Step c3: In response to the termination of the iteration, the calculated first object is obtained based on the object instance of the first object currently being updated.

[0178] In this embodiment, in response to the termination of the iteration, indicating that the traversal has ended, the calculated first object is obtained based on the object instance of the first object currently being updated.

[0179] The data calculation method provided in the embodiment of the present application, since the iterative definition sub-function contains an iterative calculation method linked to the first definition function, the iterative calculation method in the first definition function can be called based on the first link contained in the iterative definition sub-function, and by adopting the iterative calculation method, each input target data is processed one by one using the object instance of the first object, and the calculation state reflected by the object instance of the first object can be updated in each processing, so that when the iteration terminates, the calculated first object can be successfully obtained based on the currently updated object instance of the first object, thereby obtaining an accurate calculated first object and improving the success rate of obtaining the calculated first object.

[0180] As an optional embodiment, this embodiment further refines the final calculation result of outputting the target data set based on the final definition sub-function on the basis of the above embodiment. When outputting the final calculation result of the target data set based on the final definition sub-function, this embodiment specifically includes the following steps:

[0181] Step d1: Based on the link contained in the final definition sub-function, call the final calculation method in the first definition function.

[0182] Specifically, based on the link contained in the final definition sub-function, that is, the link associated with the final calculation process in the first definition function, connect to ODCIAggregateTerminate in the first definition function, and call the final calculation method based on the ODCIAggregate interface. The final calculation method is a specific strategy or logic for executing the final calculation.

[0183] Step d2: adopting the final calculation method, obtaining the calculation value of each processing according to the object instance of the first object currently updated, and performing a final calculation on each calculation value to obtain a final calculation result.

[0184] In this embodiment, based on the result of calling the final calculation method, the final calculation method is used to obtain the calculation value of each processing in the iterative calculation in the object instance of the first object currently being updated, and the final calculation is performed on each calculation value to obtain the final calculation result.

[0185] The data calculation method provided in the embodiment of the present application, since the final definition sub-function contains a link to the final calculation method in the first definition function, the final calculation method can be used to call the final calculation method in the first definition function based on the link contained in the final definition sub-function, and the calculation value of each processing can be obtained according to the object instance of the first object currently updated, so as to perform a final calculation on each calculation value and obtain the final calculation result, thereby obtaining an accurate final calculation result and improving the success rate of obtaining the final calculation result.

[0186] As an optional embodiment, based on any of the above embodiments, after parsing the first definition function according to the second function, this embodiment further includes the following steps:

[0187] A strong association relationship is established between the first definition function name and the iterative sub-function name, and between the first definition function name and the final sub-function name.

[0188] It is understandable that when the database administrator no longer needs to use the function creation rules of the first database to process the data in the second database, it is necessary to perform a deletion operation on the obtained first definition function, iterative sub-function and final sub-function.

[0189] In order to successfully locate the content to be deleted, in this embodiment, the first definition function name, the iterative sub-function name and the final sub-function name are obtained, and a strong association relationship is established between the first definition function name and the iterative sub-function name, and between the first definition function name and the final sub-function name.

[0190] Accordingly, the method further comprises:

[0191] Step e1: receiving a deletion instruction; the deletion instruction includes the first defined function name.

[0192] The deletion instruction is an instruction for instructing the second database to execute a deletion operation, and specifically includes the first defined function name.

[0193] Specifically, the database administrator may trigger a deletion operation based on the corresponding terminal, and then the database device corresponding to the second database obtains the first defined function name in response to receiving the deletion instruction.

[0194] Step e2: Deleting the first definition function corresponding to the first definition function name, and the iterative definition sub-function and final definition sub-function that have a strong association relationship with the first definition function name.

[0195] In this embodiment, based on the strong association relationship established in advance between the first definition function name, and the iterative definition subfunction and the final definition subfunction, after obtaining the deletion instruction containing the first definition function name, the deletion processing is performed on the first definition function, and the iterative definition subfunction and the final definition subfunction that have a strong association relationship with the first definition function name.

[0196] The data calculation method provided in the embodiment of the present application has previously established strong associations between the first definition function name and the iterative sub-function name, as well as between the first definition function name and the final sub-function name. Therefore, by subsequently receiving a deletion instruction including the first definition function name, the first definition function corresponding to the first definition function name, as well as the iterative definition sub-function and the final definition sub-function that have a strong association with the first definition function name can be deleted. Thus, all functions involved can be deleted to avoid omissions and improve the efficiency and accuracy of deletion.

[0197] Figure 3 Schematic diagram of the data calculation process provided for this application Figure 2 ,like Figure 3 As shown, in this embodiment Figure 2 Based on the embodiment, the data calculation method is described in detail, and the method includes:

[0198] S301: In response to a first defined function for a target data set, obtain a pre-stored second function. The first defined function is defined according to a function creation rule of a first database.

[0199] S302: According to the position to be embedded in the second function, in the first definition function, search for content having a mapping relationship with the position to be embedded to obtain the first definition function name, the first input parameter and the first object.

[0200] S303, inserting the first definition function name, the first input parameter and the first object into the second function to obtain a second definition function. The first input parameter is used to represent the target data of each iterative calculation, and the first object is used to represent the accumulated calculation state. The second definition function includes: an iterative sub-function name and a final sub-function name.

[0201] S304: Establish strong association relationships between the first definition function name and the iterative sub-function name, and between the first definition function name and the final sub-function name.

[0202] S305. Obtain the iterative subfunction and the final subfunction according to the iterative subfunction name and the final subfunction name.

[0203] S306: Use the first input parameter and the first object as input parameters of the iterative sub-function to obtain an iterative definition sub-function.

[0204] S307: Determine whether the object instance of the first object is empty. If yes, execute S308; if no, directly execute S309.

[0205] S308: Based on the second link included in the iterative definition sub-function, call the initialization method in the first definition function to initialize the first object to obtain an object instance of the first object.

[0206] S309: Based on the first link included in the iterative definition sub-function, call the iterative calculation method in the first definition function.

[0207] S310: Adopt an iterative calculation method and use the object instance of the first object to process each input target data one by one.

[0208] S311. In each processing, update the computing state reflected by the object instance of the first object.

[0209] S312: In response to termination of iteration, obtain the calculated first object based on the object instance of the first object currently being updated.

[0210] S313: Use the calculated first object as an input parameter of the final sub-function to obtain a final defined sub-function.

[0211] S314: Based on the link included in the final definition sub-function, call the final calculation method in the first definition function.

[0212] S315: adopt the final calculation method to obtain the calculation value of each processing according to the object instance of the first object currently updated.

[0213] S316: Perform final calculation on each calculated value to obtain a final calculation result.

[0214] S317. Output the final calculation result.

[0215] S318: Receive a deletion instruction, wherein the deletion instruction includes the first defined function name.

[0216] S319: Deleting the first definition function corresponding to the first definition function name, and the iterative definition sub-function and the final definition sub-function that have a strong association relationship with the first definition function name.

[0217] Figure 4 A schematic diagram of the structure of the data computing device provided in this application, such as Figure 4 As shown, the data computing device 40 provided in this embodiment includes: an acquisition module 41, a parsing module 42, an insertion module 43, a computing module 44, and an output module 45.

[0218] Among them, the acquisition module 41 is used to obtain the pre-stored second function in response to the first definition function for the target data set; the first definition function is defined according to the function creation rule of the first database; the parsing module 42 is used to parse the first definition function according to the second function; the insertion module 43 is used to insert the parsed first definition function name, the first input parameter and the first object into the second function to obtain the second definition function; the first input parameter is used to represent the target data of each iterative calculation, and the first object is used to represent the accumulated calculation state; the calculation module 44 is used to use the second definition function to calculate the target data set to obtain the final calculation result; the output module 45 is used to output the final calculation result.

[0219] Optionally, the parsing module 42, when parsing the first defined function according to the second function, is specifically configured to:

[0220] According to the position to be embedded in the second function, in the first definition function, search for content having a mapping relationship with the position to be embedded to obtain the first definition function name, the first input parameter and the first object.

[0221] Optionally, the second definition function includes: an iterative sub-function name and a final sub-function name;

[0222] Accordingly, when the calculation module 44 calculates the target data set using the second definition function to obtain the final calculation result, it is specifically used to:

[0223] According to the iterative subfunction name and the final subfunction name, the iterative subfunction and the final subfunction are obtained; the first input parameter and the first object are used as input parameters of the iterative subfunction to obtain the iterative definition subfunction, and iterative calculation is performed based on the iterative definition subfunction to obtain the calculated first object; the calculated first object is used as the input parameter of the final subfunction to obtain the final definition subfunction, and the final calculation result of the target data set is output based on the final definition subfunction.

[0224] Optionally, the data computing device further includes: a judgment module, a calling module;

[0225] Among them, the judgment module is used to judge whether the object instance of the first object is empty after the calculation module 44 uses the first input parameter and the first object as input parameters of the iterative sub-function; the calling module is used to, if so, call the initialization method in the first definition function based on the second link contained in the iterative definition sub-function to initialize the first object to obtain the object instance of the first object.

[0226] Optionally, the calculation module 44, when performing iterative calculation based on the iterative definition sub-function to obtain the calculated first object, is specifically configured to:

[0227] Based on the first link contained in the iterative definition sub-function, the iterative calculation method in the first definition function is called; using the iterative calculation method, each input target data is processed one by one using the object instance of the first object, and in each processing, the calculation state reflected by the object instance of the first object is updated; in response to the termination of the iteration, the calculated first object is obtained based on the currently updated object instance of the first object.

[0228] Optionally, the calculation module 44, when outputting the final calculation result of the target data set based on the final defined sub-function, is specifically used to:

[0229] Based on the link contained in the final definition sub-function, the final calculation method in the first definition function is called; using the final calculation method, the calculation value of each processing is obtained according to the object instance of the first object currently updated, and the final calculation is performed on each calculation value to obtain the final calculation result.

[0230] Optionally, the data computing device further includes: a construction module, a receiving module, and a processing module;

[0231] Among them, the construction module is used to build a strong association relationship between the first definition function name and the iterative sub-function name, and between the first definition function name and the final sub-function name, respectively, after the parsing module 42 parses the first definition function according to the second function; the receiving module is used to receive a deletion instruction; the deletion instruction includes the first definition function name; the processing module is used to perform deletion processing on the first definition function corresponding to the first definition function name, as well as the iterative definition sub-function and the final definition sub-function that have a strong association relationship with the first definition function name.

[0232] The data computing device provided in this embodiment can execute the method provided in the above method embodiment. Its implementation principle and technical effect are similar, and this embodiment will not be described in detail here.

[0233] Figure 5 This is a schematic diagram of the structure of the electronic device provided in this application. Figure 5 As shown, the electronic device 50 provided in this embodiment includes: at least one processor 51 and a memory 52. ​​Optionally, the device 5 also includes a communication component 53. The processor 51, the memory 52 and the communication component 53 are connected via a bus 54.

[0234] In a specific implementation process, at least one processor 51 executes the computer-executable instructions stored in the memory 52, so that at least one processor 51 executes the above method.

[0235] The specific implementation process of the processor 51 can be found in the above method embodiment, and its implementation principle and technical effect are similar, so this embodiment will not be repeated here.

[0236] In the above embodiments, it should be understood that the processor can be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. A general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in the invention can be directly implemented as a hardware processor, or can be implemented by a combination of hardware and software modules in the processor.

[0237] The memory may include a high-speed memory (Random Access Memory, RAM), and may also include a non-volatile memory (NVM), such as at least one disk storage.

[0238] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the bus in the drawings of this application is not limited to only one bus or one type of bus.

[0239] The present application also provides a computer program product, including a computer program, which implements the above method when executed by a processor.

[0240] The present application also provides a computer-readable storage medium, in which computer-executable instructions are stored. When a processor executes the computer-executable instructions, the above method is implemented.

[0241] The above-mentioned readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk. The readable storage medium can be any available medium that can be accessed by a general or special-purpose computer.

[0242] An exemplary readable storage medium is coupled to a processor so that the processor can read information from the readable storage medium and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can be located in an application specific integrated circuit (Application Specific Integrated Circuits, referred to as: ASIC). Of course, the processor and the readable storage medium can also exist in the device as discrete components.

[0243] The division of units is only a logical function division, and there may be other divisions in actual implementation, such as multiple units or components can be combined or integrated into another system, 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 interface, device or unit, which can be electrical, mechanical or other forms.

[0244] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0245] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0246] If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods of each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.

[0247] Those skilled in the art can understand that all or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned storage medium includes: ROM, RAM, disk or optical disk and other media that can store program codes.

[0248] Finally, it should be noted that those skilled in the art will readily conceive of other embodiments of the present invention after considering the specification and practicing the invention disclosed herein. The present invention is intended to cover any variations, uses or adaptations of the present invention, which follow the general principles of the present invention and include common knowledge or customary technical means in the art not disclosed by the present invention, are not limited to the precise structure described above and shown in the drawings, and may be modified and changed in various ways without departing from the scope thereof. The scope of the present invention is limited only by the appended claims.

Claims

1. A data calculation method, characterized in that: The function creation rules of the first database and the second database are different, and the method is applied to a database device of the second database, and the method includes: In response to a first defined function for a target data set, obtaining a pre-stored second function; the first defined function is defined according to a function creation rule of a first database; Parsing the first definition function according to the second function, and inserting the parsed first definition function name, first input parameter and first object into the second function to obtain the second definition function; the first input parameter is used to represent the target data of each iterative calculation, and the first object is used to represent the accumulated calculation state; Using the second definition function to calculate the target data set to obtain a final calculation result; The final calculation result is output.

2. The method according to claim 1, characterized in that The parsing of the first definition function according to the second function includes: According to the position to be embedded in the second function, in the first definition function, search for content having a mapping relationship with the position to be embedded to obtain a first definition function name, a first input parameter and a first object.

3. The method according to claim 2, characterized in that The second definition function includes: an iterative sub-function name and a final sub-function name; The using the second defined function to calculate the target data set to obtain a final calculation result includes: According to the iterative sub-function name and the final sub-function name, obtain the iterative sub-function and the final sub-function; Using the first input parameter and the first object as input parameters of the iterative sub-function to obtain an iterative definition sub-function, and performing iterative calculation based on the iterative definition sub-function to obtain a calculated first object; The calculated first object is used as an input parameter of the final sub-function to obtain a final definition sub-function, and a final calculation result of the target data set is output based on the final definition sub-function.

4. The method according to claim 3, characterized in that After taking the first input parameter and the first object as input parameters of the iterator function, the method further includes: Determine whether the object instance of the first object is empty; If so, based on the second link included in the iterative definition sub-function, the initialization method in the first definition function is called to initialize the first object to obtain an object instance of the first object.

5. The method according to claim 4, characterized in that The iterative calculation is performed based on the iterative definition sub-function to obtain a calculated first object, including: Based on the first link included in the iterative definition sub-function, calling the iterative calculation method in the first definition function; Adopting the iterative calculation method, using the object instance of the first object to process each input target data one by one, and in each processing, updating the calculation state reflected by the object instance of the first object; In response to the termination of the iteration, a calculated first object is obtained based on the object instance of the currently updated first object.

6. The method according to claim 5, characterized in that Outputting the final calculation result of the target data set based on the final defined sub-function includes: Based on the link contained in the final definition sub-function, calling the final calculation method in the first definition function; The final calculation method is adopted to obtain the calculation value of each processing according to the object instance of the first object currently updated, and the final calculation is performed on each calculation value to obtain the final calculation result.

7. The method according to any one of claims 1 to 6, characterized in that: After parsing the first definition function according to the second function, the method further includes: Establishing strong association relationships between the first definition function name and the iterative sub-function name, and between the first definition function name and the final sub-function name, respectively; The method further comprises: receiving a deletion instruction; the deletion instruction including the first defined function name; A deletion process is performed on the first definition function corresponding to the first definition function name, and the iterative definition sub-function and the final definition sub-function having a strong association relationship with the first definition function name.

8. An electronic device, characterized in that: include: Memory, processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory, so that the processor performs the method according to any one of claims 1 to 7.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 7 when executed by a processor.

10. A computer program product, characterized in that The invention comprises a computer program, which implements the method according to any one of claims 1 to 7 when being executed by a processor.