A method for updating front-end fields

By adding fields to be updated in the spreadsheet and syncing them to the backend database, the cumbersome problem of updating front-end pages and back-end database fields is solved, simplifying the update process of front-end pages and reducing the development workload.

CN115033827BActive Publication Date: 2025-07-25SHANGHAI SOUNDWISE TECHNOLOGY CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202210738882.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-27
Publication Date
2025-07-25
Estimated Expiration
2042-06-27

AI Technical Summary

Technical Problem

In the prior art, when the field update of the front-end page needs to maintain a one-to-one correspondence with the back-end database, the front-end code needs to be modified one by one after the back-end database fields are changed, which is cumbersome and time-consuming.

Method used

By adding fields to the spreadsheet to be updated, using the spreadsheet to update the backend database, and synchronizing it to the front-end page according to the updated back-end database, reducing the workload of modifying the front-end code.

Benefits of technology

It realizes the operation of quickly importing fields to be updated and data table structures, reducing development workload and simplifying the update process of front-end pages.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115033827B_ABST
    Figure CN115033827B_ABST
Patent Text Reader

Abstract

The present invention relates to the technical field of front-end page design, and specifically relates to a method for updating front-end fields, including: Step S1: Add fields to be updated in a spreadsheet; Step S2: Use the spreadsheet to update the back-end database; Step S3: Update the front-end page according to the updated back-end database. The beneficial effect of the present invention is that by introducing a spreadsheet, users can quickly import fields to be updated and operate on the data table structure through the spreadsheet. Subsequently, the back-end database performs field update operations according to the spreadsheet and synchronizes them to the front-end page. As a result, users do not have to modify the back-end database and the front-end page in the form of code, and only need to import fields to achieve the above process, reducing the development workload.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of front - end page design, and particularly to a method for updating front - end fields. Background Art

[0002] The front - end refers to the front part of a website, which runs on browsers such as PC terminals and mobile terminals and is presented to users for browsing. Generally, to achieve better user interaction effects, most websites need to obtain user operations from the front - end page and retrieve corresponding back - end fields for display on the front - end page. In this process, the field part of the front - end needs to maintain a one - to - one correspondence with the fields in the back - end database during page design.

[0003] In the prior art, when the fields in the back - end database change during update, it is usually necessary to check the front - end code and modify the corresponding fields one by one. This process is rather cumbersome and inconvenient, and requires a large amount of time and manpower to modify the fields. Summary of the Invention

[0004] In view of the above problems existing in the prior art, a method for updating front - end fields is provided herein.

[0005] The specific technical solution is as follows:

[0006] A method for updating front - end fields, comprising:

[0007] Step S1: Add fields to be updated in a spreadsheet;

[0008] Step S2: Update the back - end database using the spreadsheet;

[0009] Step S3: Update the front - end page according to the updated back - end database.

[0010] Preferably, if there are multiple database tables set in the back - end database, then step S1 includes:

[0011] Step S11: Obtain the form page corresponding to the database table and the database information to which the fields to be updated belong from the spreadsheet;

[0012] Step S12: Locate the corresponding form page according to the database information;

[0013] Step S13: Then add the fields to be updated to the form page,

[0014] Or, obtain the fields in the form page and update the fields using the fields to be updated.

[0015] Preferably, in step S12, when the corresponding form page cannot be found according to the database information, it indicates that the field to be updated belongs to a new database table.

[0016] Then step S13 includes creating a form page according to the database information, and then adding the field to be updated to the form page.

[0017] Preferably, step S2 includes:

[0018] Step S21: Obtain the form page from the spreadsheet, and judge whether the database table is updated according to the form page;

[0019] If so, go to step S22;

[0020] If not, go to step S23;

[0021] Step S22: Update the database table according to the form page;

[0022] Step S23: Update the fields of the database table according to the form page.

[0023] Preferably, step S22 includes:

[0024] Step S221: Judge whether the database table needs to be newly added according to the form page;

[0025] If so, newly add the database table, and then go to step S222;

[0026] If not, go to step S222;

[0027] Step S222: Judge whether the table structure of the database table is updated according to the form page;

[0028] If so, splice the form page and the database table, and then go to step S23;

[0029] If not, go to step S23.

