CN111966356A - Program code generation method, program code generation device, storage medium, and electronic device - Google Patents

Program code generation method, program code generation device, storage medium, and electronic device Download PDF

Info

Publication number
CN111966356A
CN111966356A CN202010866116.9A CN202010866116A CN111966356A CN 111966356 A CN111966356 A CN 111966356A CN 202010866116 A CN202010866116 A CN 202010866116A CN 111966356 A CN111966356 A CN 111966356A
Authority
CN
China
Prior art keywords
data processing
data
processing logic
code
program code
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010866116.9A
Other languages
Chinese (zh)
Inventor
段姝华
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Gree Electric Appliances Inc of Zhuhai
Zhuhai Lianyun Technology Co Ltd
Original Assignee
Gree Electric Appliances Inc of Zhuhai
Zhuhai Lianyun Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Gree Electric Appliances Inc of Zhuhai, Zhuhai Lianyun Technology Co Ltd filed Critical Gree Electric Appliances Inc of Zhuhai
Priority to CN202010866116.9A priority Critical patent/CN111966356A/en
Publication of CN111966356A publication Critical patent/CN111966356A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code

Abstract

The invention discloses a program code generation method, a program code generation device, a storage medium and electronic equipment, wherein the method comprises the following steps: acquiring a structured data processing logic, dividing the structured data processing logic, inputting an original data extraction part obtained by dividing into a data extraction template to generate a data extraction class code, inputting a data processing part obtained by dividing into a data processing class template and calling the data extraction class code to obtain a data processing class code, and inputting the divided result data storage part into a result data storage class template and calling a data processing class code to generate a result data storage class code, therefore, the program codes comprising the data extraction code, the data processing code and the data storage code are obtained, the structured data processing logic is automatically converted into the program codes which are fixed in structure and convenient for a user to check and use, and the problems of low programming efficiency and inconvenience for later maintenance in the prior art are solved.

Description

