Function conversion method, system, electronic device and computer readable storage medium

By obtaining the function specification difference information to determine the conversion rules, converting the table functions of the office environment into python functions of the development environment, solving the problem of communication difficulties in office and development environments and improving collaborative processing efficiency.

CN115268843BActive Publication Date: 2025-05-23BEIJING ZHONGXINJIA SCI-TECH DEV CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210904943.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-29
Publication Date
2025-05-23
Estimated Expiration
2042-07-29

AI Technical Summary

Technical Problem

In office environment and development environment, due to the differences in function specifications, office personnel and R&D personnel have difficulty in communicating when co-processing business, and the efficiency of collaborative processing is inefficient.

Method used

By obtaining the function specification difference information between the office environment and the development environment, determining the conversion rules, converting the conditional expressions and result expressions in the table function into relational statements and result statements corresponding to the development environment, realizing the automatic conversion of the Excel table function to the Python function.

Benefits of technology

It solves the problem of inefficient collaborative processing of personnel in office environments and development environments, realizes automatic conversion of excel table functions to python functions, and improves the efficiency of collaborative processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115268843B_ABST
    Figure CN115268843B_ABST
Patent Text Reader

Abstract

The present invention provides a function conversion method, system, electronic device and computer-readable storage medium, which relate to the field of computer application development. The method uses conversion rules determined by function specification difference information used in an office environment and a development environment to convert conditional expressions in a table function into relational statements corresponding to the development environment; at the same time, the result expression in the table function can be converted into a result statement corresponding to the development environment, thereby realizing automatic conversion of Excel table functions into Python functions, and solving the problem of low efficiency in collaborative processing problems existing when personnel of both parties perform business processing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer application development, and in particular to a function conversion method, system, electronic equipment and computer-readable storage medium. Background Art

[0002] In the process of application development and use, R&D personnel for the development and use ends are usually involved. Specifically, in daily work, some users use relevant office software to develop or write business in an office environment, while some users use relevant development tools to develop applications in the corresponding development environment. In the process of these two groups of users handling some business at the same time, it is necessary for the staff in the office environment to work together with the R&D personnel in the development environment. Due to the different nature of the work, the two have difficulty in communication due to the differences in business and usage environment when working together. For example, the staff in the office environment only know how to use Excel functions, while the R&D personnel only know how to use Python related functions. When these two groups of people work together to solve problems, they need to convert the functions they use. Once there is a lack of staff who are familiar with functions in different environments, it will lead to communication difficulties between the two parties and low efficiency in solving problems together. Summary of the invention

[0003] In view of this, the purpose of the present invention is to provide a function conversion method, system, electronic device and computer-readable storage medium. The method uses the conversion rules determined by the function specification difference information used in the office environment and the development environment to convert the conditional expression in the table function into a relational statement corresponding to the development environment; at the same time, it can convert the result expression in the table function into a result statement corresponding to the development environment, thereby realizing the automatic conversion of the Excel table function into the Python function, solving the problem of inefficient collaborative processing problems existing when the personnel of both parties perform business processing.

[0004] In a first aspect, an embodiment of the present invention provides a function conversion method, the method comprising:

[0005] After receiving a conversion instruction for a table function, a table function is obtained; wherein the table function at least includes: a conditional expression and a result expression; and the table function is suitable for running in an office environment;

[0006] Obtaining a conversion rule corresponding to the development environment; wherein the conversion rule is determined based on function specification difference information between a first function specification in the office environment and a second function specification in the development environment; the first function specification includes an Excel function specification; the second function specification includes a Python function specification; the conversion rule is used to convert a conditional expression in a table function into a relational statement corresponding to the development environment; and is also used to convert a result expression in a table function into a result statement corresponding to the development environment;

[0007] The table function is converted into a target function according to a conversion rule; wherein the target function is suitable for running in a development environment.

[0008] In one embodiment, after obtaining the conversion rules corresponding to the development environment, the method further includes:

[0009] According to the conversion rules, determine the configuration data corresponding to the development environment;

[0010] Convert the configuration data into environment variable statements corresponding to the development environment, and load the environment variable statements into the development environment.

[0011] In one embodiment, when the first function specification and the second function specification respectively include logic function specifications, and the function specification difference information includes a logic function, the step of converting the table function into the target function according to the conversion rule includes:

