Storage code conversion method and device, computer device and storage medium

By deconstructing and transforming data objects in the storage code and applying transformation rules to generate storage code suitable for the target database, the problem of low efficiency in cross-type database migration is solved, and fast and efficient data migration is achieved.

CN115686520BActive Publication Date: 2026-02-06CHINA PING AN LIFE INSURANCE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211422227.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-14
Publication Date
2026-02-06
Estimated Expiration
2042-11-14

AI Technical Summary

Technical Problem

Due to the different database types, the migration of storage code is a huge undertaking, and existing technologies are unable to quickly and efficiently complete data migration across different database types.

Method used

By obtaining data objects from the stored code, applying transformation rules to deconstruct them into various data objects, and then transforming them according to the rules, the stored code suitable for the target database is finally generated.

Benefits of technology

It enables automatic, fast, and accurate storage code conversion, improving the efficiency of data migration across different database types.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115686520B_ABST
    Figure CN115686520B_ABST
Patent Text Reader

Abstract

The application relates to the field of data storage, and discloses a storage code conversion method and device, computer equipment and a storage medium, the method comprising the following steps: acquiring a first storage code; extracting a first data object to be converted from the first storage code; the first data object comprises a first data name, first type data, a first function, a first operation expression and a first control statement; acquiring a conversion rule corresponding to the first data object; converting the first data object according to the conversion rule to generate a second data object; and generating a second storage code according to the second data object. The application can quickly realize the conversion of the storage code and improve the migration efficiency of cross-type database data.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of data storage, and in particular to a storage code conversion method and device, a computer device and a storage medium. BACKGROUND

[0002] With the development of storage technology, more and more commercial databases have emerged. Under the impetus of some needs, it is necessary to migrate data in a certain type of database A to another type of database B. Since the types of database A and database B are different, their storage codes also differ significantly, resulting in a huge workload for migration. SUMMARY

[0003] Therefore, it is necessary to provide a storage code conversion method and device, a computer device and a storage medium to quickly convert storage codes and improve the migration efficiency of cross-type database data.

[0004] A storage code conversion method comprises the following steps:

[0005] obtaining a first storage code;

[0006] extracting a first data object to be converted from the first storage code; the first data object comprises a first data name, a first type of data, a first function, a first operation expression and a first control statement;

[0007] obtaining a conversion rule corresponding to the first data object, converting the first data object according to the conversion rule, and generating a second data object;

[0008] generating a second storage code according to the second data object.

[0009] A storage code conversion device comprises the following steps:

[0010] A computer device comprises a memory, a processor and computer readable instructions stored in the memory and executable on the processor, and the processor executes the computer readable instructions to implement the above-mentioned storage code conversion method.

[0011] One or more readable storage media having computer readable instructions stored therein, the computer readable instructions being executed by one or more processors to cause the one or more processors to perform the above-mentioned storage code conversion method.

[0012] The storage code conversion method, device, computer device and storage medium described above, by obtaining a first storage code, obtains a storage code to be converted. A first data object to be converted is extracted from the first storage code; the first data object includes a first data name, a first data type, a first function, a first operation expression and a first control statement, so as to decompose the first storage code into a plurality of first data objects, facilitate conversion of the data objects, improve conversion efficiency and conversion accuracy. A conversion rule corresponding to the first data object is obtained, the first data object is converted according to the conversion rule, a second data object is generated, so as to complete conversion of each first data object. A second storage code is generated according to the second data object, so as to complete conversion of the first storage code. The present application can automatically, quickly and accurately decompose the first storage code into a plurality of first data objects, then convert the first data objects through a corresponding conversion rule to generate a second data processing object, and finally assemble the second data processing objects to generate a second storage code. The present application can quickly realize conversion of the storage code and improve migration efficiency of cross-type database data. BRIEF DESCRIPTION OF DRAWINGS

[0013] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following will briefly introduce the drawings needed to be used in the description of the embodiments of the present application. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.

[0014] Figure 1 is a schematic diagram of an application environment of a storage code conversion method in an embodiment of the present application;

[0015] Figure 2 is a flowchart of a storage code conversion method in an embodiment of the present application;

[0016] Figure 3 is a structural diagram of a storage code conversion device in an embodiment of the present application;

[0017] Figure 4 is a schematic diagram of a computer device in an embodiment of the present application. DETAILED DESCRIPTION

[0018] The technical solutions of the embodiments of the present application will be described clearly and completely in the following with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are some embodiments of the present application, but not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor are within the scope of protection of the present application.

