CN116167342A - File generation method and device, electronic equipment and storage medium - Google Patents

File generation method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN116167342A
CN116167342A CN202111412887.1A CN202111412887A CN116167342A CN 116167342 A CN116167342 A CN 116167342A CN 202111412887 A CN202111412887 A CN 202111412887A CN 116167342 A CN116167342 A CN 116167342A
Authority
CN
China
Prior art keywords
file
target file
information
configuration
identification information
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
CN202111412887.1A
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.)
Tencent Cyber Tianjin Co Ltd
Original Assignee
Tencent Cyber Tianjin 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 Tencent Cyber Tianjin Co Ltd filed Critical Tencent Cyber Tianjin Co Ltd
Priority to CN202111412887.1A priority Critical patent/CN116167342A/en
Publication of CN116167342A publication Critical patent/CN116167342A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/166Editing, e.g. inserting or deleting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/166Editing, e.g. inserting or deleting
    • G06F40/186Templates

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application provides a file generation method, a device, electronic equipment and a storage medium, which are applied to various scenes such as cloud technology, artificial intelligence, intelligent transportation, internet of vehicles and the like, and the method comprises the following steps: responding to a file generation request carrying configuration identification information, and acquiring file configuration information corresponding to the configuration identification information, a target file generation command corresponding to the configuration identification information and a target file template corresponding to the target file generation command; the file configuration information is obtained in response to a configuration information editing instruction triggered by editing the page based on the configuration information; updating information corresponding to the field information in the target file template based on the field information to obtain an updated target file template; and generating the target file corresponding to the configuration identification information according to the updated target file template and the folder identification information. The method reduces the consumption of system resources in the file generation process and improves the development efficiency of the data table operation codes.

Description

