Data query and configuration method and device, computer device and storage medium
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- KINGDEE SOFTWARE(CHINA) CO LTD
- Filing Date
- 2023-12-26
- Publication Date
- 2026-08-07
AI Technical Summary
然而现有应用于系统的数据查询技术,查询条件都是固定配置,若要满足查询条件的灵活多变,需要通过特定的插件进行二开或特殊配置,导致查取适用于不同应用场景的数据的效率较低
[0026] The aforementioned data query and configuration method, apparatus, computer equipment, and storage medium, by receiving a query request sent by a user terminal, determine from the query request the target document module identifier, the target local configuration identifier corresponding to the target document module identifier, and the query basis field information corresponding to the target document module identifier; the query basis field information includes the identifier of the local information to be queried; based on the target document module identifier and the target local configuration identifier, determine the target query configuration rule from the candidate query configuration rules; based on the query basis field information and the target query configuration rule, determine the initial query data information set; based on the association between the identifier of the local information to be queried and the sorting configuration rule identifier, determine the target sorting configuration rule from the candidate sorting configuration rules; and based on the target sorting configuration rule, process the initial query data... The system processes the data from the information set to obtain the target query data information corresponding to the query request. This target query data information is then sent to the user terminal for display. This allows users to query and configure data from both preset query and sorting rules, and to flexibly select suitable query and sorting rules from candidate query and sorting rules to meet specific application needs. This improves the efficiency of retrieving data applicable to different application scenarios. Furthermore, the selected query and sorting rules can be modified or added as needed, effectively meeting users' personalized data retrieval requirements. The scenario-adaptive nature of the query and sorting configurations also improves the system's operational efficiency.
Smart Images

