Data processing methods, apparatus, equipment, and media based on cascade selectors
By sending query requests to multiple data sources and combining lazy loading, the problem of cascading selectors being unable to perform full queries under large data volumes and multi-level structures is solved, achieving efficient and flexible data display and improved user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- INDUSTRIAL AND COMMERCIAL BANK OF CHINA
- Filing Date
- 2023-03-29
- Publication Date
- 2026-06-30
AI Technical Summary
When dealing with large amounts of data and multi-level structures, existing cascading selectors cannot support full data queries due to lazy loading, which can cause page lag or crashes. Furthermore, preloading full data can lead to resource waste and a poor user experience.
By sending query requests to N data sources, the system retrieves and displays all data. Combined with lazy loading of data sources, it achieves full data query and display. The query method is inherited and overridden to enhance functionality and supports data processing with cascading relationships.
It enables efficient display of full data in cascading selectors, avoiding page lag and resource waste, and improving user interactivity and data query flexibility.
Smart Images

Figure CN116304373B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the financial sector, and more specifically, to a data processing method, apparatus, device, medium, and program product based on a cascade selector. Background Technology
[0002] A cascading selector is a type of control component that can be used as a cascading form in visual applications. It is suitable for data collections with a clear hierarchical structure, allowing users to view and select data level by level. Cascading selectors are useful for front-end page development when the options have a one-to-many relationship and exhibit hierarchy and cascading interaction.
[0003] Currently, most cascading selectors for querying work by iterating through already loaded data, displaying only those that meet the criteria for user selection. When dealing with large amounts of data with multiple cascading levels, lazy loading may be used to improve page performance, but this doesn't support querying the entire dataset. Users then have to manually search through each level, which is inflexible, user-unfriendly, and lacks usability.
[0004] If full data queries are required, the entire dataset needs to be preloaded. If the data volume is too large, it can cause page lag or even crashes. Furthermore, users typically only use a small portion of the data, so loading the entire dataset at once would waste resources. Summary of the Invention
[0005] In view of the above problems, this disclosure provides data processing methods, apparatus, devices, media and program products based on cascade selectors.
[0006] One aspect of this disclosure provides a data processing method based on a cascading selector, comprising: obtaining data to be processed from a user; invoking a query method according to the data to be processed to send query requests to N data sources, wherein the N data sources include full data with a cascading relationship and lazy-loaded data sources independent of the cascading selector, and N is greater than or equal to 1; obtaining a first query result returned by the N data sources in response to the query request; and displaying the first query result on the query result interface of the cascading selector.
[0007] According to embodiments of this disclosure, before invoking the query method based on the data to be processed, the method further includes: providing the cascading selector inherited from the original cascading selector in the component library; and, based on the inheritance, rewriting the query method to allow sending the query request to the N data sources.
[0008] According to an embodiment of this disclosure, after obtaining the data to be processed from the user, the method further includes: querying the lazy-loaded data source based on the data to be processed to obtain a second query result; and displaying the second query result on the query result interface.
[0009] According to an embodiment of this disclosure, displaying the first query result in the query result interface of the cascading selector includes: displaying the first query result in a first area of the query result page; and displaying the second query result in a second area of the query result page.
[0010] According to an embodiment of this disclosure, displaying the second query result on the query result interface includes: determining the cascading relationship between the query data in the first query result and the query data in the second query result; and displaying the query data in a mixed manner on the query result interface according to the cascading relationship between the query data.
[0011] According to an embodiment of this disclosure, obtaining the first query result returned by the N data sources in response to the query request includes: determining the first query data in the first query result; and obtaining the second query data that is not repeated with the first query data and matches the data to be processed as the first query result.
[0012] According to an embodiment of this disclosure, displaying the first query result in the cascading selection query result interface includes: traversing each element in the first query result, setting the element value attribute, tag attribute, and text attribute of each element; and displaying the first query result in the query result interface according to the element value attribute, tag attribute, and text attribute of each element.
[0013] According to an embodiment of this disclosure, displaying the first query result on the query result interface includes: when at least one element in the first query result is selected by the user, setting the at least one element to a selected state, and / or providing a data processing method for the selected state; and displaying the first query result according to the selected state and / or the data processing method.
[0014] According to embodiments of this disclosure, obtaining the data to be processed from the user includes: obtaining the user's first selected data in the cascading selector; or obtaining the user's input data in the search box of the cascading selector.
[0015] According to an embodiment of this disclosure, after obtaining the data to be processed from the user, displaying the first query result on the query result interface of the cascading selector includes echoing data, specifically including: determining the second selected data of the user in the cascading selector, wherein the second selected data is the same as or different from the first selected data; obtaining a first feature flag of the node corresponding to the second selected data, and M second feature flags belonging to the same cascading path as the first feature flag, wherein M is greater than or equal to 1; loading the associated data of the first feature flag and the M second feature flags according to the first query result; and after loading the associated data, setting the selection state of the node corresponding to the second selected data.
[0016] According to an embodiment of this disclosure, the M nodes corresponding to the M second feature markers are all upper-level nodes of the node corresponding to the first feature marker. Loading the associated data includes: setting the highest-level node among the M nodes as the current node; loading the child nodes under each of the M nodes layer by layer from the current node until the node corresponding to the first feature marker is loaded.
[0017] Another aspect of this disclosure provides a data processing apparatus based on a cascading selector, comprising: a data module for obtaining data to be processed from a user; a calling module for calling a query method according to the data to be processed and sending query requests to N data sources, wherein the N data sources include full data with a cascading relationship and are lazy-loaded data sources independent of the cascading selector, and N is greater than or equal to 1; a result module for obtaining a first query result returned by the N data sources in response to the query request; and a display module for displaying the first query result on the query result interface of the cascading selector.
[0018] Another aspect of this disclosure provides an electronic device, including: one or more processors; and a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors perform the method as described above.
[0019] Another aspect of this disclosure provides a computer-readable storage medium having executable instructions stored thereon, which, when executed by a processor, cause the processor to perform the method described above.
[0020] Another aspect of this disclosure provides a computer program product, including a computer program that, when executed by a processor, implements the method described above.
[0021] The above one or more embodiments have the following beneficial effects: They provide a query method that can send query requests to N data sources based on the user's data to be processed, rather than only querying lazy-loaded data sources. Therefore, the first query result can be obtained and displayed in the full data, overcoming the problems of related technologies where lazy loading cannot support full data query, and loading the full data may lead to page lag or even crash, as well as wasted resources. Attached Figure Description
[0022] The foregoing contents, as well as other objects, features, and advantages of this disclosure, will become clearer from the following description of embodiments with reference to the accompanying drawings, in which:
[0023] Figure 1 This diagram illustrates an application scenario of the data processing method based on a cascade selector according to an embodiment of the present disclosure.
[0024] Figure 2 A flowchart illustrating a data processing method based on a cascade selector according to an embodiment of the present disclosure is shown schematically.
[0025] Figure 3 A flowchart illustrating the inheritance and rewrite query method according to an embodiment of this disclosure is shown schematically;
[0026] Figure 4 A flowchart illustrating a query for a lazy-loaded data source according to an embodiment of this disclosure is shown schematically;
[0027] Figure 5 An example diagram of a query results interface according to an embodiment of the present disclosure is shown schematically;
[0028] Figure 6 A flowchart illustrating a hybrid display according to an embodiment of the present disclosure is shown schematically;
[0029] Figure 7 A flowchart illustrating the process of obtaining a first query result according to an embodiment of the present disclosure is shown schematically;
[0030] Figure 8 This schematically illustrates a flowchart of processing and assembling a first query result according to an embodiment of the present disclosure;
[0031] Figure 9 A flowchart illustrating echo data according to an embodiment of the present disclosure is shown schematically;
[0032] Figure 10 A schematic diagram illustrating a dataset architecture with cascading relationships according to an embodiment of the present disclosure is provided.
[0033] Figure 11 A flowchart illustrating echo data according to other embodiments of this disclosure is shown schematically;
[0034] Figure 12 A schematic block diagram of a data processing apparatus based on a cascade selector according to an embodiment of the present disclosure is shown; and
[0035] Figure 13 A block diagram schematically illustrates an electronic device suitable for implementing a cascade selector-based data processing method according to embodiments of the present disclosure. Detailed Implementation
[0036] The embodiments of the present disclosure will now be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the disclosure. In the following detailed description, numerous specific details are set forth to provide a thorough understanding of the embodiments of the present disclosure for ease of explanation. However, it will be apparent that one or more embodiments may be practiced without these specific details. Furthermore, descriptions of well-known structures and techniques are omitted in the following description to avoid unnecessarily obscuring the concepts of the present disclosure.
[0037] The terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit this disclosure. The terms “comprising,” “including,” etc., as used herein indicate the presence of features, steps, operations, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, or components.
[0038] All terms used herein (including technical and scientific terms) have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein are to be interpreted in a manner consistent with the context of this specification, and not in an idealized or overly rigid way.
[0039] When using expressions such as "at least one of A, B, and C", they should generally be interpreted in accordance with the meaning that is commonly understood by a person skilled in the art (e.g., "a system having at least one of A, B, and C" should include, but is not limited to, a system having A alone, a system having B alone, a system having C alone, a system having A and B, a system having A and C, a system having B and C, and / or a system having A, B, and C, etc.).
[0040] In related technologies, when the option information has a one-to-many relationship and exhibits hierarchy and synergy, such as the selection of departments or cities (provinces, cities, districts), the fuzzy search of current cascading selectors involves traversing the already loaded data and displaying the matching data for the user to choose from. If the cascading selector also supports lazy loading, whether cascading data is loaded depends on the user's actions; that is, the selector's currently available dataset is not the full set, resulting in incomplete search results. Similarly, when a cascading selector uses lazy loading to dynamically display data, it can only display data that has already been loaded; data that has not been loaded cannot be displayed. Preloading the entire dataset without lazy loading can lead to page lag or even crashes, as well as wasted resources.
[0041] This disclosure provides a data processing method based on a cascading selector, comprising: obtaining data to be processed from a user; invoking a query method according to the data to be processed, sending query requests to N data sources, wherein the N data sources include full data with cascading relationships and are lazy-loaded data sources independent of the cascading selector, and N is greater than or equal to 1; obtaining the first query results returned by the N data sources in response to the query requests; and displaying the first query results on the query result interface of the cascading selector.
[0042] According to embodiments of this disclosure, a query method is provided that can send query requests to N data sources based on the user's data to be processed, rather than only querying lazy-loaded data sources. Therefore, it can obtain and display the first query result of the full data, overcoming the problem that lazy loading in related technologies cannot support full data query, and loading the full data may cause page lag or even crash, resulting in wasted resources.
[0043] It should be noted that the data processing method and apparatus based on cascade selectors disclosed herein can be used in the financial field for front-end display related aspects, and can also be used in any field other than the financial field. The application fields of the data processing method and apparatus based on cascade selectors disclosed herein are not limited.
[0044] Figure 1 The illustration depicts an application scenario of a data processing method based on a cascade selector according to an embodiment of the present disclosure. However, the present disclosure is not limited thereto.
[0045] like Figure 1 As shown, application scenario 100 according to this embodiment may include terminal devices 101, 102, and 103, a network 104, and a server 105. Network 104 serves as a medium for providing a communication link between terminal devices 101, 102, and 103 and server 105. Network 104 may include various connection types, such as wired or wireless communication links, or fiber optic cables, etc.
[0046] Users can use terminal devices 101, 102, and 103 to interact with server 105 via network 104 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 101, 102, and 103, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social media platform software, etc. (for example only).
[0047] Terminal devices 101, 102, and 103 can be various electronic devices with displays and web browsing capabilities, including but not limited to smartphones, tablets, laptops, and desktop computers.
[0048] Server 105 can be a server that provides various services, such as a backend management server that supports websites browsed by users using terminal devices 101, 102, and 103 (for example only). The backend management server can analyze and process data such as received user requests, and feed back the processing results (such as web pages, information, or data obtained or generated according to user requests) to the terminal devices.
[0049] For example, the data processing method provided in this disclosure can generally be deployed on terminal devices 101, 102, and 103, and server 105 can provide a data source and process query requests to return query results. For example, the data processing apparatus provided in this disclosure can also be deployed on terminal devices 101, 102, and 103, and server 105 can provide a data source and process query requests to return query results.
[0050] It should be understood that Figure 1 The number of terminal devices, networks, and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and servers can be included.
[0051] The following will be based on Figure 1 The described scene, through Figures 2 to 11 The data processing method based on cascade selectors according to embodiments of this disclosure will be described in detail.
[0052] Figure 2 A flowchart illustrating a data processing method based on a cascade selector according to an embodiment of the present disclosure is shown.
[0053] like Figure 2 As shown, the data processing method based on the cascade selector in this embodiment includes operations S210 to S240.
[0054] In operation S210, pending data from the user is obtained.
[0055] In operation S220, the query method is invoked based on the data to be processed, and query requests are sent to N data sources. The N data sources include full data with cascading relationships and lazy-loaded data sources independent of the cascading selector, and N is greater than or equal to 1.
[0056] For example, a query method refers to a method implemented by a code function in a programming language (such as Java or Python), including an ordered combination of steps to solve a query problem, such as being contained in a class or object and created in a program. N data sources include software and / or hardware capable of storing data and returning results in response to query requests. This can be a combination of data from N data sources forming the full dataset, or each data source storing the full dataset; for example, data sources can include databases, servers, or cloud platforms. Cascading relationships include hierarchical data relationships. Lazy-loaded data sources include datasets cached based on lazy loading techniques. Lazy loading, also known as deferred loading or on-demand loading, refers to delaying the loading of images or data on long pages until the user needs to view or use them; it is a good way to optimize page performance.
[0057] By calling the query method, the system can query from N data sources, thus providing the ability to query the full dataset without preloading it. For example, this method can be configured with query interface APIs for multiple data sources. Calling these APIs allows for connection and query execution, and queries can include exact or fuzzy searches (this is just an example).
[0058] The Cascader selector, a Vue control component, can be used as a cascading form in visual applications. It is suitable for data collections with a clear hierarchical structure, allowing users to view and select data level by level. Vue is a progressive framework for building user interfaces, employing a bottom-up, incremental development design.
[0059] In operation S230, the first query result returned by N data sources in response to the query request is obtained.
[0060] For example, a database can respond to a query request by returning results that match the data to be processed in the query request.
[0061] In operation S240, the first query result is displayed in the query result interface of the cascade selector.
[0062] The query results interface can include one or more components from a cascading selector to display hierarchical data and support one or more user operations such as single selection, multiple selection, and dynamic loading. For example, it can include a cascading panel component, which can display multiple levels of data in the same panel, such as el-casecader in Vue+ElementUI.
[0063] According to embodiments of this disclosure, a query method is provided that can send query requests to N data sources based on the user's data to be processed, rather than only querying lazy-loaded data sources. Therefore, it can obtain and display the first query result in the full data, overcoming the problem that lazy loading in related technologies cannot support full data query, and loading the full data may cause page lag or even crash, resulting in wasted resources.
[0064] Figure 3 A flowchart illustrating the inheritance and rewrite query method according to an embodiment of this disclosure is shown schematically.
[0065] In some embodiments, before invoking the query method based on the data to be processed, the method further includes: providing a cascading selector that inherits from the original cascading selector in the component library. Based on this inheritance, the query method is overridden to allow query requests to be sent to N data sources.
[0066] Inheritance is a mechanism that allows subclasses to reuse the attributes and methods of their parent classes. Subclasses can inherit from their parent classes using keywords and can also implement multiple interfaces. Overriding is a mechanism that allows subclasses to modify the behavior of methods in their parent classes. Subclasses can override parent class methods using annotations. When an overridden method is called, the version corresponding to the object's class is executed, depending on the object's type.
[0067] For example, Vue's component library provides various UI elements and components, enabling the rapid construction of beautiful and functional Vue applications. Since the controls provided by the component library are pre-encapsulated, modifications to their internal methods can be made using inheritance and overriding. For instance, you can define a custom cascading selector suitable for your system, inheriting from the Cascader provided by the component library (operation S310), override query methods such as fuzzy search (operation S320), listen for user input (operation S330), and retrieve matching data in real-time based on the user's search terms (i.e., the data to be processed) (operation S340).
[0068] According to embodiments of this disclosure, the problem that cascading selector searches only support searching for already loaded data can be solved by inheriting and overriding the control's query method. Furthermore, by utilizing inheritance and overriding, the functionality can be further extended based on the original cascading selector, enhancing the readability and maintainability of the query method.
[0069] Figure 4 A flowchart illustrating a query for a lazy-loaded data source according to an embodiment of this disclosure is shown.
[0070] After receiving the data to be processed from the user, such as Figure 4 As shown, the query lazy loading data source in this embodiment includes operations S410 to S420.
[0071] In operation S410, a second query result is obtained by querying the lazy-loaded data source based on the data to be processed.
[0072] You can call the same query method as in operation S220, or you can use the original query method.
[0073] When operating S420, the second query result is displayed on the query result interface.
[0074] According to embodiments of this disclosure, it is possible to support querying full data while using lazy loading in cascading selectors.
[0075] Figure 5 An example diagram of a query results interface according to an embodiment of the present disclosure is shown schematically.
[0076] In some embodiments, displaying the first query result in the query result interface of the cascading selector includes: displaying the first query result in a first area of the query result page (such as the fuzzy matching data panel 530); and displaying the second query result in a second area of the query result page (such as the cascading panel 520). At least one of the first and second areas may provide single-selection, multi-selection, or dynamic loading functionality. The fuzzy matching data panel 530 and the cascading panel 520 may be implemented based on the same component or different components.
[0077] Reference Figure 5 The user enters the search term "branch" in the search box 510. The cascading panel 520 displays the already lazy-loaded data, as well as the data searched from the lazy-loaded data source, such as results containing "branch". The fuzzy matching data panel 530 displays the results returned from N data sources.
[0078] According to embodiments of this disclosure, not only can the query of the full data be supported while using lazy loading in the cascading selector, but multiple query results can also be displayed and selected by the user, thus improving interactivity.
[0079] In some embodiments, a first region or a second region can be displayed at a user-specified location in the window. The first region or the second region can be dragged to change the display position of each region in the window. The two regions can be as follows: Figure 5 The linked displays can also be shown as independent areas. After the user completes a selection or query operation, either area can be hidden, making it invisible and streamlining the window. Hiding any area only changes its display state; it does not delete the selection status of the data already selected by the user. This allows for comprehensive querying and display, while also providing personalized interactive functions. The separate interaction mode of the two areas ensures that they do not interfere with each other, allowing each area's display state to meet the user's needs.
[0080] Figure 6 A flowchart illustrating a hybrid display according to an embodiment of the present disclosure is shown schematically.
[0081] like Figure 6 As shown, the display of the second query result in this embodiment includes operations S610 to S620.
[0082] In operation S610, the cascading relationship between the query data in the first query result and the query data in the second query result is determined.
[0083] When operating the S620, the query results are displayed in a mixed manner based on the cascading relationships between the queried data.
[0084] Reference Figure 5 When searching for "branch," for example, the second search result might include data on branches in Administrative District A, while the first search result might include data on branches in Street B, which belongs to Administrative District A. A mixed display refers to showing the Street B branch below the Administrative District A branch (e.g., both displayed in a cascading panel, or a third area provided for display), making the cascading relationship clear to the user. This third area can also be hidden or moved.
[0085] Figure 7 A flowchart illustrating the process of obtaining a first query result according to an embodiment of the present disclosure is shown.
[0086] like Figure 7 As shown, obtaining the first query result in operation S230 includes operations S710 to S720.
[0087] In operation S710, the first query data in the first query result is determined.
[0088] In operation S720, second query data that is not duplicated with the first query data and matches the data to be processed is obtained as the first query result.
[0089] According to embodiments of this disclosure, since some query data already exists in the lazy-loaded data source, it is not necessary to obtain it repeatedly from other data sources, thus saving computer resources.
[0090] Figure 8 The flowchart illustrating the processing and assembly of the first query result according to an embodiment of the present disclosure is shown schematically.
[0091] In some embodiments, displaying the first query result in the cascading selection query result interface includes: traversing each element in the first query result, setting the element value attribute, tag attribute, and text attribute for each element. Based on the element value attribute, tag attribute, and text attribute of each element, the first query result is displayed in the query result interface. Each element includes one result that matches the data to be processed.
[0092] Reference Figure 8 Since the first query result obtained in operation S230 is only a dataset, it needs to be further processed and assembled before it can be injected into the query result interface to avoid affecting other functions. First, the elements are traversed, and the label (label attribute), value (element value attribute), and text (text attribute) are set as data objects for display (operation S810), that is, to control the content displayed in the query result interface, so that the data obtained from N data sources can be successfully displayed to the user.
[0093] In some embodiments, displaying the first query result on the query result interface includes: if at least one element in the first query result is selected by the user, setting at least one element to a selected state, and / or providing a data processing method for the selected state. The first query result is then displayed based on the selected state and / or the data processing method.
[0094] For example, it is determined whether there is already an element selected by the user in the first query result (operation S820), and its checked flag is set to true (operation S830), that is, it is set to the selected state. Then, a processing method for selection is provided (operation S840), such as the doCheck method and getValueByOption method for multiple selections. The processed and assembled result is injected into the query result interface (operation S850).
[0095] For example, the `doCheck` method checks whether a node is selected or partially selected in multi-select mode, updating the node's `checked` and `indeterminate` properties based on the state of its child and parent nodes. The `getValueByOption` method retrieves the corresponding value array based on the option array. It iterates through each option object and generates a value array based on the `value` or `label` property (if `value` does not exist). These two methods can be inherited and overridden from existing component methods to connect with the query method called in operation S220 to handle the same query results.
[0096] According to embodiments of this disclosure, based on the rewritten query method, the first query result obtained by the query method can be processed and assembled, and the selection status can be updated in real time in response to the user's selection. It can also be connected with the query method to provide a data processing method so that the cascading selector can provide a more complete display effect.
[0097] In some embodiments, obtaining the data to be processed from the user includes: obtaining the user's first selected data in the cascading selector; or obtaining the user's input data in the search box of the cascading selector. Therefore, when the cascading selector displays data, the display method can be used to assist in completing a full-data fuzzy search, or it can be used alone for dynamic data display in the cascading selector, unaffected by lazy loading. Displaying refers to showing the selected data in the cascading selector; for example, the selected data can be converted into an array or object format and matched with the option data.
[0098] Figure 9 A flowchart illustrating echo data according to an embodiment of the present disclosure is shown schematically. Figure 10 A schematic diagram illustrating a dataset architecture with cascading relationships according to an embodiment of the present disclosure is shown.
[0099] After obtaining the data to be processed from the user, the first query result is displayed in the query results interface of the cascading selector, including echo data, such as... Figure 9 As shown, the echo data in this embodiment includes operations S910 to S940.
[0100] In operation S910, the user determines the second selected data in the cascading selector, which may or may not be the same as the first selected data.
[0101] In some embodiments, the second selected data may be data that the user previously selected using the cascading selector. In other embodiments, the second selected data may be data that the user selected in the current cascading selector, i.e., the first selected data. In still other embodiments, the second selected data may be data that the user selected in the first query result.
[0102] In operation S920, the first feature marker of the node corresponding to the second selected data is obtained, as well as M second feature markers belonging to the same cascade path as the first feature marker, where M is greater than or equal to 1. The same cascade path includes hierarchical relationships from top to bottom, such as "head office - branch office - sub-branch office - outlet", and "outlet" is the second selected data.
[0103] In operation S930, the associated data of the first feature flag and M second feature flags are loaded based on the first query result.
[0104] Feature identifiers serve as unique identifiers for corresponding nodes. Associated data includes data displayed for the corresponding nodes and used to provide other functions. For example, loading the entire cascading path "Headquarters-Branch-Sub-branch-Outlet". Query parameters can be set in the query request to include associated data for all nodes along that cascading path in the first query result.
[0105] When operating S940, after loading the associated data, set the selection status of the node corresponding to the second selected data.
[0106] According to embodiments of this disclosure, the parent node of the second selected data can be loaded together. Since the entire cascading path is loaded, the second selected data can be successfully set to the selected state.
[0107] In some embodiments, the M nodes corresponding to the M second feature markers are all upper-level nodes of the node corresponding to the first feature marker. Loading associated data includes: setting the highest-level node among the M nodes as the current node; loading the child nodes under each of the M nodes layer by layer from the current node until the node corresponding to the first feature marker is loaded.
[0108] After a user selects a node, the selection result needs to be displayed. However, cascading selectors only support displaying data that has already been loaded. Therefore, this can be achieved by simulating lazy loading, loading all parent nodes of the data to be displayed layer by layer. For example, a hierarchical relationship like... Figure 10 As shown, the cascading selector configured with lazy loading only preloads the first level (head office). After the user performs a fuzzy search for and selects branch 3, all parent node data is loaded layer by layer according to the hierarchical path of branch 3 (head office - branch 1 - sub-branch 1 - branch 3). The following demonstrates... Figure 11 Further details.
[0109] Figure 11 A flowchart illustrating echo data according to other embodiments of this disclosure is shown.
[0110] In operation S1101, listen to the user's selection and obtain the characteristic flag of the user's selection (such as "site 3").
[0111] In operation S1102, obtain the characteristic flags of all parent nodes for which data needs to be displayed (such as "Headquarters-Branch 1-Sub-branch 1").
[0112] In operation S1103, set the highest-level node of the parent node (such as "Head Office") to the current node.
[0113] In operation S1104, determine whether the current node is a node that needs to be displayed. If the current node is a node that needs to be displayed, execute operation S1110; otherwise, execute operation S1105.
[0114] In operation S1105, determine whether the child nodes of the current node have been loaded. If they have been loaded, execute operation S1108; otherwise, execute operation S1106.
[0115] In operation S1106, load all child nodes and assemble them into the hierarchy panel (e.g., if the current hierarchy is "main row", load sub-row 1, sub-row 2, sub-row 3 and sub-row 4).
[0116] In operation S1107, all child nodes of the current node are traversed and matched to the next level node (such as "line 1").
[0117] In operation S1108, the successfully matched child node is set as the current node, and operations S1104 to S1108 are repeated.
[0118] In operation S1109, all nodes in the cascade path containing the data to be displayed have been loaded, and the data to be displayed is selected.
[0119] In other embodiments, unlike the layer-by-layer loading method, nodes at each level can be loaded at once, thereby improving the loading speed.
[0120] Based on the data processing methods provided in some embodiments of this disclosure, the overall approach is as follows: inherit and override the cascading selector fuzzy search method -> process and assemble the query results -> listen for user selections and display the data. Therefore, the problem that cascading selector fuzzy search only supports searching for already loaded data can be solved by inheriting and overriding the control's fuzzy search method. The problem that cascading selectors only support displaying already loaded data can be solved by loading all parent-level data that needs to be displayed.
[0121] Based on the above-described data processing method based on cascade selectors, this disclosure also provides a data processing apparatus based on cascade selectors. The following will be combined with... Figure 12 The device is described in detail.
[0122] Figure 12 A schematic block diagram of a data processing apparatus based on a cascade selector according to an embodiment of the present disclosure is shown.
[0123] like Figure 12 As shown, the data processing device 1200 based on the cascade selector in this embodiment includes a data module 1210, a calling module 1220, a result module 1230, and a display module 1240.
[0124] The data module 1210 can perform operation S210 to obtain pending data from the user.
[0125] The calling module 1220 can execute operation S220, which is used to call the query method based on the data to be processed and send query requests to N data sources. The N data sources include full data with cascading relationships and lazy-loaded data sources independent of the cascading selector, and N is greater than or equal to 1.
[0126] Result module 1230 can perform operation S230 to obtain the first query result returned by N data sources in response to the query request.
[0127] In some embodiments, the result module 1230 may also perform operations S710 to S720, which will not be described in detail here.
[0128] Display module 1240 can perform operation S240 to display the first query result in the query result interface of the cascading selector.
[0129] In some embodiments, after obtaining the data to be processed from the user, module 1220 is invoked to query the lazy-loaded data source based on the data to be processed, and obtain a second query result. Display module 1240 is further configured to display the second query result in the query result interface.
[0130] In some embodiments, the display module 1240 is further configured to display a first query result in a first area of the query results page, and a second query result in a second area of the query results page.
[0131] In some embodiments, the display module 1240 may also perform operations S610 to S620, which will not be described in detail here.
[0132] In some embodiments, the display module 1240 is further configured to traverse each element in the first query result and set the element value attribute, tag attribute, and text attribute for each element. Based on the element value attribute, tag attribute, and text attribute of each element, the first query result is displayed in the query result interface.
[0133] In some embodiments, the display module 1240 is further configured to, when at least one element in the first query result is selected by the user, set at least one element to a selected state, and / or provide a data processing method for the selected state. The first query result is then displayed based on the selected state and / or the data processing method.
[0134] In some embodiments, the data processing apparatus 1200 may further include an inheritance and rewriting module for providing a cascading selector inherited from the original cascading selector in the component library before invoking a query method based on the data to be processed. Based on inheritance, the query method is rewritten to allow sending query requests to N data sources.
[0135] In some embodiments, the display module 1240 may further include an echo module, which can perform operations S910 to S940, which will not be described in detail here. The echo module is also used to set the highest-level node among the M nodes as the current node. The child nodes under each of the M nodes are loaded layer by layer from the current node until the node corresponding to the first feature flag is loaded.
[0136] The data processing device 1200 includes components for performing the above-mentioned operations. Figures 2 to 11 The modules of each step in any of the described embodiments.
[0137] It should be noted that the implementation methods, technical problems solved, functions achieved, and technical effects of each module / unit / subunit in the device embodiments are the same as or similar to the implementation methods, technical problems solved, functions achieved, and technical effects of each corresponding step in the method embodiments, and will not be repeated here.
[0138] According to embodiments of this disclosure, any plurality of modules among the data module 1210, the calling module 1220, the result module 1230, and the display module 1240 may be combined into one module, or any one of these modules may be split into multiple modules. Alternatively, at least some of the functionality of one or more of these modules may be combined with at least some of the functionality of other modules and implemented in one module.
[0139] According to embodiments of this disclosure, at least one of the data module 1210, the calling module 1220, the result module 1230, and the display module 1240 can be at least partially implemented as hardware circuitry, such as a field-programmable gate array (FPGA), a programmable logic array (PLA), a system-on-a-chip, a system-on-a-substrate, a system-on-package, an application-specific integrated circuit (ASIC), or any other reasonable method of integrating or packaging circuitry, or implemented in software, hardware, or firmware, or in any suitable combination of any of these three methods. Alternatively, at least one of the data module 1210, the calling module 1220, the result module 1230, and the display module 1240 can be at least partially implemented as a computer program module, which, when run, can perform corresponding functions.
[0140] Figure 13 A block diagram schematically illustrates an electronic device suitable for implementing a cascade selector-based data processing method according to embodiments of the present disclosure.
[0141] like Figure 13As shown, an electronic device 1300 according to an embodiment of the present disclosure includes a processor 1301, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1302 or a program loaded from a storage portion 1308 into a random access memory (RAM) 1303. The processor 1301 may include, for example, a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or an associated chipset and / or a special-purpose microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 1301 may also include onboard memory for caching purposes. The processor 1301 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present disclosure.
[0142] RAM 1303 stores various programs and data required for the operation of electronic device 1300. Processor 1301, ROM 1302, and RAM 1303 are interconnected via bus 1304. Processor 1301 performs various operations of the method flow according to embodiments of the present disclosure by executing programs in ROM 1302 and / or RAM 1303. It should be noted that programs may also be stored in one or more memories other than ROM 1302 and RAM 1303. Processor 1301 may also perform various operations of the method flow according to embodiments of the present disclosure by executing programs stored in one or more memories.
[0143] According to embodiments of this disclosure, the electronic device 1300 may further include an input / output (I / O) interface 1305, which is also connected to a bus 1304. The electronic device 1300 may also include one or more of the following components connected to the I / O interface 1305: an input section 1306 including a keyboard, mouse, etc.; an output section 1307 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 1308 including a hard disk, etc.; and a communication section 1309 including a network interface card such as a LAN card, modem, etc. The communication section 1309 performs communication processing via a network such as the Internet. A drive 1310 is also connected to the I / O interface 1305 as needed. A removable medium 1311, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on the drive 1310 as needed so that computer programs read from it can be installed into the storage section 1308 as needed.
[0144] This disclosure also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments, or it may exist independently and not assembled into the device / apparatus / system. The computer-readable storage medium carries one or more programs that, when executed, implement the method according to the embodiments of this disclosure.
[0145] According to embodiments of this disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium, such as including, but not limited to: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this disclosure, the computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. For example, according to embodiments of this disclosure, the computer-readable storage medium may include ROM 1302 and / or RAM 1303 and / or one or more memories other than ROM 1302 and RAM 1303 described above.
[0146] Embodiments of this disclosure also include a computer program product comprising a computer program containing program code for performing the methods shown in the flowchart. When the computer program product is run on a computer system, the program code is used to cause the computer system to implement the methods provided in the embodiments of this disclosure.
[0147] When the computer program is executed by the processor 1301, it performs the functions defined in the system / apparatus of this disclosure embodiments. According to embodiments of this disclosure, the systems, apparatuses, modules, units, etc., described above can be implemented by computer program modules.
[0148] In one embodiment, the computer program may rely on a tangible storage medium such as an optical storage device or a magnetic storage device. In another embodiment, the computer program may also be transmitted and distributed in the form of signals over a network medium, and may be downloaded and installed via the communication section 1309, and / or installed from the removable medium 1311. The program code contained in the computer program can be transmitted using any suitable network medium, including but not limited to: wireless, wired, etc., or any suitable combination thereof.
[0149] In such an embodiment, the computer program can be downloaded and installed from a network via the communication section 1309, and / or installed from the removable medium 1311. When the computer program is executed by the processor 1301, it performs the functions defined in the system of this disclosure embodiment. According to embodiments of this disclosure, the systems, devices, apparatuses, modules, units, etc., described above can be implemented by computer program modules.
[0150] According to embodiments of this disclosure, program code for executing the computer programs provided in embodiments of this disclosure can be written in any combination of one or more programming languages. Specifically, these computational programs can be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages include, but are not limited to, languages such as Java, C++, Python, "C", or similar programming languages. The program code can execute entirely on the user's computing device, partially on the user's device, partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).
[0151] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0152] Those skilled in the art will understand that the features described in the various embodiments and / or claims of this disclosure can be combined or combined in various ways, even if such combinations or combinations are not explicitly described in this disclosure. In particular, the features described in the various embodiments and / or claims of this disclosure can be combined or combined in various ways without departing from the spirit and teachings of this disclosure. All such combinations and / or combinations fall within the scope of this disclosure.
[0153] The embodiments of this disclosure have been described above. However, these embodiments are for illustrative purposes only and are not intended to limit the scope of this disclosure. Although various embodiments have been described above, this does not mean that the measures in the various embodiments cannot be used advantageously in combination. The scope of this disclosure is defined by the appended claims and their equivalents. Various substitutions and modifications can be made by those skilled in the art without departing from the scope of this disclosure, and all such substitutions and modifications should fall within the scope of this disclosure.
Claims
1. A data processing method based on cascading selectors, comprising: Obtain pending data from users; Based on the data to be processed, a second query result is obtained by querying the lazy-loaded data source, and the second query result is displayed on the query result interface. The query method is invoked based on the data to be processed, and query requests are sent to N data sources. The N data sources include full data with cascading relationships and lazy-loaded data sources independent of the cascading selector. N is greater than or equal to 1. Before invoking the query method based on the data to be processed, the method further includes: providing the cascading selector that inherits from the original cascading selector in the component library; and rewriting the query method based on the inheritance to allow the query requests to be sent to the N data sources. Obtaining the first query result returned by the N data sources in response to the query request includes: determining the first query data in the first query result; obtaining the second query data that is not repeated with the first query data and matches the data to be processed as the first query result; The first query result is displayed in the query result interface of the cascading selector.
2. The method of claim 1, wherein, The step of displaying the first query result in the query result interface of the cascading selector includes: The first query result is displayed in the first area of the query results page; and The second query result is displayed in the second area of the query results page.
3. The method of claim 1, wherein, The step of displaying the second query result on the query result interface includes: Determine the cascading relationship between the query data in the first query result and the query data in the second query result.
4. The method according to claim 1, wherein, Displaying the first query result in the cascading selection query result interface includes: Iterate through each element in the first query result and set the element value attribute, tag attribute, and text attribute for each element; The first query result is displayed on the query result interface based on the element value attribute, tag attribute, and text attribute of each element.
5. The method according to claim 4, wherein, Displaying the first query result on the query result interface includes: If at least one element in the first query result is selected by the user, the at least one element is set to a selected state, and / or a data processing method for the selected state is provided; The first query result is displayed based on the selected state and / or the data processing method.
6. The method according to claim 1, wherein, The data to be processed obtained from the user includes: Obtain the user's first selection data in the cascading selector; or Obtain the user's input data in the search box of the cascading selector.
7. The method according to claim 6, wherein, After obtaining the data to be processed from the user, displaying the first query result in the query result interface of the cascading selector includes echoing data, specifically including: Determine the second selected data of the user in the cascading selector, wherein the second selected data is the same as or different from the first selected data; Obtain the first feature flag of the node corresponding to the second selected data, and M second feature flags belonging to the same cascade path as the first feature flag, where M is greater than or equal to 1; Load the associated data of the first feature marker and the M second feature markers based on the first query result; After loading the associated data, the selection status of the node corresponding to the second selected data is set.
8. The method according to claim 7, wherein, The M nodes corresponding to the M second feature markers are all upper-level nodes of the nodes corresponding to the first feature markers. Loading the associated data includes: Set the highest-level node among the M nodes as the current node; The child nodes under each of the M nodes are loaded layer by layer from the current node until the node corresponding to the first feature flag is loaded.
9. A data processing apparatus based on a cascade selector, comprising: The data module is used to obtain pending data from users; The calling module is used to query the lazy-loaded data source based on the data to be processed, obtain the second query result, and display the second query result on the query result interface; The system also includes calling a query method based on the data to be processed, sending query requests to N data sources, where the N data sources include full data with cascading relationships and lazy-loaded data sources independent of the cascading selector, and N is greater than or equal to 1. Before calling the query method based on the data to be processed, the system further includes: providing the cascading selector inherited from the original cascading selector in the component library; and, based on the inheritance, rewriting the query method to allow sending the query requests to the N data sources. The result module is used to obtain the first query result returned by the N data sources in response to the query request, including: determining the first query data in the first query result; obtaining the second query data that is not repeated with the first query data and matches the data to be processed as the first query result; The display module is used to display the first query result in the query result interface of the cascading selector.
10. An electronic device, comprising: One or more processors; Storage device for storing one or more programs. Wherein, when the one or more programs are executed by the one or more processors, the one or more processors perform the method according to any one of claims 1 to 8.
11. A computer-readable storage medium having stored thereon executable instructions that, when executed by a processor, cause the processor to perform the method according to any one of claims 1 to 8.
12. A computer program product comprising a computer program that, when executed by a processor, implements the method according to any one of claims 1 to 8.