Business data loading method, device, electronic device and storage medium
By executing multiple scheduled loading tasks in parallel during business data loading, the problem of low data loading efficiency in the existing technology is solved, and more efficient and accurate data loading is achieved.
Patent Information
- Application Number
- CN202210594808.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-27
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2042-05-27
AI Technical Summary
In the existing technology, when loading business data, the data loading efficiency is low due to the dependency concatenation method, and cannot meet the timeliness requirements of the business.
By starting the second thread to load the next scheduled loading task of the first scheduled loading task when the preloading data that the next scheduled loading task depends on is completed, a decision tree is used to execute multiple scheduled loads in parallel. tasks to improve data loading efficiency.
It improves the efficiency of business data loading, avoids confusion during the execution of scheduled loading tasks, and improves the accuracy and efficiency of data loading.
Smart Images

Figure CN114840325B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of big data technology, and in particular to a business data loading method, device, electronic device and storage medium. Background Art
[0002] With the rapid development of the Internet and the continuous increase in business, there are dependencies between business data. When loading business data, the existing technology performs data loading in a serial manner according to the dependencies between business data.
[0003] However, data loading is performed in series according to the dependencies between business data. When the previous data loading task is completed, a copy is cached and then the next data loading task is executed. The data loading process is slow and cannot meet the timeliness requirements of the business, resulting in low data loading efficiency.
[0004] Therefore, it is necessary to propose a method that can quickly load business data. Summary of the invention
[0005] In view of the above content, it is necessary to propose a business data loading method, device, electronic device and storage medium. When the pre-loaded data that the next scheduled loading task of the first scheduled loading task depends on is loaded, the second thread is started at the same time to load the next scheduled loading task of the first scheduled loading task, thereby improving data loading efficiency.
[0006] A first aspect of the present invention provides a method for loading business data, the method comprising:
[0007] Parsing the received business data loading request to obtain pre-loading data, wherein the pre-loading data includes at least one scheduled loading task and dependencies between the scheduled loading tasks;
[0008] Performing dependency analysis on the preloaded data based on the dependency relationship between the at least one scheduled loading task and the scheduled loading tasks to obtain the preloaded data that each scheduled loading task depends on;
[0009] Creating a decision tree based on the preloaded data and the preloaded data that each scheduled loading task depends on;
[0010] Executing the decision tree and returning the execution result includes: starting the first thread to load the preloaded data in the first scheduled loading task node in the decision tree; determining whether the preloaded data that the next scheduled loading task of the first scheduled loading task depends on has been loaded; when it is detected that the preloaded data that the next scheduled loading task of the first scheduled loading task depends on has been loaded, starting the second thread to load the preloaded data in the next scheduled loading task of the first scheduled loading task in the decision tree, and controlling the first thread to load the remaining preloaded data in the first scheduled loading task, wherein the first thread and the second thread are executed in parallel; repeating the loading of the preloaded data of each scheduled loading task in the decision tree until the preloaded data in all scheduled loading tasks in the decision tree are loaded, and returning the execution result.
[0011] Optionally, performing dependency analysis on the preloaded data based on the dependency relationship between the at least one scheduled loading task and the scheduled loading tasks to obtain the preloaded data that each scheduled loading task depends on includes:
[0012] Identify the identification code of the business system corresponding to the preloaded data;
[0013] Acquire corresponding business data loading conditions based on the identification code of the business system;
[0014] Dependency analysis is performed on the preloaded data based on the business data loading condition to obtain the preloaded data that each scheduled loading task depends on.
[0015] Optionally, performing dependency analysis on the preloaded data based on the business data loading condition to obtain the preloaded data that each scheduled loading task depends on includes:
[0016] Converting the business data loading condition into a dependency analysis statement;
[0017] The dependency analysis statement and the preloaded data are input into a pre-trained dependency analysis model to obtain the preloaded data that each scheduled loading task depends on.
[0018] Optionally, the training process of the dependency analysis model includes:
[0019] Acquire multiple historical preloaded data and dependency analysis statements corresponding to each of the historical preloaded data;
[0020] Searching for a semantic vector corresponding to a dependency analysis statement corresponding to each of the historical preloaded data from a preset semantic table, and constructing a dependency analysis matrix for each of the historical preloaded data;
[0021] Determining a plurality of dependency analysis matrices of the plurality of historical preloaded data as a dependency analysis sample set;
[0022] Dividing the dependency analysis sample set into a training set and a test set according to a preset ratio;
[0023] Inputting the training set into a preset neural network for training to obtain a dependency analysis model;
[0024] Inputting the test set into the dependency analysis model for testing, and calculating the test pass rate;
[0025] If the test pass rate is greater than or equal to the preset pass rate threshold, it is determined that the dependency analysis model training is completed; if the test pass rate is less than the preset pass rate threshold, the number of training sets is increased and training is repeated.
[0026] Optionally, creating a decision tree according to the preloaded data and the preloaded data that each scheduled loading task depends on includes:
[0027] Converting the scheduled loading task node corresponding to the scheduled loading task of the preloaded data into a corresponding decision tree node, wherein the decision tree node contains the preloaded data of the scheduled loading task and the dependent preloaded data;
[0028] Converting the dependency relationship between the scheduled loading task nodes corresponding to the scheduled loading tasks in the preloaded data into edges between the nodes in the corresponding decision tree, wherein the edges between the nodes in the decision tree serve as the dependency relationship between the nodes of the decision tree;
[0029] A decision tree for the preloaded data is created according to the nodes of the decision tree and the edges between the nodes in the decision tree.
[0030] Optionally, the determining whether the preloaded data that the next scheduled loading task of the first scheduled loading task depends on has been loaded includes:
[0031] The loaded data of the first scheduled loading task received in real time are matched in sequence with the preloaded data that the next scheduled loading task of the first scheduled loading task depends on, until the preloaded data that the next scheduled loading task of the first scheduled loading task depends on is completely matched, and it is determined that the preloaded data that the next scheduled loading task of the first scheduled loading task depends on is loaded completely.
[0032] Optionally, the method further comprises:
[0033] When it is detected that the preloaded data in all scheduled loading tasks in the decision tree are loaded completely, the loaded data of each scheduled loading task is displayed according to the dependency relationship between the scheduled loading tasks.
[0034] A second aspect of the present invention provides a service data loading device, the device comprising:
[0035] A parsing and obtaining module, used to parse the received business data loading request and obtain pre-loading data, wherein the pre-loading data includes at least one scheduled loading task and dependencies between scheduled loading tasks;
[0036] An analysis module, configured to perform dependency analysis on the preloaded data based on the dependency relationship between the at least one scheduled loading task and the scheduled loading tasks, to obtain the preloaded data that each scheduled loading task depends on;
[0037] A creation module, used to create a decision tree according to the preloaded data and the preloaded data that each scheduled loading task depends on;
[0038] An execution module is used to execute the decision tree and return an execution result, including: starting a first thread to load preloaded data in a first scheduled loading task node in the decision tree; determining whether the preloaded data that the next scheduled loading task of the first scheduled loading task depends on has been loaded; when it is detected that the preloaded data that the next scheduled loading task of the first scheduled loading task depends on has been loaded, starting a second thread to load the preloaded data in the next scheduled loading task of the first scheduled loading task in the decision tree, and controlling the first thread to load the remaining preloaded data in the first scheduled loading task, wherein the first thread and the second thread are executed in parallel; repeatedly executing the loading of the preloaded data of each scheduled loading task in the decision tree until the preloaded data in all scheduled loading tasks in the decision tree are loaded, and returning the execution result.
[0039] A third aspect of the present invention provides an electronic device, comprising a processor and a memory, wherein the processor is configured to implement the business data loading method when executing a computer program stored in the memory.
[0040] A fourth aspect of the present invention provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the business data loading method is implemented.
[0041] In summary, the business data loading method, device, electronic device and storage medium described in the present invention perform dependency analysis on the preloaded data based on the dependency relationship between the at least one scheduled loading task and the scheduled loading tasks to obtain the preloaded data that each scheduled loading task depends on. By determining the preloaded data that each scheduled loading task depends on, when the dependency data corresponding to the previous scheduled loading task that the next scheduled loading task depends on is loaded in the previous scheduled loading task, the next scheduled loading task can be started, and multiple scheduled loading tasks can be loaded in parallel, thereby improving the subsequent business loading efficiency. A decision tree is created based on the preloaded data and the preloaded data that each scheduled loading task depends on. In the subsequent execution process, confusion is avoided during the execution of the scheduled loading task loading process, thereby improving the data loading efficiency and accuracy. Start the first thread to load the preloaded data in the first scheduled loading task node in the decision tree. When it is detected that the preloaded data that the next scheduled loading task of the first scheduled loading task depends on has been loaded, start the second thread to load the preloaded data in the next scheduled loading task of the first scheduled loading task in the decision tree. At the same time, control the first thread to load the remaining preloaded data in the first scheduled loading task, so as to realize parallel execution of the first thread and the second thread and improve data loading efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] Figure 1 This is a flowchart of a business data loading method provided in Embodiment 1 of the present invention.
[0043] Figure 2 It is a flowchart of executing a decision tree in the business data loading method provided in the first embodiment of the present invention.
[0044] Figure 3 It is a structural diagram of a business data loading device provided in Embodiment 2 of the present invention.
[0045] Figure 4 It is a schematic diagram of the structure of an electronic device provided in Embodiment 3 of the present invention. DETAILED DESCRIPTION
[0046] In order to more clearly understand the above-mentioned purpose, features and advantages of the present invention, the present invention is described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be noted that the embodiments of the present invention and the features in the embodiments can be combined with each other without conflict.
[0047] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art of the present invention. The terms used in the specification of the present invention herein are only for the purpose of describing specific embodiments and are not intended to limit the present invention.
[0048] Embodiment 1
[0049] Figure 1 This is a flowchart of a business data loading method provided in Embodiment 1 of the present invention.
[0050] In this embodiment, the business data loading method can be applied to electronic devices. For electronic devices that need to load business data, the business data loading function provided by the method of the present invention can be directly integrated into the electronic device, or run in the electronic device in the form of a software development kit (SDK).
[0051] The embodiments of the present invention can acquire and process relevant data based on artificial intelligence technology. Artificial Intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.
[0052] The basic technologies of artificial intelligence generally include sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics, etc. Artificial intelligence software technologies mainly include computer vision technology, robotics technology, biometrics technology, speech processing technology, natural language processing technology, as well as machine learning and deep learning.
[0053] like Figure 1 As shown, the business data loading method specifically includes the following steps. According to different requirements, the order of the steps in the flowchart can be changed, and some can be omitted.
[0054] S11, parsing the received business data loading request to obtain pre-loading data, wherein the pre-loading data includes at least one scheduled loading task and dependencies between scheduled loading tasks.
[0055] In this embodiment, when loading business data, the client initiates a business data loading request to the server. Specifically, the client can be a smart phone, IPAD or other existing smart devices, and the server can be a business data loading subsystem. During the business data loading process, the client can send a business data loading request to the business data loading subsystem, and the business data loading subsystem is used to receive the business data loading request sent by the client.
[0056] In an optional embodiment, parsing the received service data loading request and acquiring the preloaded data includes:
[0057] Parsing the message of the service data loading request to obtain the message information carried by the message;
[0058] Obtaining an identification code of the service system from the message information;
[0059] Based on the identification code of the business system, obtaining a preload interface from a preset interface;
[0060] The preloading interface is called to obtain preloading data, scheduled loading tasks corresponding to the preloading data, and dependencies between scheduled loading tasks.
[0061] In this embodiment, different business systems correspond to different preloading interfaces. Acquiring preloading data through the corresponding preloading interfaces is more targeted and ensures the accuracy of the acquired preloading data.
[0062] Exemplarily, the preloaded data M corresponds to four scheduled loading tasks: A, B, C and D, and the dependency relationship between the scheduled loading tasks is: A→B→C→D.
[0063] S12: performing dependency analysis on the preloaded data based on the dependency relationship between the at least one scheduled loading task and the scheduled loading tasks, to obtain the preloaded data that each scheduled loading task depends on.
[0064] In this embodiment, the dependency refers to a strong correlation between scheduled loading tasks, that is, the loading order relationship of scheduled loading tasks is fixed.
[0065] In an optional embodiment, performing dependency analysis on the preloaded data based on the dependency relationship between the at least one scheduled loading task and the scheduled loading tasks to obtain the preloaded data that each scheduled loading task depends on includes:
[0066] Identify the identification code of the business system corresponding to the preloaded data;
[0067] Acquire corresponding business data loading conditions based on the identification code of the business system;
[0068] Dependency analysis is performed on the preloaded data based on the business data loading condition to obtain the preloaded data that each scheduled loading task depends on.
[0069] Furthermore, the dependency analysis of the preloaded data is performed based on the business data loading condition to obtain the preloaded data that each scheduled loading task depends on, including:
[0070] Converting the business data loading condition into a dependency analysis statement;
[0071] The dependency analysis statement and the preloaded data are input into a pre-trained dependency analysis model to obtain the preloaded data that each scheduled loading task depends on.
[0072] In this embodiment, the business data loading condition may be converted into an SQL dependency analysis statement.
[0073] In this embodiment, the dependency analysis model may be pre-trained. Specifically, the training process of the dependency analysis model includes:
[0074] Acquire multiple historical preloaded data and dependency analysis statements corresponding to each of the historical preloaded data;
[0075] Searching for a semantic vector corresponding to a dependency analysis statement corresponding to each of the historical preloaded data from a preset semantic table, and constructing a dependency analysis matrix for each of the historical preloaded data;
[0076] Determining a plurality of dependency analysis matrices of the plurality of historical preloaded data as a dependency analysis sample set;
[0077] Dividing the dependency analysis sample set into a training set and a test set according to a preset ratio;
[0078] Inputting the training set into a preset neural network for training to obtain a dependency analysis model;
[0079] Inputting the test set into the dependency analysis model for testing, and calculating the test pass rate;
[0080] If the test pass rate is greater than or equal to the preset pass rate threshold, it is determined that the dependency analysis model training is completed; if the test pass rate is less than the preset pass rate threshold, the number of training sets is increased and training is repeated.
[0081] In this embodiment, each historical preloaded data may have a dependency relationship with the preloaded data to be loaded, so multiple historical preloaded data and the dependency analysis statements corresponding to each of the historical preloaded data are obtained, and the semantic vector corresponding to each dependency analysis statement is searched in the preset semantic table. Since the dependency analysis statements between the preloaded data are obtained based on semantic analysis, the dependency analysis model is trained according to the semantic vector, so that the trained dependency analysis model is more accurate. The dependency analysis model is used in the subsequent determination of the preloaded data that each scheduled loading task depends on, thereby improving the accuracy of the determined preloaded data that each scheduled loading task depends on, thereby improving the accuracy of subsequent business data loading.
[0082] In this embodiment, the division ratio of the training set and the test set may be preset. For example, the dependency analysis sample set may be divided into the training set and the test set in a ratio of 7 to 3.
[0083] In this embodiment, the preset neural network can be an existing convolutional neural network, a deep learning network, etc., and this embodiment does not limit this.
[0084] In this embodiment, the identification code of the business system is used to uniquely identify the corresponding business system. The corresponding business data loading condition can be obtained based on the identification code of the business system. Specifically, the business data loading condition refers to the preloaded data that the previous scheduled loading task depends on and that the next scheduled loading task needs to use. The business data loading condition can be a fuzzy condition or a precise condition, for example, the preloaded data of M years and N months in the previous scheduled loading task that the next scheduled loading task needs to use.
[0085] In this embodiment, a dependency analysis is performed on the preloaded data based on the dependency relationship between the at least one scheduled loading task and the scheduled loading tasks to obtain the preloaded data that each scheduled loading task depends on, thereby solving the problem in the prior art of executing the next scheduled loading task after the previous scheduled loading task is completed. By determining the preloaded data that each scheduled loading task depends on, when the dependency data corresponding to the previous scheduled loading task that the next scheduled loading task depends on is loaded in the previous scheduled loading task, the next scheduled loading task can be started, thereby realizing parallel loading of multiple scheduled loading tasks and improving the efficiency of subsequent business loading.
[0086] S13, creating a decision tree according to the preloaded data and the preloaded data that each scheduled loading task depends on.
[0087] In this embodiment, the decision tree includes multiple scheduled loading task branches, each scheduled loading task branch corresponds to a scheduled loading task node, and each scheduled loading task node includes preloaded data of the scheduled loading task and dependent preloaded data.
[0088] In an optional embodiment, creating a decision tree according to the preloaded data and the preloaded data that each scheduled loading task depends on includes:
[0089] Converting the scheduled loading task node corresponding to the scheduled loading task of the preloaded data into a corresponding decision tree node, wherein the decision tree node contains the preloaded data of the scheduled loading task and the dependent preloaded data;
[0090] Converting the dependency relationship between the scheduled loading task nodes corresponding to the scheduled loading tasks in the preloaded data into edges between the nodes in the corresponding decision tree, wherein the edges between the nodes in the decision tree serve as the dependency relationship between the nodes of the decision tree;
[0091] A decision tree for the preloaded data is created according to the nodes of the decision tree and the edges between the nodes in the decision tree.
[0092] In this embodiment, a decision tree is created based on the dependency relationship between the scheduled loading tasks corresponding to the preloaded data and the preloaded data that each scheduled loading task depends on. In the subsequent execution process, confusion in the execution of the scheduled loading tasks is avoided, and the data loading efficiency and accuracy are improved.
[0093] S14, executing the decision tree and returning the execution result.
[0094] In an optional embodiment, if Figure 2 The flowchart of executing a decision tree in the business data loading method provided is shown, wherein the executing the decision tree comprises:
[0095] S141, start a first thread to load preloaded data in a first scheduled loading task node in the decision tree.
[0096] In this embodiment, a thread may be pre-set for each scheduled loading task node in the decision tree. Specifically, when loading the preloaded data in the first scheduled loading task node in the decision tree, the loading may be performed by starting the first thread.
[0097] S142, determining whether the preloaded data that the next scheduled loading task of the first scheduled loading task depends on has been loaded.
[0098] In an optional embodiment, the determining whether the preloaded data that the next scheduled loading task of the first scheduled loading task depends on has been loaded includes:
[0099] The loaded data of the first scheduled loading task received in real time are matched in sequence with the preloaded data that the next scheduled loading task of the first scheduled loading task depends on, until the preloaded data that the next scheduled loading task of the first scheduled loading task depends on is completely matched, and it is determined that the preloaded data that the next scheduled loading task of the first scheduled loading task depends on is loaded completely.
[0100] In this embodiment, by matching the loaded data of the first scheduled loading task with the preloaded data that the next scheduled loading task of the first scheduled loading task depends on in real time, there is no need to wait until all the preloaded data in the first scheduled loading task is loaded before matching, thus saving time, quickly determining whether the preloaded data that the next scheduled loading task of the first scheduled loading task depends on is loaded, and improving the efficiency of subsequent data loading.
[0101] S143, when it is detected that the preloaded data that the next scheduled loading task of the first scheduled loading task depends on has been loaded, start the second thread to load the preloaded data in the next scheduled loading task of the first scheduled loading task of the decision tree, and control the first thread to load the remaining preloaded data in the first scheduled loading task, wherein the first thread and the second thread are executed in parallel.
[0102] In this embodiment, when the second thread is started to load the preloaded data in the next scheduled loading task of the first scheduled loading task of the decision tree, the first thread is controlled to load the remaining preloaded data in the first scheduled loading task at the same time, so that the first thread and the second thread are executed in parallel, thereby improving data loading efficiency.
[0103] S144, repeatedly execute the loading of the preloaded data of each scheduled loading task in the decision tree until the preloaded data in all scheduled loading tasks in the decision tree are loaded, and return the execution result, that is, repeatedly execute S142 and S143, until the preloaded data in all scheduled loading tasks in the decision tree are loaded, and return the execution result.
[0104] In this embodiment, when the preloaded data in all the task loading nodes included in the decision tree are loaded completely, the loading task is executed.
[0105] Furthermore, the method further comprises:
[0106] When it is detected that the preloaded data in all scheduled loading tasks in the decision tree are loaded completely, the loaded data of each scheduled loading task is displayed according to the dependency relationship between the scheduled loading tasks.
[0107] Exemplarily, there are four scheduled tasks for pre-loading data corresponding to the business data loading request, and the four scheduled tasks are strongly associated, A→B→C→D. The task loading process of the prior art is: A→ARedis→B→BRedis→C→CRedis→D. Each time a scheduled loading task is loaded, a copy is cached, and then the next scheduled loading task is loaded. If CRedis has not obtained the latest business data for that evening by 8:55 am during the daytime work, the D scheduled loading task cannot be loaded, and the loading efficiency is low. At the same time, deviations occur when performing statistics on C and D data, resulting in low data loading accuracy.
[0108] In this embodiment, the preloaded data in the scheduled loading task A that the scheduled loading task B depends on is determined, and the first thread is started to load the scheduled loading task A in the decision tree. When the preloaded data in the scheduled loading task A that the scheduled loading task B depends on is loaded, the scheduled loading task B is started synchronously. When the preloaded data in the scheduled loading task B that the scheduled loading task C depends on is loaded, the scheduled loading task C is started synchronously. When the preloaded data in the scheduled loading task C that the scheduled loading task D depends on is loaded, the scheduled loading task D is started synchronously, so that four scheduled loading tasks are executed in parallel, thereby improving the efficiency of business data loading.
[0109] S145, when it is detected that the preloaded data that the next scheduled loading task of the first scheduled loading task depends on has not been loaded completely, continue loading.
[0110] In summary, the business data loading method described in this embodiment performs dependency analysis on the preloaded data based on the dependency relationship between the at least one scheduled loading task and the scheduled loading tasks to obtain the preloaded data that each scheduled loading task depends on. By determining the preloaded data that each scheduled loading task depends on, when the dependency data corresponding to the previous scheduled loading task that the next scheduled loading task depends on is loaded in the previous scheduled loading task, the next scheduled loading task can be started, and multiple scheduled loading tasks can be loaded in parallel, thereby improving the efficiency of subsequent business data loading. A decision tree is created based on the preloaded data and the preloaded data that each scheduled loading task depends on. In the subsequent execution process, confusion is avoided during the execution of the scheduled loading task loading process, thereby improving data loading efficiency and accuracy. Start the first thread to load the preloaded data in the first scheduled loading task node in the decision tree. When it is detected that the preloaded data that the next scheduled loading task of the first scheduled loading task depends on has been loaded, start the second thread to load the preloaded data in the next scheduled loading task of the first scheduled loading task in the decision tree. At the same time, control the first thread to load the remaining preloaded data in the first scheduled loading task, so as to realize parallel execution of the first thread and the second thread and improve data loading efficiency.
[0111] Embodiment 2
[0112] Figure 3 It is a structural diagram of a business data loading device provided in Embodiment 2 of the present invention.
[0113] In some embodiments, the service data loading device 20 may include a plurality of functional modules composed of program code segments. The program code of each program segment in the service data loading device 20 may be stored in the memory of the electronic device and executed by the at least one processor to execute (see Figure 1 and Figure 2 Description) Function of loading business data.
[0114] In this embodiment, the business data loading device 20 can be divided into multiple functional modules according to the functions it performs. The functional modules may include: a parsing and acquisition module 201, an analysis module 202, a creation module 203, an execution module 204, a startup module 205, a judgment module 206 and a display module 207. The module referred to in the present invention refers to a series of computer-readable instruction segments that can be executed by at least one processor and can complete fixed functions, which are stored in a memory. In this embodiment, the functions of each module will be described in detail in subsequent embodiments.
[0115] The parsing and obtaining module 201 is used to parse the received business data loading request and obtain pre-loading data, wherein the pre-loading data includes at least one scheduled loading task and the dependency relationship between the scheduled loading tasks.
[0116] In this embodiment, when loading business data, the client initiates a business data loading request to the server. Specifically, the client can be a smart phone, IPAD or other existing smart devices, and the server can be a business data loading subsystem. During the business data loading process, the client can send a business data loading request to the business data loading subsystem, and the business data loading subsystem is used to receive the business data loading request sent by the client.
[0117] In an optional embodiment, the parsing and obtaining module 201 parses the received service data loading request, and obtaining the preloaded data includes:
[0118] Parsing the message of the service data loading request to obtain the message information carried by the message;
[0119] Obtaining an identification code of the service system from the message information;
[0120] Based on the identification code of the business system, obtaining a preload interface from a preset interface;
[0121] The preloading interface is called to obtain preloading data, scheduled loading tasks corresponding to the preloading data, and dependencies between scheduled loading tasks.
[0122] In this embodiment, different business systems correspond to different preloading interfaces. Acquiring preloading data through the corresponding preloading interfaces is more targeted and ensures the accuracy of the acquired preloading data.
[0123] Exemplarily, the preloaded data M corresponds to four scheduled loading tasks: A, B, C and D, and the dependency relationship between the scheduled loading tasks is: A→B→C→D.
[0124] The analysis module 202 is used to perform dependency analysis on the preloaded data based on the at least one scheduled loading task and the dependency relationship between the scheduled loading tasks to obtain the preloaded data that each scheduled loading task depends on.
[0125] In this embodiment, the dependency refers to a strong correlation between scheduled loading tasks, that is, the loading order relationship of the scheduled loading tasks is fixed.
[0126] In an optional embodiment, performing dependency analysis on the preloaded data based on the dependency relationship between the at least one scheduled loading task and the scheduled loading tasks to obtain the preloaded data that each scheduled loading task depends on includes:
[0127] Identify the identification code of the business system corresponding to the preloaded data;
[0128] Acquire corresponding business data loading conditions based on the identification code of the business system;
[0129] Dependency analysis is performed on the preloaded data based on the business data loading condition to obtain the preloaded data that each scheduled loading task depends on.
[0130] Furthermore, the dependency analysis of the preloaded data is performed based on the business data loading condition to obtain the preloaded data that each scheduled loading task depends on, including:
[0131] Converting the business data loading condition into a dependency analysis statement;
[0132] The dependency analysis statement and the preloaded data are input into a pre-trained dependency analysis model to obtain the preloaded data that each scheduled loading task depends on.
[0133] In this embodiment, the business data loading condition may be converted into an SQL dependency analysis statement.
[0134] In this embodiment, the dependency analysis model may be pre-trained. Specifically, the training process of the dependency analysis model includes:
[0135] Acquire multiple historical preloaded data and dependency analysis statements corresponding to each of the historical preloaded data;
[0136] Searching for a semantic vector corresponding to a dependency analysis statement corresponding to each of the historical preloaded data from a preset semantic table, and constructing a dependency analysis matrix for each of the historical preloaded data;
[0137] Determining a plurality of dependency analysis matrices of the plurality of historical preloaded data as a dependency analysis sample set;
[0138] Dividing the dependency analysis sample set into a training set and a test set according to a preset ratio;
[0139] Inputting the training set into a preset neural network for training to obtain a dependency analysis model;
[0140] Inputting the test set into the dependency analysis model for testing, and calculating the test pass rate;
[0141] If the test pass rate is greater than or equal to the preset pass rate threshold, it is determined that the dependency analysis model training is completed; if the test pass rate is less than the preset pass rate threshold, the number of training sets is increased and training is repeated.
[0142] In this embodiment, each historical preloaded data may have a dependency relationship with the preloaded data to be loaded, so multiple historical preloaded data and the dependency analysis statements corresponding to each of the historical preloaded data are obtained, and the semantic vector corresponding to each dependency analysis statement is searched in the preset semantic table. Since the dependency analysis statements between the preloaded data are obtained based on semantic analysis, the dependency analysis model is trained according to the semantic vector, so that the trained dependency analysis model is more accurate. The dependency analysis model is used in the subsequent determination of the preloaded data that each scheduled loading task depends on, thereby improving the accuracy of the determined preloaded data that each scheduled loading task depends on, thereby improving the accuracy of subsequent business data loading.
[0143] In this embodiment, the ratio may be preset. For example, the dependency analysis sample set may be divided into a training set and a test set in a ratio of 7 to 3.
[0144] In this embodiment, the preset neural network can be an existing convolutional neural network, a deep learning network, etc., and this embodiment does not limit this.
[0145] In this embodiment, the identification code of the business system is used to uniquely identify the corresponding business system. The corresponding business data loading condition can be obtained based on the identification code of the business system. Specifically, the business data loading condition refers to the preloaded data that the previous scheduled loading task depends on and that the next scheduled loading task needs to use. The business data loading condition can be a fuzzy condition or a precise condition, for example, the preloaded data of M years and N months in the previous scheduled loading task that the next scheduled loading task needs to use.
[0146] In this embodiment, a dependency analysis is performed on the preloaded data based on the dependency relationship between the at least one scheduled loading task and the scheduled loading tasks to obtain the preloaded data that each scheduled loading task depends on, thereby solving the problem in the prior art of executing the next scheduled loading task after the previous scheduled loading task is completed. By determining the preloaded data that each scheduled loading task depends on, when the dependency data corresponding to the previous scheduled loading task that the next scheduled loading task depends on is loaded in the previous scheduled loading task, the next scheduled loading task can be started, thereby realizing parallel loading of multiple scheduled loading tasks and improving the efficiency of subsequent business loading.
[0147] The creation module 203 is used to create a decision tree according to the preloaded data and the preloaded data that each scheduled loading task depends on.
[0148] In this embodiment, the decision tree includes multiple scheduled loading task branches, each scheduled loading task branch corresponds to a scheduled loading task node, and each scheduled loading task node includes preloaded data of the scheduled loading task and dependent preloaded data.
[0149] In an optional embodiment, the creation module 203 creates a decision tree according to the preloaded data and the preloaded data that each scheduled loading task depends on, including:
[0150] Converting the scheduled loading task node corresponding to the scheduled loading task of the preloaded data into a corresponding decision tree node, wherein the decision tree node contains the preloaded data of the scheduled loading task and the dependent preloaded data;
[0151] Converting the dependency relationship between the scheduled loading task nodes corresponding to the scheduled loading tasks in the preloaded data into edges between the nodes in the corresponding decision tree, wherein the edges between the nodes in the decision tree serve as the dependency relationship between the nodes of the decision tree;
[0152] A decision tree for the preloaded data is created according to the nodes of the decision tree and the edges between the nodes in the decision tree.
[0153] In this embodiment, a decision tree is created based on the dependency relationship between the scheduled loading tasks corresponding to the preloaded data and the preloaded data that each scheduled loading task depends on. In the subsequent execution process, confusion in the execution of the scheduled loading tasks is avoided, and the data loading efficiency and accuracy are improved.
[0154] The execution module 204 is used to execute the decision tree and return the execution result.
[0155] In an optional embodiment, if Figure 2 The flowchart of executing the decision tree in the business data loading method provided is shown, wherein the execution module 204 executes the decision tree including:
[0156] The starting module 205 is used to start the first thread to load the preloaded data in the first scheduled loading task node in the decision tree.
[0157] In this embodiment, a thread may be pre-set for each scheduled loading task node in the decision tree. Specifically, when loading the preloaded data in the first scheduled loading task node in the decision tree, the loading may be performed by starting the first thread.
[0158] The judgment module 206 is used to judge whether the preloaded data that the next scheduled loading task of the first scheduled loading task depends on has been loaded.
[0159] In an optional embodiment, the judging module 206 judges whether the preloaded data that the next scheduled loading task of the first scheduled loading task depends on has been loaded, including:
[0160] The loaded data of the first scheduled loading task received in real time are matched in sequence with the preloaded data that the next scheduled loading task of the first scheduled loading task depends on, until the preloaded data that the next scheduled loading task of the first scheduled loading task depends on is completely matched, and it is determined that the preloaded data that the next scheduled loading task of the first scheduled loading task depends on is loaded completely.
[0161] In this embodiment, by receiving the loaded data of the first scheduled loading task in real time and matching it with the preloaded data that the next scheduled loading task of the first scheduled loading task depends on, there is no need to wait until all the preloaded data in the first scheduled loading task is loaded before matching, which saves time and quickly determines whether the preloaded data that the next scheduled loading task of the first scheduled loading task depends on is loaded, thereby improving the efficiency of subsequent data loading.
[0162] The startup module 205 is also used to start the second thread to load the preloaded data in the next scheduled loading task of the first scheduled loading task of the decision tree when it is detected that the preloaded data that the next scheduled loading task of the first scheduled loading task depends on has been loaded, and control the first thread to load the remaining preloaded data in the first scheduled loading task, wherein the first thread and the second thread are executed in parallel.
[0163] In this embodiment, when the second thread is started to load the preloaded data in the next scheduled loading task of the first scheduled loading task of the decision tree, the first thread is controlled to load the remaining preloaded data in the first scheduled loading task at the same time, so that the first thread and the second thread are executed in parallel, thereby improving data loading efficiency.
[0164] The execution module 204 repeatedly executes the determination of whether the preloaded data that the next scheduled loading task of the first scheduled loading task depends on has been loaded, and when it is detected that the preloaded data that the next scheduled loading task of the first scheduled loading task depends on has been loaded, starts the second thread to load the preloaded data in the next scheduled loading task of the first scheduled loading task in the decision tree, and controls the first thread to load the remaining preloaded data in the first scheduled loading task, until the preloaded data in all scheduled loading tasks in the decision tree are loaded, and returns the execution result.
[0165] In this embodiment, when the preloaded data in all the task loading nodes included in the decision tree are loaded completely, the loading task is executed.
[0166] The display module 207 is used to display the loaded data of each scheduled loading task according to the dependency relationship between the scheduled loading tasks when it is detected that the preloaded data in all scheduled loading tasks in the decision tree has been loaded.
[0167] Exemplarily, there are four scheduled tasks for pre-loading data corresponding to the business data loading request, and the four scheduled tasks are strongly associated, A→B→C→D. The task loading process of the prior art is: A→Aredis→B→Bredis→C→Credis→D. Each time a scheduled loading task is loaded, a copy is cached, and then the next scheduled loading task is loaded. If Credis has not obtained the latest business data for that evening by 8:55 am during the daytime work, the D scheduled loading task cannot be loaded, and the loading efficiency is low. At the same time, deviations occur when performing statistics on C and D data, resulting in low data loading accuracy.
[0168] In this embodiment, the preloaded data in the scheduled loading task A that the scheduled loading task B depends on is determined, and the first thread is started to load the scheduled loading task A in the decision tree. When the preloaded data in the scheduled loading task A that the scheduled loading task B depends on is loaded, the scheduled loading task B is started synchronously. When the preloaded data in the scheduled loading task B that the scheduled loading task C depends on is loaded, the scheduled loading task C is started synchronously. When the preloaded data in the scheduled loading task C that the scheduled loading task D depends on is loaded, the scheduled loading task D is started synchronously, so that four scheduled loading tasks are executed in parallel, thereby improving the efficiency of business data loading.
[0169] Furthermore, when it is detected that the preloaded data that the next scheduled loading task of the first scheduled loading task depends on has not been loaded completely, the loading continues.
[0170] In summary, the business data loading device described in this embodiment performs dependency analysis on the preloaded data based on the dependency relationship between the at least one scheduled loading task and the scheduled loading tasks to obtain the preloaded data that each scheduled loading task depends on. By determining the preloaded data that each scheduled loading task depends on, when the dependency data corresponding to the previous scheduled loading task that the next scheduled loading task depends on is loaded in the previous scheduled loading task, the next scheduled loading task can be started, thereby realizing parallel loading of multiple scheduled loading tasks and improving the subsequent business loading efficiency. A decision tree is created based on the preloaded data and the preloaded data that each scheduled loading task depends on. In the subsequent execution process, confusion is avoided during the execution of the scheduled loading task loading process, thereby improving the data loading efficiency and accuracy. Start the first thread to load the preloaded data in the first scheduled loading task node in the decision tree. When it is detected that the preloaded data that the next scheduled loading task of the first scheduled loading task depends on has been loaded, start the second thread to load the preloaded data in the next scheduled loading task of the first scheduled loading task in the decision tree. At the same time, control the first thread to load the remaining preloaded data in the first scheduled loading task, so as to realize parallel execution of the first thread and the second thread and improve data loading efficiency.
[0171] Embodiment 3
[0172] See also Figure 4 FIG. 2 is a schematic diagram of the structure of an electronic device provided in Embodiment 3 of the present invention. In a preferred embodiment of the present invention, the electronic device 3 includes a memory 31 , at least one processor 32 , at least one communication bus 33 and a transceiver 34 .
[0173] Those skilled in the art should understand that Figure 4 The structure of the electronic device shown does not constitute a limitation of the embodiments of the present invention, and may be a bus structure or a star structure. The electronic device 3 may also include more or less other hardware or software than shown in the figure, or a different component arrangement.
[0174] In some embodiments, the electronic device 3 is an electronic device that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes but is not limited to microprocessors, application-specific integrated circuits, programmable gate arrays, digital processors, and embedded devices. The electronic device 3 may also include client devices, which include but are not limited to any electronic product that can interact with a client through a keyboard, mouse, remote control, touchpad, or voice-controlled device, such as a personal computer, tablet computer, smart phone, digital camera, etc.
[0175] It should be noted that the electronic device 3 is only an example, and other existing or future electronic products that are suitable for the present invention should also be included in the protection scope of the present invention and included here by reference.
[0176] In some embodiments, the memory 31 is used to store program codes and various data, such as the service data loading device 20 installed in the electronic device 3, and to achieve high-speed and automatic access to programs or data during the operation of the electronic device 3. The memory 31 includes a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), a one-time programmable read-only memory (OTPROM), an electronically erasable programmable read-only memory (EEPROM), a compact disc (CD-ROM) or other optical disc storage, magnetic disk storage, magnetic tape storage, or any other computer-readable medium that can be used to carry or store data.
[0177] In some embodiments, the at least one processor 32 may be composed of an integrated circuit, for example, a single packaged integrated circuit, or a plurality of packaged integrated circuits with the same or different functions, including one or more central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and combinations of various control chips, etc. The at least one processor 32 is the control core (Control Unit) of the electronic device 3, and uses various interfaces and lines to connect various components of the entire electronic device 3, and executes various functions and processes data of the electronic device 3 by running or executing programs or modules stored in the memory 31, and calling data stored in the memory 31.
[0178] In some embodiments, the at least one communication bus 33 is configured to implement connection and communication between the memory 31 and the at least one processor 32, etc.
[0179] Although not shown, the electronic device 3 may also include a power source (such as a battery) for supplying power to each component. Optionally, the power source may be logically connected to the at least one processor 32 through a power management device, so that the power management device can manage charging, discharging, and power consumption management. The power source may also include one or more DC or AC power sources, recharging devices, power failure detection circuits, power converters or inverters, power status indicators, and other arbitrary components. The electronic device 3 may also include a variety of sensors, Bluetooth modules, Wi-Fi modules, etc., which will not be repeated here.
[0180] It should be understood that the embodiment is for illustration only and the scope of the patent application is not limited to this structure.
[0181] The above-mentioned integrated unit implemented in the form of a software function module can be stored in a computer-readable storage medium. The above-mentioned software function module is stored in a storage medium and includes a number of instructions for enabling a computer device (which can be a personal computer, electronic device, or network device, etc.) or a processor to execute a part of the method described in each embodiment of the present invention.
[0182] In a further embodiment, in combination Figure 4 The at least one processor 32 can execute the operating device of the electronic device 3 and various installed application programs (such as the business data loading device 20), program codes, etc., for example, the above-mentioned modules.
[0183] The memory 31 stores program codes, and the at least one processor 32 can call the program codes stored in the memory 31 to execute related functions. For example, Figure 3 The modules described in the embodiment are program codes stored in the memory 31 and are executed by the at least one processor 32, thereby realizing the functions of the modules and achieving the purpose of loading business data.
[0184] Exemplarily, the program code may be divided into one or more modules / units, which are stored in the memory 31 and executed by the processor 32 to complete the present application. The one or more modules / units may be a series of computer-readable instruction segments capable of completing specific functions, which are used to describe the execution process of the program code in the electronic device 3. For example, the program code may be divided into a parsing and acquisition module 201, an analysis module 202, a creation module 203, an execution module 204, a startup module 205, a judgment module 206, and a display module 207.
[0185] In one embodiment of the present invention, the memory 31 stores a plurality of computer-readable instructions, and the plurality of computer-readable instructions are executed by the at least one processor 32 to implement the function of loading business data.
[0186] Specifically, the specific implementation method of the at least one processor 32 for the above instructions can refer to Figure 1 and Figure 2 The description of the relevant steps in the corresponding embodiments will not be repeated here.
[0187] In the several embodiments provided by the present invention, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only illustrative, for example, the division of the modules is only a logical function division, and there may be other division methods in actual implementation.
[0188] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, and may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0189] In addition, each functional module in each embodiment of the present invention may be integrated into one processing unit, each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional modules.
[0190] It is obvious to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the present invention can be implemented in other specific forms without departing from the spirit or essential features of the present invention. Therefore, from any point of view, the embodiments should be regarded as exemplary and non-restrictive, and the scope of the present invention is defined by the appended claims rather than the above description, and it is intended that all changes falling within the meaning and scope of the equivalent elements of the claims are included in the present invention. Any figure mark in the claims should not be regarded as limiting the claims involved. In addition, it is obvious that the word "including" does not exclude other units or, and the singular does not exclude the plural. The multiple units or devices stated in the present invention can also be implemented by one unit or device through software or hardware. The words first, second, etc. are used to indicate names, and do not indicate any particular order.
[0191] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solution of the present invention can be modified or replaced by equivalents without departing from the spirit and scope of the technical solution of the present invention.
Claims
1. A method for loading business data, characterized in that: The method comprises: Parsing the received business data loading request to obtain pre-loading data, wherein the pre-loading data includes at least one scheduled loading task and dependencies between the scheduled loading tasks; Performing dependency analysis on the preloaded data based on the dependency relationship between the at least one scheduled loading task and the scheduled loading tasks to obtain the preloaded data that each scheduled loading task depends on; Creating a decision tree based on the preloaded data and the preloaded data that each scheduled loading task depends on; Executing the decision tree and returning the execution result includes: starting the first thread to load the preloaded data in the first scheduled loading task node in the decision tree; determining whether the preloaded data that the next scheduled loading task of the first scheduled loading task depends on has been loaded; when it is detected that the preloaded data that the next scheduled loading task of the first scheduled loading task depends on has been loaded, starting the second thread to load the preloaded data in the next scheduled loading task of the first scheduled loading task in the decision tree, and controlling the first thread to load the remaining preloaded data in the first scheduled loading task, wherein the first thread and the second thread are executed in parallel; repeating the loading of the preloaded data of each scheduled loading task in the decision tree until the preloaded data in all scheduled loading tasks in the decision tree are loaded, and returning the execution result.
2. The business data loading method according to claim 1, characterized in that: The performing dependency analysis on the preloaded data based on the dependency relationship between the at least one scheduled loading task and the scheduled loading tasks to obtain the preloaded data that each scheduled loading task depends on includes: Identify the identification code of the business system corresponding to the preloaded data; Acquire corresponding business data loading conditions based on the identification code of the business system; Dependency analysis is performed on the preloaded data based on the business data loading condition to obtain the preloaded data that each scheduled loading task depends on.
3. The business data loading method according to claim 2, characterized in that: The performing dependency analysis on the preloaded data based on the business data loading condition to obtain the preloaded data that each scheduled loading task depends on includes: Converting the business data loading condition into a dependency analysis statement; The dependency analysis statement and the preloaded data are input into a pre-trained dependency analysis model to obtain the preloaded data that each scheduled loading task depends on.
4. The business data loading method according to claim 3, characterized in that: The training process of the dependency analysis model includes: Acquire multiple historical preloaded data and dependency analysis statements corresponding to each of the historical preloaded data; Searching for a semantic vector corresponding to a dependency analysis statement corresponding to each of the historical preloaded data from a preset semantic table, and constructing a dependency analysis matrix for each of the historical preloaded data; Determining a plurality of dependency analysis matrices of the plurality of historical preloaded data as a dependency analysis sample set; Dividing the dependency analysis sample set into a training set and a test set according to a preset ratio; Inputting the training set into a preset neural network for training to obtain a dependency analysis model; Inputting the test set into the dependency analysis model for testing, and calculating the test pass rate; If the test pass rate is greater than or equal to the preset pass rate threshold, it is determined that the dependency analysis model training is completed; if the test pass rate is less than the preset pass rate threshold, the number of training sets is increased and training is repeated.
5. The business data loading method according to claim 1, characterized in that: The creating a decision tree according to the preloaded data and the preloaded data that each scheduled loading task depends on comprises: Converting the scheduled loading task node corresponding to the scheduled loading task of the preloaded data into a corresponding decision tree node, wherein the decision tree node contains the preloaded data of the scheduled loading task and the dependent preloaded data; Converting the dependency relationship between the scheduled loading task nodes corresponding to the scheduled loading tasks in the preloaded data into edges between the nodes in the corresponding decision tree, wherein the edges between the nodes in the decision tree serve as the dependency relationship between the nodes of the decision tree; A decision tree for the preloaded data is created according to the nodes of the decision tree and the edges between the nodes in the decision tree.
6. The business data loading method according to claim 1, characterized in that: The determining whether the preloaded data that the next scheduled loading task of the first scheduled loading task depends on has been loaded includes: The loaded data of the first scheduled loading task received in real time are matched in sequence with the preloaded data that the next scheduled loading task of the first scheduled loading task depends on, until the preloaded data that the next scheduled loading task of the first scheduled loading task depends on is completely matched, and it is determined that the preloaded data that the next scheduled loading task of the first scheduled loading task depends on is loaded completely.
7. The business data loading method according to any one of claims 1 to 6, characterized in that: The method further comprises: When it is detected that the preloaded data in all scheduled loading tasks in the decision tree are loaded completely, the loaded data of each scheduled loading task is displayed according to the dependency relationship between the scheduled loading tasks.
8. A business data loading device, characterized in that: The device comprises: A parsing and obtaining module, used to parse the received business data loading request and obtain pre-loading data, wherein the pre-loading data includes at least one scheduled loading task and dependencies between scheduled loading tasks; An analysis module, configured to perform dependency analysis on the preloaded data based on the dependency relationship between the at least one scheduled loading task and the scheduled loading tasks, to obtain the preloaded data that each scheduled loading task depends on; A creation module, used to create a decision tree according to the preloaded data and the preloaded data that each scheduled loading task depends on; An execution module is used to execute the decision tree and return an execution result, including: starting a first thread to load preloaded data in a first scheduled loading task node in the decision tree; determining whether the preloaded data that the next scheduled loading task of the first scheduled loading task depends on has been loaded; when it is detected that the preloaded data that the next scheduled loading task of the first scheduled loading task depends on has been loaded, starting a second thread to load the preloaded data in the next scheduled loading task of the first scheduled loading task in the decision tree, and controlling the first thread to load the remaining preloaded data in the first scheduled loading task, wherein the first thread and the second thread are executed in parallel; repeatedly executing the loading of the preloaded data of each scheduled loading task in the decision tree until the preloaded data in all scheduled loading tasks in the decision tree are loaded, and returning the execution result.
9. An electronic device, characterized in that: The electronic device includes a processor and a memory, and the processor is used to implement the business data loading method as described in any one of claims 1 to 7 when executing the computer program stored in the memory.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the business data loading method according to any one of claims 1 to 7 is implemented.
