CN115544988A - Data processing method and device, electronic equipment and computer readable storage medium - Google Patents

Data processing method and device, electronic equipment and computer readable storage medium Download PDF

Info

Publication number
CN115544988A
CN115544988A CN202211204024.XA CN202211204024A CN115544988A CN 115544988 A CN115544988 A CN 115544988A CN 202211204024 A CN202211204024 A CN 202211204024A CN 115544988 A CN115544988 A CN 115544988A
Authority
CN
China
Prior art keywords
target
code
template
field
interface
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
CN202211204024.XA
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.)
Zhongdian Jinxin Software Co Ltd
Original Assignee
Zhongdian Jinxin Software 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 Zhongdian Jinxin Software Co Ltd filed Critical Zhongdian Jinxin Software Co Ltd
Priority to CN202211204024.XA priority Critical patent/CN115544988A/en
Publication of CN115544988A publication Critical patent/CN115544988A/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
    • G06F40/177Editing, e.g. inserting or deleting of tables; using ruled lines
    • G06F40/18Editing, e.g. inserting or deleting of tables; using ruled lines of spreadsheets
    • 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)
  • Stored Programmes (AREA)

Abstract

The embodiment of the application provides a data processing method and device, electronic equipment and a computer readable storage medium, and relates to the field of data processing. The method comprises the following steps: obtaining a target table name to be processed, a target table field, a first template code and a second template code; modifying the first template code according to the target table name and the target table field to obtain a first target code; calling a first target code to create a target data table; modifying the second template code according to the target table name and the target table field to obtain a second target code; and calling the second object code to create the object interface. According to the embodiment of the application, the target database and the corresponding target interface can be automatically created, developers do not need to manually create the corresponding target interface according to the target table names and the target table fields of different target data tables, time and labor are saved, the software development period and cost are reduced, and the production efficiency is improved.

Description

