Data query method and device, electronic equipment and storage medium

Through the data query component, the target system is determined based on the target query parameter type, the data query request is sent and the data query is processed, and the pagination, sorting and row selection is supported, which solves the problem of code duplication caused by data query requirements in different systems, and improves development efficiency and user experience .

CN119271864APending Publication Date: 2025-01-07BEIJING QIYI CENTURY SCI & TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411142621.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-20
Publication Date
2025-01-07

AI Technical Summary

Technical Problem

The data query requirements of different systems lead to excessive repetition of functional codes, which reduces the system's development efficiency.

Method used

The data query component receives the target query parameters, determines the matching target system according to the parameter type, sends a data query request and returns data, supports paging processing, sorting and row selection operations, and saves the query parameters in the URL for reuse.

Benefits of technology

Reduce duplicate code in different systems, improve system development efficiency, simplify data query process, and improve user experience and operation convenience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119271864A_ABST
    Figure CN119271864A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a data query method and device, electronic equipment and a storage medium. Relates to the technical field of data processing. The method comprises the following steps: receiving a target query parameter representing a data query condition; based on the types of the parameters contained in the target query parameters, determining a target system matched with the types, sending a data query request based on the target query parameters to the target system, and returning queried data; wherein the types of the parameters contained in the query parameters required by different systems are different; and receiving data returned by the target system. By applying the scheme provided by the embodiment of the invention, the development efficiency of the system can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing technology, and in particular to a data query method, device, electronic equipment and storage medium. Background Art

[0002] Different systems can meet different business needs. Different systems have different corresponding data query conditions, and the data displayed will also be different. Therefore, developers need to write independent data query function codes for different systems.

[0003] However, the function codes corresponding to different systems are too repetitive. If a set of function codes is written for each system, the system development efficiency will be reduced. Summary of the invention

[0004] The purpose of the embodiments of the present invention is to provide a data query method, device, electronic device and storage medium to improve the development efficiency of the system. The specific technical solution is as follows:

[0005] In a first aspect of an embodiment of the present invention, a data query method is first provided, which is applied to a data query component. The method includes:

[0006] receiving a target query parameter representing a data query condition;

[0007] Based on the type of the parameter included in the target query parameter, determine a target system that matches the type, send a data query request based on the target query parameter to the target system, and return the queried data; wherein the types of the parameters included in the query parameters required by different systems are different;

[0008] Receive data returned by the target system.

[0009] In a possible embodiment, if the target system performs paging processing on the data corresponding to the target query parameter and sends the paging data obtained after the paging processing to the data query component, the receiving of the data returned by the target system includes:

[0010] Receive the paging data returned by the target system.

[0011] In a possible embodiment, after receiving the data returned by the target system, the method further includes:

[0012] After receiving the information indicating the target sorting rule, sending the information including the target sorting rule to the target system, so that the target system sorts the queried data based on the target sorting rule and returns the sorted data to the data query component;

[0013] Receive the sorted data returned by the target system.

[0014] In a possible embodiment, after receiving the data returned by the target system, the method further includes:

[0015] After receiving the information indicating the target in the row selection, sending the information including the target in the row selection to the target system, so that the target system returns the data in the row selection to the data query component based on the target in the row selection;

[0016] Based on the row-selected data returned by the target system, a row-selection operation is performed on the data row corresponding to the row-selected target.

[0017] In a possible embodiment, the method further includes:

[0018] The target query parameter is saved in the target URL, so that when the data query component reacquires the data corresponding to the target query parameter, it parses the target query parameter from the target URL and uses the parsed target query parameter as a new data query condition.

[0019] In a second aspect of an embodiment of the present invention, a data query device is further provided, which is applied to a data query component, and the device includes:

[0020] A parameter receiving module, used for receiving a target query parameter representing a data query condition;

[0021] A data request module, used to determine a target system matching the type of parameter contained in the target query parameter based on the type of parameter contained in the target query parameter, send a data query request based on the target query parameter to the target system, and return the queried data; wherein the types of parameters contained in the query parameters required by different systems are different;

[0022] The data receiving module is used to receive the data returned by the target system.

[0023] In a possible embodiment, if the target system performs paging processing on the data corresponding to the target query parameter and sends the paging data obtained after the paging processing to the data query component, the data receiving module is specifically used to:

[0024] Receive the paging data returned by the target system.

[0025] In a possible embodiment, after the data receiving module receives the data returned by the target system, the method further includes:

[0026] A first sending module is used to send information including the target sorting rule to the target system after receiving the information indicating the target sorting rule, so that the target system sorts the queried data based on the target sorting rule and returns the sorted data to the data query component;

[0027] The first receiving module is used to receive the sorted data returned by the target system.

[0028] In a possible embodiment, after the data receiving module receives the data returned by the target system, the method further includes:

[0029] A second sending module is used to send information including the row selected target to the target system after receiving the information indicating the row selected target, so that the target system returns the row selected data to the data query component based on the row selected target;

[0030] The second receiving module is used to perform a row selection operation on the data row corresponding to the row selection target based on the row selection data returned by the target system.

[0031] In a possible embodiment, the device further includes:

[0032] The parameter saving module is used to save the target query parameter to the URL, so that when the data query component reacquires the data corresponding to the target query parameter, it can parse the target query parameter from the target URL and use the parsed target query parameter as a new data query condition.

[0033] In a third aspect of an embodiment of the present invention, there is further provided an electronic device, comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;

[0034] Memory, used to store computer programs;

[0035] The processor is used to implement any method step described in the first aspect when executing the program stored in the memory.

[0036] In another aspect of the present invention, a computer-readable storage medium is provided, wherein a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, any method step described in the first aspect is implemented.

[0037] The data query method provided by an embodiment of the present invention can, after receiving a target query parameter representing a data query condition, send a data query request based on the target query parameter to a target system matching the type of parameter contained in the target query parameter, and return the queried data. After receiving the data returned by the target system, the data query component completes the data query process.

[0038] Furthermore, compared with the prior art in which multiple clients need multiple sets of codes to query data, the query parameters required by different systems in the embodiments of the present invention contain different types of parameters, and data queries are all processed by data query components. The number of codes required for multiple interfaces to query data is much smaller than the number of codes required for multiple clients to query data, reducing duplicate codes in different systems and improving system development efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art are briefly introduced below.

[0040] Figure 1 A schematic diagram of a flow chart of a first data query method provided by an embodiment of the present invention;

[0041] Figure 2 A schematic diagram of a page of a data query component provided by an embodiment of the present invention;

[0042] Figure 3 A schematic diagram of a flow chart of a second data query method provided by an embodiment of the present invention;

[0043] Figure 4 A schematic diagram of a flow chart of a third data query method provided by an embodiment of the present invention;

[0044] Figure 5 A schematic diagram of a fourth data query method provided by an embodiment of the present invention;

[0045] Figure 6 A unit schematic diagram of a data query component provided by an embodiment of the present invention;

[0046] Figure 7 An interactive flow chart of a first data query method provided by an embodiment of the present invention;

[0047] Figure 8 An interactive flow chart of a second data query method provided by an embodiment of the present invention;

[0048] Fig. 9 An interactive flow chart of a data export method provided by an embodiment of the present invention;

[0049] Fig.10 A schematic diagram of the structure of a data query device provided by an embodiment of the present invention;

[0050] Fig.11 A schematic structural diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0051] The technical solutions in the embodiments of the present invention will be described below in conjunction with the accompanying drawings in the embodiments of the present invention.

[0052] The embodiment of the present invention provides a data query method, which is applied to a data query component, see Figure 1 , is a flow chart of a first data query method provided in an embodiment of the present invention, the method includes S101-S103.

[0053] S101, receiving a target query parameter representing a data query condition.

[0054] In S101, the target query parameter is input by the user through the data query component. The target query parameter represents the data query condition. Different businesses have different data query conditions. Therefore, the target query parameter is related to the type of business. For example, if the business is to query student information, the target query parameter may be the student name, student ID, student grades, etc. If the business is to query product activity information, the target query parameter may be the activity type, product category, product name, product instant discount amount, etc.

[0055] The target query parameter may be one parameter or multiple parameters, each parameter corresponds to a type of data query condition, and the embodiment of the present invention does not specifically limit the number of target query parameters.

[0056] In a possible embodiment, after receiving the target query parameter representing the data query condition input by the user, the data query component may pre-process the target query parameter. For example, a proxy layer may be used to convert the various time formats input by the user into a unified time format. For example, if the time format input by the user is "2021-2-3", the unified time format is "2021 / 2 / 3".

[0057] In addition, the data query component page can display input boxes for query parameters of all systems. Each input box corresponds to a parameter, and different parameters correspond to different types of data query conditions. Users can select all or part of the input boxes as needed, fill in or select specific values ​​of the parameters, so that the data query component obtains the target query parameters. For details of the data query component page, please refer to the following Figure 2 , which will not be elaborated here.

[0058] Alternatively, the user may also import the target query parameters through a file, in which case the page of the data query component may not include an input box for inputting the query parameters.

[0059] S102, based on the type of the parameter included in the target query parameter, determine a target system that matches the type, send a data query request based on the target query parameter to the target system, and return the queried data.

[0060] In S102, the query parameters required by different systems contain different types of parameters. Since the target query parameters are related to the type of business, different businesses need to be implemented by different systems. Therefore, according to the type of parameters contained in the target query parameters, a target system matching the type can be determined.

[0061] For example, when performing data query on different systems, different types of query parameters are required. For example, if the system is a student information system, the types of query parameters are student name, student ID, and student grade. If the type of parameter included in the target query parameter is the same as the type of query parameter corresponding to the student information system, then it can be determined that the target system is a student information system.

[0062] If the system is a commodity activity information system, the types of query parameters are activity type, commodity category, commodity name, and commodity instant discount amount. If the types of parameters included in the target query parameters are the same as the types of query parameters corresponding to the commodity activity information system, it can be determined that the target system is a commodity activity information system.

[0063] In a possible embodiment, if the type of the parameter input by the user does not match the type of the query parameter corresponding to the system, the target system cannot be determined. In this case, the parameters input by the user need to be discarded and the user is reminded to re-enter the parameters. For example, if the user only enters the student name and the student's grade but does not enter the student ID, the target system cannot be determined and the user is reminded to re-enter the parameters.

[0064] In addition, different businesses need to be implemented through different systems, and different systems correspond to different interfaces and different backends. For example, assume that business 1 is to query student information, system 1 is a student information query system, backend 1 is used to store student information, and interface 1 of the data query component is used to output data query requests to the backend and pass in the data queried by the backend. If, based on the type of parameters contained in the target query parameters, it is determined that the target system that matches the type is system 1, then a request is made to backend 1 through interface 1 to perform a data query based on the target query parameters and return the queried data.

[0065] S103, receiving data returned by the target system.

[0066] After receiving the data returned by the target system, the data query component displays the returned data in the data display area of ​​the page of the data query component.

[0067] When a page includes an input box for inputting query parameters, the page of the data query component can be divided into multiple areas, one area is used for users to input target query parameters, and the other area is used to display data queried based on the target query parameters.

[0068] Exemplarily, in one case, assume that the page of the data query component is divided into two areas, the upper area is the first area, the lower area is the second area, the target query parameters are entered in the first area, and the data queried based on the target query parameters are displayed in the second area.

[0069] In another case, it is assumed that the page of the data query component is divided into two areas, the left area is the first area, and the right area is the second area. The data queried based on the target query parameters are displayed in the first area, and the target query parameters are input in the second area. The embodiment of the present invention does not specifically limit the number of areas on the page of the data query component and the content displayed in each area.

[0070] By selecting the above embodiment, after receiving the target query parameters representing the data query conditions, the data query component can send a data query request based on the target query parameters to the target system matching the type of parameters contained in the target query parameters, and return the queried data. After receiving the data returned by the target system, the data query component completes the data query process.

[0071] Furthermore, compared with the prior art in which multiple clients need multiple sets of codes to query data, the query parameters required by different systems in the embodiments of the present invention contain different types of parameters, and data queries are all processed by data query components. The number of codes required for multiple interfaces to query data is much smaller than the number of codes required for multiple clients to query data, reducing duplicate codes in different systems and improving system development efficiency.

[0072] In one possible embodiment, see Figure 2 , which is a schematic diagram of a page of a data query component provided in an embodiment of the present invention.

[0073] from Figure 2It can be seen that the page of the data query component is divided into two areas, the upper area is used to enter the target query parameters, including please select the activity type, please select the product category, please select the product, please enter the start time, please enter the end time. The lower area displays the data queried based on the target query parameters, including the activity type is promotional discount, the product category is clothing, the product is product 1, the discount amount (yuan) is 6.00, the start time is 00:00:00 on 2024-01-01, the end time is 00:00:00 on 2024-01-31, the operation time is 15:30:35 on 2024-07-31, and the operator is Li.

[0074] It should be noted that the items displayed in the lower area can be increased or decreased. For example, the data queried based on the target query parameters displayed in the lower area can include the activity ID, or the column of product category can be deleted.

[0075] In a possible embodiment, if the target system performs paging processing on the data corresponding to the target query parameter and sends the paging data obtained after the paging processing to the data query component, see Figure 3 , is a flow chart of a second data query method provided by an embodiment of the present invention, which is similar to the aforementioned Figure 1 Compared with the embodiment shown, the above S103 can be implemented by S103A.

[0076] S103A, receiving paging data returned by the target system.

[0077] In S103A, after the target system retrieves the data based on the target query parameters, it can perform paging processing on the queried data and send the paging data obtained after the paging processing to the data query component. After receiving the paging data, the data query component displays the returned paging data in different pages in the data display area in the page of the data query component.

[0078] For example, assuming that the target system retrieves M data based on the target query parameters, and the data on each page after paging is n, the retrieved data is divided into M / N pages. If M / N is an integer, assuming that the target system retrieves 100 data based on the target query parameters, and the data on each page after paging is 20, the retrieved data is divided into 5 pages.

[0079] When M / N is not an integer, the number of data items on each page after paging is different. Assume that the target system retrieves 100 data items based on the target query parameters, and after paging, the first three pages contain 30 data items each, and the last page contains 10 data items.

[0080] By selecting the above embodiment, the target system performs paging processing on the data corresponding to the target query parameters, and sends the paging data obtained after the paging processing to the data query component. After receiving the paging data returned by the backend, the data query component displays the returned paging data in different pages in the data display area in the page of the data query component, which can avoid the data query component from receiving too much data at one time, thereby avoiding problems such as freezing of the page of the data query component.

[0081] In one possible embodiment, see Figure 4 , is a flow chart of a third data query method provided by an embodiment of the present invention, which is similar to the aforementioned Figure 1 Compared with the embodiment shown, after the above S103, it also includes S401-S402.

[0082] S401, after receiving information indicating a target sorting rule, sending information including the target sorting rule to a target system, so that the target system sorts the queried data based on the target sorting rule, and returns the sorted data to the data query component.

[0083] In S401, the target sorting rule refers to the rule used by the target system to sort the queried data. For example, the target sorting rule may be to instruct the target system to sort the queried data from large to small, or may be to instruct the target system to sort the queried data from small to large.

[0084] In a possible embodiment, the target sorting rule may be to instruct the target system to sort a column or a row of data from large to small. For example, if the first column of data in the data display area is the student ID, the second column of data is the student name, and the third column of data is the student's grade, the target sorting rule may be to instruct the target system to sort the third column of data from large to small, and the data in the first and second columns change with the change of the data in the third column.

[0085] After receiving the information indicating the target sorting rule input by the user, the data query component sends information containing the target sorting rule to the target system. If the target sorting rule is to sort the data from large to small, the target system will sort the queried data from large to small and return the sorted data to the data query component.

[0086] The information input by the user indicating the target sorting rule may be the user clicking a sort button on the page of the data query component, or the user inputting a sorting instruction through the keyboard. For example, when the user clicks the sort button for the first time, the data query component sorts a column or a row of data according to the rule of large to small. When the user clicks the sort button for the second time, the data query component sorts a column or a row of data according to the rule of small to large. Alternatively, the user clicks the sort shortcut key on the keyboard to input the sorting instruction.

[0087] S402, receiving sorted data returned by the target system.

[0088] After receiving the sorted data returned by the target system, the data query component displays the returned sorted data in the data display area of ​​the page of the data query component.

[0089] By selecting the above embodiment, the data query component sends information containing the target sorting rule to the target system. The target system sorts the queried data based on the target sorting rule and returns the sorted data to the data query component. The sorted data can be displayed to the user to improve the user experience.

[0090] In one possible embodiment, see Figure 5 , is a flow chart of a fourth data query method provided by an embodiment of the present invention, which is similar to the aforementioned Figure 1 Compared with the embodiment shown, after the above S103, it also includes S501-S502.

[0091] S501, after receiving information indicating a row selected target, sending information including the row selected target to a target system, so that the target system returns the row selected data to a data query component based on the row selected target.

[0092] In S501, indicating a row selection target means that the user instructs the data query component to perform a row selection operation on the selected data row. After receiving the information indicating the row selection target input by the user, the data query component sends information containing the row selection target to the target system. The target system returns the row selection data to the data query component based on the row selection target.

[0093] Assuming that the row selection target is to select the Yth row, the target system returns the data of the Yth row to the data query component based on the row selection target, and the data query component performs a row selection operation on the Yth row of data in the data display area based on the data of the Yth row. Exemplarily, assuming that the row selection target is to select the 7th row, the target system returns the data of the 7th row to the data query component based on the row selection target, and the data query component performs a row selection operation on the 7th row of data in the data display area based on the data of the 7th row.

[0094] The information indicating the row selection target may be a user clicking a row header or a user inputting a row number, for example, a user clicking the Yth row header with a mouse or a user inputting the Yth row number.

[0095] In a possible embodiment, the row selection target may be one row or multiple rows.

[0096] When the row selection target is a row, the data query component sends information containing the row selection target to the target system after receiving information indicating the row selection target input by the user. The target system returns the row selection data to the data query component based on the row selection target. The data query component performs a row selection operation on a data row corresponding to the row selection target in the data display area based on the returned row selection data.

[0097] When there are multiple rows of row selection targets, the data query component sends information containing the row selection targets to the target system after receiving information indicating the row selection targets input by the user. The target system returns the row selection data to the data query component based on the row selection targets. The data query component performs row selection operations on multiple data rows corresponding to the row selection targets in the data display area based on the returned row selection data.

[0098] In a possible embodiment, after receiving the information indicating the target in the row selected by the user, the data query component sends the information containing the target in the row selected to the target system, and the target system returns the data selected in the row to the data query component based on the target in the row selected, and the data query component performs a row selection operation on the data row corresponding to the target in the row selected based on the data selected in the row returned by the target system. Afterwards, after receiving the information indicating the target sorting rule for the target in the row selected by the user, the data query component sends the information containing the target sorting rule for the target in the row selected to the target system, and the target system sorts the data corresponding to the target in the row selected based on the target sorting rule, and returns the sorted data to the data query component.

[0099] S502: Based on the row selected data returned by the target system, a row selection operation is performed on the data row corresponding to the row selected target.

[0100] By selecting the above embodiment, after receiving the information indicating the target in the row selection, the data query component sends the information containing the target in the row selection to the target system. The target system returns the selected data in the row to the data query component. Based on the selected data in the row, the data query component performs a row selection operation on the data row corresponding to the selected target in the data display area, which helps the user to indicate the next operation on the selected data row.

[0101] In a possible embodiment, the above data query method also includes step A.

[0102] Step A, save the target query parameter to the target URL, so that when the data query component re-acquires the data corresponding to the target query parameter, it parses the target query parameter from the target URL and uses the parsed target query parameter as a new data query condition.

[0103] In step A, URL (Uniform Resource Locator) is also called web page address, which is the address of standard resources on the Internet. Every file on the Internet has a unique URL, which contains information that can indicate the location of the file and how the browser should handle it.

[0104] Saving the target query parameters to the target URL can prevent the target query parameters entered by the user from being restored to their initial state when the page of the data query component is refreshed or when the page of the data query component is re-entered.

[0105] If the target query parameters input by the user are restored to the initial state, that is, the target query parameters input by the user are cleared, the user needs to re-enter the target query parameters if he needs to perform data query.

[0106] By selecting the above embodiment, the target query parameters are saved in the URL, which can avoid the situation where the target query parameters entered by the user are restored to the initial state after the page of the data query component is refreshed or when the page of the data query component is re-entered, thereby reducing repeated operations and improving the convenience of user operations.

[0107] In one possible embodiment, see Figure 6 , which is a unit schematic diagram of a data query component provided in an embodiment of the present invention.

[0108] from Figure 6 It can be seen that the data query component consists of a data formatting unit, a data processing unit, a data persistence unit and a data export unit.

[0109] The data formatting unit is used to process the style and display of the table so that the data query component can present data according to different requirements, such as adjusting the column width. In addition, the data formatting unit can also be used to call the get ParamsBy SearchForm() function to obtain the target query parameters.

[0110] The data processing unit is used to call the loadData() function to request data from the backend.

[0111] The data persistence unit is used to call the setRecord() (create record) function to save the target query parameters to the URL. Saving the target query parameters to the URL can improve the user experience, allowing users to maintain the consistency of query results when refreshing the page of the data query component, saving bookmarks, or sharing links, reducing repeated operations and improving the convenience of user operations.

[0112] The data export unit is used to call handle Download Excel() to request the backend to export data to Excel. Exporting data to Excel allows users to easily export and save the queried data, which is suitable for scenarios that require offline data storage or processing, and improves the practicality of the data query component.

[0113] It should be noted that the data query component can be developed based on the Vue.js front-end framework or the React front-end framework. The embodiment of the present invention does not specifically limit the front-end framework of the data query component.

[0114] For example, if the data query component is developed based on the Vue.js front-end framework, the data query component can be represented by Table.vue, the data formatting unit can be represented by useTableFormat.ts, the data processing unit can be represented by useTableData.ts, the data persistence unit can be represented by useQueryTablePersist.ts, and the data export unit can be represented by useTableDownload.ts.

[0115] In addition, the data query component may also include an el-table (element Table) unit and an el-pagination (Element pagination) unit, wherein the el-table unit is used to instruct the target system to sort and select rows of data, and the el-pagination unit is used to instruct the target system to paginate data.

[0116] Before receiving the target query parameters representing the data query conditions input by the user, the data query component needs to be inserted into the DOM (Document Object Model) to implement component mounting, and initialize the component state according to the props passed in by the developer, and perform table configuration, query parameters and other related settings. In addition, if the data query component needs to load initial data, the initial data can be loaded through the nextTick method.

[0117] In addition, through the slot mechanism, more operation buttons or custom forms can be inserted into the data query component, which can provide developers with a high degree of flexibility, allowing developers to customize the form layout or add personalized functions without modifying the data query component itself, thereby enhancing the adaptability and extensibility of the data query component. For example, it is assumed that the page of the data query component is divided into two areas, the upper area is the first area, the lower area is the second area, and the third area is inserted between the first area and the second area.

[0118] In one possible embodiment, see Figure 7 , which is an interactive flow chart of the first data query method provided in an embodiment of the present invention, and the above method includes S701-S713.

[0119] S701, the user clicks a query button.

[0120] The user clicking the query button indicates that the user has selected the target query parameters on the page of the data query component, and a query form is generated. The query form is a table containing the target query parameters selected by the user.

[0121] S702: Call a first function to extract target query parameters.

[0122] Specifically, the data query unit calls the first function (ie, the get Params BySearchForm() function) through the data formatting unit to obtain the target query parameters from the query form containing the target query parameters.

[0123] S703, returning the extracted target query parameters.

[0124] Specifically, the data formatting unit returns the extracted target query parameters to the data query unit.

[0125] S704: Call the second function to save the extracted target query parameter to the uniform resource locator.

[0126] Specifically, the data query unit calls the second function (ie, the setRecord() function) through the data persistence unit to save the extracted target query parameters to the URL.

[0127] S705: Send a message indicating that the target query parameter saving is complete.

[0128] Specifically, the data persistence unit sends a message indicating that the target query parameter saving is completed to the data query unit.

[0129] S706, calling a third function to request data.

[0130] Specifically, the data query unit calls the third function (ie, the loadData() function) through the data processing unit, so that the data processing unit requests the backend for the queried data.

[0131] S707, sending a data query request.

[0132] Specifically, the data processing unit sends a data query request to the backend, requesting the backend to perform data query based on the target query parameters.

[0133] S708, return data.

[0134] Specifically, the backend returns the queried data to the data processing unit.

[0135] S709, sending an update data status message.

[0136] Specifically, the data processing unit sends an update data status message to the data query unit, and sends the data returned by the backend to the data query unit.

[0137] S710, display data.

[0138] Specifically, the data query unit displays the returned data to the user in the data display area of ​​the page of the data query component.

[0139] S711: Send a message indicating restoration of initial query parameters.

[0140] Specifically, the data query unit sends a message indicating restoration of the initial query parameters to the data persistence unit, so as to restore the target query parameters input by the user to the state when the user has not input the target query parameters.

[0141] S712, returning a message indicating that the restoration of the initial data query parameters is complete.

[0142] Specifically, the data persistence unit returns a message indicating that the restoration of the initial data query parameters is complete to the data query unit, indicating that the data persistence unit has restored the target query parameters input by the user to the state when the user has not input the target query parameters.

[0143] S713, sending a message indicating initial loading of data.

[0144] Specifically, the data query unit sends a message indicating initial loading of data to the data processing unit.

[0145] The initial loading of data is a step representing a loop, indicating the start of the next data query process.

[0146] In one possible embodiment, see Figure 8, which is an interactive flow chart of a second data query method provided in an embodiment of the present invention, the method includes S801-S810.

[0147] S801, rendering table data.

[0148] Specifically, the data query unit renders the table data and displays the data returned by the backend in the data display area of ​​the page of the data query component.

[0149] S802, the user clicks sort.

[0150] Specifically, after the user inputs information indicating the target sorting rule, the sorting unit sends the target sorting rule to the data query unit.

[0151] S803, update the sorting parameters.

[0152] Specifically, the data query unit updates the sorting parameters and records the sorting and other related information in the relevant variables of the data query component.

[0153] S804, sending persistent query conditions.

[0154] Specifically, the data query unit sends a persistent query condition to the data persistence unit. The persistent query condition is used to save the sorting parameter in the URL. The sorting parameter refers to a relevant parameter for the target system to sort the data.

[0155] S805, reload data.

[0156] Specifically, the data query unit reloads the data and displays the sorted data in the data display area of ​​the page of the data query component.

[0157] S806, rendering paging.

[0158] S807, the user clicks on the page.

[0159] S808, update paging parameters.

[0160] Specifically, the data query unit updates the paging parameters and records the related information such as the number of pages after paging in the related variables of the data query component.

[0161] S809, sending persistent query conditions.

[0162] Specifically, the data query unit sends a persistent query condition to the data persistence unit, where the persistent query condition is used to save a paging parameter in the URL, and the paging parameter refers to a relevant parameter for the target system to perform paging processing on the queried data.

[0163] S810, reload data.

[0164] Specifically, the data query unit reloads the data, and displays the paged data in different pages in the data display area of ​​the page of the data query component.

[0165] exist Figure 8 In the example, the sorting unit refers to the el-table unit, and the paging unit refers to the el-pagination unit.

[0166] In one possible embodiment, see Fig. 9 , which is an interactive flow chart of a second data query method provided in an embodiment of the present invention, the method includes S901-S905.

[0167] S901, the user clicks the data export button.

[0168] S902, calling the fourth function to export data.

[0169] Specifically, the data query unit calls the fourth function (ie, handle DownloadExcel() function) through the data export unit, so that the data export unit requests the backend to export data to Excel.

[0170] S903: Send a data export request.

[0171] Specifically, the data export unit sends a data export request to the backend, requesting the backend to query data.

[0172] S904, returning the exported data.

[0173] Specifically, after the backend finds the data, it returns the exported data to the data export unit.

[0174] S905, data download is completed.

[0175] Among them, Figure 7-Figure 9 In an embodiment, the data query unit in the data query component is used to receive target query parameters input by the user and information sent by other units in the data query component, and display the queried data to the user and send information to other units in the data query component to realize the data query function of the data query component. The back end is the back end corresponding to the target system.

[0176] Corresponding to the aforementioned data query method, the embodiment of the present invention further provides a data query device, which is applied to the data query component, see Fig.10 , is a structural diagram of a data query device provided by an embodiment of the present invention, the device comprising:

[0177] Parameter receiving module 1001, used to receive target query parameters representing data query conditions;

[0178] The data request module 1002 is used to determine a target system matching the type of parameter contained in the target query parameter based on the type of parameter contained in the target query parameter, send a data query request based on the target query parameter to the target system, and return the queried data; wherein the types of parameters contained in the query parameters required by different systems are different;

[0179] The data receiving module 1003 is used to receive data returned by the target system.

[0180] By selecting the above embodiment, after receiving the target query parameters representing the data query conditions, the data query component can send a data query request based on the target query parameters to the target system matching the type of parameters contained in the target query parameters, and return the queried data. After receiving the data returned by the target system, the data query component completes the data query process.

[0181] Furthermore, compared with the prior art in which multiple clients need multiple sets of codes to query data, the query parameters required by different systems in the embodiments of the present invention contain different types of parameters, and data queries are all processed by data query components. The number of codes required for multiple interfaces to query data is much smaller than the number of codes required for multiple clients to query data, reducing duplicate codes in different systems and improving system development efficiency.

[0182] In a possible embodiment, if the target system performs paging processing on the data corresponding to the target query parameter and sends the paging data obtained after the paging processing to the data query component, the data receiving module 1003 is specifically used to:

[0183] Receive the paging data returned by the target system.

[0184] By selecting the above embodiment, the target system performs paging processing on the data corresponding to the target query parameters, and sends the paging data obtained after the paging processing to the data query component. After receiving the paging data returned by the backend, the data query component displays the returned paging data in different pages in the data display area in the page of the data query component, which can avoid the data query component from receiving too much data at one time, thereby avoiding problems such as freezing of the page of the data query component.

[0185] In a possible embodiment, after the data receiving module 1003 receives the data returned by the target system, the method further includes:

[0186] A first sending module is used to send information including the target sorting rule to the target system after receiving the information indicating the target sorting rule, so that the target system sorts the queried data based on the target sorting rule and returns the sorted data to the data query component;

[0187] The first receiving module is used to receive the sorted data returned by the target system.

[0188] By selecting the above embodiment, the data query component sends information containing the target sorting rule to the target system. The target system sorts the queried data based on the target sorting rule and returns the sorted data to the data query component. The sorted data can be displayed to the user to improve the user experience.

[0189] In a possible embodiment, after the data receiving module 1003 receives the data returned by the target system, the method further includes:

[0190] A second sending module is used to send information including the row selected target to the target system after receiving the information indicating the row selected target, so that the target system returns the row selected data to the data query component based on the row selected target;

[0191] The second receiving module is used to perform a row selection operation on the data row corresponding to the row selection target based on the row selection data returned by the target system.

[0192] By selecting the above embodiment, after receiving the information indicating the target in the row selection, the data query component sends the information containing the target in the row selection to the target system. The target system returns the selected data in the row to the data query component. Based on the selected data in the row, the data query component performs a row selection operation on the data row corresponding to the selected target in the data display area, which helps the user to indicate the next operation on the selected data row.

[0193] In a possible embodiment, the above device further includes:

[0194] The parameter saving module is used to save the target query parameters to the target URL, so that when the data query component re-acquires the data corresponding to the target query parameters, it can parse the target query parameters from the target URL and use the parsed target query parameters as new data query conditions.

[0195] By selecting the above embodiment, the target query parameters are saved in the URL, which can avoid the situation where the target query parameters entered by the user are restored to the initial state after the page of the data query component is refreshed or when the page of the data query component is re-entered, thereby reducing repeated operations and improving the convenience of user operations.

[0196] The embodiment of the present invention further provides an electronic device, such as Fig.11 As shown, it includes a processor 1101, a communication interface 1102, a memory 1103 and a communication bus 1104, wherein the processor 1101, the communication interface 1102, and the memory 1103 communicate with each other through the communication bus 1104.

[0197] Memory 1103, used for storing computer programs;

[0198] The processor 1101 is used to implement any method step described in the above data query method when executing the program stored in the memory 1103.

[0199] By selecting the above embodiment, after receiving the target query parameters representing the data query conditions, the data query component can send a data query request based on the target query parameters to the target system matching the type of parameters contained in the target query parameters, and return the queried data. After receiving the data returned by the target system, the data query component completes the data query process.

[0200] Furthermore, compared with the prior art in which multiple clients need multiple sets of codes to query data, the query parameters required by different systems in the embodiments of the present invention contain different types of parameters, and data queries are all processed by data query components. The number of codes required for multiple interfaces to query data is much smaller than the number of codes required for multiple clients to query data, reducing duplicate codes in different systems and improving system development efficiency.

[0201] The communication bus mentioned in the above electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.

[0202] The communication interface is used for communication between the above terminal and other devices.

[0203] The memory may include a random access memory (RAM) or a non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.

[0204] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0205] In another embodiment of the present invention, a computer-readable storage medium is provided, wherein a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, the data query method described in any one of the above embodiments is implemented.

[0206] By selecting the above embodiment, after receiving the target query parameters representing the data query conditions, the data query component can send a data query request based on the target query parameters to the target system matching the type of parameters contained in the target query parameters, and return the queried data. After receiving the data returned by the target system, the data query component completes the data query process.

[0207] Furthermore, compared with the prior art in which multiple clients need multiple sets of codes to query data, the query parameters required by different systems in the embodiments of the present invention contain different types of parameters, and data queries are all processed by data query components. The number of codes required for multiple interfaces to query data is much smaller than the number of codes required for multiple clients to query data, reducing duplicate codes in different systems and improving system development efficiency.

[0208] In another embodiment provided by the present invention, a computer program product including instructions is also provided, which, when executed on a computer, enables the computer to execute the data query method described in any one of the above embodiments.

[0209] By selecting the above embodiment, after receiving the target query parameters representing the data query conditions, the data query component can send a data query request based on the target query parameters to the target system matching the type of parameters contained in the target query parameters, and return the queried data. After receiving the data returned by the target system, the data query component completes the data query process.

[0210] Furthermore, compared with the prior art in which multiple clients need multiple sets of codes to query data, the query parameters required by different systems in the embodiments of the present invention contain different types of parameters, and data queries are all processed by data query components. The number of codes required for multiple interfaces to query data is much smaller than the number of codes required for multiple clients to query data, reducing duplicate codes in different systems and improving system development efficiency.

[0211] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented by software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk Solid State Disk (SSD)), etc.

[0212] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0213] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device, electronic device, and storage medium embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments.

[0214] The above description is only a preferred embodiment of the present invention and is not intended to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.

Claims

1. A data query method, characterized in that: Applied to a data query component, the method comprises: receiving a target query parameter representing a data query condition; Based on the type of the parameter included in the target query parameter, determine a target system that matches the type, send a data query request based on the target query parameter to the target system, and return the queried data; wherein the types of the parameters included in the query parameters required by different systems are different; Receive data returned by the target system.

2. The method according to claim 1, characterized in that If the target system performs paging processing on the data corresponding to the target query parameter and sends the paging data obtained after the paging processing to the data query component, the receiving of the data returned by the target system includes: Receive the paging data returned by the target system.

3. The method according to claim 1, characterized in that After receiving the data returned by the target system, the method further includes: After receiving the information indicating the target sorting rule, sending the information including the target sorting rule to the target system, so that the target system sorts the queried data based on the target sorting rule and returns the sorted data to the data query component; Receive the sorted data returned by the target system.

4. The method according to claim 1, characterized in that: After receiving the data returned by the target system, the method further includes: After receiving the information indicating the target in the row selection, sending the information including the target in the row selection to the target system, so that the target system returns the data in the row selection to the data query component based on the target in the row selection; Based on the row-selected data returned by the target system, a row-selection operation is performed on the data row corresponding to the row-selected target.

5. The method according to any one of claims 1 to 4, characterized in that The method further comprises: The target query parameter is saved in a target uniform resource locator URL, so that when the data query component reacquires data corresponding to the target query parameter, it parses the target query parameter from the target URL and uses the parsed target query parameter as a new data query condition.

6. A data query device, characterized in that: Applied to a data query component, the device comprises: A parameter receiving module, used for receiving a target query parameter representing a data query condition; A data request module, used to determine a target system matching the type of parameter contained in the target query parameter based on the type of parameter contained in the target query parameter, send a data query request based on the target query parameter to the target system, and return the queried data; wherein the types of parameters contained in the query parameters required by different systems are different; The data receiving module is used to receive the data returned by the target system.

7. The device according to claim 6, characterized in that If the target system performs paging processing on the data corresponding to the target query parameter and sends the paging data obtained after the paging processing to the data query component, the data receiving module is specifically used to: Receive the paging data returned by the target system.

8. The device according to claim 6, characterized in that After the data receiving module receives the data returned by the target system, the method further includes: A first sending module is used to send information including the target sorting rule to the target system after receiving the information indicating the target sorting rule, so that the target system sorts the queried data based on the target sorting rule and returns the sorted data to the data query component; The first receiving module is used to receive the sorted data returned by the target system.

9. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, for implementing the method steps described in any one of claims 1 to 5 when executing a program stored in a memory.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method steps described in any one of claims 1 to 5 are implemented.