File generation method and device, electronic equipment and storage medium
Technical Field
The application belongs to the technical field of computers, and particularly relates to a file generation method, a file generation device, electronic equipment and a storage medium.
Background
With the continuous development and advancement of computer technology, it is often necessary to perform operations of adding, deleting, modifying and querying (i.e., adding, deleting, modifying) data tables stored in a database, where the operations are required to be performed in response to running instructions of preset data table operation codes.
In the related art, an entire development project is usually generated, and a template page for adding, deleting and modifying table data is built in the entire development project. When a plurality of pages need to be added, deleted and modified, a plurality of template files are generated in a copying mode. However, the related technology is only formulated for a certain frame, if the frame needs to be replaced, a set of module frames needs to be developed again, and the consumption of system resources is increased; in addition, the form and the form page of the template project are used, the fields need to be added one by one in the form of changing codes in response to the modification operation of a developer, and the development efficiency of the data form operation codes is low.
Disclosure of Invention
In order to solve the technical problems, the application provides a file generation method, a file generation device, electronic equipment and a storage medium.
In one aspect, the present application proposes a file generating method, including:
Responding to a file generation request carrying configuration identification information, and acquiring file configuration information corresponding to the configuration identification information, a target file generation command corresponding to the configuration identification information and a target file template corresponding to the target file generation command; the file configuration information comprises field information and folder identification information; the file configuration information is obtained in response to a configuration information editing instruction, and the configuration information editing instruction is triggered based on a configuration information editing page;
updating information corresponding to the field information in the target file template based on the field information to obtain an updated target file template;
and generating a target file corresponding to the configuration identification information according to the updated target file template and the folder identification information.
In another aspect, an embodiment of the present application provides a file generating apparatus, including:
the response module is used for responding to a file generation request carrying configuration identification information and acquiring file configuration information corresponding to the configuration identification information, a target file generation command corresponding to the configuration identification information and a target file template corresponding to the target file generation command; the file configuration information comprises field information and folder identification information;
The updating module is used for updating information corresponding to the field information in the target file template based on the field information to obtain an updated target file template;
and the generating module is used for generating the target file corresponding to the configuration identification information according to the updated target file template and the folder identification information.
In another aspect, the application proposes an electronic device for file generation, the electronic device comprising a processor and a memory, the memory storing at least one instruction or at least one program, the at least one instruction or at least one program being loaded and executed by the processor to implement a method for file generation as described above.
In another aspect, the present application proposes a computer readable storage medium having stored therein at least one instruction or at least one program, the at least one instruction or the at least one program being loaded and executed by a processor to implement a file generation method as described above.
In another aspect, the present application proposes a computer program product comprising a computer program which, when executed by a processor, implements a file generation method as described above.
According to the file generation method, the device, the electronic equipment and the storage medium, the file templates are formulated in advance for different frameworks, when responding to the file generation request carrying the configuration identification information, the corresponding target file generation command can be acquired and executed, the corresponding information in the target file template corresponding to the target file generation command is updated by using the file configuration information corresponding to the configuration identification information, the updated target file template is obtained, and the target file corresponding to the configuration identification information is generated according to the updated target file template and the folder identification information. Because the file template is formulated in advance, the target file template corresponding to the target file generation command can be used for generating the target file (namely, only different commands are needed to be used in running, and the needed page can be generated in different code forms) only by acquiring and executing the target file generation command corresponding to the configuration identification information, so that the consumption of the file generation process on system resources is reduced; in addition, the field information in the file configuration information edited by the configuration information editing page by the user is adopted to automatically update the corresponding information in the target file template, so that the defect of low file generation efficiency caused by updating the fields one by one in a mode of changing codes can be avoided, the file generation efficiency is improved, and the development efficiency of the data table operation codes is improved.
Drawings
In order to more clearly illustrate the technical solutions and advantages of embodiments of the present application or of the prior art, the following description will briefly introduce the drawings that are required to be used in the embodiments or the prior art descriptions, it is obvious that the drawings in the following description are only some embodiments of the present application, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic diagram illustrating an implementation environment of a file generation method according to an exemplary embodiment.
Fig. 2 is a flow diagram illustrating a method of file generation according to an exemplary embodiment.
Fig. 3 is a flow diagram illustrating a process for generating configuration identification information, file configuration information, and a selection target file generation command according to an exemplary embodiment.
FIG. 4 is a schematic diagram of a configuration identification editing page, shown in accordance with an exemplary embodiment.
Fig. 5 is a schematic diagram of a configuration information editing page, according to an example embodiment.
FIG. 6 is a schematic diagram of an identity list page, according to an example embodiment.
Fig. 7 is a flow chart illustrating another file generation method according to an exemplary embodiment.
Fig. 8 is a schematic flow chart of generating a target file corresponding to the configuration identification information according to the updated target file template and the folder identification information according to an exemplary embodiment.
Fig. 9 is a flow diagram illustrating a process for generating a target file according to an exemplary embodiment.
Fig. 10 is a schematic flow chart of another generation of a target file according to an exemplary embodiment.
Fig. 11 is a schematic diagram illustrating a preset file generation command according to an exemplary embodiment.
Fig. 12 is a schematic diagram illustrating file configuration information corresponding to execution configuration identification information of an rcloud command according to an exemplary embodiment.
FIG. 13 is a schematic diagram of a target file, according to an example embodiment.
FIG. 14 is a schematic diagram of a list page shown in accordance with an exemplary embodiment.
FIG. 15 is a diagram illustrating an interface page that appears to debug an interface according to requirements, according to an example embodiment.
FIG. 16 is a schematic diagram illustrating a detail page presented by clicking on the detail in FIG. 15, according to an exemplary embodiment.
Fig. 17 is a schematic diagram of a detail editing page shown in accordance with an exemplary embodiment in which the editing in fig. 15 appears clicked.
Fig. 18 is a schematic diagram of a file generating apparatus according to an exemplary embodiment.
Fig. 19 is a block diagram showing a hardware configuration of a server of a file generation method according to an exemplary embodiment.
Detailed Description
Cloud technology (Cloud technology) refers to a hosting technology for integrating hardware, software, network and other series resources in a wide area network or a local area network to realize calculation, storage, processing and sharing of data.
The cloud technology is a generic term of network technology, information technology, integration technology, management platform technology, application technology and the like based on cloud computing business model application, can form a resource pool, and is flexible and convenient as required. Background services of technical networking systems require a large amount of computing, storage resources, such as video websites, picture-like websites, and more portals. Along with the high development and application of the internet industry, each article possibly has an own identification mark in the future, the identification mark needs to be transmitted to a background system for logic processing, data with different levels can be processed separately, and various industry data needs strong system rear shield support and can be realized only through cloud computing. Specifically, cloud technology includes technical fields of security, big data, databases, industry applications, networks, storage, management tools, computing, and the like.
In particular, embodiments of the present application relate to database technology in cloud technology.
In order to make the present application solution better understood by those skilled in the art, the following description will be made in detail and with reference to the accompanying drawings in the embodiments of the present application, it is apparent that the described embodiments are only some embodiments of the present application, not all embodiments. All other embodiments, which can be made by one of ordinary skill in the art based on the embodiments herein without making any inventive effort, shall fall within the scope of the present application.
It should be noted that the terms "first," "second," and the like in the description and claims of the present application and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that embodiments of the present application described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or server that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed or inherent to such process, method, article, or apparatus, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Fig. 1 is a schematic diagram illustrating an implementation environment of a file generation method according to an exemplary embodiment. As shown in fig. 1, the implementation environment may include at least a client 01 and a server 02.
The client 01 may be configured to obtain file configuration information corresponding to the configuration identification information, a target file generation command corresponding to the configuration identification information, and a target file template corresponding to the target file generation command in response to a file generation request carrying the configuration identification information; the file configuration information comprises field information and folder identification information; the method comprises the steps of obtaining a field information, and updating information corresponding to the field information in a target file template based on the field information to obtain an updated target file template; and generating the target file corresponding to the configuration identification information according to the updated target file template and the folder identification information. Alternatively, the client 01 may be a smart phone, a tablet computer, a notebook computer, a desktop computer, a smart speaker, a smart watch, a vehicle-mounted terminal, a smart television, a smart voice interaction device, or the like, but is not limited thereto. The client 01 and the server 02 may be directly or indirectly connected through wired or wireless communication, which is not limited herein.
Wherein the server 02 may be used to provide background services for the client 01. Alternatively, the server 02 may be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a cloud server that provides a cloud computing service.
It should be noted that fig. 1 is only one implementation environment of the file generating method provided in the embodiment of the present application, and other implementation environments may also be included in practical applications.
Fig. 2 is a flow diagram illustrating a method of file generation according to an exemplary embodiment. The method may be used for a client in the implementation environment of fig. 1. The present specification provides method operational steps as described in the examples or flowcharts, but may include more or fewer operational steps based on conventional or non-inventive labor. The order of steps recited in the embodiments is merely one way of performing the order of steps and does not represent a unique order of execution. When implemented in a real system or server product, the methods illustrated in the embodiments or figures may be performed sequentially or in parallel (e.g., in a parallel processor or multithreaded environment). As shown in fig. 2, the method may include:
S101, responding to a file generation request carrying configuration identification information, and acquiring file configuration information corresponding to the configuration identification information, a target file generation command corresponding to the configuration identification information and a target file template corresponding to the target file generation command; the file configuration information comprises field information and folder identification information; the file configuration information is obtained in response to a configuration information editing instruction that is triggered based on a configuration information editing page.
In the embodiment of the present application, the client may respond to the file generation request in various manners, and the embodiment of the present application is not specifically limited herein.
In a possible embodiment, the file generation request may be triggered by a user as required, and in the step S101, the obtaining, in response to the file generation request carrying the configuration identification information, file configuration information corresponding to the configuration identification information, a target file generation command corresponding to the configuration identification information, and a target file template corresponding to the target file generation command may include: and responding to a file generation request carrying configuration identification information triggered by a user, and acquiring the file configuration information, the target file generation command and the target file template. For example, when the user needs to generate the target file, the corresponding page may be opened and an operation is performed on the corresponding page, so as to trigger the file generation request, and the client side responds to the file generation request to obtain the file configuration information, the target file generation command and the target file template.
In another possible embodiment, the user may also set a program in the client in advance that automatically triggers the file generation request at some point in the future. In the case that the current time reaches a certain future point in time, the program automatically triggers the file generation request in step S101, and the client obtains the file configuration information, the target file generation command, and the target file template in response to the file generation request. For example, the user sets a program for automatically triggering the file generation request at a certain point of time after a day, a certain point of time after a week, a certain point of time after a month in advance in the client. The program automatically triggers the file generation request when the current time reaches a certain time point after one day, a certain time point after one week and a certain time point after one month, and the client side responds to the file generation request to acquire the file configuration information, the target file generation command and the target file template, so that the automation degree of the target file generation process is improved.
In another possible embodiment, the client may also automatically trigger and respond to the file generation request to obtain the file configuration information, the target file generation command, and the target file template. For example, the client may take "week" as a time period, automatically trigger and respond to the file generation request in a timing manner, and acquire the file configuration information, the target file generation command and the target file template, so as to further improve the automation degree of the target file generation process.
Optionally, the configuration identification information is used to uniquely identify corresponding file configuration information, which may include, but is not limited to: unique codes, identification numbers, account numbers, etc. The number of configuration identification information may be one or more.
Optionally, the file configuration information may include, but is not limited to: field information and folder identification information. Illustratively, the field information may include, but is not limited to: fields, field names, field types, etc. The folder identification information may include, but is not limited to: folder name, folder code, etc. Wherein the field is a member variable. The field name is the name of the member variable. The field types include, but are not limited to: integer type (Int), string type (char), bit data type (bit), etc.
In an operational embodiment, the configuration identification information, the file configuration information, the target file generation command, and the target file template may be generated in advance before the file configuration information, the target file generation command, and the target file template are acquired.
Fig. 3 is a flow diagram illustrating a process for generating configuration identification information, file configuration information, and a target file generation command according to an exemplary embodiment. As shown in fig. 3, the generating the configuration identification information, the file configuration information, and the target file generation command may include:
S201, responding to a configuration identifier editing instruction triggered based on a configuration identifier editing page, and obtaining the configuration identifier information.
S203, responding to a first operation instruction triggered based on the configuration identification editing page, and displaying the configuration information editing page.
S205, responding to the configuration information editing instruction triggered by the configuration information editing page to obtain file configuration information corresponding to the configuration identification information.
S207, responding to an identification list generation instruction triggered by editing the page based on the configuration information, and displaying an identification list page; the identification list page includes an identification list of the configuration identification information.
S209, responding to a second operation instruction triggered based on the configuration identification information in the identification list, and displaying a command selection page; the command selection page comprises at least one preset file generation command.
S2011, responding to a selection instruction triggered by the page selection based on the instruction, and taking a preset file generation instruction corresponding to the selection instruction as the target file generation instruction.
In this embodiment of the present application, the client may generate the configuration identification information, the file configuration information, the target file generation command, and the target file template in a plurality of manners, which is not specifically limited herein.
In an alternative embodiment, in the step S201, the process of generating the configuration identification information may be as follows: the client displays the configuration identification editing page. The configuration identification editing page can comprise an editing box of configuration identification information, a user can edit in the editing box, so that the configuration identification editing instruction is triggered, and the client responds to the configuration identification editing instruction to obtain the configuration identification information.
In another alternative embodiment, in the above step S201, the process of generating the configuration identification information may be as follows: the client displays the configuration identification editing page. The configuration identification editing page can comprise an editing frame with configuration identification information, a user clicks the editing frame, the client side responds to the clicking operation to display a drop-down frame corresponding to the editing frame, and the drop-down frame can comprise a plurality of preset configuration identification information. And the user selects in the drop-down box, so that the configuration identification editing instruction is triggered, and the client responds to the configuration identification editing instruction to obtain the configuration identification information. The plurality of preset configuration identification messages are displayed in the drop-down frame for the user to select, so that user experience can be improved.
In an operational embodiment, in the above step S203, the process of presenting the configuration information editing page may be as follows: the user may perform a first operation on the configuration identifier editing page (the first operation may include, but is not limited to, clicking, long pressing, dragging, etc.), thereby triggering the first operation instruction, and the client side responds to the first operation instruction to display the configuration information editing page.
In another operational embodiment, in the above step S203, the process of presenting the configuration information editing page may be as follows: in a preset time period (for example, 60 s) after the configuration identification information is obtained, any operation performed by the user on the configuration identification editing page is not received, and then the client can automatically display the configuration information editing page, so that the automation degree and the user experience of the target file generating process are improved.
In a possible embodiment, in the step S205, the process of generating the file configuration information may be as follows: the configuration information editing page can comprise at least one editing box, a user can edit in the editing box, so that the configuration information editing instruction is triggered, and the client responds to the configuration information editing instruction to obtain file configuration information corresponding to the configuration identification information.
In another possible embodiment, in the step S205, the process of generating the file configuration information may be as follows: the configuration information editing page can comprise at least one editing frame, a user can click on the editing frame, the client side responds to the click operation to display a drop-down frame corresponding to the editing frame, and the drop-down frame can comprise a plurality of preset file configuration information. And the user selects from the drop-down frame so as to trigger the configuration information editing instruction, and the client responds to the configuration identification editing instruction to obtain the file configuration information. The preset configuration information of the files is displayed in the drop-down frame so that the user can select the configuration information, and user experience can be further improved.
In an alternative embodiment, in the step S207, the process of presenting the identification list page may be as follows: the configuration information editing page can comprise an identification list generation control, a user clicks the identification list generation control, so that an identification list generation instruction is triggered, a client side responds to the identification list generation instruction to generate an identification list, and the generated identification list is displayed in the identification list page.
In another alternative embodiment, in the step S207, the process of displaying the identification list page may be as follows: in a preset time period (for example, 30 s) after the file configuration information is obtained, any operation of a user for editing the page according to the configuration information is not received, and then the client can automatically generate an identification list according to the file configuration information existing in the page edited by the configuration information, and automatically display the generated identification list in the identification list page, so that the automation degree and the user experience of the target file generation process are improved.
In an exemplary embodiment, in the above step S209, the process of presenting the command selection page may be as follows: the user may click on the configuration identification information in the identification list, thereby triggering the second operation instruction (the second operation may include, but is not limited to, clicking, long pressing, dragging, etc.), and the client responds to the second operation instruction to display a command to select a page.
In another exemplary embodiment, in the above step S209, the process of presenting the command selection page may be as follows: and in a preset time period (for example, 30 s) after the identification list page is displayed, if any operation performed by the user on the identification list page is not received, the client can automatically display the command selection page according to the configuration identification information existing in the identification list.
In one operational embodiment, in the step S209, the process of presenting the command selection page may be as follows: the identification list page can also comprise a command selection control, and the user can click on the command selection control so as to display the command selection page.
In an exemplary embodiment, in the above step S209, the process of presenting the command selection page may be as follows: the identification list page can also comprise a command selection list or a command selection box, and the user can click on the command selection list or the command selection box to directly display the command selection page in the identification list page.
In an alternative embodiment, as described in the above step S2011, the process of generating the target file generation command may be as follows: the command selection page may include one or more preset file generation commands, where the number of preset file generation commands is one, and the target file generation command corresponding to each configuration identification information is the same, and at this time, command selection may not be performed, that is, the file configuration information corresponding to each configuration identification information is executed by default through the same target file generation command, and of course, the unique preset file generation command may also be selected, so as to trigger a selection instruction. Under the condition that the number of the preset file generation commands is multiple, the target file generation commands corresponding to each piece of configuration identification information can be the same or different, a user can select the target file generation commands in a command selection page according to requirements, so that the selection command is triggered, and the client responds to the selection command and takes the preset file generation command corresponding to the selection command as the target file generation command. The target file generation command is used for executing file configuration information corresponding to the corresponding configuration identification information (namely, rendering a target template corresponding to the target file generation command by using the file configuration information edited by a user in the configuration information editing page) when the target file generation command is called, so that a corresponding template file is obtained.
In an alternative embodiment, as described in the above step S2011, the process of generating the target file generation command may be as follows: one or more preset file generation commands may be included in the command selection page. Under the condition that the number of the preset file generation commands is one, the target file generation commands corresponding to each piece of configuration identification information are identical, and if the client does not receive any operation of a user in the command selection page within the preset time after the command selection page is displayed, the file configuration information corresponding to each piece of configuration identification information is executed by default through the same target file generation command. If the client side does not receive any operation of the user in the command selection page within the preset time after the command selection page is displayed under the condition that the number of the preset file generation commands is multiple, the preset file generation commands which are matched with the preset file configuration information are automatically selected from the multiple preset file generation commands to serve as the target file generation commands.
The following describes, for example, the generation process of the configuration identification information, the file configuration information, and the target file generation command in the step S201-the step S2011:
FIG. 4 is a schematic diagram of a configuration identification editing page, shown in accordance with an exemplary embodiment. Fig. 5 is a schematic diagram of a configuration information editing page, according to an example embodiment. FIG. 6 is a schematic diagram of an identity list page, according to an example embodiment.
As shown in fig. 4, the configuration identifier editing page may include a configuration identifier editing box, a "new" control, a "query" control, and the like, where the configuration identifier editing box is used for the user to edit or select the configuration identifier, the "new" control is used for creating an identifier list, and the "query" control is used for querying the configuration identifier or the created identifier list. And clicking the identification information editing box by the user, triggering the configuration identification information editing instruction, and responding to the configuration identification information editing instruction by the client to obtain the configuration identification information.
When the user clicks the "new" control in fig. 4, a configuration information editing page as shown in fig. 5 will be displayed, where an editing box of various configuration information (for example, folder identification information, fields, field types) may be included in the configuration information editing page, and the user may edit various configuration information in the editing box, so as to trigger the configuration information editing instruction, and the client responds to the configuration information editing instruction to obtain file configuration information corresponding to the configuration identification information.
After the file configuration information is edited, the user may click on the "confirm" control in fig. 5, where the "confirm" control may be understood as an identification list generation control, so as to trigger an identification list generation instruction, and the client generates an identification list in response to the identification list generation instruction, and displays an identification list page as shown in fig. 6, where an identification list including the configuration identification information is displayed.
The user can click configuration identification information displayed in the identification list page so as to trigger a second operation instruction, the client responds to the second operation instruction and displays a command selection page, the command selection page can comprise one or more preset file generation commands which are preset, the user selects in the command selection page so as to trigger a selection instruction, and the client responds to the selection instruction and takes the preset file generation command corresponding to the selection instruction as a target file generation command corresponding to the configuration identification information. For example, the command selection page includes a preset file generation command 1, a preset file generation command 2, and a preset file generation command 3, and if the user selects the preset file generation command 2, the preset file generation command 2 is taken as the target file generation command.
In the embodiment of the application, the file configuration information can be obtained in response to the configuration information editing instruction triggered by the user in the configuration information editing page, and the file configuration information can be used for updating the corresponding information in the target file template, so that the target file is obtained. By means of configuration information edited by a user in the configuration information editing page, the method can avoid adding fields one by one in the form of changing codes, improves file generation efficiency, and improves development efficiency of data form operation codes. In addition, as the number of the preset file generation commands may be multiple, the user can select the command to be executed according to the need by displaying the command selection page to the user and responding to the selection command triggered by the user in the command selection page, and the preset file generation command corresponding to the selection command is used as the target file generation command, so that the flexibility and the user experience of generating the target file are improved.
In one possible embodiment, the process of generating the target file template may be as follows:
a file template can be set for each preset file generation command in advance, and the file template corresponding to the target file generation command is the target file template. For example, if the preset file generation command is a close command, the corresponding file template is a vue template, and if the preset file generation command is an rcloud command, the corresponding file template is a compact template. If the target file generation command is a close command, the target file template is a vue template, and if the target file generation command is an rcloud command, the target file template is a reaction template. Wherein, executing the target file generation command will result in a file associated with the form of the target file template corresponding to the target file generation command.
In this embodiment of the present application, the preset file generation command may also be preset. In one operational embodiment, a preset framework (e.g., a corporation) may be used to build a file (e.g., bin/cli. Js) that binds execution commands to execution in a preset file (e.g., package. Json). And sets the preset file generation command using a first preset function (e.g., command function).
Specifically, package. Json indicates the name of the command (will) and the preset file (e.g., bin/cli. Js) that the user needs to invoke when entering the command at the client. The preset file (e.g., bin/cli. Js) may contain commands and a list of individual functions. Where corporation refers to a front end framework (CLI framework) that supports auto-completion, auto-build help, grammatical friendliness, for building projects. package JSON refers to a JSON object, each member of which is an item setting of the current item. JSON refers to a lightweight data exchange format.
Specifically, the command function is used to return command line parameters at program runtime. It corresponds to a string variable, and only requires direct call of Command or Command () to get the Command line parameters of the program.
In a possible embodiment, after the configuration identification information, the file configuration information, the target file generation command, and the target file template are generated, in step S101, the file configuration information, the target file generation command, and the target file template may be acquired in response to a file generation request triggered by the user based on the configuration identification information shown in the identification list page in fig. 6.
In this embodiment of the present application, the client may acquire the configuration identification information, the file configuration information, the target file generation command, and the target file template in a plurality of manners, which is not specifically limited herein.
In a specific embodiment, in the step S101, the process of obtaining the configuration identification information may be as follows: a second preset function may be created in advance, and a variable for acquiring the user-generated configuration identification information may be set in the second preset function (e.g., the option function). After responding to the file generation request, the client can acquire configuration identification information obtained by the user in the identification editing page through editing through variables in the second preset function. The configuration identification information is obtained from the local storage through the variable set in the second preset function, so that the efficiency of obtaining the configuration information can be improved.
In another specific embodiment, in the step S101, the process of obtaining the configuration identification information may be as follows: after the configuration identification information is obtained in response to a configuration identification editing instruction triggered by a user editing a page based on the configuration information, the configuration identification information can be stored in a preset database, the client can send a configuration identification information acquisition instruction to the preset database after responding to the file generation request, and the preset database responds to the instruction and sends the configuration identification information to the client. The configuration information is stored through the preset database, so that the storage pressure of the client can be reduced, and the efficiency of generating the target file is improved.
In a possible embodiment, in the step S101, the process of acquiring the file configuration information, the target file generation command, and the target file template may be as follows: the client may store the file configuration information and the target file generation command locally. After responding to the file generation request, the client may acquire the file configuration information, the target file generation command, and the target file template from the current storage.
In another possible embodiment, in the step S101, the process of acquiring the file configuration information, the target file generation command, and the target file template may be as follows: the client may store the file configuration information and the target file generation command in a preset database, and after responding to the file generation request, the client may send a configuration identification information acquisition instruction to the preset database, and the preset database responds to the instruction and sends the file configuration information, the target file generation command and the target file template to the client. The configuration information is stored through the preset database, so that the storage pressure of the client can be reduced, and the efficiency of generating the target file is improved.
In an alternative embodiment, in the step S101, the target file template may be obtained according to a target file generating command.
Fig. 7 is a flow chart illustrating another file generation method according to an exemplary embodiment. As shown in fig. 7, in the step S101, the obtaining the target file template corresponding to the target file generation command may include:
s10101, based on the target file generation command, acquiring the position information of a file template catalog; the file template directory is used for storing the target file templates.
S10103, acquiring the target file template from the file template catalog according to the position information.
Illustratively, continuing with fig. 7, prior to S101 above, the method may further include:
s100, presetting a file template catalog for storing target file templates through a preset template engine.
Specifically, in the step S100, a file template directory may be set in advance by a preset template engine, nunjucks.
The Nunjucks is a JavaScript-specific, rich-function and powerful template engine, which is a component for constructing character string output based on template matching data. Configuration is script configuration, javaScript is a lightweight, interpreted or just-in-time compiled programming language with function prioritization.
Alternatively, after the setting of the file template directory is completed, a preset template may be stored in the file template directory. And defines template configuration information for generating the target file, which may include, but is not limited to: variable symbols, loop start position, end position symbols, etc. The template configuration information is used in a subsequent process of rendering the target file template.
In the above steps S10101-S10103, after the client acquires the target file generation command, the target file generation command may be executed, and the location information of the file template directory may be found according to the target file generation command. Because the target file module is stored in the file template target, the target file template can be acquired from the file template catalog according to the position information, so that the target file template which is generated in advance can be conveniently acquired, the defect of low target file generation efficiency caused by generating the template in the target file generation process is avoided, the target file generation efficiency is improved, and the development efficiency of the data form operation code is improved.
Hereinafter, S100 and S101 will be described by taking a target file generation command group command and a target file template vue as an example:
the execution command and the file (e.g., bin/cli. Js) to be executed are bound in a preset file (e.g., package. Json) previously constructed using a preset framework (e.g., a corporation). And sets the close command using a first preset function (e.g., command function).
The file template directory for storing vue templates is set in advance by a preset template engine (e.g., nunjucks. Configuration).
The client responds to a file generation request triggered by a user based on configuration identification information in an identification list page, and obtains the configuration identification information edited by the user on an identification editing page and a closed command corresponding to the configuration identification information through variables in a second preset function (such as a session function).
The client executes the close command and searches the position information of the file template catalogue for storing the vue template according to the close command; the client obtains the vue template from the file template catalog according to the position information.
Hereinafter, S100 and S101 will be described by taking the target file generation command as an rcloud command and the target file template as a reaction template as an example:
the execution command and the file (e.g., bin/cli. Js) to be executed are bound in a preset file (e.g., package. Json) previously constructed using a preset framework (e.g., a corporation). And sets the rcloud command using a first preset function (e.g., command function).
The file template directory for storing the reaction templates is set in advance by a preset template engine (e.g., nunjucks. Configuration).
The client responds to a file generation request triggered by a user based on configuration identification information in an identification list page, and obtains the configuration identification information edited by the user on an identification editing page and a closed command corresponding to the configuration identification information through variables in a second preset function (such as a session function).
The client executes the rcloud command and searches the position information of the file template catalog for storing the reaction template according to the rcloud command; and the client acquires the reaction template from the file template catalog according to the position information.
S103, based on the field information, updating information corresponding to the field information in the target file template to obtain an updated target file template.
In an exemplary embodiment, the updating the information corresponding to the field information in the target file template based on the field information may include: and replacing corresponding information in the target file template by using the field information.
In another exemplary embodiment, the updating the information corresponding to the field information in the target file template based on the field information may include: the field information is used to modify the corresponding information in the target file template.
In another exemplary embodiment, the updating the information corresponding to the field information in the target file template based on the field information may include: and adding the field information into information corresponding to the field information in the target file template.
In an alternative embodiment, continuing to fig. 7, in S103, updating the information corresponding to the field information in the target file template based on the field information to obtain an updated target file template may include:
s10301, traversing the field information based on a preset circulating statement and a preset conditional statement.
S10303, replacing information corresponding to the field information in the target file template based on the traversed field information to obtain the updated target file template.
Illustratively, the preset loop statement may include, but is not limited to: for statements, while statements, and do While statements, etc. The preset conditional statement may be an if statement.
Illustratively, in the step S10301, the field information may be executed by a preset loop sentence and a preset conditional sentence, so as to obtain all the traversed field information. For example, the preset loop sentence is a for sentence, the preset condition sentence is an if sentence, and the for sentence and the if sentence may have only one sentence, but when the for sentence and the if sentence are used for executing the field information, all the self-field information corresponding to the field information will be traversed.
Illustratively, in the step S10303, the information corresponding to the field information in the target template may be replaced according to all the traversed field information, that is, all the traversed field information is injected into the target file template, so as to obtain the updated target file template.
Hereinafter, S103 will be described by taking the object file generation command as a close command and the object file template as a vue template as an example:
the client traverses field information included in the file configuration information according to the for statement and the if statement. And the client replaces the information corresponding to the field information of the vue template based on the traversed field information to obtain the updated vue template.
Hereinafter, S103 will be described by taking the target file generation command as an rcloud command and the target file template as a reaction template as an example:
the client traverses field information included in the file configuration information according to the while statement and the if statement. And the client replaces the information corresponding to the field information of the reaction template based on the traversed field information to obtain the updated reaction template.
In an alternative embodiment, in order to avoid that the client is attacked by cross site scripting (XSS), before executing the foregoing S10301, the escape processing may be further performed on the sensitive field information and the malicious field information that easily cause the XSS attack according to the field types in the field information, and after the escape processing, the foregoing step S10301 is performed, so as to avoid that the client is attacked by XSS, and improve the security of the client.
In this embodiment of the present application, the client may perform the escape processing on the sensitive field information and the malicious field information in a plurality of ways, which is not specifically limited herein.
In a specific embodiment, the escape processing of sensitive field information and malicious strings may include: deleting the sensitive field information needing to be escaped, and replacing characters in the deleted sensitive field information by using a blank character string.
In another specific embodiment, the escaping processing of the sensitive field information and the malicious character string may further include: and acquiring a preset escape rule corresponding to the characters contained in the sensitive field information to be escape, and escaping the characters contained in the sensitive field information according to the preset escape rule. For example, the sensitive field information contains a sensitive character of "chinese", which can be converted into "% d6% d0% b9% FA", and since one chinese character requires two bytes, the "chinese" is replaced with four information exchange standard code (ASCII) characters.
In the embodiment of the application, after the field information is acquired, the field information can be traversed through a preset circulating statement and a preset conditional statement, so that all required field information is traversed, and according to all traversed field information, the information corresponding to the field information in the target file template is replaced, so that the field is prevented from being updated one by one in a mode of changing codes, the file generation efficiency is improved, and the development efficiency of the data form operation codes is further improved.
S105, generating a target file corresponding to the configuration identification information according to the updated target file template and the folder identification information.
In a possible embodiment, in S105, the updated target file template may be stored in a folder corresponding to the folder identification information, so as to obtain the target file. The target file may be a template file including an application program interface (Application Programming Interface, API) file, a list page, a detail page, etc. of the table data add-delete-change related function. The API may be an interactive interface for adding and deleting the modified data between the front end and the back end.
Illustratively, the folder identification information may include, but is not limited to: folder name, folder code, etc.
Fig. 8 is a schematic flow chart of generating a target file corresponding to the configuration identification information according to the updated target file template and the folder identification information according to an exemplary embodiment. As shown in fig. 8, in S105, the generating the target file corresponding to the configuration identification information according to the updated target file template and the folder identification information may further include:
S10501, rendering out the component based on the updated target file template.
S10503, generating a file storage path according to the preset project path and the folder identification information.
S10505, writing the components into folders corresponding to the folder identification information to obtain the target file when the folder identification information exists in the file storage path.
In this embodiment of the present application, the client may render the component and generate the file storage path in a plurality of manners, which is not specifically limited herein.
In a possible embodiment, in the step S10501, the updated target file template may be rendered according to Nunjucks, so as to obtain a component corresponding to the target file template.
In an alternative embodiment, in the step S10503, the file storage path may be generated according to the preset item path and the folder identification information (e.g., folder name, etc.) edited by the user on the configuration information editing page. The preset project path is a path preset according to actual requirements. For example, if the preset item path is D_aaa_bbb and the folder identification information is ccc, the generated file storage path may be D_aaa_bbb_ccc.
In a specific embodiment, the client may pass the rendered component to the FS module of node. Js, where the FS module determines whether the folder identification information exists in the file storage path.
In the above step S10505, if it is determined by the FS module that the folder identification information already exists in the file storage path, which indicates that the folder corresponding to the configuration identification information already exists in the storage path, the component may be directly written into the folder corresponding to the folder identification information, thereby obtaining the target file. Wherein node. Js is a JavaScript runtime environment. FS is an abbreviation of file system, which provides a read-write capability of a local file, and can implement functions of reading a file, writing a file, copying a file, deleting a file, and the like.
In an alternative embodiment, as further shown in fig. 8, the method may further include:
s10507, creating a folder corresponding to the folder identification information when the folder identification information does not exist in the file storage path; and writing the components into folders corresponding to the folder identification information to obtain the target file.
Specifically, in the above step S10507, if it is determined by the FS module that the folder identification information does not exist in the file storage path, which indicates that the file storage path does not contain the folder corresponding to the folder identification information, the folder corresponding to the folder identification information may be created, and the component may be written into the folder corresponding to the folder identification information, to obtain the target file.
In the embodiment of the invention, under the condition that the folder identification information edited in advance by the user exists in the file storage path, the corresponding folder is not created, and the rendered component is directly written into the folder corresponding to the folder identification information, so that the generation efficiency of the target file can be improved. Under the condition that the folder identification information does not exist in the file storage path, the corresponding folder is created, repeated creation of the folder can be avoided, complexity of the target file generating process is reduced, and consumption of system resources by the target file generating process is avoided.
Fig. 9 is a flow diagram illustrating a process for generating a target file according to an exemplary embodiment. As shown in fig. 9, in the step S10505 and the step S10507, the writing the component into the folder corresponding to the folder identification information to obtain the target file may include:
s301, determining target file identification information of the target file.
S303, when the file folder does not contain the file corresponding to the target file identification information, creating the file corresponding to the target file identification information in the file folder.
S305, writing the components into the file to obtain the target file.
In the embodiment of the application, the user can pre-determine the target file identification information of the target file to be generated. Illustratively, the object file identification information may include, but is not limited to: file name, file number, etc.
In this embodiment of the present application, the client may determine the target file identification information of the target file in a plurality of manners, which is not specifically limited herein.
Alternatively, in the above step S301, the determining process of the target file identification information may include: the client can display an editing frame of the target file identification information in the configuration information editing page, and the user clicks the editing frame, so that an editing instruction of the target file identification information is triggered, and the client responds to the editing instruction to obtain the target file identification information.
Optionally, in the step S301, the determining process of the target file identification information may further include: the client may generate the target file identification information of the target file after generating the file storage path.
Illustratively, in the step S303, it may be determined whether the folder includes a file corresponding to the target file identification information, and if the folder does not include a file corresponding to the target file identification information, it is indicated that the target file is not currently generated, and then the file corresponding to the target file identification information may be created in the folder.
Illustratively, in the step S305, after the creation of the file corresponding to the target file identification information is completed, the component may be directly written into the file, thereby obtaining the target file. Because the target file identification information is determined in advance, and the component is written in the folder under the condition that the file corresponding to the target file identification information is not included, the generation efficiency of the target file can be improved, the complexity of the target file generation process can be reduced, and the consumption of system resources by the target file generation process can be reduced.
In an alternative embodiment, as further shown in fig. 9, the method may further include:
s307, under the condition that the file folder contains the file corresponding to the target file identification information, the target file is obtained based on the file content of the file replaced by the component.
In this embodiment of the present application, when the folder includes a file corresponding to the target file identification information, it is indicated that the file is currently generated, and then the component may be directly written into the file, so as to obtain the target file. Because the target file identification information is determined in advance, and the file content in the file is replaced by the component under the condition that the file corresponding to the configuration identification information is included in the folder, the generation efficiency of the target file can be improved, the complexity of the target file generation process can be reduced, and the consumption of system resources in the target file generation process can be reduced.
The process of generating the target file by using the preset file generation command including the group command and the rcloud command as an example will be described below:
fig. 10 is a schematic flow chart of another generation of a target file according to an exemplary embodiment. As shown in fig. 10, may include:
s401, using a preset framework (such as a corporation) to construct a file (such as bin/cli. Js) binding an execution command and execution in a preset file (such as a package. Json).
S403, setting a close command and an rcloud command by using a first preset function (such as a command function), wherein the close command is used for creating a vue template file, and the rcloud command is used for creating a compact template page.
Specifically, the closed command is used for executing the file configuration information corresponding to the corresponding configuration identification information when being called, so as to obtain the vue template file. The rcloud command is used for executing the file configuration information corresponding to the corresponding configuration identification information when being called, so as to obtain the compact template file.
Fig. 11 is a schematic diagram illustrating a preset file generation command according to an exemplary embodiment. As shown in fig. 11, different preset file generation commands such as a group command and an rcloud command may be set according to a first preset function (e.g., command function).
S405, setting a variable in a second preset function (such as an option function), wherein the variable is used for acquiring a unique identifier which is expected to be generated by user input.
S407, acquiring configuration identification information.
The configuration identification information may be acquired by the variable set in S405, for example.
S409, calling a create method in the rcloud command or the closed command, and starting to render a corresponding file template by using the file configuration information corresponding to the configuration identification information to obtain the target file.
Specifically, the configuration identification information may be obtained using the variable set in the second preset function in response to a file generation request carrying the configuration identification information.
Optionally, if the user selects the rcloud command in the command selection page, invoking the pre-created rcloud command to obtain file configuration information corresponding to the configuration identification information and a compact template corresponding to the rcloud command; updating information corresponding to field information in a target file template corresponding to the rcloud command according to the field information included in the file configuration information to obtain an updated compact template; and generating a target file corresponding to the configuration identification information according to the updated compact template and the folder identification information.
Optionally, if the user selects a close command in the command selection page, calling a pre-created close command to acquire file configuration information corresponding to the configuration identification information and a vue template corresponding to the close command; updating information corresponding to the field information in the target file template corresponding to the closed command according to the field information included in the file configuration information to obtain an updated vue template; and generating a target file corresponding to the configuration identification information according to the updated vue template and the folder identification information.
Fig. 12 is a schematic diagram illustrating file configuration information corresponding to execution configuration identification information of an rcloud command according to an exemplary embodiment. FIG. 13 is a schematic diagram of a target file, according to an example embodiment.
As shown in fig. 12, the configuration identification information may be obtained, and the rcloud command may be invoked to execute the file configuration information corresponding to the configuration identification information, thereby obtaining the target file shown in fig. 13.
In an optional embodiment, after generating the target file corresponding to the configuration identification information according to the updated target file template and the folder identification information, the method may further include:
Rendering the target file to obtain a template page corresponding to the target file; the template page has the functions of adding, deleting, searching and modifying data.
In an optional embodiment, the process of rendering the target file to obtain the template page corresponding to the target file may include: after the target file is obtained, an address can be assembled according to folder identification information (folder name), configuration identification information (file name), a storage path and the like of the target file, a user can obtain a template page corresponding to the target file by accessing the address, the template page has functions of adding, deleting, searching and modifying data, the user only needs to partially change the effect of certain non-universal templates, the page and API interface file can be obtained, and the functions of adding, deleting, checking and modifying can be completed only by debugging an interface according to the needs of the user.
The following describes functions of adding, deleting, searching and modifying data to a template page:
FIG. 14 is a schematic diagram of a list page shown in accordance with an exemplary embodiment. FIG. 15 is a diagram illustrating an interface page that appears to debug an interface according to requirements, according to an example embodiment. FIG. 16 is a schematic diagram illustrating a detail page presented by clicking on the detail in FIG. 15, according to an exemplary embodiment. Fig. 17 is a schematic diagram of a detail editing page shown in accordance with an exemplary embodiment in which the editing in fig. 15 appears clicked.
Specifically, as shown in fig. 14, the list page has functions of adding, deleting, searching, and modifying data. The user may perform an interface debug operation in fig. 14, triggering an interface debug request, in response to which the client exposes a page as shown in fig. 15.
The page in fig. 15 may include a "detail" control, an "edit" control, a "delete" control, etc., where the "detail" control may be used to expose detailed content of data, the "edit" control may be used to edit the data, and the "delete" control may be used to delete the data. The user clicks the "detail" control in fig. 15, so as to trigger a detail page display request, and the client responds to the detail page display request to display a detail page as shown in fig. 16, through which specific information can be viewed.
The user clicks the "edit" control in fig. 15, thereby triggering an edit page display request, and the client side responds to the edit page display request to display an edit page as shown in fig. 17, through which data can be modified.
According to the file generation method disclosed by the embodiment of the application, the file configuration information, the target file generation command corresponding to the configuration identification information and the target file template corresponding to the target file generation command can be stored on the blockchain.
Fig. 18 is a schematic diagram of a file generating apparatus according to an exemplary embodiment. As shown in fig. 18, the apparatus may include at least:
a response module 501, configured to obtain file configuration information corresponding to the configuration identification information, a target file generation command corresponding to the configuration identification information, and a target file template corresponding to the target file generation command in response to a file generation request carrying the configuration identification information; the file configuration information comprises field information and folder identification information; the file configuration information is obtained in response to a configuration information editing instruction that is triggered based on a configuration information editing page.
And an updating module 503, configured to update information corresponding to the field information in the target file template based on the field information, to obtain an updated target file template.
And the generating module 505 is configured to generate, according to the updated target file template and the folder identification information, a target file corresponding to the configuration identification information.
In an exemplary embodiment, the updating module 503 includes:
the traversing unit is used for traversing the field information based on a preset circulating statement and a preset conditional statement;
And the replacing unit is used for replacing information corresponding to the field information in the target file template based on the traversed field information to obtain the updated target file template.
In an exemplary embodiment, the generating module may include:
and the rendering unit is used for rendering out the component based on the updated target file template.
And the storage path generating unit is used for generating a file storage path according to the preset project path and the folder identification information.
And the first writing unit is used for writing the component into a folder corresponding to the folder identification information to obtain the target file when the folder identification information exists in the file storage path.
In an exemplary embodiment, the generating module may further include:
a second writing unit configured to create a folder corresponding to the folder identification information when the folder identification information does not exist in the file storage path; and writing the components into folders corresponding to the folder identification information to obtain the target file.
In an exemplary embodiment, the first writing unit or the second writing unit may include:
And the target file identification information determining subunit is used for determining the target file identification information of the target file.
A file creation subunit, configured to create, in the folder, a file corresponding to the target file identification information, where the file corresponding to the target file identification information is not included in the folder.
And the first target file generation subunit is used for writing the components into the file to obtain the target file.
In an exemplary embodiment, the first writing unit or the second writing unit may further include:
and the second target file generation subunit is used for obtaining the target file based on the component to replace the file content of the file when the file corresponding to the target file identification information is contained in the folder.
In an exemplary embodiment, the response module may include:
a location information obtaining unit, configured to obtain location information of a file template directory based on the target file generation command; the file template catalog is used for storing the target file template;
and the target file template acquisition unit is used for acquiring the target file template from the file template catalog according to the position information.
In an exemplary embodiment, the apparatus may further include:
the configuration identifier editing instruction response module is used for responding to a configuration identifier editing instruction triggered based on a configuration identifier editing page to obtain the configuration identifier information;
the first operation instruction response module is used for responding to a first operation instruction triggered based on the configuration identification editing page and displaying the configuration information editing page;
the configuration information editing instruction response module is used for responding to the configuration information editing instruction triggered by the configuration information editing page to obtain file configuration information corresponding to the configuration identification information;
the identification list generation instruction response module is used for responding to an identification list generation instruction triggered by editing the page based on the configuration information and displaying the identification list page; the identification list page comprises an identification list of the configuration identification information;
the second operation instruction response module is used for responding to a second operation instruction triggered based on the configuration identification information in the identification list and displaying a command selection page; the command selection page comprises at least one preset file generation command;
and the selection instruction response module is used for responding to a selection instruction triggered by the selection page based on the instruction, and taking a preset file generation instruction corresponding to the selection instruction as the target file generation instruction.
In an exemplary embodiment, the apparatus may further include:
the template page acquisition module is used for rendering the target file to obtain a template page corresponding to the target file; the template page has the functions of adding, deleting, searching and modifying data.
It should be noted that the device embodiments provided in the embodiments of the present application are based on the same inventive concept as the method embodiments described above.
The embodiment of the application also provides electronic equipment for generating the file, which comprises a processor and a memory, wherein at least one instruction or at least one section of program is stored in the memory, and the at least one instruction or the at least one section of program is loaded and executed by the processor to realize the file generation method provided by the embodiment of the method.
Embodiments of the present application also provide a computer readable storage medium that may be provided in a terminal to store at least one instruction or at least one program related to a file generation method for implementing a method embodiment, where the at least one instruction or at least one program is loaded and executed by a processor to implement a file generation method as provided in the method embodiment described above.
Alternatively, in the present description embodiment, the storage medium may be located in at least one network server among a plurality of network servers of the computer network. Alternatively, in the present embodiment, the storage medium may include, but is not limited to: a U-disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a removable hard disk, a magnetic disk, or an optical disk, or other various media capable of storing program codes.
The memory of the embodiments of the present specification may be used for storing software programs and modules, and the processor executes various functional applications and data processing by executing the software programs and modules stored in the memory. The memory may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, application programs required for functions, and the like; the storage data area may store data created according to the use of the device, etc. In addition, the memory may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, the memory may also include a memory controller to provide access to the memory by the processor.
Embodiments of the present application also provide a computer program product or computer program comprising computer instructions stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the file generating method provided by the above-mentioned method embodiment.
The file generation method, the file generation device, the electronic equipment and the storage medium have the following beneficial effects: in the embodiment of the application, as the file templates are prepared in advance for different frames, only the target file generation command corresponding to the configuration identification information is required to be acquired and executed during operation, and the target file can be generated by using the target file template corresponding to the target file generation command (namely, only different commands are required to be used during operation, and the required page can be generated in different code forms), the problem of large system resources caused by developing different templates for different frames is avoided, and the consumption of the system resources in the file generation process is reduced; furthermore, the corresponding information in the target file template is automatically updated by adopting field information in the file configuration information edited by the configuration information editing page by a user, so that the field can be prevented from being updated one by one in a mode of changing codes, the file generation efficiency is improved, and the development efficiency of the data form operation codes is improved; in addition, the generated target file is a template file comprising an API file, a list page, a detail page and the like with the functions related to the addition, deletion and modification of the form data, and the generated file is basically not required to be changed under the strict constraint with a back-end field and an interface, so that the page and the data which meet expectations can be obtained, and the generation of loopholes (bug) is reduced to a certain extent.
The file generation method embodiment provided by the embodiment of the application can be executed in a terminal, a computer terminal, a server or similar computing device. Taking the example of running on a server, fig. 19 is a block diagram of the hardware structure of the server showing a file generation method according to an exemplary embodiment. As shown in fig. 19, the server 600 may vary considerably in configuration or performance, and may include one or more central processing units (Central Processing Units, CPU) 610 (the central processing unit 610 may include, but is not limited to, a microprocessor MCU or a processing device such as a programmable logic device FPGA), a memory 630 for storing data, one or more storage mediums 620 (e.g., one or more mass storage devices) for storing applications 623 or data 622. Wherein the memory 630 and the storage medium 620 may be transitory or persistent storage. The program stored on the storage medium 620 may include one or more modules, each of which may include a series of instruction operations on a server. Still further, the central processor 610 may be configured to communicate with the storage medium 620 and execute a series of instruction operations in the storage medium 620 on the server 600. The Server 600 may also include one or more power supplies 660, one or more wired or wireless network interfaces 650, one or more input/output interfaces 640, and/or one or more operating systems 621, such as Windows Server TM ,Mac OS X TM ,Unix TM ,Linux TM ,FreeBSD TM Etc.
The input-output interface 640 may be used to receive or transmit data via a network. The specific example of the network described above may include a wireless network provided by a communication provider of the server 600. In one example, the input-output interface 640 includes a network adapter (Network Interface Controller, NIC) that can connect to other network devices through a base station to communicate with the internet. In one example, the input/output interface 640 may be a Radio Frequency (RF) module for communicating with the internet wirelessly.
It will be appreciated by those of ordinary skill in the art that the configuration shown in fig. 19 is merely illustrative and is not intended to limit the configuration of the electronic device described above. For example, the server 600 may also include more or fewer components than shown in fig. 19, or have a different configuration than shown in fig. 19.
It should be noted that: the foregoing sequence of the embodiments of the present application is only for describing, and does not represent the advantages and disadvantages of the embodiments. And the foregoing description has been directed to specific embodiments of this specification. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims can be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
In this specification, each embodiment is described in a progressive manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments. In particular, for the device and server embodiments, since they are substantially similar to the method embodiments, the description is relatively simple, and references to the parts of the description of the method embodiments are only required.
It will be appreciated by those of ordinary skill in the art that all or part of the steps of implementing the above embodiments may be implemented by hardware, or may be implemented by a program to instruct related hardware, and the program may be stored in a computer readable storage medium, where the storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
The foregoing description of the preferred embodiments of the present application is not intended to be limiting, but rather is intended to cover any and all modifications, equivalents, alternatives, and improvements within the spirit and principles of the present application.

