File conversion method, device, equipment, medium and product
By converting software design files into database-importable development files, the problem of low database creation efficiency is solved, thereby improving software development efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-28
- Publication Date
- 2026-03-20
AI Technical Summary
In existing technologies, the efficiency of database creation and database table creation is relatively low, which affects software development efficiency.
A file conversion method is provided, which obtains software design files, receives file conversion requests, and converts them into development files that can be imported into a database, including database table structure files and job files, using Visual Basic macro language for conversion.
Developers no longer need to manually create files in the database; they can directly import development files into the database, thus improving software development efficiency.
Smart Images

Figure CN114722106B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application belongs to the technical field of software, and particularly relates to a file conversion method and device, equipment, medium and product. BACKGROUND
[0002] With the continuous development of computer technology and software technology, more and more application programs (for example, web application programs (also commonly referred to as platforms)) are provided for users, and the application programs usually need the support of databases.
[0003] In the related art, when developing an application program, a developer usually creates a database and a database table according to a design document provided by a designer. In the process of creating the database and the database table, a user needs to manually write a corresponding script in a database program or create through a visual creation process. The efficiency of database creation and database table creation is low, which further affects the software development efficiency. SUMMARY
[0004] The embodiments of the present application provide a file conversion method, device, equipment, medium and product, which can solve the problem of low software development efficiency.
[0005] In a first aspect, the embodiments of the present application provide a file conversion method, comprising:
[0006] obtaining a software design file;
[0007] receiving a file conversion request;
[0008] in response to the file conversion request, converting the software design file into a development file, wherein the development file is a file that can be imported into a database.
[0009] In a second aspect, the embodiments of the present application provide a file conversion device, comprising:
[0010] an obtaining module configured to obtain a software design file;
[0011] a receiving module configured to receive a file conversion request;
[0012] a conversion module configured to, in response to the file conversion request, convert the software design file into a development file, wherein the development file is a file that can be imported into a database.
[0013] In a third aspect, the present application provides an electronic device, comprising a processor and a memory storing computer program instructions; the processor implements the file conversion method of the first aspect when executing the computer program instructions.
[0014] In a fourth aspect, the present application provides a computer readable storage medium, and the computer readable storage medium stores computer program instructions. The computer program instructions are executed by a processor to implement the file conversion method in the first aspect.
[0015] In a fifth aspect, the present application provides a computer program product. Instructions in the computer program product are executed by a processor of an electronic device to cause the electronic device to perform the file conversion method in the first aspect.
[0016] In the embodiments of the present application, the software design file is acquired, the file conversion request is received, and the software design file is converted into a development file which can be imported into the database in response to the file conversion request. Then, the development file can be directly imported into the database, and the developers do not need to create and configure the files in the database, so that the development efficiency of the software based on the database can be improved. BRIEF DESCRIPTION OF DRAWINGS
[0017] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed to be used in the embodiments of the present application will be briefly introduced. Those skilled in the art can obtain other drawings according to these drawings without creative labor.
[0018] Figure 1 FIG. 1 is a flowchart of a file conversion method provided by the embodiments of the present application;
[0019] Figure 2 FIG. 2 is a structural diagram of a file conversion device provided by the embodiments of the present application;
[0020] Figure 3 FIG. 3 is a structural diagram of an electronic device provided by the embodiments of the present application. DETAILED DESCRIPTION
[0021] The features and exemplary embodiments of each aspect of the present application will be described in detail below. In order to make the purpose, technical solutions and advantages of the present application more clear, the present application will be further described in detail below with reference to the drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain the present application, but not to limit the present application. The present application can be implemented without some of the specific details by those skilled in the art. The following description of the embodiments is only to provide a better understanding of the present application by showing examples of the present application.
[0022] It should be noted that, in the present document, relational terms such as first and second and the like can be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises", "comprising", or any other variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but can include other elements not expressly listed or inherent to such process, method, article, or apparatus. An element proceeded by "comprises... a" does not, without more constraints, exclude the presence of additional identical elements in the process, method, article, or apparatus that comprises the element.
[0023] The file conversion method, device, equipment, medium and product provided by the embodiments of the present application will be described in detail below in combination with the drawings, specific embodiments and application scenarios.
[0024] Figure 1 is a flowchart of the file conversion method provided by the embodiments of the present application. As shown in Figure 1 , the file conversion method can include:
[0025] S101: obtaining a software design file;
[0026] S102: receiving a file conversion request;
[0027] S103: converting the software design file into a development file in response to the file conversion request, wherein the development file is a file that can be imported into a database.
[0028] The specific implementation of each step will be described in detail below.
[0029] In the embodiments of the present application, by obtaining a software design file, receiving a file conversion request, and converting the software design file into a development file that can be imported into a database in response to the file conversion request, the development file can be directly imported into the database without the need for a developer to create and configure these files in the database, thereby improving the development efficiency of software based on the database.
[0030] In some possible implementations of the embodiments of the present application, the software design file (also commonly referred to as a software design document) in the embodiments of the present application can be a file designed for software by a designer according to a specific template.
[0031] In some possible embodiments of the present application, the file format of the software design file can be a word document, an excel table, a txt text, etc. When the file format of the software design file is an excel table, Visual Basic macro language (Visual Basic for Applications, VBA) can be used to convert the software design file into a development file. VBA is a macro language of Visual Basic, which is a programming language for performing common automation object connection and embedding (Object Linking and Embedding, OLE) tasks in its desktop application, and can mainly be used to expand the application functions of Windows.
[0032] In some possible embodiments of the present application, S103 can include: parsing the software design file; generating a database table structure file capable of being imported into a database according to first data related to creating a database table in the parsed data; and generating a job file capable of being imported into a database according to second data related to a job in the parsed data; wherein the development file includes the database table structure file and the job file.
[0033] In some possible embodiments of the present application, parsing the software design file includes but is not limited to: checking the file format of the software design file; checking whether the table header in the software design file is correct; checking whether the software design file contains special characters affecting the creation of a database table; extracting data in the software design file; etc.
[0034] For example, the specific template format is an excel table format, and the software design file written according to the specific template should also be an excel table format. Therefore, whether the software design file is an excel table format is detected. If it is detected that the software design file is not an excel table format, the user can be prompted with prompt information such as: "The software design file format is not accurate, and the development file may not be generated according to the software design file".
[0035] For another example, whether the software design file contains special characters affecting the creation of a database table, such as ":", "@", "#", etc. can be checked. If it is detected that the software design file contains special characters affecting the creation of a database table, these characters can be deleted.
[0036] In some possible embodiments of the present application, the first data related to creating a database table includes but is not limited to: a database name, a database table name, a table field name, a table field length, a table field character type, whether it can be null, whether it is a table primary key, a table field default value, etc.
[0037] In some possible implementations of the embodiments of the present application, the first data related to creating a database table can be processed. After generating a table, information of the table can be added in a spreadsheet sheet in an excel table. The information filled in the sheet includes but is not limited to: table name, field name, field type, field length, table partition rule, and the like. The table partition rule includes but is not limited to: range partition, quick partition, and the like.
[0038] In some possible implementations of the embodiments of the present application, a directory table can be created before each database table sheet in the excel table. The directory table includes each database table. By clicking a corresponding database table, the sheet corresponding to the clicked database table can be jumped to.
[0039] In some possible implementations of the embodiments of the present application, the second data related to the job includes but is not limited to: table-level mapping relationship (i.e., inter-table association relationship), field-level mapping relationship (i.e., inter-field association relationship), and the like.
[0040] In some possible implementations of the embodiments of the present application, according to the second data related to the job in the parsed data, a job file capable of being imported to the database can be generated. The generation can include: generating job flow information, job flow dependency information, job information, job dependency information, and job parameter information according to the second data related to the job in the parsed data; and generating the job file according to the job flow information, the job flow dependency information, the job information, the job dependency information, and the job parameter information.
[0041] In some possible implementations of the embodiments of the present application, the second data related to the job can be processed. A job flow information is generated for each table to be processed. The first effective time of the job, the execution strategy, and the like are automatically filled according to the commissioning day written by the designer. The table data processed in a certain manner is obtained according to the table processing rule (table-level mapping relationship) designed by the designer. The job flow dependency relationship of the corresponding event is generated according to a certain naming specification. A job flow information is generated for each field to be processed. The field data processed in a certain manner is obtained according to the field processing rule (field mapping relationship) designed by the designer. The job dependency relationship of the corresponding event is generated according to a certain naming specification. When the job file is generated, the technical parameter information required for the job running is filled.
[0042] In some possible implementations of the embodiments of the present application, the job flow information includes, but is not limited to, a job flow name, a first effective service time, a job flow description, an execution strategy, and the like. The job flow dependency information includes, but is not limited to, a dependency type, a job flow name, a dependent job flow name, and the like. The job information includes, but is not limited to, a job flow name, a job name, a job type, a job frequency, a required resource, and the like. The job dependency relationship includes, but is not limited to, a dependency type, a job flow name, a job name, a dependent job flow name, and a dependent job flow job name. The job parameter information includes, but is not limited to, a parameter name, a parameter type, a parameter description, a parameter value, and the like.
[0043] In some possible implementations of the embodiments of the present application, the database in the embodiments of the present application can be a massively parallel processing (MPP) database. The MPP database is a database using an MPP architecture. The MPP architecture is to distribute tasks in parallel to multiple servers and nodes, and to aggregate the results of each part together to obtain the final result after the calculation is completed on each node. The MPP database in the embodiments of the present application can be a ClickHouse database or a Greenplum database or a StarRocks database, and the like.
[0044] Corresponding to the method embodiments described above, the embodiments of the present application also provide a file conversion device, as shown in Figure 2 Figure 2 is a structural schematic diagram of the file conversion device provided by the embodiments of the present application. The file conversion device 200 can include:
[0045] The acquisition module 201 is configured to acquire a software design file.
[0046] The receiving module 202 is configured to receive a file conversion request.
[0047] The conversion module 203 is configured to convert the software design file into a development file in response to the file conversion request, where the development file is a file that can be imported into a database.
[0048] In the embodiments of the present application, by acquiring a software design file, receiving a file conversion request, and converting the software design file into a development file that can be imported into a database in response to the file conversion request, the development file can be directly imported into the database, without the need for a developer to create and configure these files in the database, thereby improving the development efficiency of software based on the database.
[0049] In some possible implementations of the embodiments of the present application, the conversion module 203 includes:
[0050] The parsing sub-module is configured to parse the software design file.
[0051] The first generating sub-module is configured to generate a database table structure file capable of being imported into the database according to first data related to creation of a database table in the parsed data.
[0052] The second generating sub-module is configured to generate a job file capable of being imported into the database according to second data related to a job in the parsed data.
[0053] The development file includes the database table structure file and the job file.
[0054] In some possible implementations of the embodiments of the present application, the second generating sub-module is specifically configured to:
[0055] generate job flow information, job flow dependency information, job information, job dependency information and job parameter information according to the second data related to the job in the parsed data;
[0056] generate the job file according to the job flow information, the job flow dependency information, the job information, the job dependency information and the job parameter information.
[0057] In some possible implementations of the embodiments of the present application, the parsing sub-module is specifically configured to at least one of the following:
[0058] check a file format of the software design file;
[0059] check whether table headers in the software design file are correct;
[0060] check whether the software design file contains special characters affecting creation of a database table;
[0061] extract data in the software design file.
[0062] In some possible implementations of the embodiments of the present application, the file format of the software design file is an excel table.
[0063] The conversion module 203 is specifically configured to:
[0064] convert the software design file into the development file by using a Visual Basic macro language.
[0065] Figure 3 FIG. 1 is a structural schematic diagram of an electronic device provided by an embodiment of the present application.
[0066] The electronic device can include a processor 301 and a memory 302 having stored computer program instructions.
[0067] Specifically, the processor 301 can include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or can be configured to implement one or more integrated circuits that implement the embodiments of the present application.
[0068] The memory 302 can include mass storage for data or instructions. By way of example, and not limitation, the memory 302 can include a hard disk drive (HDD), a floppy disk drive, flash memory, an optical disc (e.g., a CD or DVD), a tape drive, a USB drive, or a combination of two or more of these. The memory 302, in some examples, can include removable or non-removable (or fixed) media, where appropriate. The memory 302 can be internal or external to the electronic device, where appropriate. In some particular embodiments, the memory 302 is non-volatile solid-state memory.
[0069] In some particular embodiments, the memory can include read-only memory (ROM), random access memory (RAM), magnetic disk storage mediums, optical storage mediums, flash memory devices, electrical, optical, or other physical / tangible memory storage devices. Thus, in general, the memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., a memory device) encoded with software that, when executed (e.g., by the one or more processors), is operable to perform operations described with reference to the file conversion method according to the present application.
[0070] The processor 301 implements the file conversion method provided by the embodiments of the present application by reading and executing computer program instructions stored in the memory 302.
[0071] In one example, the electronic device can further include a communication interface 303 and a bus 310. As shown, the processor 301, the memory 302, and the communication interface 303 are connected through the bus 310 and complete communication with each other. Figure 3
[0072] The communication interface 303 is mainly used to realize the communication between the modules, devices, units and / or equipment in the embodiments of the present application.
[0073] Bus 310 includes a hardware, software, or both that couples components of electronic device to each other. As an example and not by way of limitation, bus can include an accelerated graphics port (AGP) or other graphics bus, an Extended Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), a Hyper Transport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an InfiniBand (IB) interconnect, a Low Pin Count (LPC) bus, a memory bus, a Micro Channel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association Local (VLB) bus, or some other suitable bus or interconnect, or a combination of two or more of these. Where appropriate, bus 310 can include one or more buses. Although this application describes and shows a particular bus, this application contemplates any suitable bus or interconnect.
[0074] The electronic device can execute the file conversion method provided by the embodiments of the present application, so as to achieve the corresponding technical effects of the file conversion method provided by the embodiments of the present application.
[0075] In addition, in combination with the file conversion method in the above embodiments, the embodiments of the present application also provide a computer readable storage medium for implementation. The computer readable storage medium has computer program instructions stored thereon; the computer program instructions are executed by the processor to implement the file conversion method provided by the embodiments of the present application. Examples of the computer readable storage medium include non-transitory computer readable media, such as ROM, RAM, magnetic disk or optical disk, etc.
[0076] The embodiments of the present application also provide a computer program product, the instructions in the computer program product are executed by the processor of the electronic device, so that the electronic device executes the file conversion method provided by the embodiments of the present application, and can achieve the same technical effects. To avoid repetition, it will not be repeated here.
[0077] It is to be understood that the application is not limited to the particular configurations and processes described hereinabove and shown in the figures. For the sake of brevity, detailed descriptions of known methods and processes are omitted. In the above embodiments, several specific steps are described and illustrated as examples. However, the method processes of the present application are not limited to the specific steps described and illustrated, and various changes, modifications and additions can be made thereto by one skilled in the art without departing from the spirit of the present application, and the order of the steps can be changed.
[0078] The functional blocks shown in the above described block diagrams can be implemented as hardware, software, firmware, or a combination thereof. When implemented in hardware, they can be, for example, electronic circuits, ASICs, appropriate firmware, plug-ins, functional cards, and the like. When implemented in software, the elements of the present application are program or code segments that are used to perform the required tasks. The program or code segments can be stored in a machine-readable medium or transmitted through a data signal carried in a carrier wave over a transmission medium or communication link. A "machine-readable medium" includes any medium that can store or transfer information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable read-only memory (EROM), floppy disks, compact discs (CD-ROM), optical disks, hard disks, fiber-optic media, radio frequency (RF) links, and the like. The code segments can be downloaded via computer networks such as the Internet, intranet, and the like.
[0079] It is also to be understood that the example embodiments described in the present application are based on a series of steps or apparatus to describe some methods or systems. However, the present application is not limited to the order of the above steps, that is, the steps can be performed in the order mentioned in the embodiments, or in an order different from the embodiments, or several steps can be performed simultaneously.
[0080] The computer program instructions can also be loaded onto a computer, other programmable data processing apparatus, or other processing device to cause a series of operational steps to be performed on the computer, other programmable apparatus or other processing device to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide processes for implementing the functions / acts specified in the flowchart and / or block diagram block or blocks.
[0081] The above solely describes specific implementations of the present application. For the purpose of description and brevity, the specific working process of the system, module and unit described above can refer to the corresponding process in the foregoing method embodiments, which will not be described herein. It should be understood that the protection scope of the present application is not limited to this. Any person skilled in the art can easily think of various equivalent modifications or replacements within the technical range disclosed in the present application, and these modifications or replacements shall be covered within the protection scope of the present application.
Claims
1. A file conversion method, characterized in that, The method includes: Obtain software design documents; Receive file conversion requests; In response to the file conversion request, the software design file is converted into a development file, wherein the development file is a file that can be imported into a database; The process of converting the software design document into a development document includes: Analyze the software design documents; Based on the first data related to the creation of the database table in the parsed data, a database table structure file that can be imported into the database is generated; Based on the second data related to the task in the parsed data, a task file that can be imported into the database is generated; The step of generating a database table structure file that can be imported into the database based on the first data related to the creation of the database table from the parsed data includes: The first data loop related to the creation of database tables is processed. For each table generated, the information of the table is added to a spreadsheet sheet in an Excel spreadsheet. A directory table is created in front of each database table sheet in the Excel spreadsheet. The directory table includes each database table. Clicking on the corresponding database table will jump to the sheet corresponding to the clicked database table. The step of generating a job file that can be imported into the database based on the second data related to the job in the parsed data includes: The second data loop related to the job is processed. For each table to be processed, a job flow information is generated. The first effective time of the job is automatically filled in according to the production date written by the designer, and the strategy is executed. The table data that the processing depends on is obtained according to the table processing rules designed by the designer. The job flow dependency relationship of the corresponding event is generated according to the naming convention. A job information is generated for each field to be processed. The field data that the processing depends on is obtained according to the field processing rules designed by the designer. The job dependency relationship of the corresponding event is generated according to the naming convention. When generating the job file, the technical parameter information required for the job to run is filled in.
2. The method according to claim 1, characterized in that, The parsing of the software design document includes at least one of the following: Check the file format of the software design document; Check if the table headers in the software design file are correct; Check whether the software design file contains special characters that could affect the creation of database tables; Extract the data from the software design file.
3. The method according to claim 1, characterized in that, The software design document is in Excel spreadsheet format. The process of converting the software design document into a development document includes: The software design documents are converted into development documents using the Visual Basic macro language.
4. The method according to claim 1, characterized in that, The database includes: Massive parallel processing of MPP databases.
5. A file conversion device, characterized in that, The device includes: The acquisition module is used to acquire software design documents; The receiving module is used to receive file conversion requests; A conversion module is used to convert the software design file into a development file in response to the file conversion request, wherein the development file is a file that can be imported into a database; The parsing submodule is used to parse the software design file; The first generation submodule is used to generate a database table structure file that can be imported into the database based on the first data related to the creation of the database table in the parsed data. The second generation submodule is used to generate a job file that can be imported into the database based on the second data related to the job in the parsed data; The first generation submodule is specifically used for: The first data loop related to the creation of database tables is processed. For each table generated, the information of the table is added to a spreadsheet sheet in an Excel spreadsheet. A directory table is created in front of each database table sheet in the Excel spreadsheet. The directory table includes each database table. Clicking on the corresponding database table will jump to the sheet corresponding to the clicked database table. The second generation submodule is specifically used for: The second data loop related to the job is processed. For each table to be processed, a job flow information is generated. The first effective time of the job is automatically filled in according to the production date written by the designer, and the strategy is executed. The table data that the processing depends on is obtained according to the table processing rules designed by the designer. The job flow dependency relationship of the corresponding event is generated according to the naming convention. A job information is generated for each field to be processed. The field data that the processing depends on is obtained according to the field processing rules designed by the designer. The job dependency relationship of the corresponding event is generated according to the naming convention. When generating the job file, the technical parameter information required for the job to run is filled in.
6. The apparatus according to claim 5, characterized in that, The parsing submodule is specifically used for at least one of the following: Check the file format of the software design document; Check if the table headers in the software design file are correct; Check whether the software design file contains special characters that could affect the creation of database tables; Extract the data from the software design file.
7. The apparatus according to claim 5, characterized in that, The software design document is in Excel spreadsheet format. The conversion module is specifically used for: The software design documents are converted into development documents using the Visual Basic macro language.
8. The apparatus according to claim 5, characterized in that, The database includes: Massive parallel processing of MPP databases.
9. An electronic device, characterized in that, The electronic device includes: a processor and a memory storing computer program instructions; The processor executes the computer program instructions to implement the file conversion method as described in any one of claims 1-4.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer program instructions, which, when executed by a processor, implement the file conversion method as described in any one of claims 1-4.
11. A computer program product, characterized in that, When the instructions in the computer program product are executed by the processor of the electronic device, the electronic device performs the file conversion method as described in any one of claims 1-4.
Citation Information
Patent Citations
Method for automatically converting source data into entity class codes
CN108052549A