[0030] Preferably, in step S222, the method of splicing the form page and the database table includes:

[0031] Obtain the number of fields in the form page, and sequentially modify the table name, field name, and field of each field according to the number of fields.

[0032] Preferably, step S3 includes:

[0033] Step S31: Obtain the updated backend database and page template;

[0034] Step S32: Update the front - end page according to the back - end database and the page template.

[0035] Preferably, the form page includes a first field and a second field;

[0036] The first field is used to mark whether this row is a primary key field, and the second field is used to mark whether this row is displayed on the front - end page.

[0037] The above - mentioned technical solution has the following advantages or beneficial effects: By introducing a spreadsheet, users can quickly import fields to be updated and operations on the data table structure through the spreadsheet. Subsequently, the back - end database performs field update operations according to the spreadsheet and synchronizes them to the front - end page. Furthermore, users do not need to modify the back - end database and the front - end page in the form of code, and only need to import fields to achieve the above process, reducing the development workload. Brief Description of the Drawings

[0038] With reference to the accompanying drawings, the embodiments of the present invention are described more fully. However, the accompanying drawings are only for illustration and explanation and do not constitute a limitation to the scope of the present invention.

[0039] Figure 1 It is the overall schematic diagram of the embodiment of the present invention;

[0040] Figure 2 It is the schematic diagram of the spreadsheet in the embodiment of the present invention;

[0041] Figure 3 It is the schematic diagram of the sub - steps of Step S1 in the embodiment of the present invention;

[0042] Figure 4 It is the schematic diagram of the sub - steps of Step S2 in the embodiment of the present invention;

[0043] Figure 5 It is the schematic diagram of the sub - steps of Step S22 in the embodiment of the present invention;

[0044] Figure 6 It is the schematic diagram of the sub - steps of Step S3 in the embodiment of the present invention;

[0045] Figure 7 It is the schematic diagram of the front - end page in the embodiment of the present invention. Detailed Embodiments

[0046] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts belong to the scope of protection of the present invention.

[0047] It should be noted that, without conflict, the embodiments in the present invention and the features in the embodiments may be combined with each other.

[0048] The present invention will be further described below in conjunction with the accompanying drawings and specific embodiments, but it is not limited to the present invention.

[0049] The present invention includes:

[0050] A method for updating a front-end field, including:

[0051] Step S1: Add a field to be updated in a spreadsheet;

[0052] Step S2: Use the spreadsheet to update the back-end database;

[0053] Step S3: Update the front-end page according to the updated back-end database.

[0054] Specifically, for the front-end page in the prior art, when the fields in the back-end database are changed, it is necessary to readjust the fields in the code and then update them. The update process is relatively cumbersome. In this embodiment, by introducing a spreadsheet as shown in Figure 2 , users can import the fields to be updated in the form of a spreadsheet and set the relevant information of the fields, and then the back-end database updates the fields in the database in turn. The front-end page reads the updated back-end database, so that while updating the back-end database, the workload of modifying the front-end code is reduced, and users only need to adjust through the spreadsheet to complete the update work of the front-end page.

[0055] In the implementation process, the above method is set as a software in a computer system, including a backend database part and a front-end page part. Among them, the backend database part is used to read and write spreadsheets and generate new front-end page templates according to the spreadsheets. The front-end page is used to display according to the newly generated front-end page after the backend database is updated, so as to realize the hot update of the front-end page, and directly display the updated fields in the backend database, reducing the workload of code adjustment. The spreadsheet itself can be implemented by existing technologies, such as Microsoft Excel worksheets. In this embodiment, only by adjusting the page layout, fields, and records of the spreadsheet can the definitions of each field in the database table be realized, and the modification of the spreadsheet in the form makes it more in line with the user's operation habits, without the user directly operating on the database, such as an SQL database, reducing the user's learning cost.

[0056] In a preferred embodiment, if there are multiple database tables set in the backend database, then as Figure 3 shown, step S1 includes:

[0057] Step S11: Obtain the form page corresponding to the database table from the spreadsheet, and the database information to which the field to be updated belongs;

[0058] Step S12: Find the corresponding form page according to the database information to which it belongs;

[0059] Step S13: Subsequently, add the field to be updated to the form page, or obtain the fields in the form page and update the fields with the field to be updated.