Data processing method and device, electronic equipment and computer readable storage medium
Technical Field
The present application relates to the field of data processing technologies, and in particular, to a data processing method and apparatus, an electronic device, and a computer-readable storage medium.
Background
With the change of usage scenarios, the increase of demand and the frequent change of demand, corresponding software often needs to be developed, and data related to the software is often placed in a data table of a database, so that an operation of creating the data table related to the software in the database or performing incremental, destructive, and censoring on specific data of the data table is often required. At present, a developer is generally required to create an interface matched with a data table, and relevant operations on the data table are realized by calling the interface. However, because the data tables and the interfaces are in one-to-one correspondence, in the prior art, the data tables and the interfaces are often created manually by developers according to specific use scenes and requirements, which not only wastes time and labor, but also affects the period and cost of software development.
Disclosure of Invention
The embodiment of the application provides a data processing method, a data processing device, electronic equipment, a computer readable storage medium and a computer program product, which can solve the problem that developers manually create data tables and interfaces according to specific use scenes and requirements. The technical scheme is as follows:
according to an aspect of an embodiment of the present application, there is provided a data processing method, including:
the method comprises the steps of obtaining a target table name to be processed, a target table field, a first template code and a second template code, wherein the first template code is used for creating a null data table, the table name of the null data table is the template table name, the table field is the template table field, the second template code is used for creating a template interface, and the template interface is used for editing a field value corresponding to the template table field of the null data table;
modifying the first template code according to the target table name and the target table field to obtain a first target code, wherein the first target code is used for creating a target data table;
calling the first target code to create the target data table;
modifying the second template code according to the target table name and the target table field to obtain a second target code, wherein the second target code is used for creating a target interface, and the target interface is used for editing a field value corresponding to the target table field of the target data table;
and calling the second object code to create the object interface.
As an alternative to the data processing method, after the invoking of the second object code to create the object interface, the method further includes:
responding to the editing operation of the target table field, and determining a field value to be edited;
and calling the target interface to edit the target data table by using the field value to obtain the edited target data table.
As an alternative of the data processing method, before obtaining the first template code, the method further includes:
establishing a first corresponding relation between the table name of each data table and a first reference template code;
the obtaining a first template code comprises: and acquiring a first reference target code corresponding to the target table name according to the first corresponding relation, and taking the first reference target code as the first template code.
As an alternative of the data processing method, obtaining the second template code previously further includes:
establishing a second corresponding relation between each first reference template code and each second reference template code;
the obtaining of the second template code comprises: and according to the second corresponding relation, obtaining a second reference target code corresponding to the first reference target code, and using the second reference target code as the second template code.
As an alternative to a data processing method, the first template code includes a first code segment for creating a plurality of tables of the empty data table, a second code segment for populating the template table name into a corresponding first table of the plurality of tables, and a third code segment for populating the template table field into a corresponding second table of the plurality of tables, the second code segment including a first placeholder corresponding to the template table name, the third code segment including a second placeholder corresponding to the template table field;
modifying the first template code according to the target form name and the target form field, including:
replacing the first placeholder with a third placeholder corresponding to the target table name;
replacing the second placeholder with a fourth placeholder corresponding to the target table field.
As an alternative to the data processing method, the second template code includes a fourth code segment and a fifth code segment, the fourth code segment is used for calling the empty data table, the fifth code segment is used for creating the template interface, the fourth code segment and the fifth code segment each include a fifth placeholder corresponding to the template table name, and the fifth code segment further includes a sixth placeholder corresponding to the template table field;
modifying the second template code according to the target form name and the target form field, including:
replacing the fifth placeholder with a seventh placeholder corresponding to the target table name;
replacing the sixth placeholder with an eighth placeholder corresponding to the target table field.
As an alternative of the data processing method, obtaining a target table name and a target table field to be processed, and then further comprising:
if the target database is determined to be created according to the target table name, a third template code is obtained, wherein the third template code is used for creating a hollow database, and the hollow database is used for storing the hollow data table;
modifying the third template code according to the target table name to obtain a third target code, wherein the third target code is used for creating the target database;
and calling the third target code to create the target database, wherein the target database is used for storing the target data table.
According to another aspect of embodiments of the present application, there is provided a data processing apparatus including:
the acquisition module is used for acquiring a target table name to be processed, a target table field, a first template code and a second template code;
the first generation module is used for modifying the first template code according to the target table name and the target table field to obtain a first target code;
the second generation module is used for modifying the second template code according to the target table name and the target table field to obtain a second target code;
and the creating module is used for creating a target database according to the first target code and creating a target interface according to the second target code.
According to another aspect of the embodiments of the present application, there is provided an electronic device, which includes a memory, a processor, and a computer program stored on the memory, wherein the processor executes the computer program to implement the steps of the data processing method described above.
According to a further aspect of embodiments of the present application, there is provided a computer-readable storage medium, which when executed by a processor performs the steps of the data processing method of the claims.
According to an aspect of the embodiments of the present application, there is provided a computer program product comprising a computer program which, when executed by a processor, is capable of implementing the steps of the aforementioned method embodiments and the corresponding content.
The technical scheme provided by the embodiment of the application has the following beneficial effects: the invention provides a data processing method, a data processing device, an electronic device and a computer readable storage medium, wherein a first template code and a second template code are modified through an obtained target table name and a target table field to respectively obtain a first target code capable of creating a target data table and a second target code capable of creating a target interface to create a target interface capable of editing the target data table.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings used in the description of the embodiments of the present application will be briefly described below.
Fig. 1 is a schematic flowchart of a data processing method according to an embodiment of the present application;
fig. 2 is a schematic structural diagram of an empty data table provided in an embodiment of the present application;
fig. 3 is a schematic structural diagram of an edited empty data table according to an embodiment of the present application;
FIG. 4 is a schematic structural diagram of a target data table provided in an embodiment of the present application;
fig. 5 is a schematic structural diagram of an edited target data table according to an embodiment of the present application;
FIG. 6 is a diagram illustrating structures of data tables with different table structures according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of a data processing apparatus according to an embodiment of the present application;
fig. 8 is a schematic structural diagram of an electronic device implementing a data processing method according to an embodiment of the present application.
Detailed Description
Embodiments of the present application are described below in conjunction with the drawings in the present application. It should be understood that the embodiments set forth below in connection with the drawings are exemplary descriptions for explaining technical solutions of the embodiments of the present application, and do not limit the technical solutions of the embodiments of the present application.
As used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should be further understood that the terms "comprises" and/or "comprising," when used in this specification in connection with embodiments of the present application, specify the presence of stated features, information, data, steps, operations, elements, and/or components, but do not preclude the presence or addition of other features, information, data, steps, operations, elements, components, and/or groups thereof, as embodied in the art. It will be understood that when an element is referred to as being "connected" or "coupled" to another element, it can be directly connected or coupled to the other element or intervening elements may be present. Further, "connected" or "coupled" as used herein may include wirelessly connected or wirelessly coupled. The term "and/or" as used herein indicates at least one of the items defined by the term, e.g., "a and/or B" can be implemented as "a", or as "B", or as "a and B".
To make the objects, technical solutions and advantages of the present application more clear, the following detailed description of the embodiments of the present application will be made with reference to the accompanying drawings.
The present application provides a data processing method, an apparatus, an electronic device, a computer-readable storage medium, and a computer program product, which are intended to solve the above technical problems in the prior art.
The technical solutions of the embodiments of the present application and the technical effects produced by the technical solutions of the present application will be described below through descriptions of several exemplary embodiments. It should be noted that the following embodiments may be referred to, referred to or combined with each other, and the description of the same terms, similar features, similar implementation steps, etc. in different embodiments is not repeated.
An embodiment of the present application provides a data processing method, which is executed by a terminal, such as a computer, as shown in fig. 1, and includes:
s100, obtaining a target table name to be processed, a target table field, a first template code and a second template code, wherein the first template code is used for creating a blank data table, the table name of the blank data table is the template table name, the table field is the template table field, the second template code is used for creating a template interface, and the template interface is used for editing a field value corresponding to the template table field of the blank data table.
Please refer to fig. 2, fig. 2 is a schematic diagram of a structure of a null data table according to an embodiment of the present disclosure, where AAA is a template table name, and BB and CC are template table fields. Referring to fig. 3, fig. 3 is a schematic structural diagram of an empty data table edited according to an embodiment of the present application, where field values corresponding to BB include BB1 and BB2, and field values corresponding to CC include CC1 and CC2, and BB1, CC1, BB2, and CC3 are filled into the empty data table with a template table name AAA, which is an expression of editing field values corresponding to template table fields.
Illustratively, the target table name and target table fields may be obtained in json language.
S101, modifying the first template code according to the target table name and the target table field to obtain a first target code, wherein the first target code is used for creating a target data table, the table name of the target data table is the target table name, and the table field is the target table field.
The target data table in S101 is a data table in which only a target table name and a target table field exist, please refer to fig. 4, where fig. 4 is a schematic structural diagram of the target data table according to the embodiment of the present application, the target table name is a customer record, and the target table field includes a name and an age.
And S102, calling the first object code to create an object data table.
That is, after determining the first object code, the execution subject calls the first object code and, based on the first object code, creates the object database.
Illustratively, the first object code may be in nodejs language.
S103, modifying the second template code according to the target table name and the target table field to obtain a second target code, wherein the second target code is used for creating a target interface, and the target interface is used for editing a field value corresponding to the target table field of the target data table.
Please refer to fig. 5, fig. 5 is a schematic structural diagram of a target data table edited according to an embodiment of the present application, where field values corresponding to names include zhang, zhu, and u, and field values corresponding to ages include 18 and 20, and the zhang, zhu, and 18 and 20 are filled in an empty data table with names of the target table as customer records, which belongs to an expression manner for editing field values corresponding to fields of the target table.
The second object code may be, for example, nodejs language.
And S104, calling the second object code to create an object interface.
I.e. after determining the second object code, the execution subject calls the second object code and based on the second object code, an object interface is created.
It can be understood that the first template code and the second template code are modified through the obtained target table name and the target table field to respectively obtain a first target code capable of creating the target data table and a second target code capable of creating the target interface to create the target interface capable of editing the target data table.
Optionally, obtaining the target table name and the target table field to be processed further includes verifying whether the current operator is logged in and registered, and if the current operator is logged in and registered, opening an interface for inputting a data model to the current operator, where the data model includes the target table name and the target table field.
It will be appreciated that the data model edited by the current operator is preserved by verifying that the current operator is logged in and registered, and that later use of the target interface is facilitated.
Illustratively, the current operator writes a data model in json in an editor of a web portal, where the data model includes a name (i.e., a target table name), a name of at least one field (i.e., a target table field), a data type (i.e., a data type corresponding to a specific field value of the target table field), a default value, and the like.
On the basis of the foregoing embodiments, as an optional embodiment, after the calling the second object code to create the object interface, the method further includes:
responding to the editing operation of the target table field, and determining a field value to be edited;
and calling a target interface to edit the target data table by using the field value to obtain the edited target data table.
It is understood that after the target data table is created by the first object code, the target data table at this time only has the target table name and the target table field, and no field value, as shown in fig. 4. Considering that a user often needs to use field values when developing software to establish a call relationship between each field value and the software, after creating a target interface, the user sends the field values needed to be used to an execution subject, for example, the execution subject determines that the field values needed to be edited include zhang, 18, lie, and 20, and edits a target data table through the target interface to obtain an edited target data table, as shown in fig. 5.
On the basis of the foregoing embodiments, as an optional embodiment, before obtaining the first template code, the method further includes:
establishing a first corresponding relation between the table name of each data table and the first reference template code;
obtaining a first template code comprising: and according to the first corresponding relation, obtaining a first reference target code corresponding to the target table name and using the first reference target code as a first template code.
It can be understood that, as shown in fig. 6, fig. 6 provides a schematic structural diagram of data tables with two different table structures, where the table name in fig. (a) is AA1, and the table field includes D1, D2, D3 and D4, and the table name in fig. (b) is AA2, and the table field includes E1 and E2, that is, there is a difference between the table structures and the number of columns corresponding to the table fields of the data tables with different table names, so that different first reference template codes are respectively needed to implement creation of the data tables with different table names. Therefore, the corresponding first reference target code is obtained through the target table name, so that the template table structure of the empty data table created by the first template code and the number of columns corresponding to the template table fields are consistent with those of the target database, the complexity of the execution main body for creating the target data table is simplified, and the response efficiency is improved.
On the basis of the foregoing embodiments, as an alternative embodiment, the obtaining of the second template code further includes:
establishing a second corresponding relation between each first reference template code and each second reference template code;
obtaining a second template code comprising: and obtaining a second reference target code corresponding to the first reference target code according to the second corresponding relation, and using the second reference target code as a second template code.
It can be understood that, because a plurality of first reference template codes are provided, and the table structures of the data tables with different table names and the number of columns corresponding to the table fields are different, the second reference template codes which enable the created interface to edit the corresponding data tables are different. Therefore, the corresponding second reference target code is obtained through the first reference target code, so that the field value of the empty data table can be edited by the template interface created by the second template code, the complexity of creating the target interface by the execution main body is simplified, and the response efficiency is improved.
On the basis of the above embodiments, as an alternative embodiment, the first template code includes a first code segment, a second code segment and a third code segment, the first code segment is used for creating a plurality of tables of empty data tables, the second code segment is used for filling template table names into corresponding first tables of the plurality of tables, the third code segment is used for filling template table fields into corresponding second tables of the plurality of tables, the second code segment includes first placeholders corresponding to the template table names, and the third code segment includes second placeholders corresponding to the template table fields;
modifying the first template code according to the target form name and the target form field, including:
replacing the first placeholder with a third placeholder corresponding to the target table name;
the second placeholder is replaced with a fourth placeholder corresponding to the target form field.
It can be understood that, the first template code realizes how to create the empty data table through the first code segment, the second code segment and the third code segment, wherein, because the form structures of the empty data table and the target data table are consistent, only the corresponding first placeholder and the corresponding second placeholder need to be replaced by the third placeholder and the fourth placeholder, respectively, so that the replaced second code segment can fill the target table name into the corresponding first form, and the replaced third code segment can fill the target table field into the corresponding second form, so that the obtained first target code can create the target data table.
Illustratively, as shown in fig. 4, the table name of the target data table is the customer record, the target table field includes a name and an age, the corresponding empty data table is as shown in fig. 2, the template table name of the empty data table is AAA, the template table field includes BB and CC, and the creation of the target data table by the first target code can be realized by replacing the first placeholder representing AAA with a third placeholder representing the customer record, replacing the second placeholder representing BB with a fourth placeholder representing the name, and replacing the second placeholder representing CC with a fourth placeholder representing the age.
On the basis of the foregoing embodiments, as an optional embodiment, the second template code includes a fourth code segment and a fifth code segment, the fourth code segment is used for calling an empty data table, the fifth code segment is used for creating a template interface, the fourth code segment and the fifth code segment both include a fifth placeholder corresponding to a name of the template table, and the fifth code segment further includes a sixth placeholder corresponding to a field of the template table;
modifying the second template code according to the target form name and the target form field, including:
replacing the fifth placeholder with a seventh placeholder corresponding to the target table name;
and replacing the sixth placeholder with an eighth placeholder corresponding to the target table field.
It can be understood that, the second template code realizes how to create the template interface through the fourth code segment and the fifth code segment, wherein, since the fourth code segment is used for calling the empty data table, only the fifth placeholder of the third code segment needs to be replaced by the seventh placeholder, and the target data table can be called by the modified fourth code segment.
Illustratively, as shown in fig. 4, the table name of the target data table is a customer record, the target table field includes a name and an age, the corresponding empty data table is as shown in fig. 2, the template table name of the empty data table is AAA, the template table field includes BB and CC, and the second object code creation target interface can be realized by replacing the fifth placeholder representing AAA with the seventh placeholder representing customer record, replacing the sixth placeholder representing BB with the seventh placeholder representing name, and replacing the sixth placeholder representing CC with the seventh placeholder representing age, and the target interface can edit the target data table by using the field value.
On the basis of the foregoing embodiments, as an optional embodiment, obtaining a target table name and a target table field to be processed, and then further including:
if the target database is determined to be created according to the target table name, a third template code is obtained, the third template code is used for creating a hollow database, and the hollow database is used for storing a hollow data table;
modifying the third template code according to the target table name to obtain a third target code, wherein the third target code is used for creating a target database;
and calling the third target code to create a target database, wherein the target database is used for storing a target data table.
Considering that a user needs to create a plurality of target data tables in the process of developing software, the target data tables are directly or indirectly connected with each other, and the target data tables in the same development environment need to be stored in the same database so as to ensure the orderliness of storage and the convenience of calling.
Illustratively, when the development environment is a product, the desired target table name includes customer records, product information, revenue, and the like, and when the development environment is a hospital, the desired target table name includes doctors, departments, business data, drug statistics, and the like. When the target table name currently created by the user is the customer and the execution subject does not have a database corresponding to the product of the development environment, determining that the target database corresponding to the product needs to be created, modifying the third template code to obtain a third target code, and further creating the target database of which the development environment is the product, so that the created target table name is the target database of the customer.
When the target table name created by the user is the product information, since the database corresponding to the product in the development environment already exists, the database does not need to be created, and the target data table with the target table name as the product information is stored in the target database corresponding to the product in the development environment. When the target table name created again by the user is a doctor and the execution subject does not have a database corresponding to the development environment being a hospital, it is determined that the target database corresponding to the hospital needs to be created so that the created target table name of the doctor can be stored in the target database corresponding to the hospital.
Illustratively, the format of the target database is mongoDB.
On the basis of the foregoing embodiments, as an optional embodiment, after the second object code is called to create the object interface, the method further includes:
obtaining an authorization code, and establishing a calling relationship between the authorization code and a target interface;
editing the target data table by using the field values, wherein the editing comprises the following steps:
responding to the instruction of obtaining the calling target interface, and obtaining an authority code included in the instruction;
and if the permission code is consistent with the authorization code, editing the target data table by using the field value.
Illustratively, the authorization code is 1111, and if the authorization code is 1111, it indicates that the user currently issuing the instruction to invoke the target interface has the authority to invoke the target interface; if the permission code is 1112, it indicates that the user currently issuing the instruction to invoke the target interface does not have the permission to invoke the target interface, thereby improving the security of editing the target database.
Furthermore, considering that the target interface includes an add interface, a modify interface, a delete interface and a query interface, the permission code may also be correspondingly set in plural numbers to meet different user requirements, that is, some users may only call the query interface (i.e., have read-only permission), some users may only call the add interface (i.e., have write-only permission), and some users may at least call the add interface and the query interface (i.e., have read-write permission). Specifically, after logging in to the portal website, the user can confirm which authority (such as read-only, write-only or read-write authority) is authorized by the user according to an authorization button on the interface, the server generates a corresponding authorization code according to the authority authorized by the user, and establishes a corresponding relationship between the authorization code and login registration information of the user, so as to ensure that different users have different authorities owned by a target interface after logging in.
On the basis of the foregoing embodiments, as an optional embodiment, after the second object code is called to create the object interface, the method further includes: and deploying the second object code to the server.
Specifically, after a user writes a data model on a portal website of a terminal to obtain a first object code and a second object code, a corresponding deployment button is displayed on a current interface of the portal website, after the user clicks the deployment button, the terminal selects an idle port of a server and establishes a corresponding relation between the port and the object interface, so that the first object code and the second object code are uploaded to the server through a nextjs + pm2 deployment mode, and the object interface is deployed on the server. When a developer needs to use a target interface, a code for calling the target interface is input in an editor of a portal website, and a terminal is connected with a port corresponding to the target interface deployed by a server, so that the developer can call the corresponding target interface on the server through the terminal.
On the basis of the foregoing embodiments, as an optional embodiment, after the second object code is called to create the object interface, the method further includes:
obtaining test data and an expected test result corresponding to the test data, wherein the test data is a field value corresponding to a target table field, and the expected test result is a field value corresponding to a target table field existing in a target data table;
calling a target interface according to the test data to obtain a response result, wherein the response result is an edited target data table, and a field value corresponding to a target table field of the target data table is the test data;
and if the expected test result is consistent with the response result, determining that the target interface is normally called.
The target interface comprises an adding interface, a modifying interface, a deleting interface and a query interface, wherein the adding interface is used for filling field values into one or more tables of the target data table, the modifying interface is used for modifying the field values of one or more tables of the target data table, the deleting interface is used for deleting the field values of one or more tables of the target data table, and the query interface is used for displaying the field values of one or more tables of the target data table.
Illustratively, the target table name is a customer record, the target table field includes a name and an age, after a user clicks a deployment button on a web portal to complete deployment of a target interface on a server, the terminal displays a test button on a current interface, the user clicks the test button to test the target interface, if the user needs to test an add interface, test data of three years and 18 years are input in a data input box of the interface, the user wants to realize field values of three years and 18 years (namely expected test results) in the target data table through the add interface, the terminal calls the add interface to obtain response results, and displays the response results to the user so as to check whether three years and 18 years (namely response results) exist in the edited target data table, and if yes, the response results are consistent with the expected test results, and the add interface functions normally; if the user needs to test the modification interface, inputting test data lie four in an input box of the interface, and the user hopes to realize that the field value of the table where the target data table opens three is lie four (namely an expected test result) through the modification interface, calling the modification interface by the terminal to obtain a response result, and displaying the response result to the user to check whether the field value of the table where the edited target data table opens three is lie four (namely a response result), if so, indicating that the response result is consistent with the expected test result, and the function of the modification interface is normal; if the user needs to test the modification interface, test data of 18 years old is input in an input box of the interface, the user hopes to achieve that the field value of a table of 18 years old in the target data table is null (namely an expected test result) through the deletion interface, the terminal calls the deletion interface to obtain a response result, and displays the response result to the user to check whether the field value of a grid of 18 years old in the edited target data table is null (namely a response result), if yes, the response result is consistent with the expected test result, and the deletion interface is normal in function.
On the basis of the foregoing embodiments, as an optional embodiment, after the second object code is called to create the object interface, the method further includes: the first object code, the second object code and the object data table are transferred to the object server. The target server is the user's own server that creates the current target data table.
Considering that the execution subject needs to satisfy the storage of the target data tables of a plurality of users at the same time, a large load exists, and the operation performance of the server is easily affected. Therefore, the user can upload the first target code and the second target code required by the user to the target server, and create the target data table and the target interface on the target server through the operation of the first target code and the second target code, so that the transfer of the first target code, the second target code and the target data table can be completed, and the smoothness of the user for developing related software by using the target data table is ensured.
Specifically, after the user finishes testing the target interface, the user can directly click the export button on the interface and input the address of the target server in the data export input box, and the terminal can import the target data table and the target interface stored on the server to the target server so as to complete the transfer of the first target code, the second target code and the target data table.
An embodiment of the present application provides a data processing apparatus, as shown in fig. 7, the data processing apparatus includes: the system comprises an obtaining module 601, a first generating module 602, a second generating module 603 and a creating module 604, wherein the obtaining module 601 is configured to obtain a target table name to be processed, a target table field, a first template code and a second template code; the first generating module 602 is configured to modify the first template code according to the target form name and the target form field, and obtain a first target code; the second generating module 603 is configured to modify the second template code according to the target form name and the target form field, and obtain a second target code; the creation module 604 is configured to create a target database from the first object code and create a target interface from the second object code.
In this embodiment, the target table name and the target table field obtained by the obtaining module 601 are obtained, the first generating module 602 modifies the first template code to obtain a first target code capable of creating the target data table, respectively, the second generating module 603 modifies the second template code to create a second target code capable of creating the target interface, and the creating module 604 creates the target data table and the target interface.
On the basis of the foregoing embodiments, as an alternative embodiment, the data processing apparatus further includes:
the receiving module is used for responding to the editing operation of the target table field and determining the field value to be edited;
and the calling module is used for calling the target interface so as to edit the target data table by using the field value and obtain the edited target data table.
On the basis of the foregoing embodiments, as an optional embodiment, the data processing apparatus further includes a first processing module, configured to establish a first correspondence between the table name of each data table and the first reference template code.
The obtaining module comprises a first submodule and a second submodule, wherein the first submodule is used for obtaining a first reference target code corresponding to the target table name according to the first corresponding relation and is used as a first template code.
On the basis of the foregoing embodiments, as an optional embodiment, the data processing apparatus further includes a second processing module, configured to establish a second correspondence between each first reference template code and each second reference template code;
the obtaining module comprises a second submodule and is used for obtaining a second reference object code corresponding to the first reference object code according to the second corresponding relation and using the second reference object code as a second template code.
On the basis of the above embodiments, as an alternative embodiment, the first template code includes a first code segment, a second code segment and a third code segment, the first code segment is used for creating a plurality of tables of empty data tables, the second code segment is used for filling template table names into corresponding first tables of the plurality of tables, the third code segment is used for filling template table fields into corresponding second tables of the plurality of tables, the second code segment includes first placeholders corresponding to the template table names, and the third code segment includes second placeholders corresponding to the template table fields.
The first generation module includes a first modification submodule for modifying the first template code based on the target form name and the target form field.
Wherein the first modification submodule comprises:
a first modification unit, configured to replace the first placeholder with a third placeholder corresponding to the target table name;
a second modification unit to replace the second placeholder with a fourth placeholder corresponding to the target table field.
On the basis of the foregoing embodiments, as an optional embodiment, the second template code includes a fourth code segment and a fifth code segment, the fourth code segment is used for calling an empty data table, the fifth code segment is used for creating a template interface, the fourth code segment and the fifth code segment each include a fifth placeholder corresponding to a template table name, and the fifth code segment further includes a sixth placeholder corresponding to a template table field.
The second generating module includes a second modifying submodule for modifying the second template code based on the target form name and the target form field.
Wherein the second modification submodule comprises:
a third modifying unit, configured to replace the fifth placeholder with a seventh placeholder corresponding to the target table name;
and the fourth modification unit is used for replacing the sixth placeholder with an eighth placeholder corresponding to the target table field.
On the basis of the foregoing embodiments, as an alternative embodiment, the data processing apparatus further includes:
the acquisition module is used for determining to create a target database according to the target table name and acquiring a third template code, wherein the third template code is used for creating a hollow database, and the hollow database is used for storing a hollow data table;
the third generation module is used for modifying a third template code according to the target table name to obtain a third target code, and the third target code is used for creating a target database;
and the deployment module is used for calling the third target code to create a target database, and the target database is used for storing a target data table.
On the basis of the foregoing embodiments, as an optional embodiment, the data processing apparatus further includes an authorization module, configured to obtain an authorization code and establish a call relationship between the authorization code and the target interface.
The calling module further comprises a preprocessing submodule, wherein the preprocessing submodule is used for responding to an instruction for obtaining a calling target interface and obtaining an authority code included in the instruction, and the method comprises the following steps: and if the permission code is consistent with the authorization code, editing the target data table by using the field value.
On the basis of the foregoing embodiments, as an optional embodiment, the data processing apparatus further includes a test module, where the test module includes:
the obtaining submodule is used for obtaining test data and an expected test result corresponding to the test data, the test data is a field value corresponding to a target table field, and the expected test result is a field value corresponding to a target table field existing in a target data table;
the calling submodule is used for calling a target interface according to the test data to obtain a response result, the response result is an edited target data table, and a field value corresponding to a target table field of the target data table is the test data;
and the judgment submodule is used for determining that the expected test result is consistent with the response result and determining that the target interface is normally called.
The apparatus of the embodiment of the present application may execute the method provided by the embodiment of the present application, and the implementation principle is similar, the actions executed by the modules in the apparatus of the embodiments of the present application correspond to the steps in the method of the embodiments of the present application, and for the detailed functional description of the modules of the apparatus, reference may be specifically made to the description in the corresponding method shown in the foregoing, and details are not repeated here.
The embodiment of the application provides an electronic device, which comprises a memory, a processor and a computer program stored on the memory, wherein the processor executes the computer program to realize the steps of the data processing method, and compared with the related art, the method can realize the following steps: the method can automatically create the target database and the corresponding target interface without requiring developers to manually create the corresponding target interface according to the target table names and the target table fields of different target data tables, thereby saving time and labor, reducing the period and cost of software development and improving the production efficiency.
In an alternative embodiment, an electronic device is provided, as shown in fig. 8, an electronic device 4000 shown in fig. 8 comprising: a processor 4001 and a memory 4003. Processor 4001 is coupled to memory 4003, such as via bus 4002. Optionally, the electronic device 4000 may further include a transceiver 4004, and the transceiver 4004 may be used for data interaction between the electronic device and other electronic devices, such as transmission of data and/or reception of data. In addition, the transceiver 4004 is not limited to one in practical applications, and the structure of the electronic device 4000 is not limited to the embodiment of the present application.
The Processor 4001 may be a CPU (Central Processing Unit), a general-purpose Processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array), or other Programmable logic device, transistor logic device, hardware component, or any combination thereof. Which may implement or perform the various illustrative logical blocks, modules, and circuits described in connection with the disclosure. The processor 4001 may also be a combination that performs a computing function, e.g., comprising one or more microprocessors, a combination of DSPs and microprocessors, etc.
Bus 4002 may include a path that carries information between the aforementioned components. The bus 4002 may be a PCI (Peripheral Component Interconnect) bus, an EISA (Extended Industry Standard Architecture) bus, or the like. The bus 4002 may be divided into an address bus, a data bus, a control bus, and the like. For ease of illustration, only one thick line is shown in FIG. 8, but this is not intended to represent only one bus or type of bus.
The Memory 4003 may be a ROM (Read Only Memory) or other types of static storage devices that can store static information and instructions, a RAM (Random Access Memory) or other types of dynamic storage devices that can store information and instructions, an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disc Read Only Memory) or other optical Disc storage, optical Disc storage (including Compact Disc, laser Disc, optical Disc, digital versatile Disc, blu-ray Disc, etc.), a magnetic Disc storage medium, other magnetic storage devices, or any other medium that can be used to carry or store a computer program and that can be Read by a computer, without limitation.
The memory 4003 is used for storing computer programs for executing the embodiments of the present application, and execution is controlled by the processor 4001. The processor 4001 is used to execute computer programs stored in the memory 4003 to implement the steps shown in the foregoing method embodiments.
Embodiments of the present application provide a computer-readable storage medium, on which a computer program is stored, and when being executed by a processor, the computer program may implement the steps and corresponding contents of the foregoing method embodiments.
Embodiments of the present application further provide a computer program product, which includes a computer program, and when the computer program is executed by a processor, the steps and corresponding contents of the foregoing method embodiments can be implemented.
The terms "first," "second," "third," "fourth," "1," "2," and the like in the description and in the claims of the present application and in the above-described drawings (if any) are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It should be understood that the data so used are interchangeable under appropriate circumstances such that the embodiments of the application described herein are capable of operation in other sequences than illustrated or otherwise described herein.
It should be understood that, although each operation step is indicated by an arrow in the flowchart of the embodiment of the present application, the implementation order of the steps is not limited to the order indicated by the arrow. In some implementation scenarios of the embodiments of the present application, the implementation steps in the flowcharts may be performed in other sequences as desired, unless explicitly stated otherwise herein. In addition, some or all of the steps in each flowchart may include multiple sub-steps or multiple stages based on an actual implementation scenario. Some or all of these sub-steps or stages may be performed at the same time, or each of these sub-steps or stages may be performed at different times, respectively. In a scenario where execution times are different, an execution sequence of the sub-steps or the phases may be flexibly configured according to requirements, which is not limited in the embodiment of the present application.
The foregoing is only an optional implementation manner of a part of implementation scenarios in this application, and it should be noted that, for those skilled in the art, other similar implementation means based on the technical idea of this application are also within the protection scope of the embodiments of this application without departing from the technical idea of this application.

