A method, apparatus, device, and medium for fetching data
By analyzing the dependencies and configurations of the number fetching items and obtaining the number fetching configuration, the problem of poor number fetching performance in complex scenarios in the existing technology is solved, and an efficient and flexible number fetching solution is achieved.
Patent Information
- Application Number
- CN202210712885.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-22
- Publication Date
- 2025-07-25
- Estimated Expiration
- 2042-06-22
AI Technical Summary
In the prior art, it is difficult to achieve efficient batch query in complex scenarios based on stored procedures of Oracle databases and number-choice solutions for primary Sql joint query, especially when using open source databases.
By obtaining the number-get-get-get-demand requirements and known conditions, the dependencies of the number-get-get-get-get-get-get-get-configuration belongs to, the number-get-get-get-based configurations are used to fetch numbers based on the number-get-get-resource configuration and dependencies, including custom rules and standard configurations, it supports cross-service queries and batch processing of known items.
It realizes an efficient and flexible number-choice solution in complex scenarios, reduces the interdependence between number-choice configurations, and improves query performance and efficiency.
Smart Images

Figure CN114996316B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of data extraction, and particularly to a data extraction method, device, equipment and medium. Background Art
[0002] In the prior art, there are two data extraction schemes for extracting data in a system. One is to extract data based on stored procedures and database functions of the Oracle database. However, this scheme depends on the Oracle database, and it is impossible to perform relatively complex queries using open-source databases such as mySql and postgre. The other is a data extraction scheme that tends to perform a first-level Sql (i.e., Structured Query Language) joint query, which requires querying the required results through known conditions in a single query, and the results that cannot be queried depending on the known conditions are queried again through calculation functions. The result set that can be queried by the first-level Sql joint query is relatively limited. When querying in the calculation function, it is difficult to perform batch queries. If queries are performed individually, there is a huge performance gap. In summary, how to achieve data extraction in complex scenarios is a problem that needs to be solved currently. Summary of the Invention
[0003] In view of this, the purpose of this application is to provide a data extraction method, device, equipment and medium, which can solve the problem of data extraction in complex scenarios. The specific scheme is as follows:
[0004] In the first aspect, this application discloses a data extraction method, including:
[0005] Obtain the data extraction requirements and known conditions;
[0006] Analyze the dependency relationship of each data extraction item based on the data extraction requirements and the known conditions, and obtain each data extraction configuration to which each data extraction item belongs; wherein, each data extraction item is a data extraction item required to query the final data extraction result corresponding to the data extraction requirements;
[0007] Perform data extraction based on each data extraction configuration and the dependency relationship to obtain the final data extraction result.
[0008] Optionally, the analyzing the dependency relationship of each data extraction item based on the data extraction requirements and the known conditions, and obtaining each data extraction configuration to which each data extraction item belongs includes:
[0009] Obtain a data extraction configuration library; wherein each data extraction configuration in the data extraction configuration library includes input parameters and output parameters, the input parameters and the output parameters are known conditions or data extraction items, and the data extraction item is the carrier of the corresponding data extraction result;
[0010] Parse the dependency relationships of each data extraction item based on the data extraction requirements, the known conditions, and the data extraction configuration library, and obtain the data extraction configurations to which the data extraction items belong.
[0011] Optionally, the parsing of the dependency relationships of each data extraction item based on the data extraction requirements, the known conditions, and the data extraction configuration library, and the obtaining of the data extraction configurations to which the data extraction items belong includes:
[0012] Determine the target data extraction item corresponding to the final data extraction result based on the data extraction requirements;
[0013] Parse the dependency relationships of each data extraction item based on the target data extraction item, the known conditions, and the data extraction configuration library, and obtain the data extraction configurations from the data extraction configuration library.
[0014] Optionally, it further includes:
[0015] If multiple data extraction requirements are obtained, determine a data extraction configuration set based on the data extraction configurations corresponding to the multiple data extraction requirements, where duplicate data extraction configurations are removed from the data extraction configuration set;
[0016] Execute the data extraction configuration set to obtain multiple final data extraction results corresponding to the multiple data extraction requirements.
[0017] Optionally, the executing of the data extraction configuration set includes:
[0018] When there are multiple different data extraction items corresponding to different data extraction requirements in any data extraction configuration in the data extraction configuration set, when executing this data extraction configuration, query for the multiple different data extraction items simultaneously;
[0019] When there is the same data extraction item corresponding to different data extraction requirements in any data extraction configuration in the data extraction configuration set, when executing this data extraction configuration, perform a query for this data extraction item once.
[0020] Optionally, the obtaining of the final data extraction result by performing data extraction based on the data extraction configurations and the dependency relationships includes:
[0021] Determine the execution order of the data extraction configurations based on the dependency relationships;
[0022] Execute the data extraction configurations in sequence based on the execution order to obtain the final data extraction result.
[0023] Optionally, if the number of known items included in the known conditions is greater than a preset batch processing number, batch the known items;
[0024] Correspondingly, obtaining the final data extraction result based on the respective data extraction configurations and the dependency relationship includes: batch obtaining the final data extraction result based on the respective data extraction configurations and the dependency relationship.
[0025] In a second aspect, the present application discloses a data extraction device, including:
[0026] An obtaining module, configured to obtain a data extraction requirement and known conditions;
[0027] An analysis module, configured to analyze the dependency relationship of each data extraction item based on the data extraction requirement and the known conditions, and obtain each data extraction configuration to which each data extraction item belongs; wherein, each data extraction item is a data extraction item required to query the final data extraction result corresponding to the data extraction requirement.
[0028] A data extraction module, configured to perform data extraction based on the respective data extraction configurations and the dependency relationship to obtain the final data extraction result.
[0029] In a third aspect, the present application discloses an electronic device, including a memory and a processor, wherein:
[0030] The memory is configured to store a computer program;
[0031] The processor is configured to execute the computer program to implement the foregoing data extraction method.
[0032] In a fourth aspect, the present application discloses a computer-readable storage medium, configured to store a computer program, wherein the computer program, when executed by a processor, implements the foregoing data extraction method.
[0033] In a fifth aspect, the present application discloses a computer program product, and the computer program product, when executed, implements the foregoing data extraction method.
[0034] It can be seen that the present application first obtains a data extraction requirement and known conditions, then analyzes the dependency relationship of each data extraction item based on the data extraction requirement and the known conditions, and obtains each data extraction configuration to which each data extraction item belongs; wherein, each data extraction item is a data extraction item required to query the final data extraction result corresponding to the data extraction requirement, and finally performs data extraction based on the respective data extraction configurations and the dependency relationship to obtain the final data extraction result. That is to say, the data extraction configuration in the present application includes data extraction items. During the data extraction process, the dependency relationship of each data extraction item is analyzed, and the data extraction configuration required for data extraction is obtained. Finally, data extraction is performed based on each data extraction configuration and the dependency relationship. In this way, flexible configuration of complex logic for data extraction based on data extraction items and data extraction based on the dependency relationship of data extraction items can solve the problem of data extraction in complex scenarios. Description of the Drawings
[0035] To more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the accompanying drawings required for the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only the embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other accompanying drawings can also be obtained based on the provided drawings.
[0036] Figure 1 Flowchart of a data fetching method disclosed in the present application;
[0037] Figure 2 Schematic diagram of a specific data fetching configuration disclosed in the present application;
[0038] Figure 3 Schematic diagram of a specific dependency relationship disclosed in the present application;
[0039] Figure 4 Schematic diagram of the structure of a data fetching device disclosed in the present application;
[0040] Figure 5 Schematic diagram of the hardware composition framework applicable to a data fetching method disclosed in the present application;
[0041] Figure 6 System architecture diagram applicable to a data fetching method disclosed in the present application. Detailed implementation manners
[0042] The following will clearly and completely describe the technical solutions in the embodiments of the present application with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all of them. Based on the embodiments of the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the scope of protection of the present application.
[0043] In the prior art, there are two data fetching solutions. One is to fetch data based on stored procedures and database functions of the Oracle database. This solution depends on the Oracle database, and it is impossible to perform relatively complex queries using open-source databases such as mySql and postgre. The other is a data fetching solution tending to perform a first-level Sql joint query, which requires querying the required results through known conditions in one query, and the results that cannot be queried depending on the known conditions are queried again through accounting functions. However, the result set that can be queried by the first-level Sql joint query is relatively limited. It is difficult to perform batch queries when querying in the accounting function. If individual queries are performed, there is a huge performance gap. Therefore, the present application provides a data fetching solution that can solve the data fetching problem in complex scenarios.
[0044] See Figure 1As shown in the figure, an embodiment of the present application discloses a data fetching method, including:
[0045] Step S11: Obtain the data fetching requirement and known conditions.
[0046] Among them, the data fetching requirement is to fetch the final data fetching result.
[0047] Step S12: Analyze the dependency relationship of each data fetching item based on the data fetching requirement and the known conditions, and obtain each data fetching configuration to which each data fetching item belongs; wherein, each data fetching item is a data fetching item required to query the final data fetching result corresponding to the data fetching requirement.
[0048] In one implementation manner, the above step S12 may specifically include:
[0049] Step 00: Obtain a data fetching configuration library; wherein, each data fetching configuration in the data fetching configuration library includes input parameters and output parameters, and the input parameters and the output parameters are known conditions or data fetching items, and the data fetching item is a carrier of the corresponding data fetching result.
[0050] That is to say, the present application can pre-determine a data fetching configuration library, and each data fetching configuration includes a data source, input parameters, and output parameters. Among them, the data source is a data fetching rule, and the data source can be a preset standard data fetching rule or a custom rule. It should be noted that for some complex result processing that cannot be achieved through ordinary queries, such as calculations that require code or cross-service queries, custom rules can be used. Further, the data source can be an enterprise cloud service platform. The data fetching rules of the enterprise cloud service platform include multi-entity queries and code implementation queries, or it can also be a custom plug-in, that is, the definition of other query methods abstracted, such as openApi (i.e., open Application programming interface, open application programming interface), microservice definition, HTTP (i.e., Hyper Text Transfer Protocol, hypertext transfer protocol) request encapsulation, etc. As long as it can define input parameters and output parameters and fetch data according to a predetermined rule, it is acceptable. That is to say, the data fetching logic of the data fetching configuration supports standard configuration and custom implementation. For example, see Figure 2 As shown in the figure, Figure 2A specific data extraction configuration schematic diagram disclosed in the embodiments of the present application. The present application defines a data extraction item as the carrier of the data extraction result. The data extraction item is used to carry the data extraction result, and defines the data type as the link for processing data extraction relationships. The data extraction configuration is defined as the data extraction processing logic, and the data extraction source, input parameters, and output parameters are defined in the data extraction configuration. The data extraction result can be used as the input parameter of other data extraction items or can be used for configuration in the target engine, such as the salary calculation engine. The salary calculation defines the overall process, rules, and execution of the entire salary calculation. Of course, the target engine includes but is not limited to the salary calculation engine.
[0051] It can be understood that the present application defines a data extraction item as an intermediate carrier of data extraction dependencies, decouples the dependency relationships, reduces the mutual dependencies between data extraction configurations, so that a change in one data extraction configuration will not affect the modification of other data extraction configurations. At the same time, it decouples the data extraction configuration from the user, so as to be able to flexibly configure deep-level data extraction and facilitate operation and maintenance management.
[0052] Step 01: Based on the data extraction requirements, the known conditions, and the data extraction configuration library, analyze the dependency relationships of each data extraction item, and obtain the data extraction configurations to which the respective data extraction items belong.
[0053] In a specific implementation manner, the target data extraction item corresponding to the final data extraction result can be determined based on the data extraction requirements; based on the target data extraction item, the known conditions, and the data extraction configuration library, analyze the dependency relationships of each data extraction item, and obtain the data extraction configurations from the data extraction configuration library. It can be understood that during the analysis process, first determine the data extraction configuration to which the target data extraction item belongs. The output parameter of this data extraction configuration is the final data extraction result, and the input parameter can be other data extraction items. According to the data extraction items on which other data extraction items depend, determine the data extraction configurations on which the current data extraction configuration depends, so as to determine the data extraction configurations that can perform data extraction through the known conditions until all data extraction configurations are obtained, and determine the data extraction items that need to be queried for each data extraction configuration.
[0054] For example, refer to Figure 3 as shown Figure 3A specific dependency diagram disclosed in an embodiment of the present application. If it is necessary to retrieve the data of [Data Retrieval Item 6], that is, the data of [Data Retrieval Item 6] is the final data retrieval result, but only the known condition [Known Input Parameter 1] is available. To obtain the final data retrieval result, it is necessary to parse the dependency relationship, that is, [Data Retrieval Item 6] depends on [Data Retrieval Item 3], [Data Retrieval Item 3] depends on [Data Retrieval Item 1], and [Data Retrieval Item 1] depends on [Known Input Parameter 1]. By parsing the dependency relationship, it is possible to obtain the data retrieval configurations on which the data retrieval depends and the data retrieval results that need to be retrieved for each data retrieval configuration. In this query, to parse the dependency relationship, it is necessary to obtain data through 3 data retrieval configurations, including [Data Retrieval Configuration 1], [Data Retrieval Configuration 2], and [Data Retrieval Configuration 3]. Among them, [Data Retrieval Configuration 1] only needs to query [Data Retrieval Item 1], [Data Retrieval Configuration 2] only needs to query [Data Retrieval Item 3], and [Data Retrieval Configuration 3] only needs to query [Data Retrieval Item 6].
[0055] Among them, data can be retrieved on demand based on the data source. When determining each data retrieval configuration based on the data source, it is necessary to query the data retrieval items. For example, when retrieving data based on an SQL query, the data retrieval items can be filtered on demand, that is, the data retrieval results can be filtered, and it is not necessary to query all the data retrieval items in the data retrieval configuration. At the same time, custom data retrieval can also perform data retrieval item filtering to further improve performance.
[0056] Step S13: Retrieve data based on the respective data retrieval configurations and the dependency relationship to obtain the final data retrieval result.
[0057] In a specific implementation manner, the execution order of the respective data retrieval configurations can be determined based on the dependency relationship; the respective data retrieval configurations are executed in sequence based on the execution order to obtain the final data retrieval result.
[0058] It can be understood that by parsing the dependency relationship of the data retrieval items, the pre-data retrieval configurations on which the data retrieval configuration depends can be obtained and used as the pre-execution of the current data retrieval configuration until the data retrieval configuration can retrieve data through known conditions. Therefore, the execution order of the respective data retrieval configurations can be determined based on the dependency relationship, and the respective data retrieval configurations are executed in sequence based on the execution order to obtain the final data retrieval result.
[0059] It can be seen that in this application, the data extraction requirements and known conditions are first obtained, and then the dependency relationships of each data extraction item are parsed based on the data extraction requirements and the known conditions, and each data extraction configuration to which each data extraction item belongs is obtained; wherein, each data extraction item is a data extraction item that needs to be queried to obtain the final data extraction result corresponding to the data extraction requirements. Finally, data extraction is performed based on each data extraction configuration and the dependency relationship to obtain the final data extraction result. That is to say, the data extraction configuration in this application includes data extraction items. During the data extraction process, the dependency relationships of each data extraction item are parsed, and the data extraction configuration required for data extraction is obtained. Finally, data extraction is performed based on each data extraction configuration and the dependency relationship. In this way, flexible configuration of complex logic for data extraction based on data extraction items and data extraction based on the dependency relationships of data extraction items can solve the data extraction problem in complex scenarios.
[0060] Furthermore, if multiple data extraction requirements are obtained, a data extraction configuration set is determined based on each data extraction configuration corresponding to the multiple data extraction requirements, wherein duplicate data extraction configurations are removed from the data extraction configuration set; the data extraction configuration set is executed to obtain multiple final data extraction results corresponding to the multiple data extraction requirements. And, in a specific implementation manner, the execution order of the data extraction configuration set can be determined based on the dependency relationship corresponding to each data extraction requirement.
[0061] Among them, during the execution of the data extraction configuration set, when there are multiple different data extraction items corresponding to different data extraction requirements in any data extraction configuration in the data extraction configuration set, then when executing this data extraction configuration, queries are performed simultaneously for the multiple different data extraction items; when there is the same data extraction item corresponding to different data extraction requirements in any data extraction configuration in the data extraction configuration set, then when executing this data extraction configuration, a query for this data extraction item is performed once.
[0062] For example, as Figure 3 shown, if there are other data extraction requirements that depend on [Data Extraction Item 2], [Data Extraction Item 4], and [Data Extraction Item 5], then only one query is made for [Data Extraction Configuration 1], [Data Extraction Configuration 2], and [Data Extraction Configuration 3] during the query, that is, homologous merging is performed. The same data extraction configuration is only executed once for data extraction, and the required results will be queried simultaneously without multiple queries, improving the query efficiency. If multiple data extraction requirements all need to obtain the data of the same data extraction item, analysis is performed during data extraction, and the data extraction configuration where the same data extraction item is located will only be executed once for data extraction, and there will be no multiple data extractions. That is to say, homologous merging is performed on the data extraction of the same data extraction configuration during the data extraction process, and the results of the same data extraction item are only obtained once.
[0063] Further, if the known items included in the known conditions are greater than the preset batch processing number, the known items are batched; then the data is fetched based on the respective data fetching configurations and the dependency relationships to obtain the final data fetching result. That is, the input parameters can be multiple data. For example, in a salary calculation engine, the known conditions are a list of calculation names to be calculated, including multiple known items. When fetching data, batch data fetching is performed through the list of calculation names. When the data in the calculation list is too large, batch processing is carried out. For example, 500 items are fetched in one batch to achieve the purpose of high-performance data fetching. That is, the data fetching process of this application supports batch data fetching and improves the data fetching performance.
[0064] That is, in the embodiments of this application, the dependency relationships are first analyzed for the data fetching configurations to determine the data fetching order, and homologous merging is performed. Moreover, data can be fetched once based on the result, or batch data fetching can be carried out. During the data fetching process within a batch, the same data fetching configuration is only fetched once for each batch, and the same data fetching result only needs to be fetched once.
[0065] See Figure 4 As shown, the embodiments of this application disclose a data fetching device, including:
[0066] An acquisition module 11, configured to acquire data fetching requirements and known conditions;
[0067] An analysis module 12, configured to analyze the dependency relationships of each data fetching item based on the data fetching requirements and the known conditions, and acquire the respective data fetching configurations to which the data fetching items belong; wherein, each data fetching item is a data fetching item required to query the final data fetching result corresponding to the data fetching requirements;
[0068] A data fetching module 13, configured to fetch data based on the respective data fetching configurations and the dependency relationships to obtain the final data fetching result.
[0069] It can be seen that in the embodiments of this application, the data fetching requirements and known conditions are first acquired, then the dependency relationships of each data fetching item are analyzed based on the data fetching requirements and the known conditions, and the respective data fetching configurations to which the data fetching items belong are acquired; wherein, each data fetching item is a data fetching item required to query the final data fetching result corresponding to the data fetching requirements. Finally, data is fetched based on the respective data fetching configurations and the dependency relationships to obtain the final data fetching result. That is, the data fetching configurations in this application include data fetching items. During the data fetching process, the dependency relationships of each data fetching item are analyzed, and the data fetching configurations required for data fetching are acquired. Finally, data is fetched based on the respective data fetching configurations and the dependency relationships. In this way, flexible configuration of complex logic for data fetching based on data fetching items and data fetching based on the dependency relationships of data fetching items can solve the data fetching problems in complex scenarios.
[0070] In a specific implementation manner, the analysis module 12 specifically includes:
[0071] The data fetching configuration library acquisition sub-module is used to acquire the data fetching configuration library; wherein, each data fetching configuration in the data fetching configuration library includes input parameters and output parameters, and the input parameters and the output parameters are known conditions or data fetching items, and the data fetching items are carriers of corresponding data fetching results.
[0072] The parsing sub-module is used to parse the dependency relationships of each data fetching item based on the data fetching requirements, the known conditions, and the data fetching configuration library, and acquire the data fetching configurations to which the data fetching items belong.
[0073] Further, the parsing sub-module is specifically used to determine the target data fetching item corresponding to the final data fetching result based on the data fetching requirements; parse the dependency relationships of each data fetching item based on the target data fetching item, the known conditions, and the data fetching configuration library, and acquire the data fetching configurations from the data fetching configuration library.
[0074] In addition, the device further includes a data fetching configuration set determination module, which is used to, if multiple data fetching requirements are acquired, determine a data fetching configuration set based on the data fetching configurations corresponding to the multiple data fetching requirements, wherein duplicate data fetching configurations are removed from the data fetching configuration set;
[0075] Correspondingly, the device is further used to execute the data fetching configuration set to obtain multiple final data fetching results corresponding to the multiple data fetching requirements. When there are multiple different data fetching items corresponding to different data fetching requirements in any data fetching configuration in the data fetching configuration set, when executing this data fetching configuration, queries are simultaneously performed for the multiple different data fetching items; when there is the same data fetching item corresponding to different data fetching requirements in any data fetching configuration in the data fetching configuration set, when executing this data fetching configuration, a query for this data fetching item is performed once.
[0076] Among them, the data fetching module 13 specifically includes:
[0077] The execution order determination sub-module is used to determine the execution order of the data fetching configurations based on the dependency relationships;
[0078] The data fetching sub-module is used to sequentially execute the data fetching configurations based on the execution order to obtain the final data fetching result.
[0079] Further, the device further includes a batching module, which is used to batch the known items if the number of known items included in the known conditions is greater than a preset batch processing number;
[0080] Correspondingly, the data fetching module 13 is used to batch data fetching based on the data fetching configurations and the dependency relationships to obtain the final data fetching result.
[0081] Further, please refer to Figure 5 , Figure 5Schematic diagram of the hardware composition framework applicable to a data fetching method provided by an embodiment of the present application. The electronic device 100 may include a processor 101 and a memory 102, and may further include one or more of a multimedia component 103, an information input / information output (I / O) interface 104, and a communication component 105.
[0082] Among them, the processor 101 is used to control the overall operation of the electronic device 100 to complete all or part of the steps in the data fetching method; the memory 102 is used to store various types of data to support the operation of the electronic device 100. These data may include, for example, instructions for any application or method operating on the electronic device 100, and application-related data. The memory 102 may be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read-Only Memory (EPROM), Programmable Read-Only Memory (PROM), Read-Only Memory (ROM), magnetic memory, flash memory, a magnetic disk, or an optical disc. In this embodiment, the memory 102 stores at least programs and / or data for implementing the following functions:
[0083] Obtain data fetching requirements and known conditions;
[0084] Analyze the dependency relationships of each data fetching item based on the data fetching requirements and the known conditions, and obtain each data fetching configuration to which each data fetching item belongs; where each data fetching item is a data fetching item required to query the final data fetching result corresponding to the data fetching requirements.
[0085] Perform data fetching based on each data fetching configuration and the dependency relationships to obtain the final data fetching result.
[0086] The multimedia component 103 may include a screen and an audio component. The screen may be, for example, a touch screen, and the audio component is used to output and / or input audio signals. For example, the audio component may include a microphone for receiving external audio signals. The received audio signals may be further stored in the memory 102 or transmitted through the communication component 105. The audio component further includes at least one speaker for outputting audio signals. The I / O interface 104 provides an interface between the processor 101 and other interface modules, and the other interface modules may be a keyboard, a mouse, buttons, etc. These buttons may be virtual buttons or physical buttons. The communication component 105 is used for wired or wireless communication between the electronic device 100 and other devices. Wireless communication, such as Wi-Fi, Bluetooth, Near Field Communication (NFC), 2G, 3G, or 4G, or a combination of one or more of them. Accordingly, the communication component 105 may include: a Wi-Fi component, a Bluetooth component, and an NFC component.
[0087] The electronic device 100 may be implemented by one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components for performing the data fetching method.
[0088] Of course, Figure 1 The structure of the illustrated electronic device 100 does not constitute a limitation on the electronic device in the embodiments of the present application. In practical applications, the electronic device 100 may include more or fewer components than Figure 1 those shown, or combine certain components.
[0089] Refer to Figure 6 as shown Figure 6 which is a schematic diagram of a system framework applicable to a data fetching method provided by an embodiment of the present application. As Figure 6 can be seen, the schematic diagram of the system framework may include: a first electronic device 21 and a second electronic device 22, which are connected through a network 23.
[0090] In the embodiments of the present application, the hardware structures of the first electronic device 21 and the second electronic device 22 may refer toFigure 5 The electronic device 100. Further, in the embodiments of the present application, the form of the network 23 is not limited, that is, the network 23 can be a wireless network (such as WIFI, Bluetooth, etc.) or a wired network.
[0091] Among them, the first electronic device 21 and the second electronic device 22 can be the same type of electronic device. For example, both the first electronic device 21 and the second electronic device 22 are servers; they can also be different types of electronic devices. For example, the first electronic device 21 can be a smart phone or other smart terminals, and the second electronic device 22 can be a server. In a possible implementation manner, the first electronic device 21 is used for data fetching requirements and known conditions; based on the data fetching requirements and the known conditions, the dependency relationships of each data fetching item are analyzed, and each data fetching configuration to which each data fetching item belongs is obtained; wherein, each data fetching item is a data fetching item required to query the final data fetching result corresponding to the data fetching requirements; based on each data fetching configuration and the dependency relationships, data is fetched to obtain the final data fetching result. Then the final data fetching result is sent to the second electronic device 22 through the network 23, and a target engine in the second electronic device 22, such as a salary calculation engine, performs corresponding processing based on the final data fetching result. It should be noted that in salary calculation, the data fetching ability is a great factor affecting salary calculation. The amount of salary data fetched is large, the data fetching logic is complex, and the data fetching link is long. The solution provided by the present application is applicable to the salary calculation scenario.
[0092] Further, the embodiments of the present application also disclose a computer-readable storage medium for storing a computer program, wherein the computer program, when executed by a processor, implements the data fetching method disclosed in the foregoing embodiments.
[0093] For the specific process of the above data fetching method, reference can be made to the corresponding content disclosed in the foregoing embodiments, and details will not be repeated here.
[0094] The embodiments of the present application also disclose a computer program product, which implements the data fetching method disclosed in the foregoing embodiments when executed.
[0095] For the specific process of the above data fetching method, reference can be made to the corresponding content disclosed in the foregoing embodiments, and details will not be repeated here.
[0096] In the present specification, the various embodiments are described in a progressive manner. Each embodiment focuses on the differences from other embodiments. The same or similar parts among the various embodiments can be referred to each other. For the devices disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple, and the relevant parts can be referred to the description of the method part.
[0097] The steps of the methods or algorithms described in connection with the embodiments disclosed herein may be implemented directly in hardware, in software modules executed by a processor, or in a combination thereof. The software modules may be placed in a random access memory (RAM), internal memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium well-known in the art.
[0098] The above has introduced in detail a data fetching method, apparatus, device and medium provided by the present application. Specific examples are used herein to elaborate on the principle and implementation manner of the present application. The description of the above embodiments is only used to help understand the method and its core idea of the present application; at the same time, for those of ordinary skill in the art, according to the idea of the present application, there will be changes in the specific implementation manner and application scope. In summary, the content of this specification should not be construed as a limitation to the present application.
Claims
1. A method for fetching numbers, characterized in that, including: obtaining the data extraction requirements and known conditions; analyzing the dependency relationships of each data extraction item based on the data extraction requirements and the known conditions, and obtaining each data extraction configuration to which each data extraction item belongs; wherein, each data extraction item is a data extraction item required to query the final data extraction result corresponding to the data extraction requirements; performing data extraction based on each data extraction configuration and the dependency relationships to obtain the final data extraction result; wherein, the analyzing the dependency relationships of each data extraction item based on the data extraction requirements and the known conditions, and obtaining each data extraction configuration to which each data extraction item belongs includes: obtaining a data extraction configuration library; each data extraction configuration in the data extraction configuration library includes input parameters and output parameters, the input parameters and the output parameters are known conditions or data extraction items, and a data extraction item is a carrier of a corresponding data extraction result; determining the target data extraction item corresponding to the final data extraction result based on the data extraction requirements; analyzing the dependency relationships of each data extraction item based on the target data extraction item, the known conditions, and the data extraction configuration library, and obtaining each data extraction configuration from the data extraction configuration library. During the analysis process, first determine the data extraction configuration to which the target data extraction item belongs, the input parameters of this data extraction configuration are other data extraction items, and according to the data extraction items on which other data extraction items depend, determine the data extraction configurations on which the current data extraction configuration depends, so as to obtain each data extraction configuration.
2. The data fetching method according to claim 1, wherein further including: if multiple data extraction requirements are obtained, determining a data extraction configuration set based on each data extraction configuration corresponding to the multiple data extraction requirements, wherein duplicate data extraction configurations are removed from the data extraction configuration set; executing the data extraction configuration set to obtain multiple final data extraction results corresponding to the multiple data extraction requirements.
3. The data fetching method according to claim 2, wherein The executing the data extraction configuration set includes: when there are multiple different data extraction items corresponding to different data extraction requirements in any data extraction configuration in the data extraction configuration set, when executing this data extraction configuration, query simultaneously for the multiple different data extraction items; when there is the same data extraction item corresponding to different data extraction requirements in any data extraction configuration in the data extraction configuration set, when executing this data extraction configuration, perform a query for this data extraction item once.
4. The data fetching method according to claim 1, wherein The performing data extraction based on each data extraction configuration and the dependency relationships to obtain the final data extraction result includes: determining the execution order of each data extraction configuration based on the dependency relationships; successively executing each data extraction configuration based on the execution order to obtain the final data extraction result.
5. The data fetching method according to any one of claims 1 to 4, characterized in that, if the number of known items included in the known conditions is greater than a preset batch processing number, then batch the known items; correspondingly, the performing data extraction based on each data extraction configuration and the dependency relationships to obtain the final data extraction result includes: batch performing data extraction based on each data extraction configuration and the dependency relationships to obtain the final data extraction result.
6. A number fetching device, characterized in that, including: an obtaining module, configured to obtain data extraction requirements and known conditions; an analyzing module, configured to analyze the dependency relationships of each data extraction item based on the data extraction requirements and the known conditions, and obtain each data extraction configuration to which each data extraction item belongs; wherein, each data extraction item is a data extraction item required to query the final data extraction result corresponding to the data extraction requirements; A data fetching module, configured to fetch data based on the respective data fetching configurations and the dependency relationship to obtain the final data fetching result; Among them, a parsing module is configured to obtain a data fetching configuration library; each data fetching configuration in the data fetching configuration library includes input parameters and output parameters, the input parameters and the output parameters are known conditions or data fetching items, and the data fetching item is a carrier of the corresponding data fetching result; determine the target data fetching item corresponding to the final data fetching result based on the data fetching requirement; parse the dependency relationship of each data fetching item based on the target data fetching item, the known conditions and the data fetching configuration library, and obtain the respective data fetching configurations from the data fetching configuration library. During the parsing process, first determine the data fetching configuration to which the target data fetching item belongs, the input parameters of this data fetching configuration are other data fetching items, and according to the data fetching items on which other data fetching items depend, determine the data fetching configuration on which the current data fetching configuration depends, so as to obtain each data fetching configuration.
7. An electronic device, characterized in that, It includes a memory and a processor, wherein: The memory is used to store computer programs; The processor is configured to execute the computer program to implement the data fetching method according to any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that, It is used to store computer programs, wherein the computer program, when executed by the processor, implements the data fetching method according to any one of claims 1 to 5.
9. A computer program product, which, when executed, implements the data fetching method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Method and device for extracting task relation chain, computer equipment and storage medium
CN109918432A
Data extraction method and device, computer equipment and storage medium
CN113254454A