[0012] According to the definition of the logic function, the logic condition contained in the conditional expression is determined; wherein the logic condition at least includes: whether the relationship condition and the and or relationship condition;

[0013] By using logical conditions, the conditional expression and result expression that meet the first function specification are converted into relational statements and result statements that meet the second function specification, respectively, and the target function is determined according to the relational statements and result statements.

[0014] In one embodiment, when the first function specification and the second function specification respectively include text function specifications, and the function specification difference information includes a text function, the step of converting the table function into the target function according to the conversion rule includes:

[0015] According to the definition of the text function, determine the text acquisition condition contained in the conditional expression; wherein the text acquisition condition at least includes: text interception condition, text search condition and text search condition;

[0016] By using the text to obtain conditions, the conditional expression and the result expression that meet the first function specification are converted into the relational statement and the result statement that meet the second function specification respectively, and the target function is determined according to the relational statement and the result statement.

[0017] In one embodiment, when the first function specification and the second function specification respectively include a query reference function specification, and the function specification difference information includes a query reference function, the step of converting the table function into the target function according to the conversion rule includes:

[0018] According to the definition of the query reference function, the query reference condition contained in the conditional expression is determined; wherein the query reference condition at least includes: a cell query condition and a cell function reference condition;

[0019] By using the query reference condition, the condition expression and result expression that meet the first function specification are converted into the relation statement and result statement that meet the second function specification respectively, and the target function is determined according to the relation statement and result statement.

[0020] In one embodiment, when the first function specification and the second function specification respectively include mathematical function specifications, and the function specification difference information includes a mathematical function, the step of converting the table function into the target function according to the conversion rule includes:

[0021] According to the definition of the mathematical function, determine the mathematical calculation conditions contained in the conditional expression; wherein the mathematical calculation conditions at least include: a summation operation condition and a trigonometric function operation condition;

[0022] By using mathematical calculation conditions, the conditional expression and result expression that meet the first function specification are converted into relational statements and result statements that meet the second function specification, respectively, and the objective function is determined according to the relational statements and result statements.

[0023] In one embodiment, when the first function specification and the second function specification respectively include statistical function specifications, and the function specification difference information includes a statistical function, the step of converting the tabular function into the target function according to the conversion rule includes:

[0024] According to the definition of the statistical function, the statistical conditions contained in the conditional expression are determined; wherein the statistical conditions at least include: average value statistical conditions, extreme value statistical conditions and count statistical conditions;

[0025] By using statistical conditions, the conditional expression and the result expression that meet the first function specification are respectively converted into the relational statement and the result statement that meet the second function specification, and the objective function is determined according to the relational statement and the result statement.

[0026] In a second aspect, an embodiment of the present invention further provides a function conversion system, the system comprising:

[0027] A function acquisition module, used for acquiring a table function after receiving a conversion instruction for the table function; wherein the table function at least includes: a conditional expression and a result expression; the table function is suitable for running in an office environment;

[0028] A function conversion rule determination module is used to obtain a conversion rule corresponding to a development environment; wherein the conversion rule is determined based on function specification difference information between a first function specification in an office environment and a second function specification in a development environment; the first function specification includes an Excel function specification; the second function specification includes a Python function specification; the conversion rule is used to convert a conditional expression in a table function into a relational statement corresponding to the development environment; and is also used to convert a result expression in a table function into a result statement corresponding to the development environment;

[0029] The function conversion execution module is used to convert the table function into a target function according to the conversion rule; wherein the target function is suitable for running in the development environment.

[0030] In a third aspect, an embodiment of the present invention further provides an electronic device, including a processor and a memory, wherein the memory stores computer executable instructions that can be executed by the processor, and the processor executes the computer executable instructions to implement any one of the function conversion methods provided in the first aspect.

[0031] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, which stores computer-executable instructions. When the computer-executable instructions are called and executed by a processor, the computer-executable instructions prompt the processor to implement any one of the function conversion methods provided in the first aspect.