Claims (10)

1. A method of data processing, comprising:
the method comprises the steps of obtaining a target table name to be processed, a target table field, a first template code and a second template code, wherein the first template code is used for creating a null data table, the table name of the null data table is the template table name, the table field is the template table field, the second template code is used for creating a template interface, and the template interface is used for editing a field value corresponding to the template table field of the null data table;
modifying the first template code according to the target table name and the target table field to obtain a first target code, wherein the first target code is used for creating a target data table;
calling the first target code to create the target data table;
modifying the second template code according to the target table name and the target table field to obtain a second target code, wherein the second target code is used for creating a target interface, and the target interface is used for editing a field value corresponding to the target table field of the target data table;
and calling the second object code to create the object interface.
2. The data processing method of claim 1, wherein invoking the second object code further comprises, after creating the object interface:
responding to the editing operation of the target table field, and determining a field value to be edited;
and calling the target interface to edit the target data table by using the field value to obtain the edited target data table.
3. The data processing method of any of claims 1 or 2, wherein obtaining the first template code further comprises:
establishing a first corresponding relation between the table name of each data table and a first reference template code;
the obtaining a first template code comprises: and acquiring a first reference target code corresponding to the target table name according to the first corresponding relation, and taking the first reference target code as the first template code.
4. The data processing method of claim 3, wherein obtaining the second template code further comprises:
establishing a second corresponding relation between each first reference template code and each second reference template code;
the obtaining of the second template code comprises: and according to the second corresponding relation, obtaining a second reference target code corresponding to the first reference target code, and using the second reference target code as the second template code.
5. The data processing method of claim 1, wherein the first template code comprises a first code segment for creating a plurality of tables of the empty data table, a second code segment for populating the template table name into a corresponding first table of the plurality of tables, and a third code segment for populating the template table field into a corresponding second table of the plurality of tables, wherein the second code segment comprises a first placeholder corresponding to the template table name, and wherein the third code segment comprises a second placeholder corresponding to the template table field;
modifying the first template code according to the target form name and the target form field, including:
replacing the first placeholder with a third placeholder corresponding to the target table name;
replacing the second placeholder with a fourth placeholder corresponding to the target form field.
6. The data processing method of claim 5, wherein the second template code comprises a fourth code section and a fifth code section, the fourth code section is for calling the empty data table, the fifth code section is for creating the template interface, the fourth code section and the fifth code section each comprise a fifth placeholder corresponding to the template table name, the fifth code section further comprises a sixth placeholder corresponding to the template table field;
modifying the second template code according to the target form name and the target form field, including:
replacing the fifth placeholder with a seventh placeholder corresponding to the target table name;
replacing the sixth placeholder with an eighth placeholder corresponding to the target form field.
7. The data processing method according to claim 1 or 2, wherein the target table name and the target table field to be processed are obtained, and thereafter further comprising:
if the target database is determined to be created according to the target table name, a third template code is obtained, wherein the third template code is used for creating a hollow database, and the hollow database is used for storing the hollow data table;
modifying the third template code according to the target table name to obtain a third target code, wherein the third target code is used for creating the target database;
and calling the third target code to create the target database, wherein the target database is used for storing the target data table.
8. A data processing apparatus, comprising:
the acquisition module is used for acquiring a target table name to be processed, a target table field, a first template code and a second template code;
the first generation module is used for modifying the first template code according to the target table name and the target table field to obtain a first target code;
the second generation module is used for modifying the second template code according to the target table name and the target table field to obtain a second target code;
and the creating module is used for creating a target database according to the first target code and creating a target interface according to the second target code.
9. An electronic device comprising a memory, a processor and a computer program stored on the memory, characterized in that the processor executes the computer program to implement the steps of the data processing method of any of claims 1-7.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the data processing method of any one of claims 1 to 7.
CN202211204024.XA 2022-09-29 2022-09-29 Data processing method and device, electronic equipment and computer readable storage medium Pending CN115544988A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211204024.XA CN115544988A (en) 2022-09-29 2022-09-29 Data processing method and device, electronic equipment and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211204024.XA CN115544988A (en) 2022-09-29 2022-09-29 Data processing method and device, electronic equipment and computer readable storage medium