Figure CN117851454B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a data query and configuration method, apparatus, computer device, and storage medium. Background Technology
[0002] With the development of computer technology, more and more technologies have emerged to facilitate efficient data retrieval. However, existing data retrieval technologies applied to systems have fixed query conditions. To meet the need for flexible and varied query conditions, it is necessary to develop specific plugins or perform special configurations, resulting in low efficiency in retrieving data suitable for different application scenarios. Summary of the Invention
[0003] Therefore, it is necessary to provide a data query and configuration method, device, computer equipment, and storage medium that can flexibly configure data query rules to address the above-mentioned technical problems, thereby improving the efficiency of querying data applicable to application scenarios.
[0004] A data query method, applied to a server, the method comprising:
[0005] Receive a query request sent by a user terminal, and determine the target document module identifier, the target local configuration identifier corresponding to the target document module identifier, and the query basis field information corresponding to the target document module identifier from the query request; the query basis field information includes the identifier of the local information to be queried;
[0006] Based on the target document module identifier and the target local configuration identifier, the target query configuration rule is determined from the candidate query configuration rules. Based on the query basis field information and the target query configuration rule, the initial query data information set is determined.
[0007] Based on the association between the identifier of the local information to be queried and the identifier of the sorting configuration rule, the target sorting configuration rule is determined from the candidate sorting configuration rules. Based on the target sorting configuration rule, the data in the initial query data information set is processed to obtain the target query data information corresponding to the query request.
[0008] The target query data is sent to the user's terminal for display.
[0009] A data configuration method, applied to a terminal, the method comprising:
[0010] Retrieve the target document module identifier and the target local configuration identifier corresponding to the target document module identifier entered in the query configuration interface;
[0011] Virtual buttons are added to the configuration fields in the response query configuration interface to identify the configuration field corresponding to the target document module identifier. Virtual buttons are also added to the query conditions configuration in the response query configuration interface to identify the query condition configuration type corresponding to the configuration field.
[0012] Based on the target document module identifier, the target local configuration identifier corresponding to the target document module identifier, the configuration field corresponding to the target document module identifier, and the query condition configuration type corresponding to the configuration field, generate the custom query configuration rule corresponding to the target document module identifier.
[0013] Custom query configuration rules are used as candidate query configuration rules, and these candidate query configuration rules are sent to the server for storage.
[0014] A data query device. The device includes:
[0015] The receiving module is used to receive query requests sent by user terminals, and determine the target document module identifier, the target local configuration identifier corresponding to the target document module identifier, and the query basis field information corresponding to the target document module identifier from the query request; the query basis field information includes the identifier of the local information to be queried;
[0016] The query module is used to determine the target query configuration rule from the candidate query configuration rules based on the target document module identifier and the target local configuration identifier, and to determine the initial query data information set based on the query basis field information and the target query configuration rule.
[0017] The sorting module is used to determine the target sorting configuration rule from the candidate sorting configuration rules based on the association between the identifier of the local information to be queried and the identifier of the sorting configuration rule, and to process the data in the initial query data set based on the target sorting configuration rule to obtain the target query data information corresponding to the query request.
[0018] The sending module is used to send the target query data information to the user terminal for display.
[0019] A data configuration apparatus, the apparatus comprising:
[0020] The acquisition module is used to obtain the target document module identifier and the target local configuration identifier corresponding to the target document module identifier entered in the query configuration interface.
[0021] The determination module is used to respond to the addition of virtual buttons to configuration fields in the query configuration interface, determine the configuration field corresponding to the target document module identifier, respond to the query condition configuration virtual buttons in the query configuration interface, and determine the query condition configuration type corresponding to the configuration field.
[0022] The generation module is used to generate custom query configuration rules corresponding to the target document module identifier based on the target document module identifier, the target local configuration identifier corresponding to the target document module identifier, the configuration field corresponding to the target document module identifier, and the query condition configuration type corresponding to the configuration field.
[0023] The storage module is used to store custom query configuration rules as candidate query configuration rules and send them to the server for storage.
[0024] A computer device includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the steps in the above-described data query and data configuration method.
[0025] A computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps in the above-described data query and data configuration methods.
[0026] The aforementioned data query and configuration method, apparatus, computer equipment, and storage medium, by receiving a query request sent by a user terminal, determine from the query request the target document module identifier, the target local configuration identifier corresponding to the target document module identifier, and the query basis field information corresponding to the target document module identifier; the query basis field information includes the identifier of the local information to be queried; based on the target document module identifier and the target local configuration identifier, determine the target query configuration rule from the candidate query configuration rules; based on the query basis field information and the target query configuration rule, determine the initial query data information set; based on the association between the identifier of the local information to be queried and the sorting configuration rule identifier, determine the target sorting configuration rule from the candidate sorting configuration rules; and based on the target sorting configuration rule, process the initial query data... The system processes the data from the information set to obtain the target query data information corresponding to the query request. This target query data information is then sent to the user terminal for display. This allows users to query and configure data from both preset query and sorting rules, and to flexibly select suitable query and sorting rules from candidate query and sorting rules to meet specific application needs. This improves the efficiency of retrieving data applicable to different application scenarios. Furthermore, the selected query and sorting rules can be modified or added as needed, effectively meeting users' personalized data retrieval requirements. The scenario-adaptive nature of the query and sorting configurations also improves the system's operational efficiency. Attached Figure Description
[0027] Figure 1 This is an application environment diagram of the data query and data configuration methods in one embodiment;
[0028] Figure 2 This is a flowchart illustrating a data query method in one embodiment;
[0029] Figure 3 This is a flowchart illustrating a data configuration method in one embodiment;
[0030] Figure 4 This is a schematic diagram of the query configuration interface in one embodiment;
[0031] Figure 5 This is a schematic diagram of the sorting configuration interface in one embodiment;
[0032] Figure 6 Here is a flowchart of the query and sorting process in one embodiment;
[0033] Figure 7 This is a schematic diagram of the query statement logic in one embodiment;
[0034] Figure 8 This is a schematic diagram of the sorting process in one embodiment;
[0035] Figure 9 This is a schematic diagram of a document frame in one embodiment;
[0036] Figure 10 This is a structural block diagram of a data query device in one embodiment;
[0037] Figure 11 This is a structural block diagram of a data configuration device in one embodiment;
[0038] Figure 12 This is an internal structural diagram of a computer device in one embodiment;
[0039] Figure 13 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0040] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0041] The data query and data configuration methods provided in this application can be applied to, for example... Figure 1In the application environment shown, terminal 102 communicates with server 104 via a network. A data storage system can store the data that server 104 needs to process. The data storage system can be integrated onto server 104 or placed on a cloud or other network server. Server 104 receives query requests sent by user terminals, determines from the query request the target document module identifier, the target local configuration identifier corresponding to the target document module identifier, and the query basis field information corresponding to the target document module identifier; the query basis field information includes the identifier of the local information to be queried; based on the target document module identifier and the target local configuration identifier, it determines the target query configuration rule from the candidate query configuration rules; based on the query basis field information and the target query configuration rule, it determines the initial query data information set; based on the association between the identifier of the local information to be queried and the sorting configuration rule identifier, it determines the target sorting configuration rule from the candidate sorting configuration rules; based on the target sorting configuration rule, it processes the data in the initial query data information set to obtain the target query data information corresponding to the query request; and sends the target query data information to the user terminal for display.
[0042] Terminal 102 is used to obtain the target document module identifier and the target local configuration identifier corresponding to the target document module identifier entered in the query configuration interface; respond to the addition of virtual buttons to the configuration fields in the query configuration interface to determine the configuration fields corresponding to the target document module identifier; respond to the query condition configuration virtual buttons in the query configuration interface to determine the query condition configuration type corresponding to the configuration fields; generate a custom query configuration rule corresponding to the target document module identifier based on the target document module identifier, the target local configuration identifier corresponding to the target document module identifier, the configuration fields corresponding to the target document module identifier, and the query condition configuration types corresponding to the configuration fields; use the custom query configuration rule as a candidate query configuration rule and send the candidate query configuration rule to the server for storage.
[0043] The terminal 102 can be, but is not limited to, various personal computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices. IoT devices can include smart speakers, smart TVs, smart air conditioners, and smart in-vehicle systems. Portable wearable devices can include smartwatches, smart bracelets, and head-mounted devices. The server 104 can be implemented using a standalone server or a server cluster consisting of multiple servers.
[0044] In one embodiment, such as Figure 2 As shown, a data query method is provided, which can be applied to... Figure 1 Taking the server in the example, the following steps are included:
[0045] Step S200: Receive a query request sent by the user terminal, and determine the target document module identifier, the target local configuration identifier corresponding to the target document module identifier, and the query basis field information corresponding to the target document module identifier from the query request; the query basis field information includes the identifier of the local information to be queried.
[0046] Here, "Query Request" refers to a request to query data. "Target Document Module Identifier" refers to the identifier used to identify documents and document entries, including document identifier and document partial identifier. The document partial identifier refers to the identification information of document entries within the document. "Target Partial Configuration Identifier" refers to the virtual key identifier used to respond to the query configuration adopted by document entries in the document; this can be a virtual key identifier set in the form of operation codes. "Query Basis Field Information" refers to the data information required when querying related data, including but not limited to data corresponding to fields. "Pending Query Partial Information Identifier" refers to the identifier used to identify the object to be queried corresponding to the queried data information; for example, if the queried data information is data related to certain fields of a certain material in a certain entry of a document, then that material is the object to be queried, and the material number used to identify that material is the pending query partial information identifier.
[0047] Specifically, before performing a data query, users can first set up relevant query rules and sorting rules on their user terminals. Then, they can enter the required data information in the data query interface corresponding to the target document specified by the target document module identifier and generate a query request to send to the server. After receiving the query request from the user terminal, the server determines the target document module identifier, the target local configuration identifier corresponding to the target document module identifier, and the query basis field information entered in the data query interface corresponding to the target document module identifier from the query request. This provides a basis for subsequently determining the query configuration rules based on the target document module identifier and the target local configuration identifier, as well as for querying the required data from the database or other data sources based on the query basis field information.
[0048] Step S202: Based on the target document module identifier and the target local configuration identifier, determine the target query configuration rule from the candidate query configuration rules, and determine the initial query data information set based on the query basis field information and the target query configuration rule.
[0049] Among them, candidate query configuration rules refer to the stored and configured query rules; a target document module identifier can be configured with multiple query configuration rules, and a target local configuration identifier within a target module identifier corresponds to one query configuration rule; these include system-preset query configuration rules and query configuration rules customized in the terminal. Target query configuration rules refer to the query configuration rules jointly specified by the target document identifier and the target local configuration identifier. The initial query data set refers to the dataset used for the initial query but before sorting and selection based on the sorting configuration rules; however, the data in the initial query data set has undergone initial priority sorting, meaning that data meeting the priority query conditions in the target query configuration rules has a higher sorting priority than data not meeting the priority query conditions. Custom query configuration rules refer to query rules set in the terminal.
[0050] Specifically, the target document module identifier includes a target document identifier and a target document local identifier. The corresponding target query configuration rules can be determined based on these identifiers. Different target document module identifiers and different local configuration identifiers correspond to different target query configuration rules. Each target query configuration rule includes one or more configuration fields. Different configuration fields can be configured with different query rules. Configuration fields can be fields used as the query basis or fields used as the basis for the query. When a configuration field is used as the basis for the query, different query condition configuration types can be set according to actual needs. Different query condition configuration types play different roles in the query basis. Then, based on the target query configuration rules, the fields belonging to the query basis and their data information can be determined. Based on these fields and their data information, an initial query data set can be obtained from the database or other data sources.
[0051] Step S204: Based on the association between the local information identifier to be queried and the sorting configuration rule identifier, determine the target sorting configuration rule from the candidate sorting configuration rules, and process the data in the initial query data information set based on the target sorting configuration rule to obtain the target query data information corresponding to the query request.
[0052] Here, "sorting configuration rule identifier" refers to the identifier used to specify the sorting configuration rule; different identifiers of the local information to be queried can correspond to different sorting configuration rule identifiers. "Association relationship" refers to the configuration relationship between the identifier of the local information to be queried and the identifier of the sorting configuration rule to be sorted. "Candidate sorting configuration rule" refers to the stored configured sorting rules; it includes system-preset sorting configuration rules and sorting configuration rules customized on the terminal. "Target sorting configuration rule" refers to the sorting rule configured corresponding to the identifier of the local information to be queried. "Target query data information" refers to the data information that needs to be queried and returned to the user terminal in the query request. "Custom sorting configuration rule" refers to the sorting rule customized on the terminal.
[0053] Specifically, different local information to be queried can be selected from a variety of stored candidate sorting configuration rules, choosing the appropriate sorting configuration rule for the current application scenario. Alternatively, a custom sorting configuration rule can be added to the terminal before data querying. Then, a relationship is established between the identifier of the local information to be queried and the identifier of the sorting configuration rule. This allows the target sorting configuration rule corresponding to the local information to be queried to be determined from the candidate sorting configuration rules based on the relationship between the identifier and the sorting configuration rule. The data in the initial query data set is then sorted according to the target sorting configuration rule. The target sorting configuration rule contains one or more sorting fields to limit sorting priority. Different sorting fields can be set with different sorting methods and different null value handling rules, flexibly implementing data sorting settings suitable for various application scenarios. Furthermore, before determining the target query data information corresponding to the query request, all data information that meets the query conditions is sorted, that is, all data in the initial query data set is sorted. Finally, the data information corresponding to the target query data required by the query request is obtained from the sorted target query data set.
[0054] Step S206: Send the target query data information to the user terminal for display.
[0055] Specifically, certain configuration fields in the target query configuration rules are configured to return data values. Therefore, the target query data information includes the fields corresponding to the configured return data values and the data information corresponding to the fields. The target query data information is received by the terminal from the server and displayed in the data query interface.
[0056] The above data query method receives a query request from a user terminal, and determines from the query request the target document module identifier, the target local configuration identifier corresponding to the target document module identifier, and the query basis field information corresponding to the target document module identifier; the query basis field information includes the identifier of the local information to be queried; based on the target document module identifier and the target local configuration identifier, a target query configuration rule is determined from candidate query configuration rules; based on the query basis field information and the target query configuration rule, an initial query data information set is determined, the candidate query configuration rules include custom query configuration rules, and the custom query configuration rules include query rules set for querying local information related to the target document module identifier; based on the association between the identifier of the local information to be queried and the sorting configuration rule identifier, from... The candidate sorting configuration rules determine the target sorting configuration rules. Based on the target sorting configuration rules, the data in the initial query data set is processed to obtain the target query data information corresponding to the query request. The candidate sorting configuration rules include custom sorting configuration rules, which are sorting rules set to sort the query data information corresponding to the local information identifier to be queried. The target query data information is sent to the user terminal for display. This allows users to query and configure data from the system's preset query and sorting configuration rules, as well as flexibly select configured custom query and sorting configuration rules according to application scenario requirements to query and sort the queried data, thus improving the efficiency of querying data suitable for different application scenarios.
[0057] In one embodiment, the target query configuration rule includes the query condition configuration type corresponding to the configuration field; the query condition configuration type includes priority query condition and regular query condition; the query basis field information includes the configuration field in the target query configuration rule; step S202 includes:
[0058] Step S300: Based on the query condition configuration type corresponding to the configured fields in the target query configuration rules, select the fields belonging to the priority query conditions in the query basis field information as priority query fields, and obtain the target priority query condition information corresponding to the priority query fields from the query basis field information; and,
[0059] Fields that belong to the regular query conditions are used as regular query fields, and the target regular query condition information corresponding to the regular query fields is obtained from the query basis field information.
[0060] Step S302: Obtain the first query dataset that simultaneously satisfies the target's regular query conditions and the target's priority query conditions, and obtain the second query dataset that satisfies the target's regular query conditions.
[0061] Step S304: The first query dataset and the second query dataset are associated and merged to obtain the initial query data information set; the sorting priority of the data in the initial query data information set that meets the target priority query condition information is higher than the sorting priority of the data that does not meet the target priority query condition information.
[0062] Here, "Configuration Fields" refers to the fields relevant to the data information in a query document; for example, when querying A's gender, A's name or account number and gender are the relevant fields used as the basis for the query. "Query Condition Configuration Type" refers to the type of conditional role that the configuration fields play during the query process; this includes mandatory query conditions, priority query conditions, and regular query conditions. "Priority Query Fields" refers to fields configured as priority query conditions. "Regular Query Fields" refers to fields configured as regular query conditions. "Target Regular Query Condition Information" refers to data information including regular query fields and their values. "Target Priority Query Condition Information" refers to data information including priority query fields and their values. "First Query Dataset" refers to the collection of data that simultaneously satisfies both the target regular query condition information and the target priority query condition information. "Second Query Dataset" refers to the collection of data that only satisfies the target regular query condition information.
[0063] Specifically, in the target query configuration rules, different configuration fields can be configured with different query condition configuration types. If the query condition configuration type of a configuration field is a priority query condition, then data information related to fields that meet the priority query condition can be retrieved from the database first, followed by data information related to fields that do not meet the priority query condition. In other words, data information related to fields that meet the priority query condition is read first. Furthermore, data information of fields that do not meet the priority query condition but meet other query condition configuration types can be queried. During the query, a first query dataset corresponding to both the target regular query condition information and the target priority query condition information can be retrieved, and a second query dataset corresponding to only the target regular query condition information can be retrieved. The retrieval of the first and second query datasets can be performed simultaneously or in any order. The first query dataset contains query data related to fields that meet the priority query condition, which is more suitable for user needs. The second query dataset contains data from the first query dataset, allowing selection from the second query dataset if the data in the first query dataset still does not meet the user's needs. Furthermore, data information related to fields that have been configured and meet priority query conditions has a higher sorting priority than data information related to fields that do not have been configured and meet priority query conditions. In other words, when sorting data, data information containing fields that have been configured and meet priority query conditions is ranked before data information containing fields that do not have priority query conditions. This allows users to more intuitively and quickly obtain the data information they want from the final returned data.
[0064] In the above embodiments, by using target query configuration rules, data information that meets the query configuration rules and query requests is queried. Since the target query configuration rules are configured based on application scenario requirements, the corresponding data query operations can be executed directly according to the configured target query configuration rules during the query process, thereby improving the efficiency of querying data that matches the application scenario requirements.
[0065] In one embodiment, step S204 includes:
[0066] Step S400: The initial query data information set is used as the current data information set to be sorted. Based on the processing priority of each sorting field in the target sorting configuration rule, the current sorting field is determined sequentially from the sorting fields in the target sorting configuration rule.
[0067] Step S402: Based on the target null value handling rules and target sorting method corresponding to the current sorting field, process the current data information set to be sorted to obtain the current sorted data information set.
[0068] Step S404: Take the current sorted data information set as the current unsorted data information set, and take the backward sorting field corresponding to the current sorting field as the current sorting field.
[0069] Step S406 returns the steps of processing the current data set to be sorted based on the target null value processing rule and target sorting method corresponding to the current sorting field, until the operation corresponding to the target sorting configuration rule is completed, and the current sorted data set corresponding to the current sorting field is used as the target query data set.
[0070] Step S408: Obtain the target query data information corresponding to the query request from the target query data information set.
[0071] Here, "Sort Field" refers to the relevant fields in the target sorting configuration rules, used as the basis for restricting the sorting of query data. "Processing Priority" refers to the processing order of the sorting fields set in the sorting configuration rules. "Target Null Value Handling Rule" refers to the rules for processing data information where the corresponding field contains null values; it includes priority processing rules and last processing rules. "Target Sorting Method" refers to the sorting method corresponding to the current sorting field; different sorting fields can be set with different sorting methods; sorting methods include descending order, ascending order, and custom sorting; custom sorting means that the sorting method can be set according to needs, for example, the custom sorting method for sorting field A is: first sort the data information corresponding to A's value of 003, then sort the data information corresponding to A's value of 002, and finally sort the data information where A has other values according to the default sorting method. "Current Data Set to be Sorted" refers to the data information set to be sorted under the current operation. "Target Query Data Set" refers to the data information set obtained after sorting the initial query data information set based on the target null value handling rules and target sorting methods corresponding to each sorting field in the target sorting configuration rules.
[0072] Specifically, the target sorting configuration rules set different sorting fields, each with a different processing priority. The current sorting field can be determined sequentially based on its processing priority. Each sorting field has a corresponding target null value handling rule and target sorting method. Based on the target null value handling rule corresponding to the current sorting field, the values belonging to the current sorting field in the current unsorted data set are first set. Then, based on the target sorting method corresponding to the current sorting field, the current unsorted data set, after the values of the current sorting field (which are null values) have been set, is sorted to obtain the current sorted data set. This process is repeated, using the next sorting field (i.e., the sorting field with the next lower processing priority) as the current sorting field, and the current sorted data set as the current unsorted data set. Further processing is then performed on the current unsorted data set based on the target null value handling rule and target sorting method corresponding to the current sorting field, until all operations corresponding to the sorting fields in the target sorting configuration rules are completed, resulting in the target query data set. For example... Figure 5 As shown, Figure 5 The sorting fields in the query are resource, batch number, and business date. The processing priority is resource > batch number > business date. First, the queried data is sorted according to the null value handling rules and sorting method of resource. Then, the data sorted according to the null value handling rules and sorting method of batch number is sorted again. Finally, the data sorted according to the null value handling rules and sorting method of business date is sorted again to obtain the final data that meets the null value handling rules and sorting method of resource, batch number, and business date.
[0073] More specifically, in one embodiment, the current sorting field can be determined from the sorting field in the target sorting configuration rule. Based on the target null value handling rule and target sorting method corresponding to the current sorting field, the initial query data information set is processed to obtain the initial sorted query data information set. The initial sorted query data information set is used as the current data information set to be sorted, and the backward sorting field of the current sorting field is used as the current sorting field. Data information in the current data information set to be sorted where the values of the forward sorting fields corresponding to the current sorting field are the same is used as the current local data information to be sorted. Based on the target null value handling rule corresponding to the current sorting field in the target sorting configuration rule... Based on the processing rules and target sorting method, the system processes the local data information in the current unsorted data set to obtain the current sorted local data information set; it then uses this set as the current unsorted data set and the backward sorting field corresponding to the current sorting field as the current sorting field; it returns data information in the current unsorted data set whose forward sorting field values are the same as the current sorting field as the current unsorted local data information, and repeats this process until the operation corresponding to the target sorting configuration rule is completed, resulting in the target query data information set; finally, it retrieves the target query data information corresponding to the query request from the target query data information set.
[0074] The initial sorted query data set refers to the data set obtained after sorting the initial query data set based on the target null value handling rules and target sorting method corresponding to the initial sorting field in the target sorting configuration rules. The currently unsorted partial data information refers to data where all fields have the same value, such as... Figure 8 The data information enclosed in the second table frame. The current sorted local data information set refers to the data information set obtained after sorting the current unsorted local data information in the current unsorted data information set under the current operation, which is also the current sorted data information set.
[0075] Specifically, the target sorting configuration rule may contain one or more sorting fields. Different sorting fields correspond to different sorting methods, and different sorting fields are configured with corresponding processing priorities, such as... Figure 5 The outbound rule configuration interface shown is an example of a configuration interface for setting sorting rules. Figure 5 As can be seen, different sorting fields correspond to different rows. The earlier the row number, the higher the processing priority of the sorting field, meaning that the sorting method and null value handling rules corresponding to that sorting field are applied first. Figure 5The data information is processed using the null value handling rules in the target sorting configuration rules. The current sorting field can be determined sequentially from the target sorting configuration rules. Based on the target null value handling rules and target sorting method corresponding to the current sorting field, the initial query data set is processed to obtain the initial sorted query data set. This initial sorted data set is then used as the current unsorted data set. The backward sorting field corresponding to the current sorting field is also used as the current sorting field. Finally, data in the current unsorted data set whose values are the same as the forward sorting field corresponding to the current sorting field are used as the current unsorted local data. For example, if the current sorting field is field B, and the forward sorting field of field B is field A, and the values of field A may be 001, 002, and 003, etc. If the data information containing the value 001 of field A is the current unsorted local data information, and the data information containing the value 002 of field A is also the current unsorted local data information, then one forward sorting field may correspond to multiple current unsorted local data information. Each current unsorted local data information can be sorted according to the target null value handling rule and target sorting method corresponding to the current sorting field, so that each part of the current unsorted local data information in the current unsorted data information set is sorted, resulting in the current sorted local data information set. At this time, the data in the current sorted local data information set is still the data in the initial query data information set, only the data sorting position has changed. Further, in order to perform the sorting operation of the next sorting field, the current sorted local data information can be used as the current unsorted data information set, and the backward sorting field corresponding to the current sorting field can be used as the current sorting field. The step of returning the data information in the current unsorted data information set with the same value as the forward sorting field corresponding to the current sorting field as the current unsorted local data information can be repeated until the sorting operation corresponding to each sorting field in the target sorting configuration rule is completed, resulting in the sorted target query data information set.
[0076] To aid understanding, you can combine Figure 5 and Figure 8 The example illustrates the priority of sorting methods for the sorting fields. If the target sorting configuration only sets the "Source" and "Batch Number" sorting fields, and the "Source" sorting method is set to custom sorting with the numbers 003, 002, and 001 (others sort according to the system default), and the "Batch Number" sorting method is set to ascending order, assuming... Figure 8 The data in the first table is from the initial query data set. Figure 8 The material number in the table is the identifier of the local information to be queried. First, use the resource as the current sorting field, and then sort according to the custom sort "003, 002, 001" corresponding to the resource to obtain the result. Figure 8The second table is sorted by using the backward sorting field (batch number) of the resource as the current sorting field. Data with the same value in the forward sorting field (resource) corresponding to the sorting field (batch number) is used as the current local data to be sorted. Figure 8 The data information corresponding to the part enclosed in the second table frame is sorted based on the sorting method (ascending order) of the current sorting field (batch number), resulting in the sorted partial data information (i.e., the sorted partial data information). Figure 8 (The sorting of the third table in the middle).
[0077] In the above embodiments, the initial query data information set obtained by the query is sorted according to the target sorting configuration rules to obtain the sorted target query data information set. Since the target sorting configuration rules are configured based on the application scenario requirements, the corresponding data sorting operation can be directly performed according to the configured target sorting configuration rules during the query process, so that the data finally displayed on the terminal is more compatible with the application scenario requirements.
[0078] In one embodiment, step S402 includes:
[0079] Step S500: If the target null value handling rule is the priority handling rule, then in the current unsorted data information set, the value of the current sorting field that belongs to null values is set to the maximum value corresponding to the current sorting field, and the current updated sorted data information set is obtained.
[0080] Step S502: If the target null value handling rule is the last handling rule, then in the current unsorted data information set, the value of the current sorting field that belongs to null values is set to the minimum value corresponding to the current sorting field, and the current updated sorted data information set is obtained.
[0081] Step S504: If the target sorting method is custom sorting, then based on the sorting table corresponding to the target sorting method, sort the data in the current updated sorting data information set to obtain the current sorting data information set. Custom sorting refers to the sorting rules set for sorting data information related to the same field.
[0082] Among them, the priority processing rule refers to the rule of placing data with null values in the sorting field before data with non-null values. The last processing rule refers to the rule of placing data with null values in the sorting field after data with non-null values. The currently updated sorted data set refers to the data set obtained after setting the values of the current sorting field containing null values in the current unsorted data set based on the target null value processing rule.
[0083] Specifically, different sorting fields correspond to different target null value handling rules. If the target null value handling rule for the current sorting field is a priority handling rule, then the null values in the current sorting field of the current unsorted data set can be set to the maximum value corresponding to the current sorting field. This maximum value is determined relative to the target sorting method of the current sorting field. If the target sorting method of the current sorting field is a custom sort, then the value set first in the custom sort is taken as the maximum value. For example, if the target sorting method for field A is a custom sort: 002, 001, 003, others, then the maximum value for field A is 002. Similarly, if the target null value handling rule for the current sorting field is a last handling rule, then the null values in the current sorting field of the initial query data set are set to the minimum value corresponding to the current sorting field. This minimum value is also determined relative to the target sorting method of the current sorting field. If the target sorting method for the current sorting field is a custom sort, then the value set last in the custom sort is also taken as the minimum value. Furthermore, each custom sorting field has a corresponding sorting table. These tables contain values for sorting priority fields. For example, if the custom sort is "X, B", it will be converted into a sorting table: "X (priority 1), B (priority 2), all others not equal to X and B (priority 3)". The data in the currently updated sorting data set can then be sorted according to these tables, resulting in the current sorted data set processed based on the target null value handling rule and target sorting method corresponding to the current sorting field. When different sorting fields have corresponding custom sorting settings, corresponding sorting tables will be generated. These sorting tables will sequentially sort the data in the currently updated sorting data set until all operations corresponding to the sorting rules (including null value handling rules and sorting methods) configured for each sorting field in the target sorting configuration rules have been executed.
[0084] In the above embodiments, the queried data information is processed based on the null value handling rules of each sorting field and the target sorting method. The addition of null value handling rules takes into account the processing needs of null data in certain scenarios. In addition, the sorting method is no longer limited to the system's preset sorting method and common sorting methods, but can be set according to actual needs. This is conducive to flexibly switching or setting different sorting rules according to different application scenarios, thereby improving the efficiency of obtaining sorted data adapted to the application scenario.
[0085] In one embodiment, the query criteria field information includes the target query quantity, and step S408 includes:
[0086] Step S600: If the target data matching rule corresponding to the sorting field in the target sorting configuration rule is an overall match, then the data information in the target query data information set is used as the target query data information corresponding to the query request.
[0087] Step S602: If the target data matching rule corresponding to the sorting field in the target sorting configuration rule is not a complete match, then based on the sorting order of the data in the target query data information set, obtain the target query quantity data information from the target query data information set as the target query data information corresponding to the query request.
[0088] Among them, the target data matching rule refers to the rule used to set whether all the queried data is returned to the user's terminal. The overall matching rule refers to the rule that returns all the queried data to the user's terminal. The target query quantity refers to the amount of data requested in the query request.
[0089] Specifically, in the target sorting configuration rules, each sorting field can be set with a corresponding target data matching rule, thereby providing a function of overall data matching. That is, when querying, if the requirement is to obtain a certain number of query results, but if you want to know all the information that meets the query conditions of a certain sorting field even if it belongs to a certain query data, you can set the target data matching rule corresponding to that sorting field to overall matching, and then use all the data information in the target query data information set as the target query data information corresponding to the query request; if you only want to return the data information of the target query number required for the query, you can directly obtain the data information corresponding to the target query number from the target query data information set in sequence. For example, if the sorting field is the box number, and the query is for 10 quantities of box number X0001, and the quantity of box number X0001 that satisfies the query is 100, then if the target quantity matching rule set for this box number is overall matching, the data information of box number X0001 with a quantity of 100 will be used as the target query data information required by the query request. If the target quantity matching rule set for this box number is not overall matching, then the data information of box number X0001 with a quantity of 10 will be used as the target query data information required by the query request.
[0090] In the above embodiments, by adding a function to determine whether to return the queried data as a whole to the terminal for display, it is beneficial to flexibly switch between returning only the data information of the number of queries that meet the query conditions and returning all the data information that meets the query conditions, thus expanding the functionality required for certain application scenarios during the query process.
[0091] In one embodiment, such as Figure 3 As shown, a data configuration method is provided, which can be applied to... Figure 1 Taking the terminal in the example, the explanation includes the following steps:
[0092] Step S700: Obtain the target document module identifier and the target local configuration identifier corresponding to the target document module identifier entered in the query configuration interface.
[0093] The query configuration interface refers to the interface for configuring the rules for querying data. The target document module identifier refers to the identifier used to identify documents and document entries, including document identifiers and document partial identifiers. Document partial identifiers refer to the identification information of document entries within a document. The target partial configuration identifier refers to the virtual button identifier used to respond to the query configuration adopted by document entries within a document; this can be a virtual button identifier set in the form of operation codes.
[0094] Specifically, when configuring the query for data information related to a specific module of a document, you can enter the target document module identifier and the target local configuration identifier corresponding to the target document module identifier in the query configuration interface. This allows you to determine the specific query configuration rule when using the currently configured query configuration rule.
[0095] Step S702: Add virtual buttons to the configuration fields in the response query configuration interface, determine the configuration field corresponding to the target document module identifier, configure virtual buttons for query conditions in the response query configuration interface, and determine the query condition configuration type corresponding to the configuration field.
[0096] Adding virtual buttons to configuration fields refers to adding virtual buttons for configuration fields; each virtual button press corresponds to the addition of one configuration field. Configuration fields refer to fields relevant to data information in a document; for example, when querying A's gender, fields identifying A's name or account and gender are relevant during the query. Setting virtual buttons for query conditions refers to setting the query condition configuration type for configuration fields, as shown in the example below. Figure 4 As shown, Figure 4 The system has corresponding virtual buttons for query conditions (i.e., regular query conditions), mandatory field validation (i.e., mandatory query conditions), and priority outbound (i.e., priority query conditions). The query condition configuration type refers to the type of condition a field plays during the query process; it includes mandatory query conditions, priority query conditions, and regular query conditions.
[0097] Specifically, to improve the efficiency and flexibility of configuration, you can click on the configuration field to add a virtual button in the query configuration interface, then select the configuration field to be added, and click on the query condition configuration virtual button in the query configuration interface to select the query condition configuration type corresponding to the configuration field.
[0098] Step S704: Based on the target document module identifier, the target local configuration identifier corresponding to the target document module identifier, the configuration field corresponding to the target document module identifier, and the query condition configuration type corresponding to the configuration field, generate the custom query configuration rule corresponding to the target document module identifier.
[0099] Among them, custom query configuration rules refer to query rules that are set in the terminal; including query rules set to query local information related to the target document module identifier.
[0100] Step S706: The custom query configuration rule is used as a candidate query configuration rule, and the candidate query configuration rule is sent to the server for storage.
[0101] Specifically, the terminal can generate a new custom query configuration rule based on the target document module identifier, the corresponding target local configuration identifier, the configuration field corresponding to the target document module identifier, and the query condition configuration type corresponding to the configuration field, all entered in the query configuration interface. This custom query configuration rule is then stored as a candidate query configuration rule. When in use, the terminal can directly determine the relevant query configurations for each configuration field in the custom query configuration rule based on the configured target document module identifier and its corresponding target local configuration identifier. Furthermore, this custom query configuration rule can be modified in the relevant query configuration modification interface, or its usage status can be set to enabled or disabled. It can also be deleted when no longer needed, providing high flexibility in the configuration and use of custom query configuration rules.
[0102] For example, such as Figure 4 As shown, Figure 4 The image shown is an example of a query configuration interface. Figure 4 The basic information in the field is used to input or select information about the query configuration rules configured on the current interface. Figure 4 The document + document body identifier + document body name constitutes the target document module identifier, and the operation code constitutes the target local configuration identifier. Figure 4 The inventory query field mapping section is the part where you add and configure configuration fields. Figure 4 The document fields in the configuration file are called configuration fields. Different configuration fields can have their query condition configuration type determined by clicking the buttons for "Query Conditions (i.e., regular query conditions)," "Return Fields," "Required Document Field Validation (i.e., required query conditions)," and "Priority Outbound (i.e., priority query conditions)." Figure 4 The "Return Document" configuration field refers to the field that will ultimately display the corresponding data information in the terminal, including the fields corresponding to the queried data.
[0103] The above data configuration method obtains the target document module identifier and the corresponding target local configuration identifier entered in the query configuration interface. It then adds virtual buttons to the configuration fields in the query configuration interface to determine the configuration fields corresponding to the target document module identifier. Finally, it responds to the query condition configuration virtual buttons in the query configuration interface to determine the query condition configuration type corresponding to the configuration fields. Based on the target document module identifier, the corresponding target local configuration identifier, the corresponding configuration fields, and the corresponding query condition configuration types, it generates custom query configuration rules corresponding to the target document module identifier. These custom query configuration rules are then used as candidate query configuration rules and sent to the server for storage. This achieves flexible configuration of query rules, facilitating the setting of different query configuration rules according to different application scenarios. Furthermore, it allows for flexible configuration of the set query configuration rules for documents in different application scenarios, improving the flexibility of system data query configuration and adaptability to different application scenarios. This provides a configuration foundation for efficiently querying data adapted to different application scenarios.
[0104] In one embodiment, the data configuration method further includes:
[0105] Step S800: Obtain the sorting configuration rule identifier entered in the sorting configuration interface, add virtual buttons to the sorting field in the sorting configuration interface, and determine the sorting field corresponding to the sorting configuration rule identifier.
[0106] Step S802: Respond to the sorting method click operation in the sorting configuration interface to determine the target sorting method corresponding to the sorting field; respond to the null value handling rule click operation in the sorting configuration interface to determine the target null value handling rule corresponding to the sorting field; respond to the data matching rule selection virtual button in the sorting configuration interface to determine the target data matching rule corresponding to the sorting field.
[0107] Step S804: Generate a custom sorting configuration rule based on the sorting configuration rule identifier, the sorting field corresponding to the sorting configuration rule identifier, the target sorting method corresponding to the sorting field, the target null value handling rule, and the target data matching rule.
[0108] Step S806: Obtain the local information identifier to be queried and the sorting configuration rule identifier entered in the sorting rule matching interface, and construct the association relationship between the local information identifier to be queried and the sorting configuration rule identifier.
[0109] Step S808: The custom sorting configuration rule is used as a candidate sorting configuration rule, and the association relationship and candidate sorting configuration rule are sent to the server for storage.
[0110] The sorting configuration interface refers to the interface for configuring the sorting rules for query data. The sorting configuration rule identifier is the identifier used to specify the sorting configuration rule; it can be a number or ID that identifies the sorting configuration rule. Adding a virtual button to a sorting field adds a virtual button; each virtual button press corresponds to the addition of one sorting field. The sorting method click operation selects the sorting method; sorting methods include ascending, descending, and custom sorting. Custom sorting allows you to set the sorting method according to your needs; for example, the custom sorting method for sorting field A is: first sort the data information corresponding to A's value of 003, then sort the data information corresponding to A's value of 002, and finally sort the data information where A has other values according to the default sorting method. The null value handling rule click operation selects the null value handling rule; null value handling rules include priority handling rules, last handling rules, and no handling rules. The data matching rule selection virtual button indicates whether to set the data matching rule as a global match. Custom sorting configuration rules refer to the sorting rules customized in the terminal. The sorting rule matching interface refers to the interface that configures the relationship between the local information to be queried in the document and the sorting configuration rules, such as the interface for configuring a certain material to use a certain sorting configuration rule.
[0111] Specifically, in the sorting configuration interface, you can enter the sorting configuration rule identifier of the currently set sorting configuration rule, and add virtual buttons to the sorting fields in the sorting configuration interface to determine the sorting fields included in the currently configured sorting configuration rule. You can also respond to the click operation of the sorting method corresponding to each sorting field in the sorting configuration interface to determine the target sorting method for each sorting field, and respond to the click operation of the null value handling rule corresponding to each sorting field in the sorting configuration interface to determine the target null value handling rule for each sorting field. Finally, you can respond to the virtual button for selecting the data matching rule in the sorting configuration interface to determine the target data matching rule for each sorting field. For example... Figure 5 As shown, Figure 5 Sort field (including Figure 5 The field source, sorting field identifier, sorting field name, sorting method, and null value exit rule (i.e., null value handling rule) can all be selected by clicking. Figure 5The overall matching in the system refers to the corresponding data matching rules, and the corresponding buttons in the overall matching column are virtual buttons for selecting data matching rules. After entering the relevant identifier information and confirming the corresponding virtual button selection operation in the sorting configuration interface, the terminal can generate a custom sorting configuration rule based on the sorting configuration rule identifier, the sorting field corresponding to the sorting configuration rule identifier, the target sorting method corresponding to the sorting field, the target null value handling rule, and the target data matching rule, and store this custom sorting configuration rule as a candidate sorting configuration rule. Before performing a query operation, if the configuration corresponding to this custom sorting configuration rule needs to be applied, the identifier of the local information to be queried and the sorting configuration rule identifier can be entered in the sorting rule matching interface first, so that the terminal can establish the association relationship between the identifier of the local information to be queried and the sorting configuration rule identifier. In addition, this custom sorting configuration rule can be modified in the relevant sorting configuration modification interface when needed, or its usage status can be set to enabled or disabled. It can also be deleted directly when it is no longer needed, providing high flexibility for the configuration and use of custom sorting configuration rules.
[0112] In the above embodiments, by responding to relevant operations in the sorting configuration interface and sorting rule matching interface through the terminal, and constructing custom sorting configuration rules based on the data information entered in the interface, the system can flexibly configure data sorting rules suitable for different application scenarios, improve the flexibility of system data sorting configuration, and provide a configuration basis for efficiently sorting data that is suitable for different application scenarios.
[0113] In one embodiment, taking the query of relevant material information in a document as an example, before querying the material data in the inventory, the query configuration rules can be designed in the inventory query configuration interface (i.e., the query configuration interface). Specifically, this can be done as follows: Figure 4 As shown, users can enter the identifier information in the basic information column of the query configuration interface to specify which document and which entry module's data the query rules are for; among them, Figure 4 In the basic information section, the "Document" box allows you to enter a document identifier; the "Document Body Identifier" box allows you to enter a document entry identifier; the "Document Body Name" box allows you to enter the name of the document entry; and the "Operation Code" box allows you to enter a local configuration identifier. The local configuration identifier corresponds to the query configuration rule button in the actual query interface, as shown in the example below. Figure 9 As shown, Figure 9This is a partial framework diagram of a document. A single document can be divided into different entry entries. These different entries may contain different data and may be related to different business data within the document. Multiple different query configuration rules can be set for the same entry. The specific query configuration rule used is determined by the local configuration identifier. Then, based on... Figure 4 The description is as follows: In the query configuration interface, configuration fields can be added to the inventory query field mapping according to application scenario requirements. The query condition configuration type for the added configuration fields can be determined based on the application scenario requirements. The query condition configuration type can be set to one or more of the following: "Query Condition (i.e., regular query condition)," "Required Query Condition (i.e., document field required validation)," and "Priority Query Condition (priority outbound)." "Query Condition" and "Priority Query Condition" are mutually exclusive; they cannot be set to both simultaneously. During the query process, the regular query condition must be met, while the priority query condition prioritizes data that meets the priority query condition. After entering the relevant configuration information and clicking the selection button in the query configuration interface, the terminal can obtain the entered information and respond to the corresponding click operation, confirm the configuration information, and generate custom query configuration rules based on the configuration information. In other words, the terminal obtains the target document module identifier and the corresponding target local configuration identifier entered in the query configuration interface. It then adds virtual buttons to the configuration fields in the query configuration interface, determines the configuration fields corresponding to the target document module identifier, and responds to the query condition configuration virtual buttons in the query configuration interface to determine the query condition configuration type corresponding to the configuration fields. Based on the target document module identifier, the corresponding target local configuration identifier, the corresponding configuration fields, and the corresponding query condition configuration types, it generates a custom query configuration rule corresponding to the target document module identifier. This custom query configuration rule is then stored as a candidate query configuration rule. Storage can be done in the page cache or sent to the server, which stores the candidate query configuration rules in the database. Specifically, the configuration storage can utilize the development platform's basic data first-level cache and the application's internal second-level cache.
[0114] Furthermore, before performing a query, you can also set the sorting rules for the retrieved data in the sorting configuration interface. Figure 5 The following description uses the material picking and warehousing sorting rule configuration interface as an example. Figure 5 The basic information column is mainly used to input sorting configuration rule identification information (including...) Figure 5 The encoding and name in the configuration file) and the usage status of the currently configured sorting rules can be added. Figure 5Add sorting fields to the sorting rules section. For each sorting field, set the corresponding sorting method, null value return rule (i.e., null value handling rule), and data matching rule (i.e., whether to return all queried data). The sorting fields, sorting methods, null value return rules, and matching rules can all be selected via clicks. After entering relevant information and making selections in the sorting configuration interface, the terminal can obtain the sorting configuration rule identifier entered in the sorting configuration interface. It can also respond to the sorting field click operation in the sorting configuration interface by adding virtual buttons to confirm the sorting field corresponding to the sorting configuration rule identifier, and respond to the sorting method click operation in the sorting configuration interface to confirm the target sorting field. The sorting method responds to the click operation of the null value handling rule in the sorting configuration interface, determines the target null value handling rule corresponding to the sorting field, responds to the virtual button for selecting the data matching rule in the sorting configuration interface, determines the target data matching rule corresponding to the sorting field, and generates a custom sorting configuration rule based on the sorting configuration rule identifier, the sorting field corresponding to the sorting configuration rule identifier, the target sorting method corresponding to the sorting field, the target null value handling rule, and the target data matching rule. The custom sorting configuration rule is stored as a candidate sorting configuration rule, which can be stored in the page cache or stored in the database through the server. When storing, it can also specifically use the basic data first-level cache of the development platform and the second-level cache within the application.
[0115] Furthermore, when users perform data queries, they can enter the required field information in the document entry corresponding to the target document, and click the virtual button to select the query configuration rule applicable to the current application scenario to generate a query request. The server can receive the query request sent by the user terminal and determine the target document module identifier, the target local configuration identifier corresponding to the target document module identifier (that is, the identifier that determines which specific query configuration rule the virtual button was clicked), and the query basis field information corresponding to the target document module identifier from the query request. Based on the target document module identifier and the target local configuration identifier, the target query configuration rule can be determined, and it is judged whether the fields in the query basis field information that are the same as the fields configured with mandatory query conditions in the target query configuration rule already have values. If not, a prompt window will pop up. After re-entering the values of the fields corresponding to the mandatory query conditions in the query interface, the query request will be regenerated to obtain the updated query basis field information; then, based on the target... The document module identifier and target local configuration identifier are used to determine the target query configuration rule from the candidate query configuration rules. Based on the query basis field information and the target query configuration rule, an initial query data information set is determined. The candidate query configuration rules include system-preset query configuration rules and custom query configuration rules. Before returning the query results, the target sorting configuration rule can be determined from the candidate sorting configuration rules based on the association between the local information identifier to be queried and the sorting configuration rule identifier. Based on the target sorting configuration rule, the data in the initial query data information set is sorted, and it is determined whether to use all sorted data information as the target query data information corresponding to the query request, or only to extract the data information of the target query quantity in the query request from the sorted data information as the target query data information. The target query data information is then sent to the user terminal for display. The displayed data information is also presented in a sorted form, which helps users quickly read the data information they need to understand first.
[0116] In more detail, the process of executing operations related to query configuration rules and sorting configuration rules can be described as follows: Figure 6 As shown, when performing a query, you can first determine whether the document has enabled query configuration rules (i.e., Figure 6 The inventory query configuration and whether sorting rules are set (i.e., ...) Figure 6 The outbound rules in the query configuration rules are then used to determine the mandatory query conditions (i.e., ...) Figure 6The system checks the fields configured with mandatory query conditions (i.e., fields that are empty) before executing the query. If no data is entered for a field with mandatory query conditions, a prompt window appears on the terminal. After the data for the mandatory query condition field is re-entered, the re-entered data is sent to the server again as the query basis field information. Then, based on the target query configuration rules, it determines which fields belong to the priority query fields corresponding to the priority query conditions and which fields belong to the regular query fields corresponding to the regular query conditions. Finally, it retrieves the target priority query condition information (i.e., the target priority query condition information corresponding to the priority query fields) from the query basis field information. Figure 6 The priority matching query conditions in the query, and the information on the target regular query conditions corresponding to the regular query fields (i.e., Figure 6 The query process involves several steps: first, retrieving a first query dataset from a database or other data source that simultaneously satisfies both the target's regular query conditions and the target's preferred query conditions; and second, retrieving a second query dataset that satisfies the target's regular query conditions. These two datasets are then linked and merged to obtain an initial query data set. In this initial set, data satisfying the target's preferred query conditions is prioritized over data not satisfying them. More specifically, both the target's regular and preferred query conditions are translated into corresponding SQL statements during the query process, as detailed below. Figure 7 As shown, Figure 7 The fixed matching result set is the second query dataset, and the priority matching result set is the first query dataset. Figure 7 In the "Priority Outbound" setting, the priority query condition is used, and the "Outbound Rules" configuration sorting is based on the target sorting configuration rules.
[0117] Furthermore, to meet the data sorting requirements of application scenarios, the data in the initial query data set can be further sorted according to the processing order of the sorting fields in the target sorting configuration rules, the target null value handling rules corresponding to each sorting field, and the target sorting method. In addition, the system's default sorting method can be used during sorting, which can be based on the IDs of each row of data in the queried data table, thus obtaining a sorted target query data set. Before returning the queried data to the terminal, it can be checked whether there are sorting fields in the target sorting configuration rules that are set to an overall matching rule. If the target data matching rule is set to an overall matching rule, all data in the target query data set with fields set to an overall matching rule are returned to the terminal as a whole. If no overall matching rule is set, the target query data is retrieved sequentially from the target query data set according to the target query quantity requested in the query request, and the retrieved target query data is returned to the terminal for display. This allows for flexible configuration and use of query and sorting configuration rules, significantly improving the efficiency of querying data required for different application scenarios.
[0118] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0119] Based on the same inventive concept, this application also provides a data query apparatus and a data configuration apparatus for implementing the data query method and data configuration method described above. The solutions provided by the data query apparatus and data configuration apparatus are similar to those described in the data query method and data configuration method above. Therefore, the specific limitations in one or more embodiments of the data query apparatus and data configuration apparatus provided below can be found in the limitations of the data query method and data configuration method described above, and will not be repeated here.
[0120] In one embodiment, such as Figure 10As shown, a data query device is provided, including: a receiving module 1000, a query module 1002, a sorting module 1004, and a sending module 1006, wherein:
[0121] The receiving module 1000 is used to receive a query request sent by a user terminal, and determine the target document module identifier, the target local configuration identifier corresponding to the target document module identifier, and the query basis field information corresponding to the target document module identifier from the query request; the query basis field information includes the identifier of the local information to be queried.
[0122] The query module 1002 is used to determine the target query configuration rule from the candidate query configuration rules based on the target document module identifier and the target local configuration identifier, and to determine the initial query data information set based on the query basis field information and the target query configuration rule.
[0123] The sorting module 1004 is used to determine the target sorting configuration rule from the candidate sorting configuration rules based on the association between the identifier of the local information to be queried and the identifier of the sorting configuration rule, and to process the data in the initial query data information set based on the target sorting configuration rule to obtain the target query data information corresponding to the query request.
[0124] The sending module 1006 is used to send the target query data information to the user terminal for display.
[0125] In one embodiment, the query module 1002 is further configured to: ...
[0126] In one embodiment, the sorting module 1004 is further configured to: use the initial query data information set as the current data information set to be sorted; determine the current sorting field sequentially from the sorting fields in the target sorting configuration rule based on the processing priority of each sorting field in the target sorting configuration rule; process the current data information set to be sorted based on the target null value handling rule and the target sorting method corresponding to the current sorting field to obtain the current sorted data information set; use the current sorted data information set as the current data information set to be sorted, and use the backward sorting field corresponding to the current sorting field as the current sorting field; return to the steps of processing the current data information set based on the target null value handling rule and the target sorting method corresponding to the current sorting field, until the operation corresponding to the target sorting configuration rule is completed, and use the current sorted data information set corresponding to the last current sorting field as the target query data information set; and obtain the target query data information corresponding to the query request from the target query data information set.
[0127] In one embodiment, the sorting module 1004 is further configured to: if the target null value handling rule is a priority handling rule, set the value of the current sorting field that belongs to null values in the current data information set to be sorted to the maximum value corresponding to the current sorting field, thereby obtaining the current updated sorted data information set; if the target null value handling rule is a last handling rule, set the value of the current sorting field that belongs to null values in the current data information set to the minimum value corresponding to the current sorting field, thereby obtaining the current updated sorted data information set; if the target sorting method is a custom sorting, sort the data in the current updated sorted data information set based on the sorting table corresponding to the target sorting method, thereby obtaining the current sorted data information set. Custom sorting refers to the sorting rule set for sorting data information related to the same field.
[0128] In one embodiment, the sorting module 1004 is further configured to: if the target data matching rule corresponding to the sorting field in the target sorting configuration rule is an overall match, then use the data information in the target query data information set as the target query data information corresponding to the query request; if the target data matching rule corresponding to the sorting field in the target sorting configuration rule is not an overall match, then obtain the target query quantity data information from the target query data information set based on the sorting order of the data in the target query data information set, and use it as the target query data information corresponding to the query request.
[0129] In one embodiment, such as Figure 11 As shown, a data configuration device is provided, including: an acquisition module 1100, a determination module 1102, a generation module 1104, and a storage module 1106, wherein:
[0130] The acquisition module 1100 is used to acquire the target document module identifier and the target local configuration identifier corresponding to the target document module identifier entered in the query configuration interface.
[0131] The determination module 1102 is used to respond to the addition of virtual buttons to configuration fields in the query configuration interface, determine the configuration field corresponding to the target document module identifier, respond to the query condition configuration virtual buttons in the query configuration interface, and determine the query condition configuration type corresponding to the configuration field.
[0132] The generation module 1104 is used to generate custom query configuration rules corresponding to the target document module identifier based on the target document module identifier, the target local configuration identifier corresponding to the target document module identifier, the configuration field corresponding to the target document module identifier, and the query condition configuration type corresponding to the configuration field.
[0133] The storage module 1106 is used to store custom query configuration rules as candidate query configuration rules and send the candidate query configuration rules to the server for storage.
[0134] In one embodiment, the data configuration device further includes an additional configuration module 1108, which is used to: obtain the sorting configuration rule identifier entered in the sorting configuration interface; respond to the addition of a virtual button to the sorting field in the sorting configuration interface to determine the sorting field corresponding to the sorting configuration rule identifier; respond to the sorting method click operation in the sorting configuration interface to determine the target sorting method corresponding to the sorting field; respond to the null value handling rule click operation in the sorting configuration interface to determine the target null value handling rule corresponding to the sorting field; respond to the data matching rule selection virtual button in the sorting configuration interface to determine the target data matching rule corresponding to the sorting field; generate a custom sorting configuration rule based on the sorting configuration rule identifier, the sorting field corresponding to the sorting configuration rule identifier, the target sorting method corresponding to the sorting field, the target null value handling rule, and the target data matching rule; obtain the local information identifier to be queried and the sorting configuration rule identifier entered in the sorting rule matching interface, and construct the association relationship between the local information identifier to be queried and the sorting configuration rule identifier; use the custom sorting configuration rule as a candidate sorting configuration rule, and send the association relationship and the candidate sorting configuration rule to the server for storage.
[0135] Each module in the aforementioned data query device and data configuration device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device in hardware form, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.
[0136] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 12 As shown, this computer device includes a processor, memory, input / output interfaces (I / O), and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores data related to the execution process. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communicating with external terminals via a network connection. When executed by the processor, the computer program implements a data query and data configuration method.
[0137] In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 13 As shown, the computer device includes a processor, memory, input / output interface, communication interface, display unit, and input device. The processor, memory, and input / output interface are connected via a system bus, and the communication interface, display unit, and input device are also connected to the system bus via the input / output interface. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The input / output interface is used for exchanging information between the processor and external devices. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, NFC (Near Field Communication), or other technologies. When the computer program is executed by the processor, it implements a data query and data configuration method. The display unit is used to form a visually visible image and can be a display screen, a projection device, or a virtual reality imaging device. The display screen can be an LCD screen or an e-ink screen. The input device of the computer device can be a touch layer covering the display screen, or buttons, trackballs, or touchpads set on the casing of the computer device, or external keyboards, touchpads, or mice, etc.
[0138] Those skilled in the art will understand that Figure 12 or Figure 13The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0139] In one embodiment, a computer device is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above method embodiments.
[0140] In one embodiment, a computer-readable storage medium is provided storing a computer program that, when executed by a processor, implements the steps in the above method embodiments.
[0141] In one embodiment, a computer program product or computer program is provided, the computer program product or computer program including computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and executes the computer instructions, causing the computer device to perform the steps in the above method embodiments.
[0142] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data shall comply with the relevant laws, regulations and standards of the relevant countries and regions.
[0143] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.
[0144] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0145] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A data query method, characterized in that, Applied to a server, the method includes: The system receives a query request from a user terminal and determines from the query request a target document module identifier, a target local configuration identifier corresponding to the target document module identifier, and query basis field information corresponding to the target document module identifier. The query basis field information includes a local information identifier to be queried. The target document module identifier is an identifier used to identify documents and document entries. The target local configuration identifier is a virtual button identifier used to respond to the query configuration used by document entries in the document. The local information identifier to be queried is an identifier used to identify the object to be queried corresponding to the data information being queried. Based on the target document module identifier and the target local configuration identifier, a target query configuration rule is determined from the candidate query configuration rules. Based on the query basis field information and the target query configuration rule, an initial query data information set is determined. The target query configuration rule includes query condition configuration types corresponding to configuration fields. The query condition configuration types include priority query conditions and regular query conditions. The query basis field information includes configuration fields in the target query configuration rule. The process of determining the initial query data information set includes: Based on the query condition configuration type corresponding to the configured fields in the target query configuration rule, the fields belonging to the priority query conditions in the query basis field information are taken as priority query fields, and the target priority query condition information corresponding to the priority query fields is obtained from the query basis field information; and, Fields that belong to the regular query conditions are used as regular query fields, and the target regular query condition information corresponding to the regular query fields is obtained from the query basis field information; Obtain a first query dataset that simultaneously satisfies the target regular query condition information and the target priority query condition information; obtain a second query dataset that satisfies the target regular query condition information. The first query dataset and the second query dataset are associated and merged to obtain the initial query data information set; the initial query data information set has a higher sorting priority for data that meets the target priority query condition information than for data that does not meet the target priority query condition information. Based on the association between the local information identifier to be queried and the sorting configuration rule identifier, the target sorting configuration rule is determined from the candidate sorting configuration rules, and the data in the initial query data information set is processed based on the target sorting configuration rule to obtain the target query data information corresponding to the query request; The target query data information is sent to the user terminal for display.
2. The method according to claim 1, characterized in that, The process of processing the data in the initial query data set based on the target sorting configuration rule to obtain the target query data information corresponding to the query request includes: The initial query data set is used as the current data set to be sorted. Based on the processing priority of each sorting field in the target sorting configuration rule, the current sorting field is determined sequentially from the sorting fields in the target sorting configuration rule. Based on the target null value handling rules and target sorting method corresponding to the current sorting field, the current data information set to be sorted is processed to obtain the current sorted data information set; The current sorted data information set is used as the current unsorted data information set, and the backward sorting field corresponding to the current sorting field is used as the current sorting field; Returning to the steps of processing the current data information set to be sorted based on the target null value processing rule and target sorting method corresponding to the current sorting field, until the operation corresponding to the target sorting configuration rule is completed, and the current sorted data information set corresponding to the last current sorting field is used as the target query data information set; Obtain the target query data information corresponding to the query request from the target query data information set.
3. The method according to claim 2, characterized in that, The process of processing the current unsorted data set based on the target null value processing rule and target sorting method corresponding to the current sorting field to obtain the current sorted data set includes: If the target null value processing rule is a priority processing rule, then in the current unsorted data information set, the value of the current sorting field that belongs to null values is set to the maximum value corresponding to the current sorting field, and the current updated sorted data information set is obtained; If the target null value processing rule is the last processing rule, then in the current unsorted data information set, the value of the current sorting field that belongs to null values is set to the minimum value corresponding to the current sorting field, and the current updated sorted data information set is obtained. If the target sorting method is a custom sorting, then based on the sorting table corresponding to the target sorting method, the data in the current updated sorting data information set is sorted to obtain the current sorting data information set. The custom sorting refers to the sorting rules set for sorting data information related to the same field.
4. The method according to claim 2, characterized in that, The query criteria field information includes the target query quantity; obtaining the target query data information corresponding to the query request from the target query data information set includes: If the target data matching rule corresponding to the sorting field in the target sorting configuration rule is an overall match, then the data information in the target query data information set will be used as the target query data information corresponding to the query request. If the target data matching rule corresponding to the sorting field in the target sorting configuration rule is not a complete match, then based on the sorting order of the data in the target query data information set, the data information of the target query quantity is obtained from the target query data information set and used as the target query data information corresponding to the query request.
5. A data configuration method, characterized in that, Applied to a terminal, the method includes: Obtain the target document module identifier and the target local configuration identifier corresponding to the target document module identifier entered in the query configuration interface; In response to the addition of virtual buttons to the configuration fields in the query configuration interface, the configuration field corresponding to the target document module identifier is determined; in response to the query condition configuration virtual buttons in the query configuration interface, the query condition configuration type corresponding to the configuration field is determined. Based on the target document module identifier, the target local configuration identifier corresponding to the target document module identifier, the configuration field corresponding to the target document module identifier, and the query condition configuration type corresponding to the configuration field, a custom query configuration rule corresponding to the target document module identifier is generated; the target document module identifier refers to the identifier used to identify the document and the document entry; the target local configuration identifier refers to the virtual button identifier used to respond to the query configuration adopted by the document entry in the document; The custom query configuration rule is used as a candidate query configuration rule, and the candidate query configuration rule is sent to the server for storage. The method further includes: Obtain the sorting configuration rule identifier entered in the sorting configuration interface, respond to the addition of virtual buttons to the sorting field in the sorting configuration interface, and determine the sorting field corresponding to the sorting configuration rule identifier; In response to the sorting method click operation in the sorting configuration interface, the target sorting method corresponding to the sorting field is determined; in response to the null value handling rule click operation in the sorting configuration interface, the target null value handling rule corresponding to the sorting field is determined; in response to the data matching rule selection virtual button in the sorting configuration interface, the target data matching rule corresponding to the sorting field is determined. Based on the sorting configuration rule identifier, the sorting field corresponding to the sorting configuration rule identifier, the target sorting method corresponding to the sorting field, the target null value handling rule, and the target data matching rule, a custom sorting configuration rule is generated. Obtain the local information identifier to be queried and the sorting configuration rule identifier entered in the sorting rule matching interface, and construct the association relationship between the local information identifier to be queried and the sorting configuration rule identifier; the local information identifier to be queried refers to the identifier used to identify the query object corresponding to the data information being queried. The custom sorting configuration rule is used as a candidate sorting configuration rule, and the association relationship and the candidate sorting configuration rule are sent to the server for storage.
6. A data query device, characterized in that, The device includes: The receiving module is used to receive a query request sent by a user terminal, and determine from the query request a target document module identifier, a target local configuration identifier corresponding to the target document module identifier, and query basis field information corresponding to the target document module identifier; the query basis field information includes a local information identifier to be queried; the target document module identifier is an identifier used to identify documents and document entries; the target local configuration identifier is a virtual button identifier used to respond to the query configuration used by document entries in the document; the local information identifier to be queried is an identifier used to identify the object to be queried corresponding to the data information being queried; The query module is used to determine a target query configuration rule from candidate query configuration rules based on the target document module identifier and the target local configuration identifier, and to determine an initial query data information set based on the query basis field information and the target query configuration rule. The target query configuration rule includes query condition configuration types corresponding to configuration fields; the query condition configuration types include priority query conditions and regular query conditions; the query basis field information includes configuration fields in the target query configuration rule; and the process of determining the initial query data information set includes: Based on the query condition configuration type corresponding to the configured fields in the target query configuration rule, the fields belonging to the priority query conditions in the query basis field information are taken as priority query fields, and the target priority query condition information corresponding to the priority query fields is obtained from the query basis field information; and, Fields that belong to the regular query conditions are used as regular query fields, and the target regular query condition information corresponding to the regular query fields is obtained from the query basis field information; Obtain a first query dataset that simultaneously satisfies the target regular query condition information and the target priority query condition information; obtain a second query dataset that satisfies the target regular query condition information. The first query dataset and the second query dataset are associated and merged to obtain the initial query data information set; the initial query data information set has a higher sorting priority for data that meets the target priority query condition information than for data that does not meet the target priority query condition information. The sorting module is used to determine the target sorting configuration rule from the candidate sorting configuration rules based on the association between the identifier of the local information to be queried and the identifier of the sorting configuration rule, and to process the data in the initial query data information set based on the target sorting configuration rule to obtain the target query data information corresponding to the query request. The sending module is used to send the target query data information to the user terminal for display.
7. A data configuration device, characterized in that, The device includes: The acquisition module is used to acquire the target document module identifier and the target local configuration identifier corresponding to the target document module identifier entered in the query configuration interface. The determination module is used to respond to the addition of virtual buttons to configuration fields in the query configuration interface, determine the configuration field corresponding to the target document module identifier, respond to the query condition configuration virtual buttons in the query configuration interface, and determine the query condition configuration type corresponding to the configuration field. The generation module is used to generate a custom query configuration rule corresponding to the target document module identifier based on the target document module identifier, the target local configuration identifier corresponding to the target document module identifier, the configuration field corresponding to the target document module identifier, and the query condition configuration type corresponding to the configuration field; the target document module identifier refers to the identifier used to identify the document and the document entry; the target local configuration identifier refers to the virtual key identifier used to respond to the query configuration adopted by the document entry in the document; The storage module is used to use the custom query configuration rules as candidate query configuration rules and send the candidate query configuration rules to the server for storage; The acquisition module is also used to acquire the sorting configuration rule identifier entered in the sorting configuration interface, respond to the addition of virtual buttons to the sorting field in the sorting configuration interface, and determine the sorting field corresponding to the sorting configuration rule identifier. The determining module is also used to respond to the sorting method click operation in the sorting configuration interface to determine the target sorting method corresponding to the sorting field, respond to the null value handling rule click operation in the sorting configuration interface to determine the target null value handling rule corresponding to the sorting field, and respond to the data matching rule selection virtual button in the sorting configuration interface to determine the target data matching rule corresponding to the sorting field. The generation module is also used to generate a custom sorting configuration rule based on the sorting configuration rule identifier, the sorting field corresponding to the sorting configuration rule identifier, the target sorting method corresponding to the sorting field, the target null value handling rule, and the target data matching rule; The acquisition module is further configured to acquire the local information identifier to be queried and the sorting configuration rule identifier entered in the sorting rule matching interface, and to construct the association between the local information identifier to be queried and the sorting configuration rule identifier; the local information identifier to be queried refers to the identifier used to identify the object to be queried corresponding to the data information being queried; The storage module is used to use the custom sorting configuration rule as a candidate sorting configuration rule, and to send the association relationship and the candidate sorting configuration rule to the server for storage.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 5.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Data sorting method and device, electronic medium and storage medium
CN112527847A
Data integration and processing method and device
WO2016206377A1