Program code generation method, program code generation device, storage medium, and electronic device
Technical Field
The invention belongs to the field of computers, and particularly relates to a program code generation method, a program code generation device, a storage medium and electronic equipment.
Background
As internet technology has been developed, a large amount of data has been generated, and as such, technology for processing a large amount of data has been applied. Apache Spark is a fast and general computing engine specially designed for large-scale data processing; SparkSQL, in turn, is the module Spark uses to process structured data.
The inventor finds that the sparkSQL program is basically written manually in the generation of the sparkSQL program at present. But the processing mode is substantially fixed for structured data. After the fixed processing mode is manually organized each time, the sparkSQL program is manually written, so that the problem of low manual programming efficiency exists in the prior art, and in addition, different developers have different coding modes for the sparkSQL program, so that the later code maintenance is inconvenient.
Disclosure of Invention
The invention provides a program code generation method, a program code generation device, a storage medium and electronic equipment, which effectively solve the problems of low programming efficiency and inconvenience for later code maintenance in the prior art.
In a first aspect, the present invention provides a program code generating method, including:
acquiring a structured data processing logic;
dividing the structured data processing logic to obtain an original data extraction part, a data processing part and a result data storage part;
inputting the original data extraction part into a data extraction template to generate a data extraction code;
inputting the data processing part into a data processing class template and calling the data extraction class code to obtain a data processing class code;
and inputting the result data storage part into a result data storage class template, calling the data processing class code, and generating a result data storage class code so as to obtain a program code comprising the data extraction class code, the data processing class code and the data storage class code.
Optionally, in the above program code generating method, before executing the acquiring the structured data processing logic, the method further includes:
pre-configuring a processing logic box, a parameter input box and a result data box;
acquiring target processing logic input into the processing logic box, target parameter information input into the parameter input box and target result data input into the result data box;
and carrying out structural processing on the target parameter information, the target processing logic and the target result data to obtain structural data processing logic.
Optionally, in the program code generating method, the target processing logic includes processing logic for performing a limiting operation, a logical operation, or a mathematical operation, the target parameter information includes a data table parameter and/or a field parameter of a data table, and the target result data includes a processing result obtained by processing one or more data tables and/or field parameters of the data table.
Optionally, in the program code generating method, dividing the structured data processing logic to obtain an original data extracting part, a data processing part, and a result data storing part, includes:
converting the structured data processing logic into a character string of a preset type;
and dividing the character string according to the three types of preset characters to obtain an original data extraction part, a data processing part and a result data storage part.
Optionally, in the program code generating method, converting the structured data processing logic into a character string of a preset type includes:
converting the structured data processing logic into a Json string;
dividing the character string according to three types of preset characters to obtain an original data extraction part, a data processing part and a result data storage part, wherein the method comprises the following steps:
extracting a part corresponding to each type of preset character string from the Json character string according to the three types of preset characters to obtain an original data extraction part, a data processing part and a result data storage part, wherein the types of the preset characters are three, and the three types of preset characters respectively correspond to the original data extraction part, the data processing part and the result data storage part.
Optionally, in the program code generating method, the three types of preset characters include an element type character, an operator type character, and a storage type character.
In a second aspect, the present invention provides a program code generation apparatus, the apparatus comprising:
the first acquisition module is used for acquiring the structured data processing logic;
the dividing module is used for dividing the structured data processing logic to obtain an original data extraction part, a data processing part and a result data storage part;
the first generation module is used for inputting the original data extraction part into a data extraction template to generate a data extraction code;
the second generation module is used for inputting the data processing part into a data processing class template and calling the data extraction class code to obtain a data processing class code;
and the third generation module is used for inputting the result data storage part into a result data storage class template, calling the data processing class code and generating a result data storage class code so as to obtain a program code comprising the data extraction class code, the data processing class code and the data storage class code.
Optionally, in the program code generating apparatus, the dividing module includes:
the conversion submodule is used for converting the structured data processing logic into a character string of a preset type;
and the dividing submodule is used for dividing the character string according to the three types of preset characters to obtain an original data extraction part, a data processing part and a result data storage part.
In a third aspect, the invention provides a storage medium storing a computer program which, when executed by one or more processors, implements a program code generation method as described above
In a fourth aspect, the present invention provides an electronic device comprising a memory and a processor, wherein the memory stores a computer program, and the computer program executes the program code generation method when the computer program is executed by the processor
The invention provides a program code generation method, a program code generation device, a storage medium and electronic equipment, wherein the method comprises the following steps: acquiring a structured data processing logic, dividing the structured data processing logic to obtain an original data extraction part, a data processing part and a result data storage part, inputting the original data extraction part into a data extraction class template to generate a data extraction class code, inputting the data processing part into a data processing class template and calling the data extraction class code to obtain a data processing class code, inputting the result data storage part into a result data storage class template and calling the data processing class code to generate a result data storage class code, thereby obtaining a program code comprising the data extraction class code, the data processing class code and the data storage class code, automatically converting the structured data processing logic into the program code by the method, wherein the converted program code comprises three class codes, the structure is fixed, so that a user can conveniently check and use the code, and manual programming is not needed, thereby relieving the problems of low programming efficiency and inconvenient code maintenance in the later period in the prior art.
Drawings
The accompanying drawings are included to provide a further understanding of the technology or prior art of the present application and are incorporated in and constitute a part of this specification. The drawings expressing the embodiments of the present application are used for explaining the technical solutions of the present application, and should not be construed as limiting the technical solutions of the present application.
Fig. 1 is a flowchart illustrating a program code generation method according to an embodiment of the present application.
Fig. 2 is another schematic flowchart of a program code generation method according to an embodiment of the present disclosure.
Detailed Description
The following detailed description of the embodiments of the present invention will be provided with reference to the accompanying drawings and examples, so that how to apply the technical means to solve the technical problems and achieve the corresponding technical effects can be fully understood and implemented. The embodiments and the features of the embodiments can be combined without conflict, and the technical solutions formed are all within the scope of the present invention.
Additionally, the steps illustrated in the flow charts of the figures may be performed in a computer such as a set of computer-executable instructions. Also, while a logical order is shown in the flow diagrams, in some cases, the steps shown or described may be performed in an order different than here.
First embodiment
Referring to fig. 1, the present embodiment provides a program code generation method, which can be executed by one or more processors and implements the following steps when the one or more processors execute the program code generation method:
step S110: and acquiring the structured data processing logic (obtained by editing the configuration logic according to a preset format).
Step S120: and dividing the structured data processing logic (according to a preset dividing mode corresponding to the preset format) to obtain an original data extraction part, a data processing part and a result data storage part.
Step S130: and inputting the original data extraction part into a data extraction template to generate a data extraction code.
Step S140: and inputting the data processing part into a data processing class template and calling the data extraction class code to obtain a data processing class code.
Step S150: and inputting the result data storage part into a result data storage class template, calling the data processing class code, and generating a result data storage class code so as to obtain a program code comprising the data extraction class code, the data processing class code and the data storage class code.
This application is through adopting above-mentioned step to the realization is with the automatic program code that converts into of structured data processing logic, and includes three class code in the program code after the conversion, and the structure is fixed, and the user of being convenient for looks over the use, and need not manual programming, thereby has alleviated the programming inefficiency that exists among the prior art, and the problem of the code maintenance in later stage of being not convenient for.
Specifically, in step S110, the structured data processing logic may be obtained by obtaining the structured data processing logic in a character string format from the front-end device, or obtaining the pre-stored structured data processing logic in a character string/text form or a block diagram form.
It should be understood that when the structured data processing logic is represented in a block diagram form, the structured data processing logic should include one or more processing logic blocks, a parameter input block corresponding to the processing logic block for inputting parameters, and a result data block for generating final target result data, the target processing logic input in the processing logic blocks may be symbols, words or characters corresponding to a restrictive operation, a logical operation and/or a mathematical operation, the target parameter information input in the parameter input block includes data table parameters and/or field parameters of a data table, and the target result data in the result data block includes processing results from processing one or more data tables and/or field parameters of the data table.
When the structured data processing logic is represented in a character string, the character string should include an operator, such as an operator, (i.e., an operation manner, specifically, a limited operation manner, a logical operation manner, and/or a mathematical operation manner), an element of the operator, such as an element, (i.e., an element, specifically, a specific element participating in an operation manner to perform an operation), and a result of the operator, such as write, (i.e., a result, specifically, a result obtained by performing an operation manner on one or more elements).
When the structured data processing logic is represented in the form of text, the text should include elements or parameters to be processed, processing manners for the elements or parameters, and processing results obtained by the elements or parameters through the processing manners.
In this embodiment, before performing step S110, the method further includes:
step S210: the processing logic box, the parameter input box and the result data box are configured in advance.
Step S220: and acquiring target processing logic input into the processing logic box, target parameter information input into the parameter input box and target result data input into the result data box.
Specifically, the step S220 may be to select or input the target processing logic, the target parameter information, and the target result data based on the user operation.
Specifically, in this embodiment, the target processing logic includes processing logic for limiting operation, logical operation, or mathematical operation, the target parameter information includes a data table parameter and/or a field parameter of a database table, and the target result data includes a processing result obtained by processing one or more data tables and/or field parameters of the data tables.
Step S230: and carrying out structural processing on the target parameter information, the target processing logic and the target result data to obtain structural data processing logic.
It is understood that the steps S210 to S230 may be executed in a front-end device, such as a PC, the steps S110 to S150 are executed in a back-end device, such as a server, and the steps S210 to S230 and the steps S110 to S150 may be executed in the PC or in the server, which is not limited herein and may be set according to actual requirements.
In step S120, the structured data processing logic may be divided according to the type of each box in the block diagram when the structured data processing logic is represented in the block diagram form, according to a keyword in a word when the structured data processing logic is represented in the word form, or according to a keyword in a character string when the structured data processing logic is represented in the character string form.
Specifically, in this embodiment, when the structured data processing logic is represented by words or a block diagram, the step S120 may specifically include:
step S122: and converting the structured data processing logic into a character string of a preset type.
The preset type of character string may be a Json character string or an Object character string, which is not specifically limited herein and may be set according to actual requirements.
Optionally, in this embodiment, the step S122 may specifically be to convert the structured data processing logic into a Json character string.
Step S124: and dividing the character string according to the three types of preset characters to obtain an original data extraction part, a data processing part and a result data storage part.
It should be noted that the types of the preset characters are three, and the three types of the preset characters respectively correspond to the original data extraction part, the data processing part and the result data storage part, that is, each type of character string corresponds to one part.
When the character string is a Json character string, the step S124 may specifically be: extracting a part corresponding to each type of preset character string from the Json character string according to the three types of preset characters to obtain an original data extraction part, a data processing part and a result data storage part, wherein the types of the preset characters are three, and the three types of preset characters respectively correspond to the original data extraction part, the data processing part and the result data storage part.
In this embodiment, the three types of preset characters include an element type character, an operator type character and a storage type character.
Namely, the part obtained by correspondingly dividing the character string of the element type is an original data extraction part, the part obtained by correspondingly dividing the operator type character is a data processing part, and the part obtained by correspondingly dividing the storage type character is a result data storage part.
By adopting the method steps, when a code needs to be generated, a user only needs to select or input target processing logic, target parameter information and target result data from a pre-configured processing logic frame, a parameter input frame and a result data frame according to the processing logic corresponding to the code, so that the target parameter information, the target processing logic and the target result data are subjected to structural processing to obtain structural data processing logic, the structural data processing logic is automatically divided to obtain an original data extraction part, a data processing part and a result data storage part, and the original data extraction part is input into a data extraction type template to generate a data extraction type code; inputting the data processing part into a data processing class template and calling the data extraction class code to obtain a data processing class code; and inputting the result data storage part into a result data storage class template, calling the data processing class code, and generating a result data storage class code, so as to obtain a program code comprising the data extraction class code, the data processing class code and the data storage class code, thereby effectively relieving the problems of low programming efficiency and inconvenience for later code maintenance in the prior art.
Example two
Taking as an example that the pre-configuration processing box, the parameter input box and the result data box are already completed at the front end, and the user needs to generate a corresponding program code at the back end based on the target processing logic input to the processing box in the pre-configuration processing box, the parameter input box and the result data box at the front end in a dragging or inputting manner, the target parameter information input to the parameter input box and the target result data input to the result data box, respectively.
The user can realize the structuralization processing of the target parameter information, the target processing logic and the target result data to obtain the structuralization data processing logic through the target processing logic input to the processing logic box configured at the front end, the target parameter information input to the parameter input box and the target result data input to the result data box, and the structuralization data processing logic is converted into the format of the Json character string and is transmitted to the rear end. Specifically, the specified fields of table1 in the database of database1 and the specified fields of table2 in the database of database2 are extracted, and the two tables are internally connected according to the 'otbp' field; and the result obtained by internally connecting the result in the above connection with the table3 in the database of database3 according to the "otbp" field is explained by taking the storage of a hive table-overhead pattern-data base _ write database-table _ write table as an example. It can be known that the target parameter information input in the parameter input box includes a specified field of table1 in database of database1, a specified field of table2 in database of database2, a connection result of the specified field of table1 and the specified field of table2, and table3 in database of database3, the target processing logic includes an internal connection, and the output target result data is data stored according to the hive table-overlay mode-data base _ write database-table _ write table.
The structured data processing logic for converting the above elements into a character string form is specifically as follows:
Figure BDA0002649791870000081
when dividing, according to the three types of preset characters (element, operator and write), extracting the parts corresponding to each type of preset character string from the Json character string to obtain the contents corresponding to the left _ element and the right _ element in the front-end incoming logic, namely the data extracting part, the contents except the write in the contents corresponding to the operator are the data calculating part, and if the key corresponding to the operator is the write, dividing into the data storing part.
Specifically, left _ element is a left element of the operator; right _ element is the right element of the operator; { operator _ name, operator _ elements } are operator name and operator corresponding incoming parameters, respectively.
Traversing a Json character string transmitted by a front end, putting non-nested elements such as { elementA, elementB and elementC } into a product stack, putting relevant parts of operators into a consumer stack in the traversing process, synthesizing all elements in the product stack, transmitting the elements into a data extraction class template, correspondingly generating all Spark original data extraction class codes, inputting the relevant information of the operators in the consume stack into a data processing class template, generating the data processing class codes by combining the original data extraction class codes, finding out the relevant information of the write operators and a final generated result in the consume stack, transmitting the relevant information and the final generated result as parameters into a result storage class template, and generating a result storage class code, thereby obtaining a program code comprising the original data extraction class codes, the data processing class codes and the storage class codes.
EXAMPLE III
The embodiment provides a program code generation device, which comprises an acquisition module, a division module, a first generation module, a second generation module and a third generation module.
The first obtaining module is used for obtaining the structured data processing logic.
The description of the first obtaining module may specifically refer to the detailed description of step S110 in the foregoing method embodiment, that is, step S110 may be executed by the first obtaining module.
The dividing module is used for dividing the structured data processing logic to obtain an original data extraction part, a data processing part and a result data storage part.
The description of the dividing module may refer to the detailed description of step S120 in the foregoing method embodiment, that is, step S120 may be performed by the dividing module.
In this embodiment, the dividing module includes a converting sub-module and a dividing sub-module.
And the conversion submodule is used for converting the structured data processing logic into a character string of a preset type.
And the dividing submodule is used for dividing the character string according to the three types of preset characters to obtain an original data extraction part, a data processing part and a result data storage part.
And the first generation module is used for inputting the original data extraction part into a data extraction template to generate a data extraction code.
The description of the first generating module may refer to the detailed description of step S130 in the foregoing method embodiment, that is, step S130 may be executed by the first generating module.
And the second generation module is used for inputting the data processing part into a data processing class template and calling the data extraction class code to obtain the data processing class code.
The description of the second generating module may refer to the detailed description of step S140 in the foregoing method embodiment, that is, step S140 may be executed by the second generating module.
And the third generation module is used for inputting the result data storage part into a result data storage class template, calling the data processing class code and generating a result data storage class code so as to obtain a program code comprising the data extraction class code, the data processing class code and the data storage class code.
The description of the third generating module may refer to the detailed description of step S150 in the foregoing method embodiment, that is, step S150 may be executed by the third generating module.
It is to be understood that, in this embodiment, the program code generation apparatus further includes: the device comprises a configuration module, a second acquisition module and a structuring module.
The configuration module is used for pre-configuring a processing logic box, a parameter input box and a result data box;
the description of the configuration module may refer to the detailed description of step S210 in the foregoing method embodiment, that is, step S210 may be executed by the configuration module.
The second obtaining module is configured to obtain target processing logic input to the processing logic box, target parameter information input to the parameter input box, and target result data input to the result data box;
the description of the second obtaining module may refer to the detailed description of step S220 in the foregoing method embodiment, that is, step S220 may be executed by the second obtaining module.
And the structuring module is used for carrying out structuring processing on the target parameter information, the target processing logic and the target result data to obtain a structured data processing logic.
The description of the structural module may refer to the detailed description of step S230 in the foregoing method embodiment, that is, step S230 may be performed by the structural module.
Example four
The present embodiment provides a storage medium such as a flash memory, a hard disk, a multimedia card, a card-type memory (e.g., SD or DX memory, etc.), a Random Access Memory (RAM), a Static Random Access Memory (SRAM), a Read Only Memory (ROM), an Electrically Erasable Programmable Read Only Memory (EEPROM), a Programmable Read Only Memory (PROM), a magnetic memory, a magnetic disk, an optical disk, a server, an App application mall, etc., on which a computer program is stored, which when executed by one or more processors may implement the program code generation method of the embodiment.
The specific embodiment process of the above method steps can be referred to as embodiment one, and the detailed description of this embodiment is not repeated herein.
EXAMPLE five
An embodiment of the present application provides an electronic device, which includes a memory and a processor, where the memory stores a computer program, and when the computer program is executed by the processor, the program code generation method in the first embodiment is performed.
It is to be understood that the electronic device may also include multimedia components, input/output (I/O) interfaces, and communication components.
Wherein, the processor is used for executing all or part of the steps in the program code generation method in the first embodiment. The memory is used to store various types of data, which may include, for example, instructions for any application or method in the electronic device, as well as application-related data.
The Processor may be an Application Specific Integrated Circuit (ASIC), a Digital Signal Processor (DSP), a Digital Signal Processing Device (DSPD), a Programmable Logic Device (PLD), a Field Programmable Gate Array (FPGA), a controller, a microcontroller, a microprocessor, or other electronic components, and is configured to execute the program code generating method in the first embodiment.
The Memory may be implemented by any type of volatile or non-volatile Memory device or combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read-Only Memory (EPROM), Programmable Read-Only Memory (PROM), Read-Only Memory (ROM), magnetic Memory, flash Memory, magnetic disk or optical disk.
In the embodiments provided in the present application, it should be understood that the disclosed method can be implemented in other ways. The embodiments described above are merely illustrative, and the flowcharts and block diagrams in the figures, for example, illustrate the architecture, functionality, and operation of possible implementations of methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The above description is only an example of the present application and is not intended to limit the scope of the present application, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application shall be included in the protection scope of the present application. It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures.
It should be noted that the above description is only a specific embodiment of the present application, but the above description is only an embodiment adopted for facilitating understanding of the present invention, and is not intended to limit the present invention. It will be understood by those skilled in the art that various changes in form and details may be made therein without departing from the spirit and scope of the disclosure, and it is intended that all such changes and modifications as fall within the true spirit and scope of the disclosure be embraced therein. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (10)