[0019] The storage code conversion method provided by the embodiment can be applied in an application environment as shown in Figure 1 , in which a client communicates with a server. The client includes but is not limited to various personal computers, notebook computers, smart phones, tablet computers and portable wearable devices. The server can be implemented by an independent server or a server cluster composed of multiple servers.

[0020] In an embodiment, as shown in Figure 2 , a storage code conversion method is provided. The method is applied in the server in Figure 1 , and includes the following steps S10-S40.

[0021] S10, obtaining a first storage code.

[0022] Understandably, the first storage code refers to the storage code of a first database to be converted, which can be an Oracle (a kind of commercial database) storage code. The first storage code can be stored in a first storage file of a first storage directory. In an example, the first storage file can be an Oracle file with a suffix of sql.

[0023] S20, extracting a first data object to be converted from the first storage code; the first data object includes a first data name, a first type data, a first function, a first operation expression and a first control statement.

[0024] Understandably, the first storage code can be imported by using an algorithm associated with a second storage code, and the storage structure and storage object of the first storage code are analyzed to extract the first data object to be converted. In an example, the algorithm associated with the second storage code is a Java algorithm, and the first data object includes the first data name, the first type data, the first function, the first operation expression and the first control statement. These first data objects need to be converted into second data objects conforming to the Java algorithm specification.

[0025] The first data name includes a table name, a variable name, a stored procedure name, etc. The first type data includes numbers, strings, arrays, dates, etc. The first function includes some function functions of Oracle, such as ABS, ADD_MONTHS, ASCII, etc. The first operation expression includes a bracket expression, an and expression, an or expression, etc. The first control statement includes a conditional ifelse statement, a general loop statement, a cursor loop statement, etc.

[0026] S30, obtaining a conversion rule corresponding to the first data object, converting the first data object according to the conversion rule, and generating a second data object.

[0027] It is understandable that each first data object has a corresponding conversion rule. The first data object can be converted into a second data object using the conversion rule. For example, the first data name contains special characters such as $, #, etc. When converted into a second data name, $ is replaced by an underscore, and # is replaced by a double underscore. It should be noted that the variable name needs to be specially processed, but the field name cannot be changed.

[0028] S40, generating a second storage code according to the second data object.

[0029] It is understandable that after the conversion of all first data objects is completed, all second data objects can be combined into a second storage code of a second database and written into a second storage file. In an example, the second storage file can be a java file with a java suffix. Here, the second database is a database constructed based on a java algorithm.

[0030] After obtaining the second storage code, the second storage code can be verified in terms of data and function, and compared with the first storage code. If there are errors in the second storage code, the conversion rules need to be further checked to find out the reasons for the errors.

[0031] In steps S10-S40, the first storage code is obtained to obtain the storage code to be converted. The first data object to be converted is extracted from the first storage code; the first data object includes a first data name, a first data type, a first function, a first operation expression and a first control statement, so as to decompose the first storage code into a plurality of first data objects, facilitate the conversion of the data objects, and improve the conversion efficiency and accuracy. The conversion rule corresponding to the first data object is obtained, the first data object is converted according to the conversion rule, and the second data object is generated to complete the conversion of each first data object. The second storage code is generated according to the second data object to complete the conversion of the first storage code. The embodiment can automatically, quickly and accurately decompose the first storage code into each first data object, then convert the first data object through the corresponding conversion rule to generate a second data processing object, and finally assemble each second data processing object to generate a second storage code. The embodiment quickly realizes the conversion of the storage code and improves the migration efficiency of cross-type database data.

[0032] Optionally, the second data object includes a second data name.

[0033] Step S30, that is, the conversion rule corresponding to the first data object is obtained, the first data object is converted according to the conversion rule, and the second data object is generated, including:

[0034] S301, acquire a name conversion rule corresponding to the first data name;

[0035] S302, detect whether the first data name contains case and / or special characters according to the name conversion rule;

[0036] S303, if the first data name contains case and / or special characters, convert the case and / or special characters in the first data name according to the name conversion rule to generate a second data name.

[0037] Understandably, the second data name includes but is not limited to table name, variable name, and stored procedure name. In an example, oracle is not case sensitive to name, and java is case sensitive. Therefore, it is necessary to detect whether the first data name contains case, and if the same variable name exists in upper case and lower case, they need to be unified into the same writing form. Here, the name conversion rule can unify the same data name into upper case or lower case format.