Claims (13)

1. A method of generating a file, the method comprising:
responding to a file generation request carrying configuration identification information, and acquiring file configuration information corresponding to the configuration identification information, a target file generation command corresponding to the configuration identification information and a target file template corresponding to the target file generation command; the file configuration information comprises field information and folder identification information; the file configuration information is obtained in response to a configuration information editing instruction, and the configuration information editing instruction is triggered based on a configuration information editing page;
Updating information corresponding to the field information in the target file template based on the field information to obtain an updated target file template;
and generating a target file corresponding to the configuration identification information according to the updated target file template and the folder identification information.
2. The method of generating a file according to claim 1, wherein updating information corresponding to the field information in the target file template based on the field information to obtain an updated target file template includes:
traversing the field information based on a preset circulating statement and a preset conditional statement;
and replacing information corresponding to the field information in the target file template based on the traversed field information to obtain the updated target file template.
3. The method of generating a file according to claim 1, wherein generating the target file corresponding to the configuration identification information according to the updated target file template and the folder identification information includes:
rendering out a component based on the updated target file template;
generating a file storage path according to a preset project path and the folder identification information;
And writing the component into a folder corresponding to the folder identification information under the condition that the folder identification information exists in the file storage path, so as to obtain the target file.
4. A file generation method according to claim 3, wherein the method further comprises:
creating a folder corresponding to the folder identification information under the condition that the folder identification information does not exist in the file storage path;
and writing the component into a folder corresponding to the folder identification information to obtain the target file.
5. The method for generating a file according to claim 3 or 4, wherein writing the component into a folder corresponding to the folder identification information to obtain the target file includes:
determining target file identification information of the target file;
creating a file corresponding to the target file identification information in the folder under the condition that the file corresponding to the target file identification information is not contained in the folder;
and writing the component into the file to obtain the target file.
6. The file generation method according to claim 5, characterized in that the method further comprises:
And under the condition that the file folder contains the file corresponding to the target file identification information, replacing the file content of the file based on the component to obtain the target file.
7. The method of generating a file according to claim 1, wherein the obtaining the target file template corresponding to the target file generation command includes:
acquiring the position information of a file template directory based on the target file generation command; the file template catalog is used for storing the target file template;
and acquiring the target file template from the file template catalog according to the position information.
8. The file generation method according to claim 1, characterized in that the method further comprises:
responding to a configuration identifier editing instruction triggered based on a configuration identifier editing page to obtain the configuration identifier information;
responding to a first operation instruction triggered based on the configuration identification editing page, and displaying the configuration information editing page;
responding to the configuration information editing instruction triggered by the page editing based on the configuration information to obtain the file configuration information corresponding to the configuration identification information;
Responding to an identification list generation instruction triggered by editing the page based on the configuration information, and displaying an identification list page; the identification list page comprises an identification list of the configuration identification information;
responding to a second operation instruction triggered based on the configuration identification information in the identification list, and displaying a command selection page; the command selection page comprises at least one preset file generation command;
and responding to a selection instruction triggered by selecting a page based on the instruction, and taking a preset file generation instruction corresponding to the selection instruction as the target file generation instruction.
9. The file generation method according to claim 1 or 8, wherein after the generating the target file corresponding to the configuration identification information based on the updated target file template and the folder identification information, the method further comprises:
rendering the target file to obtain a template page corresponding to the target file; the template page has the functions of adding, deleting, searching and modifying data.
10. A document generating apparatus, the apparatus comprising:
the response module is used for responding to a file generation request carrying configuration identification information and acquiring file configuration information corresponding to the configuration identification information, a target file generation command corresponding to the configuration identification information and a target file template corresponding to the target file generation command; the file configuration information comprises field information and folder identification information; the file configuration information is obtained in response to a configuration information editing instruction, and the configuration information editing instruction is triggered based on a configuration information editing page;
The updating module is used for updating information corresponding to the field information in the target file template based on the field information to obtain an updated target file template;
and the generating module is used for generating the target file corresponding to the configuration identification information according to the updated target file template and the folder identification information.
11. An electronic device for file generation, characterized in that the electronic device comprises a processor and a memory, in which at least one instruction or at least one program is stored, which is loaded and executed by the processor to implement the file generation method according to any of claims 1 to 9.
12. A computer readable storage medium having stored therein at least one instruction or at least one program, the at least one instruction or the at least one program being loaded and executed by a processor to implement the file generation method of any one of claims 1 to 9.
13. A computer program product comprising a computer program, characterized in that the computer program, when executed by a processor, implements the file generation method of any of claims 1 to 9.
CN202111412887.1A 2021-11-25 2021-11-25 File generation method and device, electronic equipment and storage medium Pending CN116167342A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111412887.1A CN116167342A (en) 2021-11-25 2021-11-25 File generation method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111412887.1A CN116167342A (en) 2021-11-25 2021-11-25 File generation method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN116167342A true CN116167342A (en) 2023-05-26