[0060] Specifically, aiming at the problem that the process of modifying front-end fields in the prior art is relatively cumbersome, in this embodiment, by compiling a field table as Figure 2 shown, the user can switch different database tables by adjusting the form page at the bottom, and through options such as "whether to display on the front end", "whether it is the primary key", and "field type", the user can complete the synchronization operation of the database table through this spreadsheet.

[0061] In the implementation process, as Figure 2 shown, for a backend database, a corresponding spreadsheet is pre-constructed, or a corresponding spreadsheet is generated according to the backend database by setting a corresponding software program. This spreadsheet has multiple form pages corresponding to different data tables, and its field settings are consistent with the database table, and two additional fields, "whether to display on the front end" and "whether it is the primary key", are added to make additional annotations for each row of records, facilitating subsequent adjustment of the database table structure according to the "whether it is the primary key" field and generating a new page template according to the "whether to display on the front end" field.

[0062] In a preferred embodiment, in step S12, when the corresponding form page cannot be found according to the information of the affiliated database, it indicates that the field to be updated belongs to a new database table.

[0063] Then step S13 includes creating a form page according to the information of the affiliated database, and then adding the field to be updated to the form page.

[0064] Specifically, for the problem that the process of modifying front-end fields in the prior art is relatively cumbersome, in this embodiment, the information of the fields to be updated added by the user is read through a spreadsheet, and a new form page is created in the spreadsheet when the field to be updated belongs to a new database table, thereby achieving a better corresponding effect for the database table and facilitating the back-end database to operate on the database table according to the content of the spreadsheet.

[0065] In a preferred embodiment, as Figure 4 shown, step S2 includes:

[0066] Step S21: Obtain the form page from the spreadsheet, and determine whether the database table is updated according to the form page;

[0067] If so, go to step S22;

[0068] If not, go to step S23;

[0069] Step S22: Update the database table according to the form page;

[0070] Step S23: Update the fields of the database table according to the form page.

[0071] Specifically, for the problem that modifying fields in the prior art is relatively cumbersome, in this embodiment, after the user completes the modification of the spreadsheet, the back-end database reads the form page one by one, then searches for the corresponding database table according to the page name of the form page, and determines whether the table structure of the database table is updated and whether a new database table needs to be added. If the database table needs to be updated, go to step S22; if only the field content needs to be added, deleted, or updated, go to step S23, thus realizing a relatively simple database table import process.

[0072] In a preferred embodiment, as Figure 5 shown, step S22 includes:

[0073] Step S221: Determine whether a new database table needs to be added according to the form page;

[0074] If so, add a new database table, and then go to step S222;

[0075] If not, go to step S222;

[0076] Step S222: Determine whether the table structure of the database table is updated according to the form page;

[0077] If so, splice the form page and the database table, and then turn to step S23;

[0078] If not, turn to step S23.

[0079] Specifically, in view of the problem that field modification is relatively cumbersome in the prior art, in this embodiment, during the update process of the database table, it is successively determined whether there is a newly added database table and whether the structure of the data table has changed, thereby realizing the addition of the database table and the update of the data table structure. Subsequently, new fields are added to the updated database table, thus reducing the workload of field update.

[0080] In a preferred embodiment, in step S222, the method for splicing the form page and the database table includes:

[0081] Obtain the number of fields in the form page, and successively modify the table name, field name, and field of each field according to the number of fields.

[0082] Specifically, to implement the update of the backend database through a spreadsheet, in this embodiment, when the table structure needs to be changed, splicing processing is adopted to generate a database table with an updated table structure, and then the characters to be updated are added to the updated database table, achieving a good update effect.

[0083] During the implementation process, the splicing processing specifically includes the following steps carried out successively: creating, obtaining the corresponding number of fields in the form page, and circularly creating fields and splicing processing, including:

[0084] CREATE TABLE table_name (database_field_name1 field_type field_length, database_field_name2 field_type field_length);

[0085] Modify the field: ALTER TABLE table_name ADD database_field_name field_type field_length;

[0086] Modify the field name: alter table table_name rename column database_field_name to database_new_field_name;

[0087] Modify the field: alter table table_name modify (database_field_name field_type default_value whether_null);