[0032] The embodiment of the present invention provides a function conversion method, system, electronic device and computer-readable storage medium. After receiving a conversion instruction for a table function, the method obtains a table function; wherein the table function at least includes: a conditional expression and a result expression; the table function is suitable for running in an office environment; then obtains a conversion rule corresponding to the development environment; wherein the conversion rule is determined according to the function specification difference information between the first function specification in the office environment and the second function specification in the development environment; the first function specification includes an excel function specification; the second function specification includes a python function specification; the conversion rule is used to convert the conditional expression in the table function into a relational statement corresponding to the development environment; and is also used to convert the result expression in the table function into a result statement corresponding to the development environment; finally, the table function is converted into a target function according to the conversion rule; wherein the target function is suitable for running in the development environment. The method uses the conversion rule determined by the function specification difference information used in the office environment and the development environment to convert the conditional expression in the table function into a relational statement corresponding to the development environment; and at the same time, it can convert the result expression in the table function into a result statement corresponding to the development environment, thereby realizing the automatic conversion of the excel table function into a python function, solving the problem of low efficiency of collaborative processing problems existing in business processing between personnel of both parties.

[0033] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or understood by practicing the present invention. The purpose and other advantages of the present invention are realized and obtained by the structures particularly pointed out in the description, claims and drawings.

[0034] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0036] Figure 1 A flow chart of a function conversion method provided by an embodiment of the present invention;

[0037] Figure 2 A flow chart after obtaining a conversion rule corresponding to a development environment in a function conversion method provided by an embodiment of the present invention;

[0038] Figure 3 A flowchart of step S103 of processing a logic function in a function conversion method provided by an embodiment of the present invention;

[0039] Figure 4 A flowchart of step S103 of processing a text function in a function conversion method provided by an embodiment of the present invention;

[0040] Figure 5 A flowchart of step S103 of processing a query reference function in a function conversion method provided by an embodiment of the present invention;

[0041] Figure 6 A flowchart of step S103 of processing a mathematical function in a function conversion method provided by an embodiment of the present invention;

[0042] Figure 7 A flowchart of step S103 of processing a statistical function in a function conversion method provided by an embodiment of the present invention;

[0043] Figure 8 A schematic diagram of the structure of a function conversion system provided by an embodiment of the present invention;

[0044] Fig. 9 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention.

[0045] icon:

[0046] 810-function acquisition module; 820-function conversion rule determination module; 830-function conversion execution module;

[0047] 101 - processor; 102 - memory; 103 - bus; 104 - communication interface. DETAILED DESCRIPTION

[0048] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution of the present invention will be clearly and completely described in combination with the embodiments below. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0049] In the process of application development and use, R&D personnel for the development and use ends are usually involved. Specifically, in daily work, some users use relevant office software to develop or write business in an office environment, while some users use relevant development tools to develop applications in the corresponding development environment. In the process of these two groups of users handling some business at the same time, it is necessary for the staff in the office environment to work together with the R&D personnel in the development environment. Due to the different nature of the work, the two have difficulty in communication due to the differences in business and usage environment when working together. For example, the staff in the office environment only know how to use Excel functions, while the R&D personnel only know how to use Python related functions. When these two groups of people work together to solve problems, they need to convert the functions they use. Once there is a lack of staff who are familiar with functions in different environments, it will lead to communication difficulties between the two parties and low efficiency in solving problems together.

[0050] In summary, the existing development process has the problem of low efficiency in collaborative processing when developers in different fields perform business processing. Based on this, the present invention provides a function conversion method, system, electronic device and computer-readable storage medium. The method uses the conversion rules determined by the function specification difference information used in the office environment and the development environment to convert the conditional expression in the table function into a relational statement corresponding to the development environment; at the same time, it can convert the result expression in the table function into a result statement corresponding to the development environment, thereby realizing the automatic conversion of the Excel table function into a Python function, solving the problem of low efficiency in collaborative processing when the personnel of both parties perform business processing.

[0051] To facilitate understanding of this embodiment, a function conversion method disclosed in an embodiment of the present invention is first described in detail. The specific flow chart is as follows: Figure 1 As shown, the method mainly includes the following steps S101 to S103:

[0052] Step S101, after receiving a conversion instruction for a table function, obtain a table function; wherein the table function at least includes: a conditional expression and a result expression; the table function is suitable for running in an office environment.

[0053] Table functions are mainly functions related to table business processing. Generally, table functions are divided into logical functions, text functions, query reference functions, mathematical functions, statistical functions, etc. according to their functions. These functions include at least one conditional expression and a result expression. The conditional expression is the execution condition of the function; the result expression can be understood as the execution result of the function. It is worth mentioning that these table functions are used to run in an office environment, and the business scenarios used in actual scenarios are mainly for office personnel.