1. A program code generation method, the method comprising:
acquiring a structured data processing logic;
dividing the structured data processing logic to obtain an original data extraction part, a data processing part and a result data storage part;
inputting the original data extraction part into a data extraction template to generate a data extraction code;
inputting the data processing part into a data processing class template and calling the data extraction class code to obtain a data processing class code;
and inputting the result data storage part into a result data storage class template, calling the data processing class code, and generating a result data storage class code so as to obtain a program code comprising the data extraction class code, the data processing class code and the data storage class code.
2. The program code generation method of claim 1, wherein prior to executing the obtain structured data processing logic, the method further comprises:
pre-configuring a processing logic box, a parameter input box and a result data box;
acquiring target processing logic input into the processing logic box, target parameter information input into the parameter input box and target result data input into the result data box;
and carrying out structural processing on the target parameter information, the target processing logic and the target result data to obtain structural data processing logic.
3. The program code generation method according to claim 2, wherein the target processing logic includes processing logic for performing a restricted operation, a logical operation, or a mathematical operation, the target parameter information includes a table parameter and/or a field parameter of a database table, and the target result data includes a processing result obtained by processing one or more tables and/or field parameters of tables.
4. The program code generation method of claim 1, wherein dividing the structured data processing logic into a raw data extraction portion, a data processing portion, and a result data storage portion comprises:
converting the structured data processing logic into a character string of a preset type;
and dividing the character string according to the three types of preset characters to obtain an original data extraction part, a data processing part and a result data storage part.
5. The program code generation method of claim 4, wherein converting the structured data processing logic into a string of a preset type comprises:
converting the structured data processing logic into a Json string;
dividing the character string according to three types of preset characters to obtain an original data extraction part, a data processing part and a result data storage part, wherein the method comprises the following steps:
extracting a part corresponding to each type of preset character string from the Json character string according to the three types of preset characters to obtain an original data extraction part, a data processing part and a result data storage part, wherein the types of the preset characters are three, and the three types of preset characters respectively correspond to the original data extraction part, the data processing part and the result data storage part.
6. The program code generation method according to claim 5, wherein the three types of preset characters include an element type character, an operator type character, and a storage type character.
7. An apparatus for generating program code, the apparatus comprising:
the first acquisition module is used for acquiring the structured data processing logic;
the dividing module is used for dividing the structured data processing logic to obtain an original data extraction part, a data processing part and a result data storage part;
the first generation module is used for inputting the original data extraction part into a data extraction template to generate a data extraction code;
the second generation module is used for inputting the data processing part into a data processing class template and calling the data extraction class code to obtain a data processing class code;
and the third generation module is used for inputting the result data storage part into a result data storage class template, calling the data processing class code and generating a result data storage class code so as to obtain a program code comprising the data extraction class code, the data processing class code and the data storage class code.
8. The program code generation apparatus of claim 7, wherein the partitioning module comprises:
the conversion submodule is used for converting the structured data processing logic into a character string of a preset type;
and the dividing submodule is used for dividing the character string according to the three types of preset characters to obtain an original data extraction part, a data processing part and a result data storage part.
9. A storage medium storing a computer program, wherein the computer program, when executed by one or more processors, implements a program code generation method as claimed in any one of claims 1 to 6.
10. An electronic device, comprising a memory and a processor, the memory having stored thereon a computer program that, when executed by the processor, performs a program code generation method according to any one of claims 1-6.
CN202010866116.9A 2020-08-25 2020-08-25 Program code generation method, program code generation device, storage medium, and electronic device Pending CN111966356A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010866116.9A CN111966356A (en) 2020-08-25 2020-08-25 Program code generation method, program code generation device, storage medium, and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010866116.9A CN111966356A (en) 2020-08-25 2020-08-25 Program code generation method, program code generation device, storage medium, and electronic device