[0088] The splicing process of the field is realized through the above steps, and the content of the field to be updated is merged into the database table.

[0089] In a preferred embodiment, as Figure 6 shown, step S3 includes:

[0090] Step S31: Obtain the updated backend database and page template;

[0091] Step S32: Update the front-end page according to the backend database and page template.

[0092] Specifically, in view of the problem in the prior art that when the fields in the backend database are modified, the front-end page needs to synchronously modify the code to correctly display the updated fields. In this embodiment, after the update of the backend database is completed, a new page template is generated and exported according to the updated fields. For example, the front-end page is a table display page as Figure 7 shown. A table object is pre-created on this page, and the data source in the table object is a database table in the backend database. For this table object, when there are new fields, new fields are added to the table, and reserved update bits are used, such as adding new rows / columns and adjusting the display effect of the table object, including row / column spacing, background color, serial number, etc. Subsequently, other contents are created according to the new data, such as the select-all button on the left, etc., so as to generate a new page template. Subsequently, the front-end page reads the page template and obtains the data in the backend database according to the page template for display, so as to achieve the effect of automatic update of the front-end page.

[0093] The beneficial effect of the present invention is that by introducing a spreadsheet, the user can quickly import the fields to be updated and the operations on the data table structure through the spreadsheet. Subsequently, the backend database performs field update operations according to the spreadsheet and synchronizes them to the front-end page. Furthermore, the user does not need to modify the backend database and the front-end page in the form of code, and only needs to import the fields to achieve the above process, reducing the development workload.

[0094] The above are only preferred embodiments of the present invention, and do not limit the implementation manners and protection scope of the present invention. For those skilled in the art, it should be realized that all equivalent replacements and obvious changes made by using the description and illustrations of the present invention should be included in the protection scope of the present invention.

Claims

1. A method for updating front-end fields, characterized in that, Including: Step S1: Add fields to be updated in a spreadsheet. Step S2; Use the spreadsheet to update the backend database. Step S3: Update the front-end page according to the updated backend database. The said Step S3 includes: Step S31: Obtain the updated backend database and page template. Step S32: Update the front-end page according to the backend database and the page template. The front-end page includes a table object corresponding to the database table in the backend database. When there are new fields, add the new fields to the spreadsheet and use the update bit to update to form new data. The new data is used to generate the page template. The said Step S2 includes: Step S21: The backend database sequentially obtains form pages from the spreadsheet, searches for the corresponding database table according to the page name of the form page, and then determines whether the database table is updated. If so, go to Step S22; If not, go to Step S23; Step S22: Update the database table according to the form page. Step S23: Update the fields of the database table according to the form page. The said Step S22 includes: Step S221: Determine whether the database table needs to be newly added according to the form page. If so, newly add the database table, and then go to Step S222; If not, go to Step S222; Step S222: Determine whether the table structure of the database table is updated according to the form page. If so, splice the form page and the database table, and then go to Step S23; If not, go to Step S23; In the said Step S222, the method of splicing the form page and the database table includes: Obtain the number of fields in the form page, create fields in a loop according to the number of fields, and sequentially modify the table name, field name and fields of each field for splicing.

2. The update method according to claim 1, characterized in that If there are multiple database tables set in the backend database, then the said Step S1 includes: Step S11: Obtain the form page corresponding to the database table and the database information to which the fields to be updated belong from the spreadsheet. Step S12: Find the corresponding form page according to the said database information. Step S13: Then add the fields to be updated in the form page. Or, obtain the fields in the form page and update the fields with the fields to be updated.

3. The update method according to claim 2, characterized in that In the said Step S12, when the corresponding form page cannot be found according to the said database information, it indicates that the fields to be updated belong to a new database table. Then the said Step S13 includes creating a form page according to the said database information, and then adding the fields to be updated in the form page.

4. The update method according to claim 2, wherein The form page includes a first field and a second field. The first field is used to mark whether the corresponding row is a primary key field, and the second field is used to mark whether the row is displayed on the front-end page.

Citation Information

Patent Citations

  • Method and system for creating data table, and relevant equipment

    CN108197091A

  • Form management method and device

    CN108959361A

  • Front-end page modification method, system, equipment and medium

    CN114518882A