[0054] Step S102, obtaining conversion rules corresponding to the development environment; wherein the conversion rules are determined based on function specification difference information between a first function specification in an office environment and a second function specification in a development environment; the first function specification includes an excel function specification; the second function specification includes a python function specification; the conversion rules are used to convert conditional expressions in table functions into relational statements corresponding to the development environment; and are also used to convert result expressions in table functions into result statements corresponding to the development environment.

[0055] In the conversion rule, the input is the Excel function in the office environment, and the output is the Python function in the development environment. Specifically, the conversion rule is determined based on the function specification difference information between the Excel function specification in the office environment and the Python function specification in the development environment. This function specification difference information can be understood as a corresponding relationship. Taking the if statement as an example, the if statement in Excel is a line of statements containing if and brackets; while the if statement in Python is a statement containing if and backspace keys. The difference between the two is mainly reflected in the format; due to the high requirements for spaces and backspaces in Python, the if statement needs to strictly follow its corresponding format, which is not required by the if function in Excel. Since the formats of the if statements in the first function specification corresponding to Excel and the second function specification corresponding to Python are fixed, the conversion rules can be determined through the function specification difference information of the two, so that the conditional expression in the table function can be converted into a relational statement corresponding to the development environment through the conversion rule, and the result expression in the table function can be converted into a result statement corresponding to the development environment.

[0056] Step S103, converting the table function into a target function according to the conversion rule; wherein the target function is suitable for running in a development environment.

[0057] The conversion rules in the above steps are determined according to the function specifications contained in the table function. Therefore, after determining the conversion rules corresponding to the Excel function, the corresponding Python format target function can be determined in the development environment.

[0058] In actual scenarios, table functions can only be obtained by loading the corresponding table file, so the table file can be loaded and parsed by the corresponding table text parser first, and the loading process also requires loading related configuration files and configuration parameters. Specifically, the table file can be loaded into the corresponding cache device or running memory so that the table file can be quickly read and parsed later.

[0059] After the table file is loaded, its built-in table function can be obtained through relevant analysis, and then the conversion rules corresponding to the development environment can be obtained. After the conversion rules are obtained, they need to be saved to facilitate subsequent calls, so they can be set as environment variables. In some embodiments, after obtaining the conversion rules corresponding to the development environment, such as Figure 2 As shown, the method also includes:

[0060] Step S201, determining configuration data corresponding to the development environment according to the conversion rule.

[0061] The conversion rule is a kind of corresponding relationship, and the corresponding results involved can be saved in the form of related arrays, vectors, structures, etc. In these forms, the conversion rules can be saved by setting the corresponding relationship, so as to be configured as corresponding configuration data.

[0062] Step S202: convert the configuration data into an environment variable statement corresponding to the development environment, and load the environment variable statement into the development environment.

[0063] After the configuration data is determined, the environment variables corresponding to the development environment can be used to generate environment variable statements and load them into the development environment. In the subsequent use process, the corresponding configuration data in the statement can be directly called.

[0064] After the conversion rules are determined, the conditional expressions in the table function can be parsed to determine the function form and corresponding parameters of the target function. Then, the table function is semantically converted through the conversion rules to obtain the target function with the same execution effect as the table function.

[0065] In one embodiment, when the first function specification and the second function specification respectively include logic function specifications, and the function specification difference information includes logic functions, step S103 of converting the table function into the target function according to the conversion rule is as follows: Figure 3 As shown, including:

[0066] Step S301, according to the definition of the logic function, determine the logic conditions contained in the conditional expression; wherein the logic conditions at least include: whether the relationship condition, and the and or relationship condition;

[0067] Step S302, using logical conditions, converting the conditional expression and result expression that meet the first function specification into relational statements and result statements that meet the second function specification, respectively, and determining the target function based on the relational statements and result statements.

[0068] The following is an explanation of the distance using the if function. For example, the table function is the if function, the conditional expression is "per capita hourly output < 22", and the result expression is "0,1". The logical condition at this time is: if the per capita hourly output is less than 22, the result is 0; if the per capita hourly output is not less than 22, the result is 1. Therefore, according to the above logical conditions, the relational statements and result statements that meet the second function specification, namely Python, can be determined as follows:

[0069] If average hourly output per person < 22:

[0070] return 0

[0071] else:

[0072] return 0

[0073] After the above relational statements and result statements are determined, they can be encapsulated to obtain the corresponding objective function.