Family

ID=86416940

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111412887.1A Pending CN116167342A (en) 2021-11-25 2021-11-25 File generation method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116167342A (en)

Similar Documents

Publication Publication Date Title
CN111045655B (en) Page rendering method and device, rendering server and storage medium
CN108279932B (en) Method and device for dynamically configuring user interface of mobile terminal
EP3011442B1 (en) Method and apparatus for customized software development kit (sdk) generation
CN106569783B (en) Method and device for executing task script
CN110244942B (en) Page generation method, device and system
CN104731589A (en) Automatic generation method and device of user interface (UI)
CN111427561A (en) Service code generation method and device, computer equipment and storage medium
CN110955428A (en) Page display method and device, electronic equipment and medium
CN104484216A (en) Method and device for generating service interface document and on-line test tool
CN110502212A (en) It is a kind of towards the multilingual online Development Support method of high concurrent
CN111068328A (en) Game advertisement configuration table generation method, terminal device and medium
CN109284488B (en) Method, device and medium for modifying front-end table column data based on local storage
US20200356469A1 (en) Test automation systems and methods using logical identifiers
CN111414158A (en) Cross-platform development method, cross-platform development system and electronic equipment
CN114691132A (en) ARXML file generation method, device, equipment and storage medium
CN112000334A (en) Page development method, device, server and storage medium
CN113268232B (en) Page skin generation method and device and computer readable storage medium
CN112068879A (en) Method and device for constructing client application development framework based on configuration
CN116048517A (en) API (application program interface) generating method, system and device based on B/S (browser/Server) architecture application system
CN116167342A (en) File generation method and device, electronic equipment and storage medium
CN111124386B (en) Animation event processing method, device, equipment and storage medium based on Unity
WO2022099913A1 (en) Interface configuration method and apparatus, and device and medium
CN114449063A (en) Message processing method, device and equipment
CN115525305A (en) Data processing method, application starting method, device, computer equipment and storage medium
CN112835901A (en) File storage method and device, computer equipment and computer readable 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