[0038] For $, # and other special characters, java does not support these two special characters. When converted to the second data name, $ is replaced by an underscore, and # is replaced by a double underscore. It should be noted that here, the variable name needs to be specially processed, but the field name cannot be changed. In other words, the name conversion rule is only responsible for converting the variable name (which belongs to the first data name), and does not convert the field name (which does not belong to the first data name).

[0039] If the first data name does not contain case and / or special characters, the first data name does not need to be converted, that is, the first data name and the second data name are the same.

[0040] The embodiment can intelligently detect the first data name and convert the first data name to a second data name suitable for the second database.

[0041] Optionally, the second data object includes second type data;

[0042] Step S30, that is, acquiring a conversion rule corresponding to the first data object, converting the first data object according to the conversion rule to generate a second data object, including:

[0043] S311, acquiring a type conversion rule corresponding to the first type data;

[0044] S312, converting the first type data according to the type conversion rule to generate second type data.

[0045] Understandably, the second type of data includes numbers, strings, arrays, dates, etc. Generally, the same type of data, the performance of the first database and the performance of the second database may differ. Thus, the first type of data in the first database needs to be converted by the type conversion rule to generate the second type of data.

[0046] Specifically, for data, convert to java's BigDecimal, range / precision reservation. With BigDecimal, keep exactly the same as oracle, no precision loss. The budget BigDecimal of the number can directly use the default API method, which will not be described here.

[0047] For strings, you can convert to java string concatenation (java String). Here, a large number of implicit conversions need to be handled, such as numbers || numbers, dates || numbers, numbers || strings, etc. The type conversion rule defines all possible concatenation types, including non-string on either side. After conversion to java, the string is connected with an explicit connector.

[0048] For dates, you can convert to java.util.Date objects. When comparing dates, first convert to seconds, then compare. You can use the default operation method of the Java.util.Date object.

[0049] For arrays, you can convert to java.util.ArrayList objects. The converted java array object has the same functions as the original oracle array.

[0050] For tables, oracle tables can be converted to java classes. So this variable type is a table class object instance, and the table field is an object property.

[0051] For custom structures, like tables, they are also converted to java classes.

[0052] For cursors, generate a corresponding class, assign a connection, execute a sql query, clean up, close the connection, read the row (fetchrow) in jdbc, then get one by one, convert the jdbc fetch row, and then assign a field to a variable. Determine the jdbc result set state.

[0053] The embodiment can convert the first type of data into the second type of data suitable for the second database.

[0054] Optionally, the second data object comprises a second function.

[0055] The step S30 of obtaining the conversion rule corresponding to the first data object, converting the first data object according to the conversion rule, and generating a second data object comprises:

[0056] S321, obtaining a function conversion rule corresponding to the first function;

[0057] S322, converting the first function according to the function conversion rule to generate the second function.

[0058] Understandably, the second function (using the second database) can be customized to implement the function of the first function (using the first database). Each first function has a corresponding second function. Here, the function conversion rule records the association between the two functions. Through the function conversion rule, the conversion between the first function and the second function can be realized.

[0059] In an example, the function conversion rule records the following function association relationship:

[0060]

[0061]

[0062] The embodiment realizes the function of the first function through the customized second function, ensuring that the function of the first function can also be realized in the second database.

[0063] Optionally, the second data object comprises a second operation expression.

[0064] The step S30 of obtaining the conversion rule corresponding to the first data object, converting the first data object according to the conversion rule, and generating a second data object comprises:

[0065] S331, obtaining an operation expression conversion rule corresponding to the first operation expression;

[0066] S332, converting the first operation expression according to the operation expression conversion rule to generate the second operation expression.

[0067] Understandably, in the first database, there are a plurality of first operation expressions, and a corresponding operation expression conversion rule can be set for each first operation expression to convert the first operation expression into a second operation expression.

[0068] For example, if the first operation expression is a bracket expression, only brackets need to be added in the second operation expression; if the first operation expression is an and expression, && is used in the second operation expression; if the first operation expression is an or expression, && is used in the second operation expression; if the first operation expression is an and expression, || is used in the second operation expression; if the first operation expression is a not expression,! is used in the second operation expression; if the first operation expression is an in expression, Arrays.asList({}).contains({}) is used in the second operation expression; if the first operation expression is a like expression, a regular expression is used in the second operation expression; if the first operation expression is a case when then expression, if, else if and else are used in the second operation expression; if the first operation expression is a function or stored procedure calling expression, the function or stored procedure calling expression is identified and converted into a second operation expression (a java function calling expression), an out parameter is converted into a global variable calling, and the global variable value is assigned to the calling parameter; if the out parameter is the same as the in parameter, the calling parameter value is assigned to the global variable.