[0074] In actual scenarios, logical conditions contain nested if conditions and AND or OR conditions. For example, the table function is: IF(per capita hourly output <22, 0, IF(per capita hourly output <30, 4+(per capita hourly output - 22) / (30-22)*(10-4), 10)), which contains multiple nested conditional expressions. After the conversion rules, the logical condition can be obtained as follows: if the per capita hourly output is less than 22, the result is 0; if the per capita hourly output is not less than 22 and the per capita hourly output is less than 30, it returns: 4+(per capita hourly output - 22) / (30-22)*(10-4); and if the per capita hourly output is not less than 30, it returns 10. Therefore, according to the above logical conditions, the relational statements and result statements that meet the second function specification, namely Python, can be determined as follows:

[0075]

[0076] It can be seen that when the first function specification and the second function specification respectively include logic function specifications, and the function specification difference information includes logic functions, the above steps can be used to convert the table function into the target function according to the conversion rule. The processes in other related scenarios such as text functions, query reference functions, mathematical functions, and statistical functions are shown below.

[0077] In one embodiment, when the first function specification and the second function specification respectively include text function specifications, and the function specification difference information includes text functions, a step of converting the table function into the target function according to the conversion rule is performed, such as Figure 4 As shown, including:

[0078] Step S401, determining the text acquisition condition contained in the conditional expression according to the definition of the text function; wherein the text acquisition condition at least includes: a text interception condition, a text search condition and a text search condition;

[0079] Step S402, using the text to obtain conditions, converting the conditional expression and result expression that meet the first function specification into a relational statement and a result statement that meet the second function specification, and determining the target function according to the relational statement and the result statement.

[0080] In one embodiment, when the first function specification and the second function specification respectively include a query reference function specification, and the function specification difference information includes a query reference function, a step of converting the table function into the target function according to the conversion rule is performed, such as Figure 5 As shown, including:

[0081] Step S501, determining the query reference condition contained in the conditional expression according to the definition of the query reference function; wherein the query reference condition at least includes: a cell query condition and a cell function reference condition;

[0082] Step S502, using the query reference condition, converts the condition expression and result expression that meet the first function specification into a relation statement and result statement that meet the second function specification, respectively, and determines the target function according to the relation statement and result statement.

[0083] In one embodiment, when the first function specification and the second function specification respectively include mathematical function specifications, and the function specification difference information includes a mathematical function, a step of converting the tabular function into the target function according to the conversion rule is performed, such as Figure 6 As shown, including:

[0084] Step S601, determining the mathematical calculation conditions contained in the conditional expression according to the definition of the mathematical function; wherein the mathematical calculation conditions at least include: a summation operation condition and a trigonometric function operation condition;

[0085] Step S602, using mathematical calculation conditions, converting the conditional expression and result expression that meet the first function specification into a relational statement and result statement that meet the second function specification, and determining the target function according to the relational statement and result statement.

[0086] In one embodiment, when the first function specification and the second function specification respectively include statistical function specifications, and the function specification difference information includes statistical functions, a step of converting the tabular function into the target function according to the conversion rule is performed, such as Figure 7 As shown, including:

[0087] Step S701, according to the definition of the statistical function, determine the statistical conditions contained in the conditional expression; wherein the statistical conditions at least include: average value statistical conditions, extreme value statistical conditions and count statistical conditions;

[0088] Step S702, using statistical conditions, converting the conditional expression and result expression that meet the first function specification into relational statements and result statements that meet the second function specification, respectively, and determining the target function according to the relational statements and result statements.

[0089] The following is a mathematical function SUMIF distance. The SUMIF function in the first function specification sums the data that meets certain conditions. For example, the table function is:

[0090] SUMIFS(#["Write-off fee 1 (200 yuan after 30 days on the job)","Write-off fee 2 (200 yuan after 60 days on the job)","Write-off fee 3 (200 yuan after 90 days on the job)","Write-off fee 4 (200 yuan after 90 days on the job)"]#,#Internal referral table.ID number#==#row.ID number#)

[0091] The corresponding logical conditions are: count the employees who have been on the job for 30 days and have received 200 yuan in expense reimbursement 1, the employees who have been on the job for 60 days and have received 200 yuan in expense reimbursement 2, the employees who have been on the job for 90 days and have received 200 yuan in expense reimbursement 3, and the employees who have been on the job for 90 days and have received 200 yuan in expense reimbursement 4, and output their ID numbers.

[0092] Therefore, according to the above logical conditions, we can determine the relational statements and result statements that meet the second function specification, namely Python, as follows:

[0093]

[0094]

[0095] The above conversion relationship is for the use scenario of mathematical functions. As for other related scenarios such as text functions, query reference functions, statistical functions, etc., the processes are similar to those of mathematical functions and will not be described in detail.

[0096] It can be seen that from the above-mentioned function conversion method provided by the embodiment of the present invention, the method can convert the conditional expression in the table function into a relational statement corresponding to the development environment by utilizing the conversion rules determined by the function specification difference information used in the office environment and the development environment; at the same time, the result expression in the table function can be converted into a result statement corresponding to the development environment, thereby realizing the automatic conversion of the Excel table function into a Python function, and solving the problem of inefficient collaborative processing problems existing between the personnel of both parties when performing business processing.

[0097] For the function conversion method provided in the above embodiment, the embodiment of the present invention provides a function conversion system, such as Figure 8 As shown, the system includes:

[0098] The function acquisition module 810 is used to acquire a table function after receiving a conversion instruction for the table function; wherein the table function at least includes: a conditional expression and a result expression; the table function is suitable for running in an office environment;

[0099] Function conversion rule determination module 820, used to obtain conversion rules corresponding to the development environment; wherein the conversion rules are determined based on function specification difference information between a first function specification in the office environment and a second function specification in the development environment; the first function specification includes an Excel function specification; the second function specification includes a Python function specification; the conversion rules are used to convert a conditional expression in a table function into a relational statement corresponding to the development environment; and also used to convert a result expression in a table function into a result statement corresponding to the development environment;

[0100] The function conversion execution module 830 is used to convert the table function into a target function according to the conversion rule; wherein the target function is suitable for running in a development environment.

[0101] The function conversion system provided by the embodiment of the present invention can convert the conditional expression in the table function into a relational statement corresponding to the development environment by using the conversion rules determined by the function specification difference information used in the office environment and the development environment; at the same time, it can convert the result expression in the table function into a result statement corresponding to the development environment, thereby realizing the automatic conversion of the Excel table function into the Python function, solving the problem of inefficient collaborative processing problems existing when personnel from both parties perform business processing.

[0102] In one embodiment, the function conversion system also includes a loading module, which is used to: determine configuration data corresponding to the development environment according to the conversion rules; convert the configuration data into environment variable statements corresponding to the development environment, and load the environment variable statements into the development environment.

[0103] In one embodiment, when the first function specification and the second function specification respectively include logical function specifications, and the function specification difference information includes a logical function, the function conversion execution module 830 is also used to: determine the logical conditions included in the conditional expression according to the definition of the logical function; wherein the logical conditions include at least: whether the relationship condition, and the and or relationship condition; using the logical conditions, the conditional expression and the result expression that meet the first function specification are converted into the relationship statement and the result statement that meet the second function specification, respectively, and determine the target function according to the relationship statement and the result statement.

[0104] In one embodiment, when the first function specification and the second function specification respectively include text function specifications, and the function specification difference information includes a text function, the function conversion execution module 830 is also used to: determine the text acquisition condition contained in the conditional expression according to the definition of the text function; wherein the text acquisition condition includes at least: text interception condition, text search condition and text search condition; using the text acquisition condition, convert the conditional expression and result expression that meet the first function specification into relational statements and result statements that meet the second function specification, respectively, and determine the target function based on the relational statements and result statements.

[0105] In one embodiment, when the first function specification and the second function specification respectively include query reference function specifications, and the function specification difference information includes a query reference function, the function conversion execution module 830 is also used to: determine the query reference condition contained in the conditional expression according to the definition of the query reference function; wherein the query reference condition includes at least: a cell query condition and a cell function reference condition; using the query reference condition, the conditional expression and result expression that meet the first function specification are respectively converted into a relational statement and a result statement that meet the second function specification, and the target function is determined according to the relational statement and the result statement.

[0106] In one embodiment, when the first function specification and the second function specification respectively include mathematical function specifications, and the function specification difference information includes mathematical functions, the function conversion execution module 830 is also used to: determine the mathematical calculation conditions included in the conditional expression according to the definition of the mathematical function; wherein the mathematical calculation conditions at least include: summation operation conditions, trigonometric function operation conditions; using the mathematical calculation conditions, convert the conditional expression and result expression that meet the first function specification into relational statements and result statements that meet the second function specification, respectively, and determine the target function based on the relational statements and result statements.

[0107] In one embodiment, when the first function specification and the second function specification respectively include statistical function specifications, and the function specification difference information includes statistical functions, the function conversion execution module 830 is also used to: determine the statistical conditions included in the conditional expression according to the definition of the statistical function; wherein the statistical conditions include at least: average value statistical conditions, extreme value statistical conditions and counting statistical conditions; using the statistical conditions, convert the conditional expression and result expression that meet the first function specification into relational statements and result statements that meet the second function specification, respectively, and determine the target function based on the relational statements and result statements.

[0108] The function conversion system provided in the embodiment of the present invention has the same implementation principle and technical effects as those of the aforementioned method embodiment. For the sake of brief description, for matters not mentioned in the system embodiment, reference may be made to the corresponding contents in the aforementioned method embodiment.

[0109] This embodiment also provides an electronic device, which is a structural diagram of the electronic device as shown in Fig. 9 As shown, the device includes a processor 101 and a memory 102; wherein the memory 102 is used to store one or more computer instructions, and the one or more computer instructions are executed by the processor to implement the above-mentioned function conversion method.

[0110] Fig. 9 The server shown further includes a bus 103 and a communication interface 104 , and the processor 101 , the communication interface 104 and the memory 102 are connected via the bus 103 .

[0111] The memory 102 may include a high-speed random access memory (RAM), and may also include a non-volatile memory, such as at least one disk storage. The bus 103 may be an ISA bus, a PCI bus, or an EISA bus. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Fig. 9 Only one bidirectional arrow is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0112] The communication interface 104 is used to connect to at least one user terminal and other network units through a network interface, and send the encapsulated IPv4 message or IPv4 message to the user terminal through the network interface.

