A data management method, system, computer device and storage medium
By writing reusable table paging components and using callback parameters for data requests and dynamic rendering, the problem of inconvenient data paging processing during continuous integration is solved, and the efficiency and quality of code development is improved.
Patent Information
- Application Number
- CN202311101267.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-30
- Publication Date
- 2025-02-11
- Estimated Expiration
- 2043-08-30
AI Technical Summary
The prior art is inconvenient to process data table paging during continuous integration, resulting in code redundancy and difficulty in maintaining.
By writing a reusable table paging component, using callback parameters to feedback the changed page number and number of pages per page, the parent component makes data requests and dynamically renders the table data.
It improves the efficiency and quality of code development, reduces duplicate code, simplifies post-maintenance, and solves the problem of inconvenient data table paging.
Smart Images

Figure CN117272958B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data management, and in particular to a data management method, system, computer equipment and storage medium. Background Art
[0002] Continuous integration (CI) is a common method used in Internet software development, which is generally managed by a distributed version control system (Git) or code review software (Gerrit). When the continuous integration tool Jenkins detects code changes in the code base, it will automatically build compilation and testing processes to detect errors as early as possible, reduce risks, and ensure code quality.
[0003] Each step of continuous integration is accompanied by a large amount of data, including the remote repository address of code submission, submitted branch information, compilation progress, compilation results, test cases, test results, etc. Relevant personnel need to query continuous integration data from different software separately, such as querying code branches, updates, merges, etc. from Git software, and checking task build information after code changes from Jenkins. This method is not conducive to relevant personnel to grasp the data of code warehouses and compilation, testing and other processes in a timely manner.
[0004] The existing technology includes directly writing the table structure on each page. When a table is needed, a table structure is written. There are too many repeated codes with similar structures, which causes code redundancy and is not conducive to later maintenance. In addition, when there is a lot of table data, paging is required. Equipping each table with a pager will also cause cumbersome code and large code volume. Summary of the invention
[0005] In view of the deficiencies in the prior art, the present invention provides a data management method, system, computer device and storage medium, which solve the technical problem of inconvenient paging processing of data tables in the continuous integration process in the prior art.
[0006] In a first aspect, the present invention provides a data management method, the management method comprising:
[0007] S1: Write a table pager component and confirm the component tag, and register the table pager component globally; the table pager component is bound with callback parameters; the callback parameters include page number and number of entries per page;
[0008] S2: When several callback parameters are changed, the table pager component feeds back the changed callback parameters to the parent component;
[0009] S3: The parent component confirms the data request based on the changed callback parameters.
[0010] S4: Obtain target data based on data request, process the target data, obtain table data and pass it to the parent component;
[0011] S5: The parent component calls the table pager component through the component tag to dynamically render the table data.
[0012] Furthermore, write a table pager component, including:
[0013] Import the table and paginator into the component;
[0014] Define the table parameters, page number, number of entries per page and total number of entries of the component, and use the page number and number of entries per page as callback parameters;
[0015] Define the component tag to generate the table pager component.
[0016] Further, obtaining the table data after processing the target data includes:
[0017] The target data is looped through and processed into a preset format to obtain table row data and table header data as table data.
[0018] Furthermore, the preset format includes an array format.
[0019] Furthermore, the data request includes a request method, a request path and request parameters.
[0020] In a second aspect, the present invention provides a data management system, wherein the management system is used to execute the steps of the management method; the management system comprises:
[0021] Front-end development platform and back-end data storage platform;
[0022] Front-end development platform, used to load and run the parent component; used to write the table pager component and confirm the component tag, and globally register the table pager component; used to send data requests to the back-end data storage platform; used to obtain table data after processing the target data;
[0023] The backend data storage platform is used to store target data and to respond to data requests to obtain target data.
[0024] Furthermore, the backend data storage platform includes:
[0025] Multiple local code repositories, remote code repositories, inspection modules, compilation machines, automated testing modules, and backend databases
[0026] Each local code repository is used to store the code written by the developer; the developer submits the written code from the local code repository to the remote code repository;
[0027] Remote code repository, used to store the code uploaded to each local code repository and perform version control;
[0028] The inspection module is used to detect whether there are code changes in the remote code repository; if so, the inspection module obtains the submission information of the code, builds a compilation task to pull the changed code from the remote code repository to the compilation machine, obtains the compilation code for compilation and records and stores the compilation data; the compilation data includes the compilation process, compilation status and compilation results; the compilation machine sends the compilation code to the automated testing module, which is used to formulate test tasks based on the compilation code and obtain test data;
[0029] The backend database is used to store data table information, compilation data, and test data.
[0030] Furthermore, the submission information includes the code author, remote code repository address, branch, version number and title.
[0031] In a third aspect, the present invention provides a computer device, comprising a processor and a memory, wherein a computer program is stored in the memory, and the computer program is characterized in that when the computer program is executed by the processor, the processor executes the steps of the management method, including: writing a table pager component and confirming the component tag, and globally registering the table pager component; the table pager component is bound with callback parameters; the callback parameters include page numbers and the number of entries per page; when several callback parameters are changed, the table pager component feeds back the changed callback parameters to the parent component; the parent component confirms the data request based on the changed callback parameters; obtains target data based on the data request, and obtains table data after processing the target data and passes it to the parent component; the parent component calls the table pager component through the component tag to dynamically render the table data.
[0032] In a fourth aspect, the present invention provides a storage medium storing a computer program, characterized in that when the computer program is executed by a processor, the processor executes the steps of the management method, including: writing a table pager component and confirming the component tag, and globally registering the table pager component; the table pager component is bound with callback parameters; the callback parameters include page numbers and the number of entries per page; when several callback parameters change, the table pager component feeds back the changed callback parameters to the parent component; the parent component confirms the data request based on the changed callback parameters; obtains target data based on the data request, and obtains table data after processing the target data and passes it to the parent component; the parent component calls the table pager component through the component tag to dynamically render the table data.
[0033] Compared with the prior art, the present invention has the following beneficial effects:
[0034] The present invention compiles a table and a pager into a reusable table pager component. When a number of callback parameters are changed, the table pager component feeds back the changed callback parameters to the parent component so that the parent component can make a data request to obtain the target data. The table pager component can be called by using a component tag to realize the table rendering and paging functions for the target data. The efficiency and quality of code development are effectively improved, duplicate code is reduced, and later maintenance is also facilitated. The technical problem of inconvenient data table paging processing in the continuous integration process existing in the prior art is solved. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] Figure 1 A method step diagram of an embodiment of the present invention.
[0036] Figure 2 4 is a system structure diagram of an embodiment of the present invention. DETAILED DESCRIPTION
[0037] The technical solution of the present invention is further described below in conjunction with the accompanying drawings and embodiments.
[0038] In a first aspect, the present invention provides a data management method, such as Figure 1 As shown,
[0039] The management method comprises:
[0040] S1: Write a table pager component and confirm the component tag, and register the table pager component globally; the table pager component is bound with callback parameters; the callback parameters include page number and number of entries per page;
[0041] S2: When several callback parameters are changed, the table pager component feeds back the changed callback parameters to the parent component;
[0042] S3: The parent component confirms the data request based on the changed callback parameters.
[0043] S4: Obtain target data based on data request, process the target data, obtain table data and pass it to the parent component;
[0044] The data request includes a request method, a request path and request parameters;
[0045] S5: The parent component calls the table pager component through the component tag to dynamically render the table data.
[0046] The specific implementation process of this embodiment includes:
[0047] In this embodiment, writing a table pager component includes: introducing a table and a pager into the component together; defining the table parameters, page number, number of entries per page and total number of entries of the component, and using the page number and number of entries per page as callback parameters; defining a component tag to generate a table pager component.
[0048] For example: create a table pager file (TablePage.vue file) under the component folder (components folder), and then in the template of the table pager file (TablePage.vue file) ( <template>) using adaptive tables ( <el-table>table); Adaptive table( <el-table>Table) uses the binding instruction (:data) to bind the parent component to pass in the table data; adaptive table ( <el-table>Table) header ( <el-table-column>)Use the loop instruction (v-for) to loop;
[0049] In Adaptive Tables ( <el-table>Add a pager after the code of the table ( <el-pagination>); Paginator( <el-pagination>) is bound with the current page number and the number of entries per page as callback parameters.
[0050] It should be noted that when the number of items per page and the current page number change, the size-change event and the current-change event will be triggered, and then the custom event will be triggered through the trigger instruction (emit instruction), and the changed current page number and the number of items per page of the table will be passed to the parent component. The size-change event is automatically executed after the number of items per page changes, and the current-change event is automatically executed when the current page number changes.
[0051] In this embodiment, obtaining table data after processing the target data includes:
[0052] The target data is traversed in a loop and the target data is processed into a preset format to obtain table row data and table header data as table data; the preset format includes an array format.
[0053] For example, in this embodiment, the preset format includes [{}, {}, ..., {}]; each {} represents a piece of data and is used to render a row of a table.
[0054] In this embodiment, by writing the table and the pager as a reusable table pager component, when several callback parameters are changed, the table pager component feeds back the changed callback parameters to the parent component so that the parent component can make a data request to obtain the target data; using the component tag to call the table pager component can realize the table rendering and paging functions for the target data. It effectively improves the efficiency and quality of code development, reduces duplicate code, and is also conducive to later maintenance. It solves the technical problem of inconvenient data table paging processing in the continuous integration process in the prior art.
[0055] In a second aspect, the present invention provides a data management system, wherein the management system is used to execute the steps of the management method; Figure 2 As shown, the management system includes:
[0056] Front-end development platform and back-end data storage platform;
[0057] Front-end development platform, used to load and run the parent component; used to write the table pager component and confirm the component tag, and globally register the table pager component; used to send data requests to the back-end data storage platform; used to obtain table data after processing the target data;
[0058] The backend data storage platform is used to store target data and to respond to data requests to obtain target data.
[0059] The specific implementation process of this embodiment includes:
[0060] In this embodiment, the backend data storage platform includes:
[0061] Multiple local code repositories, remote code repositories, inspection modules, compilation machines, automated testing modules, and backend databases
[0062] Each local code repository is used to store the code written by the developer; the developer submits the written code from the local code repository to the remote code repository;
[0063] Remote code repository, used to store the code uploaded to each local code repository and perform version control;
[0064] The inspection module is used to detect whether there are code changes in the remote code repository; if so, the inspection module obtains the submission information of the code, builds a compilation task to pull the changed code from the remote code repository to the compilation machine, obtains the compilation code for compilation and records and stores the compilation data; the compilation data includes the compilation process, compilation status and compilation results; the compilation machine sends the compilation code to the automated testing module, which is used to formulate test tasks based on the compilation code and obtain test data; the submission information includes the code author, code repository address, branch, version number and title.
[0065] The compilation machine compiles according to the changed code, and obtains the compiled code after successful compilation. The compilation machine also records the compilation process, compilation status and compilation results during the compilation process; after successful compilation, the compilation machine sends the compiled code to the automated testing module to formulate test tasks.
[0066] The backend database is used to store data table information, compilation data, and test data.
[0067] In this embodiment, the inspection module includes a continuous integration tool, Jenkins, which is configured with the address information of a remote code repository; is used to check changes in the remote code repository code; and also writes automated task scripts according to the requirements corresponding to the code; calls an idle compilable machine to compile the changed code into packages for different systems; the automated testing module prepares test cases according to the automated task scripts, and performs automated testing on the successfully compiled code, wherein the test data includes information such as test cases, test status, and test results.
[0068] It should be noted that, in this embodiment, the front-end development platform and the back-end data storage platform interact with each other through the Axios interaction method.
[0069] In a third aspect, the present invention provides a computer device, comprising a processor and a memory, wherein a computer program is stored in the memory, and the computer program is characterized in that when the computer program is executed by the processor, the processor executes the steps of the management method, including: writing a table pager component and confirming the component tag, and globally registering the table pager component; the table pager component is bound with callback parameters; the callback parameters include page numbers and the number of entries per page; when several callback parameters are changed, the table pager component feeds back the changed callback parameters to the parent component; the parent component confirms the data request based on the changed callback parameters; obtains target data based on the data request, and obtains table data after processing the target data and passes it to the parent component; the parent component calls the table pager component through the component tag to dynamically render the table data.
[0070] In a fourth aspect, the present invention provides a storage medium storing a computer program, characterized in that when the computer program is executed by a processor, the processor executes the steps of the management method, including: writing a table pager component and confirming the component tag, and globally registering the table pager component; the table pager component is bound with callback parameters; the callback parameters include page numbers and the number of entries per page; when several callback parameters change, the table pager component feeds back the changed callback parameters to the parent component; the parent component confirms the data request based on the changed callback parameters; obtains target data based on the data request, and obtains table data after processing the target data and passes it to the parent component; the parent component calls the table pager component through the component tag to dynamically render the table data.
[0071] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the program can be stored in a non-volatile computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0072] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solution of the present invention can be modified or replaced by equivalents without departing from the purpose and scope of the technical solution of the present invention, which should be included in the scope of the claims of the present invention. < / template>
Claims
1. A data management method, characterized in that: The management method comprises: Write a table pager component and confirm the component tag, and register the table pager component globally; the table pager component is bound with callback parameters; the callback parameters include the page number and the number of entries per page; When several callback parameters are changed, the table pager component feeds back the changed callback parameters to the parent component; The parent component confirms the data request based on the changed callback parameters; Obtain target data based on data request, process the target data, obtain table data and pass it to the parent component; The parent component calls the table pager component through the component tag to dynamically render the table data; The writing table pager component includes: Import the table and paginator into the component; Define the table parameters, page number, number of entries per page and total number of entries of the component, and use the page number and number of entries per page as callback parameters; Define the component tag to generate the table pager component.
2. A data management method as claimed in claim 1, characterized in that: After processing the target data, the table data is obtained, including: The target data is looped through and processed into a preset format to obtain table row data and table header data as table data.
3. A data management method as claimed in claim 2, characterized in that: The preset format includes an array format.
4. A data management method as claimed in claim 3, characterized in that: The data request includes a request method, a request path and request parameters.
5. A data management system, characterized in that: The management system is used to execute the steps of the management method according to any one of claims 1 to 4; The management system includes: Front-end development platform and back-end data storage platform; Front-end development platform, used to load and run the parent component; used to write the table pager component and confirm the component tag, and globally register the table pager component; used to send data requests to the back-end data storage platform; used to obtain table data after processing the target data; The backend data storage platform is used to store target data and to respond to data requests to obtain target data.
6. A data management system as claimed in claim 5, characterized in that: The backend data storage platform includes: Multiple local code repositories, remote code repositories, inspection modules, compilation machines, automated testing modules, and backend databases; Each local code repository is used to store the code written by the developer; the developer submits the written code from the local code repository to the remote code repository; Remote code repository, used to store the code uploaded to each local code repository and perform version control; The inspection module is used to detect whether there are code changes in the remote code repository; if so, the inspection module obtains the submission information of the code, builds a compilation task to pull the changed code from the remote code repository to the compilation machine, obtains the compilation code for compilation and records and stores the compilation data; the compilation data includes the compilation process, compilation status and compilation results; the compilation machine sends the compilation code to the automated testing module, which is used to formulate test tasks based on the compilation code and obtain test data; The backend database is used to store data table information, compilation data, and test data.
7. A data management system as claimed in claim 6, characterized in that: The submission information includes the code author, remote code repository address, branch, version number and title.
8. A computer device comprising a processor and a memory, wherein a computer program is stored in the memory, wherein: When the computer program is executed by the processor, the processor executes the steps of the management method according to any one of claims 1 to 4.
9. A storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the processor is caused to execute the steps of the management method according to any one of claims 1 to 4.
Citation Information
Patent Citations
A method and a system for optimizing the rendering performance of a Vue front-end table component
CN108959206A
Configurable web form implementation method
CN113407877A