Publications (1)

Publication Number Publication Date
CN111966356A true CN111966356A (en) 2020-11-20

Family

ID=73390301

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010866116.9A Pending CN111966356A (en) 2020-08-25 2020-08-25 Program code generation method, program code generation device, storage medium, and electronic device

Country Status (1)

Country Link
CN (1) CN111966356A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112765173A (en) * 2021-01-20 2021-05-07 四川湖山电器股份有限公司 Data storage method, system and loading method suitable for upper computer
CN113094031A (en) * 2021-03-16 2021-07-09 上海晓途网络科技有限公司 Factor generation method and device, computer equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
AU2005201715A1 (en) * 2004-04-30 2005-11-17 Phase N Australia Pty Ltd Automated code generation
CN109101231A (en) * 2018-08-07 2018-12-28 百度在线网络技术(北京)有限公司 Scripted code generation method, device, computer equipment and storage medium
CN109614102A (en) * 2018-10-09 2019-04-12 平安科技(深圳)有限公司 Code automatic generation method, device, electronic equipment and storage medium
CN110457378A (en) * 2018-05-08 2019-11-15 华为技术有限公司 A kind of method and apparatus of data processing
CN110764753A (en) * 2019-09-18 2020-02-07 亚信创新技术(南京)有限公司 Business logic code generation method, device, equipment and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
AU2005201715A1 (en) * 2004-04-30 2005-11-17 Phase N Australia Pty Ltd Automated code generation
CN110457378A (en) * 2018-05-08 2019-11-15 华为技术有限公司 A kind of method and apparatus of data processing
CN109101231A (en) * 2018-08-07 2018-12-28 百度在线网络技术(北京)有限公司 Scripted code generation method, device, computer equipment and storage medium
CN109614102A (en) * 2018-10-09 2019-04-12 平安科技(深圳)有限公司 Code automatic generation method, device, electronic equipment and storage medium
CN110764753A (en) * 2019-09-18 2020-02-07 亚信创新技术(南京)有限公司 Business logic code generation method, device, equipment and storage medium

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112765173A (en) * 2021-01-20 2021-05-07 四川湖山电器股份有限公司 Data storage method, system and loading method suitable for upper computer
CN113094031A (en) * 2021-03-16 2021-07-09 上海晓途网络科技有限公司 Factor generation method and device, computer equipment and storage medium
CN113094031B (en) * 2021-03-16 2024-02-20 上海晓途网络科技有限公司 Factor generation method, device, computer equipment and storage medium