[0069] The operation expression conversion rule can be used to convert the first operation expression into a second operation expression suitable for the second database.

[0070] Optionally, the second data object comprises a second control statement.

[0071] The step S30 of obtaining the conversion rule corresponding to the first data object and converting the first data object according to the conversion rule to generate a second data object comprises:

[0072] S341, obtaining a control statement conversion rule corresponding to the first control statement;

[0073] S342, converting the first control statement according to the control statement conversion rule to generate the second control statement.

[0074] Understandably, in the first database, there are a plurality of first control statements, and a corresponding control statement conversion rule can be set for each first control statement to convert the first control statement into a second control statement.

[0075] For example, if the first control statement is an if else statement, the second control statement is expressed as if / else if / else. If the first control statement is a general loop statement, if the loop statement is expressed as loop…end loop…, the second control statement can be expressed as while(true){…}; if the loop statement is expressed as for x in lower..upper loop…end loop, the second control statement can be expressed as for(x=lower;x<=upper; ++x).

[0076] If the first control statement is a cursor loop statement, the second control statement can simulate server call (such as jdbc) to perform a selection operation. The second control statement includes the following steps:

[0077] Step 1, record declaration code; define a cursor resultset structure;

[0078] Step 2, open_cursor(); perform query sql for the split connection;

[0079] Step 3, fetch into code; loop fetch row to resultset variable;

[0080] Step 4, break code; jump out of the loop after the result set is taken;

[0081] Step 5, close_cursor; clean up the result set and release the connection.

[0082] If the first control statement is a go to statement, the second control statement can use java label+while+goto label to simulate. At this point, the converted code is quite different from the source code, and the back jump is mainly used to skip the subsequent processing to enter the next loop; the forward jump is mainly used for error handling to enter the next loop.

[0083] If the first control statement is an exit statement, the second control statement can use java break+label. If there is a condition, an if judgment is added. If the first control statement is a continue statement, the second control statement can use java continue+label. Similarly, if there is a condition, an if judgment can be added. If the first control statement is a return statement, the second control statement can use return, and the data precision conversion is made according to the actual situation.

[0084] In the embodiment, each first control statement has a corresponding control statement conversion rule, which can convert the first control statement into a second control statement suitable for the second database.

[0085] Optionally, after the step S30 of obtaining the conversion rule corresponding to the first data object and converting the first data object according to the conversion rule to generate the second data object, the method further includes:

[0086] S41, obtaining a conversion record of the second data object;

[0087] S42, generating a conversion analysis report of the second storage code according to the conversion record.

[0088] Understandably, in the process of generating the second data object, the record is recorded synchronously to form the conversion record. Then, the conversion record is processed according to the preset analysis engine to generate the conversion analysis report. In some examples, the conversion analysis report includes the converted code amount, the first data object and the corresponding second data object, which facilitates comparison to determine whether the conversion is complete. The conversion analysis report can be represented in the form of a picture, a table or the like.

[0089] The embodiment can generate the conversion analysis report synchronously, which facilitates verification of the second storage code.

[0090] It should be understood that the size of the serial number of each step in the above embodiment does not mean the order of execution, and the execution order of each process should be determined according to its function and inherent logic, and should not constitute any limitation on the implementation process of the embodiment of the present application.

[0091] In an embodiment, a storage code conversion device is provided, which corresponds to the storage code conversion method in the above embodiment. As shown in the figure, the storage code conversion device includes a first code acquisition module 10, a first data object extraction module 20, a second data object conversion module 30 and a second storage code generation module 40. The function modules are described in detail as follows: Figure 3

[0092] The first code acquisition module 10 is used for acquiring the first storage code.

[0093] The first data object extraction module 20 is used for extracting the first data object to be converted from the first storage code; the first data object includes a first data name, a first type data, a first function, a first operation expression and a first control statement.

[0094] The second data object conversion module 30 is used for obtaining a conversion rule corresponding to the first data object, converting the first data object according to the conversion rule to generate a second data object; ​

[0095] The second storage code module 40 is configured to generate a second storage code according to the second data object.

[0096] Optionally, the second data object comprises a second data name.

[0097] The second data object conversion module 30 comprises:

[0098] A name rule acquisition unit is configured to acquire a name conversion rule corresponding to the first data name.