[0113] The processor 101 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit or software instructions in the processor 101. The above processor 101 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The disclosed methods, steps and logic block diagrams in the embodiments of the present disclosure can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in conjunction with the embodiments of the present disclosure can be directly embodied as a hardware decoding processor for execution, or a combination of hardware and software modules in the decoding processor for execution. The software module may be located in a storage medium mature in the art, such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 102, and the processor 101 reads the information in the memory 102 and completes the steps of the method of the above embodiment in combination with its hardware.

[0114] An embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the method of the above embodiment are executed.

[0115] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. The system embodiments described above are merely schematic. For example, the division of units is only a logical function division. There may be other division methods in actual implementation. For example, 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 through some communication interface, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0116] 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.

[0117] 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.

[0118] 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 non-volatile computer-readable storage medium that is executable by a processor. 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 and includes several instructions for a computer device (which can be a personal computer, a server, or a 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.

[0119] Finally, it should be noted that the above embodiments are only specific implementations of the present invention, which are used to illustrate the technical solutions of the present invention, rather than to limit them. The protection scope of the present invention is not limited thereto. Although the present invention is described in detail with reference to the above embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above embodiments within the technical scope disclosed by the present invention, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.

Claims

1. A function conversion method, It is characterized in that The method comprises: After receiving a conversion instruction for a table function, a table function is obtained; wherein the table function at least includes: a conditional expression and a result expression; the table function is suitable for running in an office environment; the table function is a function related to table business processing, including: a logical function, a text function, a query reference function, a mathematical function, and a statistical function; the conditional expression is an execution condition of the table function; the result expression is an execution result of the table function; the business scenario of the table function is for office personnel; Acquire a conversion rule corresponding to the development environment; wherein the conversion rule is determined based on function specification difference information between a first function specification in the office environment and a second function specification in the development environment; the first function specification includes an Excel function specification; the second function specification includes a Python function specification; the conversion rule is used to convert the conditional expression in the table function into a relational statement corresponding to the development environment; and is also used to convert the result expression in the table function into a result statement corresponding to the development environment; Converting the table function into a target function according to the conversion rule; wherein the target function is suitable for running in the development environment; After obtaining the conversion rules corresponding to the development environment, the method further includes: Determining configuration data corresponding to the development environment according to the conversion rule; The configuration data is converted into an environment variable statement corresponding to the development environment, and the environment variable statement is loaded into the development environment.

2. The function conversion method according to claim 1, It is characterized in that When the first function specification and the second function specification respectively include logic function specifications, and the function specification difference information includes the logic function, the step of converting the table function into the target function according to the conversion rule includes: According to the definition of the logic function, determining the logic condition contained in the conditional expression; wherein the logic condition at least includes: whether the relationship condition, and the and or relationship condition; Using the logical conditions, the conditional expression and the result expression that meet the first function specification are converted into the relational statement and the result statement that meet the second function specification respectively, and the objective function is determined based on the relational statement and the result statement.

3. The function conversion method according to claim 1, It is characterized in that When the first function specification and the second function specification respectively include text function specifications, and the function specification difference information includes the text function, the step of converting the table function into the target function according to the conversion rule includes: According to the definition of the text function, determine the text acquisition condition contained in the conditional expression; wherein the text acquisition condition at least includes: a text interception condition, a text search condition and a text search condition; The text is used to obtain the condition, and the condition expression and the result expression that meet the first function specification are converted into the relation statement and the result statement that meet the second function specification respectively, and the objective function is determined according to the relation statement and the result statement.

4. The function conversion method according to claim 1, It is characterized in that The first function specification and the second function specification respectively include a query reference function specification, and when the function specification difference information includes the query reference function, the step of converting the table function into a target function according to the conversion rule includes: According to the definition of the query reference function, determine the query reference condition contained in the conditional expression; wherein the query reference condition at least includes: a cell query condition and a cell function reference condition; The query reference condition is used to convert the condition expression and the result expression that meet the first function specification into the relation statement and the result statement that meet the second function specification, respectively, and determine the target function based on the relation statement and the result statement.

5. The function conversion method according to claim 1, It is characterized in that When the first function specification and the second function specification respectively include mathematical function specifications, and the function specification difference information includes the mathematical function, the step of converting the table function into the target function according to the conversion rule includes: According to the definition of the mathematical function, determine the mathematical calculation conditions contained in the conditional expression; wherein the mathematical calculation conditions at least include: a summation operation condition and a trigonometric function operation condition; Using the mathematical calculation conditions, the conditional expression and the result expression that meet the first function specification are converted into the relational statement and the result statement that meet the second function specification, respectively, and the objective function is determined based on the relational statement and the result statement.

6. The function conversion method according to claim 1, It is characterized in that When the first function specification and the second function specification respectively include statistical function specifications, and the function specification difference information includes the statistical function, the step of converting the table function into the target function according to the conversion rule includes: According to the definition of the statistical function, determine the statistical conditions contained in the conditional expression; wherein the statistical conditions at least include: average value statistical conditions, extreme value statistical conditions and count statistical conditions; Using the statistical conditions, the conditional expression and the result expression that meet the first function specification are respectively converted into the relational statement and the result statement that meet the second function specification, and the objective function is determined based on the relational statement and the result statement.

7. A function conversion system, It is characterized in that The system comprises: A function acquisition module is used to acquire a table function after receiving a conversion instruction for a table function; wherein the table function at least includes: a conditional expression and a result expression; the table function is suitable for running in an office environment; the table function is a function related to table business processing, including: a logical function, a text function, a query reference function, a mathematical function, and a statistical function; the conditional expression is an execution condition of the table function; the result expression is an execution result of the table function; the business scenario of the table function is for office personnel; A function conversion rule determination module, used for obtaining a conversion rule corresponding to a development environment; wherein the conversion rule is determined based on function specification difference information between a first function specification in the office environment and a second function specification in the development environment; the first function specification includes an Excel function specification; the second function specification includes a Python function specification; the conversion rule is used for converting the conditional expression in the table function into a relational statement corresponding to the development environment; and is also used for converting the result expression in the table function into a result statement corresponding to the development environment; A configuration data loading module, used to determine the configuration data corresponding to the development environment according to the conversion rule; convert the configuration data into an environment variable statement corresponding to the development environment, and load the environment variable statement into the development environment; A function conversion execution module is used to convert the table function into a target function according to the conversion rule; wherein the target function is suitable for running in the development environment.

8. An electronic device, It is characterized in that It comprises a processor and a memory, wherein the memory stores computer executable instructions that can be executed by the processor, and the processor executes the computer executable instructions to implement the function conversion method according to any one of claims 1 to 6.

9. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the steps of the function conversion method described in any one of claims 1 to 6 are implemented.

Citation Information

Patent Citations

  • Interface configuration method and device, interface calling method and device, equipment and storage medium

    CN110377325A

  • Data mining method and device based on feature conversion function and readable medium

    CN114490809A