Publications (1)

Publication Number Publication Date
CN115544988A true CN115544988A (en) 2022-12-30

Family

ID=84731484

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211204024.XA Pending CN115544988A (en) 2022-09-29 2022-09-29 Data processing method and device, electronic equipment and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN115544988A (en)

Similar Documents

Publication Publication Date Title
CN108268253B (en) Interface code generation method and terminal equipment
CN107644286B (en) Workflow processing method and device
US9430228B2 (en) Verification of backward compatibility of software components
JP5049280B2 (en) Extensible XML format and object model for localization data
CN111611784A (en) Report generation method and device, terminal equipment and storage medium
CN110968509B (en) Method and system for batch customizing of variables
CN105159670A (en) Universal cockpit display control system software development framework
CN102236544A (en) Method and device for designing skins
CN112860260A (en) Web-based cross-platform application construction tool and method in college scene
CN115993966B (en) Application development system and method
CN114915643B (en) Configuration method, device, equipment and medium of railway signal centralized monitoring system
CN112800730A (en) Report form filling method and device
CN115840567A (en) Application editing method and related equipment
CN113742228B (en) Test, data playback and recording methods, systems, devices, equipment and media
US10678864B2 (en) Analysis model preparing system, programming apparatus, and analysis model preparing method
CN109086476B (en) Data processing method for drawing design, PLM plug-in and computing equipment
CN113919158A (en) Simulation method and device for flight control panel and storage medium
KR20090099977A (en) A reserved component container based software development method and apparatus
US9830204B2 (en) Facilitating communication between software components that use middleware
CN115544988A (en) Data processing method and device, electronic equipment and computer readable storage medium
CN111933228B (en) Method and device for realizing project distribution and management system in clinical research
CN111459583B (en) Menu creation method and device
CN112416995B (en) Data statistics method, device, computer equipment and storage medium
CN113254455A (en) Dynamic configuration method and device of database, computer equipment and storage medium
CN116755684B (en) OAS Schema generation method, device, equipment and 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