[0099] A name detection unit is configured to detect whether the first data name contains a case and / or a special character according to the name conversion rule.

[0100] A name conversion unit is configured to convert the case and / or the special character in the first data name according to the name conversion rule to generate a second data name if the first data name contains the case and / or the special character.

[0101] Optionally, the second data object comprises a second type data.

[0102] The second data object conversion module 30 comprises:

[0103] A type rule acquisition unit is configured to acquire a type conversion rule corresponding to the first type data.

[0104] A type conversion unit is configured to convert the first type data according to the type conversion rule to generate a second type data.

[0105] Optionally, the second data object comprises a second function.

[0106] The second data object conversion module 30 comprises:

[0107] A function rule acquisition unit is configured to acquire a function conversion rule corresponding to the first function.

[0108] A function conversion unit is configured to convert the first function according to the function conversion rule to generate the second function.

[0109] Optionally, the second data object comprises a second operation expression.

[0110] The second data object conversion module 30 comprises:

[0111] An operation rule acquisition unit is configured to acquire an operation expression conversion rule corresponding to the first operation expression.

[0112] The operation expression conversion unit is configured to convert the first operation expression according to the operation expression conversion rule to generate the second operation expression.

[0113] Optionally, the second data object comprises a second control statement.

[0114] The conversion second data object module 30 comprises:

[0115] The statement conversion unit is configured to convert the first control statement according to the control statement conversion rule to generate the second control statement.

[0116] The statement conversion unit is configured to convert the first control statement according to the control statement conversion rule to generate the second control statement.

[0117] Optionally, the storage code conversion device further comprises:

[0118] The conversion record acquisition module is configured to acquire the conversion record of the second data object.

[0119] The conversion report generation module is configured to generate a conversion analysis report of the second storage code according to the conversion record.

[0120] The specific limitation of the storage code conversion device can be referred to the limitation of the storage code conversion method in the foregoing, which will not be repeated here. Each module in the above storage code conversion device can be realized by software, hardware and combination thereof in whole or in part. The above each module can be embedded in or independent of the processor in the computer device in hardware form, or can be stored in the memory in the computer device in software form, so as to call and execute the operation corresponding to each module by the processor.

[0121] In one embodiment, a computer device is provided, which can be a server, and the internal structure diagram thereof can be as shown in Figure 4 The computer device comprises a processor, a memory, a network interface and a database connected through a system bus. The processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a readable storage medium and an internal memory. The readable storage medium stores an operating system, computer readable instructions and a database. The internal memory provides an environment for the operation of the operating system and the computer readable instructions in the readable storage medium. The database of the computer device is configured to store the data involved in the above storage code conversion method. The network interface of the computer device is configured to communicate with the external terminal through the network connection. The computer readable instructions are executed by the processor to implement a storage code conversion method. The readable storage medium provided in the embodiment comprises a non-volatile readable storage medium and a volatile readable storage medium.

[0122] In one embodiment, a computer device is provided, comprising a memory, a processor, and computer readable instructions stored on the memory and executable on the processor, the processor implementing the following steps when executing the computer readable instructions:

[0123] obtaining first storage code;

[0124] extracting a first data object to be converted from the first storage code; the first data object comprising a first data name, first type data, a first function, a first operation expression, and a first control statement;

[0125] obtaining a conversion rule corresponding to the first data object, converting the first data object according to the conversion rule, and generating a second data object;

[0126] generating second storage code according to the second data object.

[0127] In one embodiment, one or more computer readable storage media storing computer readable instructions are provided. The computer readable storage media provided by the embodiment includes non-volatile computer readable storage media and volatile computer readable storage media. The computer readable storage media stores computer readable instructions, which are executed by one or more processors to implement the following steps:

[0128] obtaining first storage code;

[0129] extracting a first data object to be converted from the first storage code; the first data object comprising a first data name, first type data, a first function, a first operation expression, and a first control statement;

[0130] obtaining a conversion rule corresponding to the first data object, converting the first data object according to the conversion rule, and generating a second data object;

[0131] generating second storage code according to the second data object.

[0132] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing relevant hardware through computer readable instructions, and the computer readable instructions can be stored in a non-volatile readable storage medium or a volatile readable storage medium. When the computer readable instructions are executed, the processes of the above-mentioned embodiments of the method can be included. Any reference to memory, storage, database or other medium used in each embodiment provided by the present application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration but not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0133] Those skilled in the art can clearly understand that, for the convenience and brevity of description, only the above-mentioned division of functional units and modules is exemplified, and in actual application, the above-mentioned functions can be completed by different functional units and modules according to needs, that is, the internal structure of the device is divided into different functional units or modules to complete all or part of the functions described above.