Similar Documents

Publication Publication Date Title
WO2019095424A1 (en) Data acquisition method and device, storage medium and terminal
CN108038212B (en) Data interaction method, device, system, equipment and storage medium
CN111966356A (en) Program code generation method, program code generation device, storage medium, and electronic device
CN109344193B (en) Method and system for converting structured data into unstructured data
CN109471893B (en) Network data query method, equipment and computer readable storage medium
CN113408668A (en) Decision tree construction method and device based on federated learning system and electronic equipment
CN110888672B (en) Expression engine implementation method and system based on metadata architecture
CN115526160A (en) Rich text processing method, device and equipment and storage medium
CN110554877A (en) JSON data analysis method, device, equipment and storage medium
CN112650529B (en) System and method for configurable generation of mobile terminal APP codes
WO2020015220A1 (en) Method and apparatus for downloading data based on pdf document, and storage medium and terminal
CN113986248A (en) Code generation method and device, computer equipment and storage medium
CN112883088B (en) Data processing method, device, equipment and storage medium
US10482171B2 (en) Digital form optimization
CN109542357B (en) Command parameter assembling method, system, equipment and computer storage medium
US9613090B2 (en) Simplified query generation from prior query results
CN113741864B (en) Automatic semantic service interface design method and system based on natural language processing
CN109542953B (en) Presto-based data processing method and device
CN111124378B (en) Code generation method and device
CN109992293B (en) Method and device for assembling Android system component version information
CN112685435A (en) Table query method and system based on Vue and Mybatis
US10817486B2 (en) Containment of data structures with data objects in data modeling tools
CN111782608A (en) Automatic file generation method and device, electronic equipment and storage medium
US11101819B2 (en) Compression of semi-structured data
CN117933194A (en) Data conversion method, device, computer equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination