Paging sorting method and device for form data in page, equipment and medium

By receiving and converting non-string type data into key-value pair types and building database query requests, the Mybatis paging plug-in cannot handle sorting of multiple data types is solved, and the paging sorting of form data of multiple data types is realized, which improves the improvement of the paging of multiple data types. System data processing flexibility and efficiency.

CN119271674APending Publication Date: 2025-01-07CHINA CONSTRUCTION BANK +1
View PDF 0 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

The sorting method of Mybatis's own paging plugin PageHelper cannot flexibly handle multiple data types, especially inconvenient to sort data of non-string types (such as JSON, Map).

Method used

By receiving the front-end paging sorting request, converting non-string type data into key-value pair types, determining paging information, and building a database query request for paging sorting, supporting sorting of multiple data types.

Benefits of technology

It realizes flexible paging and sorting of form data of multiple data types, improves the system's data processing flexibility and efficiency, and meets the sorting requirements for data formats such as JSON and Map.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119271674A_ABST
    Figure CN119271674A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of data processing, in particular to a paging sorting method and device for form data in a page, equipment and a medium, and is used for performing paging sorting on form data of various data types. The method comprises the steps that a paging sorting request used for triggering by a front end is received, the paging sorting request comprises form data and a sorting instruction, and the sorting instruction is used for indicating a to-be-sorted field and a sorting mode; if the form data has data of a non-character string type, converting the data of the non-character string type into data of a key-value pair type so as to adapt to paging sorting of various data, and determining paging information based on the paging sorting request; and constructing a database query request on the basis of the paging information, the form data and the sorting instruction, and sorting the form data according to the data type corresponding to the form data through the database query request, so that paging sorting can be performed on the form data of multiple data types.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and in particular to a method, device, equipment and medium for paging sorting of form data in a page. Background Art

[0002] When users visit system pages, due to the large amount of data in some forms in the system or business needs, users hope to reorganize the page information through sorting to facilitate business operations, statistics or comparisons. Therefore, a sorting function needs to be developed for it in the background processing.

[0003] During the actual system development process, it was found that the sorting method orderBy of the commonly used Mybatis built-in paging plug-in PageHelper cannot flexibly handle multiple data types. In short, there are scenarios that are inconsistent with the native method for processing object types. The sorting method of the Mybatis built-in paging plug-in PageHelper, that is, the orderBy function, only sorts the defined Page class objects for the parameter of type String, that is, the sorting field name, and cannot directly handle data formats such as JSON and Map. The method is not very flexible.

[0004] Therefore, there is an urgent need for a paging sorting method for form data in a page, which can perform paging sorting for form data of various data types. Summary of the invention

[0005] The present application provides a method, apparatus, device and medium for paging sorting of form data in a page, which are used for paging sorting of form data of various data types.

[0006] In a first aspect, the present application provides a method for paging sorting of form data in a page, the method comprising:

[0007] Receive a paging sorting request triggered by a user from the front end; the paging sorting request includes form data and a sorting instruction; the sorting instruction is used to indicate the fields to be sorted and the sorting method;

[0008] If the form data contains data of a non-string type, converting the data of the non-string type into data of a key-value pair type, and determining paging information based on the paging sorting request;

[0009] Constructing a database query request based on the paging information, the form data and the sorting instruction;

[0010] Through the database query request, the form data is paged and sorted according to the data type corresponding to the form data, and the paged sorting result of the form data is fed back.

[0011] In a possible implementation, if the form data contains data of a non-string type, converting the data of the non-string type into data of a key-value pair type includes:

[0012] By inheriting the resolveArgument method of the parent class, the non-string type data in the form data is converted into key-value pair type data.

[0013] In a possible implementation manner, before constructing the database query request, the method further includes:

[0014] The parameter information of the paging sorting request is extracted and stored in a key-value pair type.

[0015] In a possible implementation, determining the paging information based on the paging sorting request includes:

[0016] According to the parameter information of the paging sorting request, the paging information corresponding to the key-value pair type data and / or the string type data in the form data is determined; the paging information includes the number of pages, page capacity, total records and total number of pages.

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

[0018] If all the form data are string type data, the form data are paged and sorted through a database query statement.

[0019] In a possible implementation, the paging and sorting the form data according to the data type corresponding to the form data through the database query request includes:

[0020] Determine whether the sorting method of the field to be sorted in the database query request is empty;

[0021] If the sorting method of the field to be sorted is empty, the form data is sorted by page using a default sorting method according to the data type corresponding to the form data; and / or

[0022] Determine whether the field to be sorted in the database query request is empty;

[0023] If the field to be sorted is empty, the form data is sorted by page using the default sorting field according to the data type corresponding to the form data.

[0024] In a second aspect, the present application provides a paging sorting device for form data in a page, the device comprising:

[0025] A receiving module, used to receive a paging sorting request triggered by a user from the front end; the paging sorting request includes form data and a sorting instruction; the sorting instruction is used to indicate the fields to be sorted and the sorting method;

[0026] A sorting module is used to convert the non-string type data into key-value pair type data if the form data contains non-string type data, and determine paging information based on the paging sorting request; construct a database query request based on the paging information, the form data and the sorting instruction; through the database query request, paging and sorting the form data according to the data type corresponding to the form data, and feed back the paging sorting result of the form data.

[0027] In a possible implementation, the sorting module is specifically configured to convert non-string type data in the form data into key-value pair type data by inheriting the resolveArgument method of the parent class.

[0028] In a possible implementation, the sorting module is further configured to extract parameter information of the paging sorting request and store it in a key-value pair type.

[0029] In a possible implementation, the sorting module is specifically used to determine the paging information corresponding to the key-value pair type data and / or string type data in the form data according to the parameter information of the paging sorting request; the paging information includes the number of pages, page capacity, total records and total number of pages.

[0030] In a possible implementation manner, the sorting module is further configured to sort the form data by pages using a database query statement if all the form data are string type data.

[0031] In a possible implementation, the sorting module is specifically used to determine whether the sorting method of the field to be sorted in the database query request is empty; if the sorting method of the field to be sorted is empty, the form data is paged and sorted in a default sorting method according to the data type corresponding to the form data; and / or determine whether the field to be sorted in the database query request is empty; if the field to be sorted is empty, the form data is paged and sorted in a default sorting field according to the data type corresponding to the form data.

[0032] In a third aspect, the present application provides an electronic device, which includes at least a processor and a memory, and the processor is used to implement the steps of any method described in the first aspect when executing a computer program stored in the memory.

[0033] In a fourth aspect, the present application provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of any method described in the first aspect.

[0034] In a fifth aspect, the present application provides a computer program product, comprising: a computer program code, when the computer program code is run on a computer, the computer executes the steps of any method described in the first aspect.

[0035] In an embodiment of the present application, a front-end is received based on a paging sorting request for triggering, the paging sorting request includes form data and a sorting instruction, the sorting instruction is used to indicate the field to be sorted and the sorting method; if the form data contains non-string type data, the non-string type data is converted into key-value pair type data to accommodate the paging sorting of a variety of data, and based on the paging sorting request, the paging information is determined; based on the paging information, the form data and the sorting instruction, a database query request is constructed, and through the database query request, the form data is sorted according to the data type corresponding to the form data, so that paging sorting can be performed on form data of a variety of data types. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] In order to more clearly illustrate the implementation methods in the embodiments of the present application or the related technologies, the following is a brief introduction to the drawings required for use in the embodiments or the related technology descriptions. Obviously, the drawings described below are some embodiments of the present application, and a person skilled in the art can also obtain other drawings based on these drawings.

[0037] Figure 1 A schematic diagram of a paging sorting process for form data in a page provided for some embodiments of the present application;

[0038] Figure 2 A schematic diagram of interaction between a front end and a back end provided for some embodiments of the present application;

[0039] Figure 3 A schematic diagram of the structure of a paging sorting device for form data in a page provided for some embodiments of the present application;

[0040] Figure 4 A schematic diagram of the structure of an electronic device provided for some embodiments of the present application. DETAILED DESCRIPTION

[0041] In order to make the purpose, technical solutions and advantages of this application clearer, this application will be further described in detail below in conjunction with the accompanying drawings. Obviously, the embodiments described in this application are only part of the embodiments of this application, rather than all the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.

[0042] It should be noted that the brief description of terms in this application is only for the convenience of understanding the embodiments described below, and is not intended to limit the embodiments of this application. Unless otherwise specified, these terms should be understood according to their common and usual meanings.

[0043] The terms "first", "second", "third", etc. in the specification and claims of this application and the above drawings are used to distinguish similar or similar objects or entities, and do not necessarily mean to limit a specific order or sequence, unless otherwise noted. It should be understood that the terms used in this way can be interchangeable under appropriate circumstances.

[0044] The terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover but not exclude inclusion, for example, a product or device comprising a list of components is not necessarily limited to all the components expressly listed but may include other components not expressly listed or inherent to such product or device.

[0045] The term "module" refers to any known or later developed hardware, software, firmware, artificial intelligence, fuzzy logic or combination of hardware and / or software code that is capable of performing the functions associated with that element.

[0046] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.

[0047] The following is a description of exemplary embodiments of the present application in conjunction with the accompanying drawings, including various details of the embodiments of the present application to facilitate understanding, which should be considered as merely exemplary. Therefore, those of ordinary skill in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope of the present application. Similarly, for the sake of clarity and conciseness, the description of well-known functions and structures is omitted in the following description. It should be noted that in the embodiments of the present application, certain software, components, models and other existing solutions in the industry may be mentioned, which should be considered as exemplary, and their purpose is only to illustrate the feasibility of the implementation of the technical solution of the present application, but it does not mean that the applicant has or will necessarily use the solution.

[0048] In the technical solution of this application, the acquisition, transmission, storage, and use of data are in compliance with the requirements of relevant national laws and regulations.

[0049] Before introducing the paging sorting method for form data in a page provided by an embodiment of the present application, in order to facilitate understanding, the technical background of the embodiment of the present application is first introduced.

[0050] When users visit system pages, due to the large amount of data in some forms in the system or business needs, users hope to reorganize the page information through sorting to facilitate business operations, statistics or comparisons. Therefore, a sorting function needs to be developed for it in the background processing.

[0051] During the actual system development process, it was found that the sorting method orderBy of the commonly used Mybatis built-in paging plug-in PageHelper cannot flexibly handle multiple data types. In short, there are scenarios that are inconsistent with the native method for processing object types. The sorting method of the Mybatis built-in paging plug-in PageHelper, that is, the orderBy function, only sorts the defined Page class objects for the parameter of type String, that is, the sorting field name, and cannot directly handle data formats such as JSON and Map. The method is not very flexible.

[0052] Based on this, the present application provides a paging sorting method, device, equipment, medium and computer program product for form data in a page. In this method, a paging sorting request based on user triggering is received from the front end; the paging sorting request contains form data and sorting instructions; the sorting instructions are used to indicate the fields to be sorted and the sorting method; if the form data contains non-string type data, the non-string type data is converted into key-value pair type data, and paging information is determined based on the paging sorting request; a database query request is constructed based on the paging information, the form data and the sorting instructions; through the database query request, the form data is paging sorted according to the data type corresponding to the form data, and the paging sorting result of the form data is fed back.

[0053] Embodiment 1:

[0054] Figure 1 A schematic diagram of a paging sorting process for form data in a page is provided for some embodiments of the present application. Figure 1 As shown, the process includes the following steps:

[0055] S101: receiving a page sorting request triggered by a user from the front end; the page sorting request includes form data and a sorting instruction; the sorting instruction is used to indicate the fields to be sorted and the sorting method.

[0056] The method in the embodiment of the present application is applied to a backend device, wherein the backend device may be a smart phone, a server, a PC or other device.

[0057] When users access system pages, due to the large amount of data in some forms in the system or business needs, users want to reorganize page information through sorting to facilitate business operations, statistics or comparisons. Therefore, it is necessary to develop a sorting function for it in the back-end device processing. During the actual system development process, it was found that the sorting method orderBy of the commonly used Mybatis built-in paging plug-in PageHelper cannot flexibly handle multiple data types.

[0058] Figure 2 A schematic diagram of the interaction between the front end and the back end is provided for some embodiments of the present application. In the embodiment of the present application, the user can click the sort button in the header of the front end page to select the field to be sorted and the sorting method. The front end receives the user information and triggers the paging sorting request to be sent to the back end via the Hypertext Transfer Protocol (HTTP).

[0059] The backend receives a paging sorting request triggered by a user from the frontend, and the paging sorting request includes form data and a sorting instruction, and the sorting instruction is used to indicate the field to be sorted and the sorting method. For example, the field to be sorted can be any column field in the form data. The sorting method includes but is not limited to positive order and reverse order, for example, in ascending or descending order of data.

[0060] Specifically, the front-end and back-end interaction processing can be realized by combining multiple modules in a unified Spring framework. The front-end data and context are obtained in the Spring Web module in the framework and passed to the back-end controller for processing. A data type converter is added before the controller processing to adapt to the common data processing scenarios of this system.

[0061] S102: If the form data contains data of a non-string type, convert the data of the non-string type into data of a key-value pair type, and determine paging information based on the paging sorting request.

[0062] Since the data type required by the system is key-value pair data, if the form data contains non-string data, such as JSON data, the non-string data is converted into system key-value pair data, that is, Map data, through a data type converter to adapt to the system's common data processing scenarios. And when processing large amounts of data, in order to improve performance and user experience, paging technology is used to determine paging information based on paging sorting requests. For example, paging information includes the number of pages, the page capacity of data displayed per page, etc. Paging information allows you to specify which page the field to be sorted should start from, and how many data items to display per page, so as to avoid loading too much data at one time and improve the efficiency of paging sorting.

[0063] Specifically, in the data converter part, it is necessary to optimize data reception and conversion in the Spring Framework, using the HandlerMethodArgumentResolver interface provided in the Spring Web module, that is, the interface for parsing method parameters, to implement the method class SimpleSearchRequestResolver of the data type converter required by the system. The role of this method class in the Spring Framework is to receive user information, process data, and transfer it to the controller for processing.

[0064] S103: Constructing a database query request based on the paging information, the form data and the sorting instruction.

[0065] A database query request may be constructed according to the paging information, and the form data and sorting instructions contained in the paging information, wherein the sorting instructions are used to indicate the fields to be sorted and the sorting method.

[0066] Specifically, the constructed database query request can use the data query parameter type SimpleSearchRequest to simplify the development of the data query interface. The database query request may include but is not limited to: JPA (Java Persistence API) query request, paging information, request map, and original request data.

[0067] By defining the data query parameter type SimpleSearchRequest, which specifically includes four contents: JPA query request, paging information, request Map, and original request data, the data processor can more conveniently process multiple data formats. When used in conjunction with the SimpleSearchRequestResolver in the WEB package, the query interface development can be simplified.

[0068] In a possible implementation, through JPA query request, an object-oriented approach can be used to operate the database, providing an object-relational mapping (ORM) solution for Java applications. In SimpleSearchRequest, JPA query can be an object that encapsulates JPA query logic, and query conditions can be defined according to actual needs, such as the fields to be sorted, sorting rules, etc. that need to be sorted by paging. The original request data can be the data in the paging sorting request sent by the front end, such as query parameters and form data in HTTP requests. Retaining the original request data can be further processed or verified when necessary, and is also convenient for debugging and logging. When processing large amounts of data, paging technology is usually used to improve performance and user experience. Paging information includes the current page number, the number of data items displayed per page, etc. In SimpleSearchRequest, paging information allows the specification of which page the query results should start from and how many data items are displayed per page, so as to avoid loading too much data at one time and improve paging sorting efficiency.

[0069] SimpleSearchRequestResolver is a tool used with SimpleSearchRequest to parse the request sent by the client and convert it into a SimpleSearchRequest object. SimpleSearchRequestResolver automatically handles the parsing and conversion of paging and sorting requests, which can simplify the development of query interfaces.

[0070] The combination of SimpleSearchRequest and SimpleSearchRequestResolver provides a convenient way to handle query requests in multiple data formats, reducing the complexity of the query interface. It helps to improve the efficiency of paging sorting, reduce maintenance costs, and improve the readability and maintainability of paging sorting solution code.

[0071] S104: sorting the form data by page according to the data type corresponding to the form data through the database query request, and feeding back the paging sorting result of the form data.

[0072] Through the database query request, the form data can be paged and sorted according to the data type corresponding to the form data, and the paged and sorted results of the form data can be fed back.

[0073] In order to perform paging and sorting for form data of various data types, the orderBy method that can process the Map format is added to the core module of the Spring framework, enriching the orderBy method that comes with the Mybatis framework, making paging and sorting more convenient.

[0074] Specifically, a processing method class MybatisHelper for StandardPageInfo objects can be added to the controller. Among them, the paging method in this method class is implemented by calling the startPage function in the paging plug-in PageHelper, which is equivalent to intercepting the Structured Query Language (SQL) query statement and adding limits for paging. Two new orderBy methods have been added. In the back-end controller, the orderBy method of MybatisHelper can be directly called to conveniently handle the paging and sorting of database search data, and the paging and sorting results of the retrieved form data type are encapsulated into the Response required by the front-end and returned to the front-end.

[0075] In the specific paging and sorting process, the various data formats of the passed parameters can be flexibly processed and converted uniformly to meet the data format requirements of JPA and Mybatis. After conversion, the data is directly paging and sorted through optimized methods, making the overall processing process of the paging and sorting framework more flexible. In addition, the data format converter also simplifies the development of subsequent query interfaces.

[0076] In an embodiment of the present application, a front-end is received based on a paging sorting request for triggering, the paging sorting request includes form data and a sorting instruction, the sorting instruction is used to indicate the field to be sorted and the sorting method; if the form data contains non-string type data, the non-string type data is converted into key-value pair type data to adapt to the paging sorting of various data, and based on the paging sorting request, the paging information is determined; based on the paging information, the form data and the sorting instruction, a database query request is constructed, and through the database query request, the form data is sorted according to the data type corresponding to the form data, so that paging sorting can be performed on form data of various data types, and the page information is reorganized through sorting to facilitate business operations, statistics or comparisons.

[0077] Embodiment 2:

[0078] In order to further improve the accuracy and efficiency of paging sorting for form data in a page, based on the above embodiment, in an embodiment of the present application, if the form data contains non-string type data, the non-string type data is converted into key-value pair type data, including:

[0079] By inheriting the resolveArgument method of the parent class, the non-string type data in the form data is converted into key-value pair type data.

[0080] In order to convert non-string data in the form data into key-value pair data, in the embodiment of the present application, the inherited method can be used, and the resolveArgument method is to parse a certain input, such as an input stream, and convert it into an object. Inherit the parent class resolveArgument method to convert non-string data in the form data into key-value pair data, such as converting JSON type data into Map type or HashMap type data, where the HashMap type is a special Map type.

[0081] Specifically, by inheriting the resolveArgument method of the parent class, the non-string type data in the single data is converted to the HashMap type, so that the subsequent database query controller can perform paging and sorting processing, which can achieve the effect of simplifying the query interface development. In the part of the data converter, the optimization of data reception and conversion can be realized in the Spring Framework. The HandlerMethodArgumentResolver interface provided in the Spring Web module, that is, the interface for parsing and processing method parameters, is used to implement the method class SimpleSearchRequestResolver of the data type converter required by the system. The role of implementing this method class in the Spring framework is to receive user information, process data, and transfer it to the controller for processing.

[0082] In an embodiment of the present application, by inheriting the parent class resolveArgument method, non-string type data in the form data is converted into key-value pair type data, which simplifies the query interface development and further improves the accuracy and efficiency of paging sorting for form data in the page.

[0083] Embodiment 3:

[0084] In order to further improve the accuracy and efficiency of paging sorting for form data in a page, based on the above embodiments, in the embodiment of the present application, before constructing the database query request, it also includes:

[0085] The parameter information of the paging sorting request is extracted and stored in a key-value pair type.

[0086] Before building a database query request, parameter information of the paging sort request can be extracted and stored in a key-value pair type, that is, in a Map type.

[0087] Specifically, the paging sorting request can be an HttpServletRequest class, which represents the HTTP request sent by the front end to the back end. Although the HttpServletRequest itself does not directly contain paging information, it can be used to obtain paging-related parameter information, such as the current page number and page capacity. The parameter information can be obtained by parsing the HttpServletRequest, and the paging information StandardPageInfo object can be constructed accordingly.

[0088] By storing parameter information in the Map type, the parameter information can be flexibly called and processed without hard coding in the query interface.

[0089] In an embodiment of the present application, before constructing a database query request, parameter information of the paging sorting request can be extracted and stored in a key-value pair type to facilitate flexible calling of the parameter information without the need for hard coding in the query interface, thereby further improving the accuracy and efficiency of paging sorting for form data in the page.

[0090] Embodiment 4:

[0091] In order to further improve the accuracy and efficiency of paging sorting for form data in a page, based on the above embodiments, in an embodiment of the present application, the paging information is determined based on the paging sorting request, including:

[0092] According to the parameter information of the paging sorting request, the paging information corresponding to the key-value pair type data and / or the string type data in the form data is determined; the paging information includes the number of pages, page capacity, total records and total number of pages.

[0093] According to the parameter information of the paging sorting request, the paging information corresponding to the key-value pair type data and / or string type data in the form data can be determined, wherein the paging information includes the number of pages, page capacity, total records and total number of pages.

[0094] Specifically, the Map type and HttpServletRequest type are converted into unified standard paging information, which can be a description interface StandardPageInfo object, which actually serializes the JAVA object. The StandardPageInfo object is usually a data structure used to represent paging information, encapsulating multiple key attributes related to paging. The StandardPageInfo object contains: number of pages, page capacity, total records, total number of pages, corresponding to the content covered by the paging sorting request, and serialization of page objects is achieved by inheriting the Serialiazable interface, simplifying the complexity of system processing.

[0095] The following are the meanings of the various properties in the StandardPageInfo object: Page number refers to the page number currently being viewed. Users can browse different pages to view different parts of the form data. Page capacity refers to the number or size of data that can be displayed per page. For example, if the page capacity is 10, then 10 data items will be displayed per page. Total records: Indicates the total number of records in the form data. Regardless of how the form data is paginated, this number remains unchanged, and it reflects the size of the entire form data. The total number of pages refers to the total number of pages that the data can be divided into based on the current page capacity. The calculation method can be the total number of records divided by the page capacity. If there is a remainder, the total number of pages needs to be rounded up.

[0096] In an embodiment of the present application, the paging information corresponding to the key-value pair type data and / or string type data in the form data is determined according to the parameter information of the paging sorting request; the paging information includes the number of pages, page capacity, total records and total number of pages, so that the form data in the page can be paginated and sorted more accurately.

[0097] Embodiment 5:

[0098] In order to further improve the accuracy and efficiency of paging sorting for form data in a page, based on the above embodiments, in an embodiment of the present application, the method further includes:

[0099] If all the form data are string type data, the form data are paged and sorted through a database query statement.

[0100] If all the data in the form are string data, there is no need to convert the data, and the form data can be directly paged and sorted through database query statements.

[0101] In an embodiment of the present application, there is no need to perform data conversion on string type data, and data of different data types in the form data are processed separately, further improving the accuracy and efficiency of paging sorting for the form data in the page.

[0102] Embodiment 6:

[0103] In order to further improve the accuracy and efficiency of paging and sorting the form data in the page, based on the above embodiments, in the embodiment of the present application, the paging and sorting of the form data according to the data type corresponding to the form data through the database query request includes:

[0104] Determine whether the sorting method of the field to be sorted in the database query request is empty;

[0105] If the sorting method of the field to be sorted is empty, the form data is sorted by page using a default sorting method according to the data type corresponding to the form data; and / or

[0106] Determine whether the field to be sorted in the database query request is empty;

[0107] If the field to be sorted is empty, the form data is sorted by page using the default sorting field according to the data type corresponding to the form data.

[0108] In order to further improve the accuracy and efficiency of paging sorting for form data in a page, a default sorting method for the data type of the form data and / or the field to be sorted of the form data can be pre-set. When paging sorting is performed on the form data according to the data type corresponding to the form data through a database query request, it can be determined first whether the default field required for paging sorting is empty, wherein the default field required for paging sorting includes the field to be sorted and the sorting method of the field to be sorted.

[0109] Specifically, it is determined whether the sorting method of the field to be sorted in the database query request is empty. If the sorting method of the field to be sorted is empty, the form data is sorted by page in a default sorting method according to the data type corresponding to the form data, wherein the default sorting method may be in ascending order or descending order, such as an order of increasing data or decreasing data. And / or, it is determined whether the field to be sorted is empty. If the field to be sorted is empty, the form data is sorted by page in a default sorting field according to the data type corresponding to the form data. For example, the default sorting field is the first column field of the form data.

[0110] In an embodiment of the present application, the sorting method of the field to be sorted in the database query request is determined whether the field to be sorted is empty. If so, the form is sorted in a default sorting method according to the data type corresponding to the form data; and / or it is determined whether the field to be sorted is empty. If so, the form data is paginated and sorted with the default sorting field according to the data type corresponding to the form data, thereby further improving the accuracy and efficiency of pagination sorting for the form data in the page.

[0111] Embodiment 7:

[0112] Based on the same technical concept, on the basis of the above embodiments, in the embodiment of the present application, a paging sorting device for form data in a page is provided. Figure 3 A schematic diagram of a structure of a paging sorting device for form data in a page provided in some embodiments of the present application. Figure 3 As shown, the device comprises:

[0113] The receiving module 301 is used to receive a paging sorting request triggered by a user from the front end; the paging sorting request includes form data and a sorting instruction; the sorting instruction is used to indicate the fields to be sorted and the sorting method;

[0114] The sorting module 302 is used to convert the non-string type data into key-value pair type data if the form data contains non-string type data, and determine the paging information based on the paging sorting request; construct a database query request based on the paging information, the form data and the sorting instruction; through the database query request, paging and sorting the form data according to the data type corresponding to the form data, and feedback the paging sorting result of the form data.

[0115] In a possible implementation, the sorting module 302 is specifically configured to convert non-string type data in the form data into key-value pair type data by inheriting the resolveArgument method of the parent class.

[0116] In a possible implementation, the sorting module 302 is further configured to extract parameter information of the paging sorting request and store it in a key-value pair type.

[0117] In a possible implementation, the sorting module 302 is specifically used to determine the paging information corresponding to the key-value pair type data and / or string type data in the form data according to the parameter information of the paging sorting request; the paging information includes the number of pages, page capacity, total records and total number of pages.

[0118] In a possible implementation, the sorting module 302 is further configured to sort the form data by pages using a database query statement if all the form data are string type data.

[0119] In a possible implementation, the sorting module 302 is specifically used to determine whether the sorting method of the field to be sorted in the database query request is empty; if the sorting method of the field to be sorted is empty, the form data is paged and sorted in a default sorting method according to the data type corresponding to the form data; and / or determine whether the field to be sorted in the database query request is empty; if the field to be sorted is empty, the form data is paged and sorted in a default sorting field according to the data type corresponding to the form data.

[0120] In an embodiment of the present application, a front-end is received based on a paging sorting request for triggering, the paging sorting request includes form data and a sorting instruction, the sorting instruction is used to indicate the field to be sorted and the sorting method; if the form data contains non-string type data, the non-string type data is converted into key-value pair type data to accommodate the paging sorting of a variety of data, and based on the paging sorting request, the paging information is determined; based on the paging information, the form data and the sorting instruction, a database query request is constructed, and through the database query request, the form data is sorted according to the data type corresponding to the form data, so that paging sorting can be performed on form data of a variety of data types.

[0121] Embodiment 8:

[0122] Based on the same inventive concept and on the basis of the above embodiments, in an embodiment of the present application, an electronic device is provided, which can realize the functions of the information disclosure device described above. Figure 4 A schematic diagram of the structure of an electronic device provided in some embodiments of the present application. Figure 4 As shown, the electronic device includes: a processor 401, a communication interface 402, a memory 403 and a communication bus 404, wherein the processor 401, the communication interface 402, and the memory 403 communicate with each other through the communication bus 404;

[0123] The memory 403 stores a computer program. When the program is executed by the processor 601, the processor 401 executes the steps of the paging sorting method for form data in a page as described in any of the above embodiments.

[0124] 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.

[0125] The communication interface 402 is used for communication between the electronic device and other devices.

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

[0127] The above-mentioned processor can be a general-purpose processor, including a central processing unit, a network processor (Network Processor, NP), etc.; it can also be a digital signal processing processor (Digital Signal Processing, DSP), an application-specific integrated circuit, a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component, etc.

[0128] In an embodiment of the present application, a front-end is received based on a paging sorting request for triggering, the paging sorting request includes form data and a sorting instruction, the sorting instruction is used to indicate the field to be sorted and the sorting method; if the form data contains non-string type data, the non-string type data is converted into key-value pair type data to accommodate the paging sorting of a variety of data, and based on the paging sorting request, the paging information is determined; based on the paging information, the form data and the sorting instruction, a database query request is constructed, and through the database query request, the form data is sorted according to the data type corresponding to the form data, so that paging sorting can be performed on form data of a variety of data types.

[0129] Embodiment 9:

[0130] Based on the same inventive concept, on the basis of the above embodiments, in an embodiment of the present application, a computer-readable storage medium is provided, in which a computer program executable by a processor is stored. When the program runs on the processor, the processor implements the steps included in the paging sorting method for form data in a page as described in any of the above embodiments.

[0131] The above-mentioned computer-readable storage medium can be any available medium or data storage device that can be accessed by the processor in the electronic device, including but not limited to magnetic storage such as floppy disks, hard disks, magnetic tapes, magneto-optical disks (MO), etc., optical storage such as CD, DVD, BD, HVD, etc., and semiconductor storage such as ROM, EPROM, EEPROM, non-volatile memory (NANDFLASH), solid-state drive (SSD), etc.

[0132] Based on the same inventive concept, the embodiment of the present application also provides a computer program product, which includes: computer program code, when the computer program code is executed on a computer, the computer executes the steps of any of the paging sorting methods for form data in a page as discussed above. Since the principle of solving the problem by the above computer program product is similar to the paging sorting method for form data in a page, the implementation of the above computer program product can refer to the implementation of the method, and the repeated parts will not be repeated.

[0133] In an embodiment of the present application, a front-end is received based on a paging sorting request for triggering, the paging sorting request includes form data and a sorting instruction, the sorting instruction is used to indicate the field to be sorted and the sorting method; if the form data contains non-string type data, the non-string type data is converted into key-value pair type data to accommodate the paging sorting of a variety of data, and based on the paging sorting request, the paging information is determined; based on the paging information, the form data and the sorting instruction, a database query request is constructed, and through the database query request, the form data is sorted according to the data type corresponding to the form data, so that paging sorting can be performed on form data of a variety of data types.

[0134] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0135] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0136] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0137] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0138] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

Claims

1. A paging sorting method for form data in a page, characterized in that: The method comprises: Receive a paging sorting request triggered by a user from the front end; the paging sorting request includes form data and a sorting instruction; the sorting instruction is used to indicate the fields to be sorted and the sorting method; If the form data contains data of a non-string type, converting the data of the non-string type into data of a key-value pair type, and determining paging information based on the paging sorting request; Constructing a database query request based on the paging information, the form data and the sorting instruction; Through the database query request, the form data is paged and sorted according to the data type corresponding to the form data, and the paged sorting result of the form data is fed back.

2. The method according to claim 1, characterized in that If the form data contains data of a non-string type, converting the data of the non-string type into data of a key-value pair type includes: By inheriting the resolveArgument method of the parent class, the non-string type data in the form data is converted into key-value pair type data.

3. The method according to claim 1, characterized in that Before constructing the database query request, the method further includes: The parameter information of the paging sorting request is extracted and stored in a key-value pair type.

4. The method according to claim 3, characterized in that The determining of paging information based on the paging sorting request includes: According to the parameter information of the paging sorting request, the paging information corresponding to the key-value pair type data and / or the string type data in the form data is determined; the paging information includes the number of pages, page capacity, total records and total number of pages.

5. The method according to any one of claims 1 to 4, characterized in that: The method further comprises: If all the form data are string type data, the form data are paged and sorted through a database query statement.

6. The method according to any one of claims 1 to 4, characterized in that: The step of paging and sorting the form data according to the data type corresponding to the form data through the database query request includes: Determine whether the sorting method of the field to be sorted in the database query request is empty; If the sorting method of the field to be sorted is empty, the form data is sorted by page using a default sorting method according to the data type corresponding to the form data; and / or Determine whether the field to be sorted in the database query request is empty; If the field to be sorted is empty, the form data is sorted by page using the default sorting field according to the data type corresponding to the form data.

7. A paging sorting device for form data in a page, characterized in that: The device comprises: A receiving module, used to receive a paging sorting request triggered by a user from the front end; the paging sorting request includes form data and a sorting instruction; the sorting instruction is used to indicate the fields to be sorted and the sorting method; A sorting module is used to convert the non-string type data into key-value pair type data if the form data contains non-string type data, and determine paging information based on the paging sorting request; construct a database query request based on the paging information, the form data and the sorting instruction; through the database query request, paging and sorting the form data according to the data type corresponding to the form data, and feed back the paging sorting result of the form data.

8. An electronic device, characterized in that: include: A memory for storing program instructions; A processor is used to call the program instructions stored in the memory, and execute the steps included in any one of claims 1-6 according to the obtained program instructions.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a computer, the computer executes the method according to any one of claims 1 to 6.

10. A computer program product, characterized in that The computer program product comprises: a computer program code, and when the computer program code is run on a computer, the computer is enabled to execute the method according to any one of claims 1 to 6.