[0134] The above-mentioned embodiments are only used to illustrate the technical solutions of the present application, but not to limit it; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that the technical solutions recorded in the foregoing embodiments can be modified, or some technical features can be replaced by equivalents; and these modifications 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 application, and should be included in the protection scope of the present application.

Claims

1. A method for converting stored code, characterized in that, include: Obtain the first storage code; Extract the first data object to be converted from the first stored code; The first data object includes a first data name, a first type of data, a first function, a first operational expression, and a first control statement; Obtain the transformation rule corresponding to the first data object, and transform the first data object according to the transformation rule to generate the second data object; Generate a second storage code based on the second data object; The second data object includes a second data name; the step of obtaining the conversion rule corresponding to the first data object, and converting the first data object according to the conversion rule to generate the second data object includes: obtaining the name conversion rule corresponding to the first data name; The first data name is detected according to the name conversion rule to determine whether it contains uppercase and lowercase letters and / or special characters; if the first data name contains uppercase and lowercase letters and / or special characters, the uppercase and lowercase letters and / or special characters in the first data name are converted according to the name conversion rule to generate a second data name.

2. The storage code conversion method as described in claim 1, characterized in that, The second data object includes a second type of data; The step of obtaining the transformation rule corresponding to the first data object, and transforming the first data object according to the transformation rule to generate the second data object includes: Obtain the type conversion rule corresponding to the first type of data; The first type of data is converted according to the type conversion rules to generate the second type of data.

3. The storage code conversion method as described in claim 1, characterized in that, The second data object includes a second function; The step of obtaining the transformation rule corresponding to the first data object, and transforming the first data object according to the transformation rule to generate the second data object includes: Obtain the function transformation rule corresponding to the first function; The first function is transformed according to the function transformation rules to generate the second function.

4. The storage code conversion method as described in claim 1, characterized in that, The second data object includes a second operational expression; The step of obtaining the transformation rule corresponding to the first data object, and transforming the first data object according to the transformation rule to generate the second data object includes: Obtain the conversion rule of the operation expression corresponding to the first operation expression; The first operational expression is transformed according to the operational expression transformation rules to generate the second operational expression.

5. The storage code conversion method as described in claim 1, characterized in that, The second data object includes the second control statement; The step of obtaining the transformation rule corresponding to the first data object, and transforming the first data object according to the transformation rule to generate the second data object includes: Obtain the control statement conversion rule corresponding to the first control statement; The first control statement is transformed according to the control statement transformation rules to generate the second control statement.

6. The storage code conversion method as described in claim 1, characterized in that, After obtaining the transformation rule corresponding to the first data object, transforming the first data object according to the transformation rule, and generating the second data object, the process further includes: Retrieve the transformation record of the second data object; A conversion analysis report for the second stored code is generated based on the conversion record.

7. A storage code conversion device, characterized in that, include: Get the first code module, used to retrieve the first stored code; The module for extracting the first data object is used to extract the first data object to be converted from the first stored code. The first data object includes a first data name, a first type of data, a first function, a first operational expression, and a first control statement; The second data object conversion module is used to obtain the conversion rule corresponding to the first data object, and convert the first data object according to the conversion rule to generate the second data object; A module for generating second storage code is used to generate second storage code based on the second data object; The second data object includes a second data name; the step of obtaining the conversion rule corresponding to the first data object, and converting the first data object according to the conversion rule to generate the second data object includes: obtaining the name conversion rule corresponding to the first data name; The first data name is detected according to the name conversion rule to determine whether it contains uppercase and lowercase letters and / or special characters; if the first data name contains uppercase and lowercase letters and / or special characters, the uppercase and lowercase letters and / or special characters in the first data name are converted according to the name conversion rule to generate a second data name.

8. A computer device comprising a memory, a processor, and computer-readable instructions stored in the memory and executable on the processor, characterized in that, When the processor executes the computer-readable instructions, it implements the stored code conversion method as described in any one of claims 1 to 7.

9. One or more readable storage media storing computer-readable instructions, which, when executed by one or more processors, cause the one or more processors to perform the stored code translation method as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Method, device and equipment for automatic generation of test cases and readable storage medium

    CN108399130A

  • Intelligent control method for electronic accounting period, terminal equipment and medium

    CN109255692A