File data storage method and device, equipment, storage medium and product
By using the control scheduling platform and tree structure model to store file data in a decentralized environment, the inefficiency problem caused by frequent resource inspections between nodes is solved, and efficient parallel data processing and storage is achieved.
Patent Information
- Application Number
- CN202411461884.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-18
- Publication Date
- 2025-03-07
AI Technical Summary
In a decentralized environment, frequent inspection of resource usage between nodes leads to inefficient file data entry.
Through the control scheduling platform, the task set generated by the file data to be loaded is allocated to the workflow nodes under the preset tree structure model, and the workflow nodes are loaded in parallel, and finally the data is written to the database.
Centralized control of the database is realized, and the waiting time is reduced through parallel processing, the overall processing speed is improved, and the task execution order is optimized, so as to improve the efficiency of file data entry into the database.
Smart Images

Figure CN119577006A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to methods, devices, equipment, storage media and products for storing file data. Background Art
[0002] In the information age, the rapid flow and real-time nature of data are crucial to the operation of enterprises. With the advancement of technology, the interaction between enterprise systems is becoming more and more frequent, and the real-time transmission and storage of data have become key indicators for measuring system performance. In this context, the system needs to have strong concurrent processing capabilities to support the real-time processing and storage of large amounts of data, ensuring that users can quickly obtain the latest data from online databases, thereby improving business response speed and user experience.
[0003] In related technologies, corresponding data loading and storage rules are usually set on the terminal nodes of each database to realize the storage of large amounts of text data. However, in this method, the resource overhead is large when the nodes need to frequently check the resource usage in a decentralized environment, resulting in low efficiency in the storage of file data.
[0004] The above contents are only used to assist in understanding the technical solution of the present application and do not constitute an admission that the above contents are prior art. Summary of the invention
[0005] The main purpose of this application is to provide a method for storing file data in a database, aiming to solve the technical problem of low efficiency in storing file data in a database.
[0006] To achieve the above purpose, the present application proposes a method for storing file data, the method comprising:
[0007] Acquire file data to be loaded, and generate a corresponding task set based on the file data to be loaded;
[0008] Based on the preset workflow configuration information, the task set is assigned to the workflow node under the preset tree structure model;
[0009] The workflow nodes are loaded with data in parallel to obtain loaded target data, and the target data is written into a corresponding database to obtain a data storage result.
[0010] Optionally, the step of performing parallel data loading on the workflow nodes to obtain loaded target data includes:
[0011] Get workflow node dependencies;
[0012] Based on the workflow node dependency, data of each round of workflow nodes is loaded in parallel in a recursive manner to obtain loading data of each workflow node;
[0013] The loaded data of each workflow node are merged to obtain loaded target data.
[0014] Optionally, the step of performing parallel data loading on workflow nodes of each round in a recursive manner based on the workflow node dependency to obtain loaded data of each workflow node includes:
[0015] Based on the workflow node dependency, determining the leaf nodes of the workflow nodes in the current round;
[0016] Performing parallel data loading on the leaf nodes to obtain loaded data of the leaf nodes;
[0017] After the leaf nodes of the current round are removed from the workflow nodes, the parallel data loading of the leaf nodes of the next round is recursively executed until the data loading of the root node is completed, and the loading data of each workflow node is obtained.
[0018] Optionally, the step of determining the leaf node of the workflow node in the current round based on the workflow node dependency relationship includes:
[0019] Performing node inversion conversion on the workflow node dependency to obtain a converted workflow node dependency, wherein a leaf node in the converted workflow node dependency is a root node in the workflow node dependency, and a root node in the converted workflow node dependency is a leaf node in the workflow node dependency;
[0020] Based on the converted workflow node dependency, the leaf nodes of the workflow nodes in the current round are determined.
[0021] Optionally, before the step of allocating the task set to a workflow node under a tree structure model based on preset workflow configuration information, the method includes:
[0022] In response to the workflow update instruction, obtaining task information to be updated and workflow configuration information before updating;
[0023] Based on the task information to be updated, generating corresponding configuration update information, wherein the configuration update information includes update task configuration information and target dependency relationship of the update task configuration information;
[0024] Based on the updated task configuration information and the target dependency relationship, the workflow configuration information before the update is updated to obtain the updated workflow configuration information.
[0025] Optionally, the method for storing file data further includes:
[0026] During the data loading process of each workflow node, determining in real time whether an abnormality occurs in the data loading task of each workflow node;
[0027] If an exception occurs in the data loading task, the abnormal workflow node corresponding to the data loading task is marked, and the state of the data loading task is reset to the initial state;
[0028] Based on a preset allocation strategy, a target workflow node is selected from the workflow node list to re-execute the data loading task to obtain the loading data of the target workflow node.
[0029] In addition, to achieve the above-mentioned purpose, the present application also proposes a file data storage device, the file data storage device comprising:
[0030] An acquisition module, used for acquiring file data to be loaded, and generating a corresponding task set based on the file data to be loaded;
[0031] An allocation module, used to allocate the task set to a corresponding workflow node based on preset workflow configuration information;
[0032] The loading module is used to load data in parallel to the workflow nodes to obtain the loaded target data, and write the target data into the corresponding database to obtain the data storage result.
[0033] In addition, to achieve the above-mentioned purpose, the present application also proposes a file data storage device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, and the computer program is configured to implement the steps of the file data storage method described above.
[0034] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by the processor, the steps of the file data storage method described above are implemented.
[0035] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the steps of the file data storage method described above are implemented.
[0036] One or more technical solutions proposed in this application have at least the following technical effects:
[0037] Compared with the related art, which usually sets corresponding data loading and warehousing rules on the terminal nodes of each database to realize the warehousing of a large amount of text data. However, in this method, the resource overhead between nodes in a decentralized environment is large when it is necessary to frequently check the resource usage, resulting in low efficiency of file data warehousing. In comparison, the present application proposes to control the scheduling platform to assign the task set generated by the file data to be loaded to the workflow node under the preset tree structure model, and then load the data in parallel on the workflow node to obtain the loaded target data, and finally write the target data into the corresponding database to obtain the data warehousing result. It can be understood that the present application realizes the centralized control of file data warehousing in the database through the control scheduling platform, specifically, the control scheduling platform is used to assign the task set to multiple workflow nodes, so that the workflow nodes can process data loading tasks in parallel, so as to realize that each workflow node executes data loading at the same time, reduces waiting time, improves the overall processing speed, and optimizes the execution order of tasks by using the tree structure model, thereby improving the concurrent execution capability, and thus improving the efficiency of file data warehousing. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0039] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0040] Figure 1 A flowchart of the first embodiment of the method for storing document data in this application;
[0041] Figure 2 This is a schematic diagram of the system structure in the data storage method of this application document;
[0042] Figure 3 This is a schematic diagram of the logic execution in the data storage method of this application document;
[0043] Figure 4 This is a schematic diagram of the execution process of the tree structure task of the control center in the data storage method of the application document;
[0044] Figure 5 A flowchart of a second embodiment of the method for storing document data in this application;
[0045] Figure 6 This is a schematic diagram of the module structure of the file data storage device of the embodiment of the present application;
[0046] Figure 7 Schematic diagram of the device structure of the hardware operating environment involved in the file data storage method in the embodiment of the present application.
[0047] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0048] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.
[0049] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.
[0050] The main solution of the embodiment of the present application is: obtain the file data to be loaded, and generate a corresponding task set based on the file data to be loaded; based on the preset workflow configuration information, assign the task set to the workflow node under the preset tree structure model; perform parallel data loading on the workflow node to obtain the loaded target data, and write the target data into the corresponding database to obtain the data warehousing result.
[0051] In this embodiment, the file data storage device is used as the execution body. For the convenience of description, it will be explained as a "platform" hereinafter.
[0052] In the related technologies, corresponding data loading and storage rules are usually set on the terminal nodes of each database to realize the storage of large amounts of text data. However, in this method, the resource overhead is large when the nodes need to frequently check the resource usage in a decentralized environment, resulting in low efficiency in the storage of file data.
[0053] The present application provides a solution to achieve the storage of large amounts of text data, thereby improving the efficiency of file data storage.
[0054] From the above embodiments, it can be seen that the present application proposes to assign the task set generated by the file data to be loaded to the workflow node under the preset tree structure model through the control scheduling platform, and then load the data in parallel to the workflow node to obtain the loaded target data, and finally write the target data into the corresponding database to obtain the data storage result. It can be understood that the present application realizes the centralized control of the file data storage in the database through the control scheduling platform, specifically, the control scheduling platform is used to assign the task set to multiple workflow nodes, so that the workflow nodes can process the data loading tasks in parallel, so as to realize the simultaneous execution of data loading by each workflow node, reduce the waiting time, improve the overall processing speed, and use the tree structure model to optimize the execution order of tasks, thereby improving the concurrent execution capability, and then improving the efficiency of file data storage.
[0055] It should be noted that the execution subject of this embodiment can be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or an electronic device capable of realizing the above functions, a terminal system, etc. The following takes a file data storage device as an example to illustrate this embodiment and the following embodiments.
[0056] Based on this, the present application embodiment provides a method for storing file data. Figure 1 , Figure 1 This is a flow chart of the first embodiment of the method for storing document data in this application.
[0057] In this embodiment, the file data storage method is applied to a control scheduling platform, and the file data storage method includes steps S100 to S300:
[0058] Step S100, obtaining file data to be loaded, and generating a corresponding task set based on the file data to be loaded;
[0059] It should be noted that the file data to be loaded refers to the file data to be loaded and stored in the database. In the scenario of this application, it is usually a large amount of file data. Specifically, the platform retrieves the original file data to be processed from the data source (file system, database, API interface, etc.). File data includes log files, text documents, CSV / JSON / XML files, images or any other type of data files. The acquisition process involves operations such as reading file content, verifying file integrity, and parsing file formats.
[0060] In the specific implementation, after the platform obtains the file data to be loaded, the platform generates a series of tasks for its data, which will be used for subsequent data loading and processing. Task set refers to the decomposition of large files or complex data processing work into multiple small tasks for parallel processing or distributed processing. Each task may target a part of the file data. For example, a task may be responsible for loading a specific area of the file or processing a specific type of record. The generation of task sets usually needs to consider factors such as data characteristics, processing requirements, and system resources to ensure the reasonable division and efficient execution of tasks. The purpose of this process is to improve the overall data loading efficiency by decomposing the data processing work into multiple tasks so that data can be loaded and processed in parallel. In large-scale data processing scenarios, this method can significantly reduce the total time required for data processing and improve the throughput of the system.
[0061] Step S200, based on preset workflow configuration information, assigning the task set to a workflow node under a preset tree structure model;
[0062] It should be noted that the workflow configuration information is predefined, and the workflow configuration information specifies how to process tasks, dependencies between tasks, the execution order of tasks, etc. The workflow configuration information includes but is not limited to the type of task, the resources required for each task, the execution conditions of the task, the priority of the task, etc.
[0063] In the specific implementation, the tree structure model is a hierarchical organization method for managing and scheduling tasks. In this model, tasks are organized into a tree structure, and each node represents a workflow node, that is, a specific work task or processing step. The root node of the tree in the tree structure model usually represents the beginning of the entire workflow, while the branches and leaf nodes represent the intermediate steps and final steps in the workflow. The workflow node is an element in the tree structure. The workflow node defines the specific location and context of task execution. Each node has different attributes, such as the server that executes the node task, the execution time, the data required for execution, etc.
[0064] Furthermore, the platform will assign each task in the task set to the corresponding node in the tree structure model according to the preset workflow configuration information. This process involves task scheduling algorithms, such as polling, priority scheduling, least job priority, etc., to ensure that tasks can be executed efficiently and according to the predetermined logic. Once tasks are assigned to workflow nodes, they can be executed on the corresponding nodes. That is, tasks will be executed in parallel on different servers or service instances.
[0065] The above process emphasizes the preset and flexibility of the workflow management system. The platform dynamically allocates and schedules tasks according to predefined rules and models, thereby improving the efficiency and reliability of data processing. In practical applications, this method can help automate complex data processing processes and ensure that tasks are executed in the correct order and conditions.
[0066] In a specific implementation, before the step of allocating the task set to the workflow node under the tree structure model based on the preset workflow configuration information, the method includes:
[0067] In response to a workflow update instruction, the task information to be updated and the workflow configuration information before the update are obtained; based on the task information to be updated, corresponding configuration update information is generated, wherein the configuration update information includes the update task configuration information and the target dependency relationship of the update task configuration information; based on the update task configuration information and the target dependency relationship, the workflow configuration information before the update is updated to obtain the updated workflow configuration information.
[0068] Understandably, when there is an update requirement, the platform will receive a workflow update instruction, which may be due to a user request, a problem found by system monitoring, or a trigger of an automated script. The platform needs to obtain two key pieces of information from the workflow update instruction: one is the task information to be updated, that is, the specific task information that needs to be changed; the other is the configuration information of the current workflow, that is, the status before the update.
[0069] In the specific implementation, based on the task information to be updated, the platform will generate configuration update information. The updated task configuration information specifically indicates which task attributes will be updated, such as the order of task execution, allocated resources, execution conditions, etc.; target dependency refers to the impact of the updated task on other tasks, including new dependencies and dependencies.
[0070] Furthermore, the platform uses the generated configuration update information to update the existing workflow configuration. The above configuration updates involve operations such as modifying task attributes, adjusting dependencies between tasks, and reallocating resources. After the update operation is completed, the platform saves the new workflow configuration information, which represents the new state of the workflow.
[0071] In the specific implementation, the purpose of the above workflow extension process is to ensure that the workflow can flexibly adapt to changes while maintaining the continuity and consistency of work. In actual operation, this may involve complex logic and data operations, requiring the workflow management system to have efficient data processing capabilities and a stable update mechanism. In addition, the update operation may require version control and rollback strategies to ensure that it can be restored to a stable state when the update fails.
[0072] Furthermore, all loading tasks and dependencies of this application are configured, which can clearly display the execution order of each task node, dependent task nodes, information of the task nodes being loaded, etc., and can easily expand the workflow.
[0073] Step S300, parallel data loading is performed on the workflow nodes to obtain loaded target data, and the target data is written into a corresponding database to obtain a data storage result.
[0074] It is understandable that the platform performs parallel data loading on the workflow nodes to obtain the loaded target data. Specifically, the platform performs data loading operations on multiple workflow nodes at the same time. Parallel means that tasks on multiple nodes can be executed simultaneously, rather than sequentially. In this way, the efficiency of data loading can be significantly improved because it allows the system to use all available resources to process data simultaneously, rather than waiting for one task to be completed before starting another task.
[0075] In the specific implementation, after parallel data loading, the original data is processed and converted into the required format or structure. The converted data is called target data. Specifically, the target data is the data ready to be stored in the database after preprocessing steps such as cleaning, verification, and conversion.
[0076] In the specific implementation, when the target data is ready, the next step of the platform is to write (insert or update) this data into the pre-specified database. This process involves database transaction management to ensure the consistency and integrity of the data.
[0077] Furthermore, after the data is written to the database, the result of the operation (success or failure) will be recorded and returned. This result is usually called the "data entry result". The data entry result is very important for monitoring the data processing process, ensuring data accuracy, and performing subsequent error handling.
[0078] In the specific implementation, the above process emphasizes how to efficiently process and store large amounts of data in workflow management. Through parallel processing and precise data management, data can be quickly and accurately loaded into the database, thereby supporting the company's data analysis and decision-making.
[0079] In the specific implementation, refer to Figure 2 This application is based on the online database of large batches of file data, which can automatically or semi-automatically adapt to file data, reducing the complexity of development and maintenance. It reduces the access cost and makes the access and docking of new scenarios more convenient and efficient. At the same time, it provides accurate progress search results by monitoring the process.
[0080] In a specific implementation, the platform performs parallel data loading on the workflow nodes to obtain the loaded target data, including:
[0081] Obtaining workflow node dependencies; based on the workflow node dependencies, recursively loading data for each round of workflow nodes in parallel to obtain loaded data for each workflow node; merging the loaded data for each workflow node to obtain loaded target data.
[0082] In the specific implementation, the platform first needs to identify and obtain the dependencies between the nodes in the workflow. The dependencies define the execution order between the nodes, that is, the tasks of some nodes must be completed before the tasks of other nodes can be started. And using these dependencies, the platform will use a recursive method to process the nodes in the workflow. Recursion is a method that calls itself in a function, which allows the system to traverse the node tree level by level until all leaf nodes (nodes without child nodes) are processed.
[0083] Furthermore, during the recursive process, the platform will load data to each node in parallel. This means that the platform can process data loading tasks for multiple nodes at the same time, rather than waiting for the task of one node to be completed before starting the task of another node. Parallel processing can significantly improve the efficiency of data processing. Finally, each workflow node will generate or process specific data during the parallel data loading process and obtain the loaded data, which is the result of the node task execution.
[0084] In the specific implementation, when all nodes have loaded data, the platform merges the data into a unified format or structure. The merging process involves data integration, splicing, or other forms of data combination. The result of the merger is the loaded target data, which is the final output of the entire workflow processing. This data can now be used for further analysis, storage, or other processing.
[0085] In the specific implementation, the purpose of the above process is to efficiently process and integrate data from multiple workflow nodes, ensure data integrity and consistency, and use parallel processing and recursive methods to optimize performance and resource utilization. This method is suitable for complex workflows where data loading and processing need to consider the dependencies between nodes.
[0086] In a specific implementation, the platform performs parallel data loading on workflow nodes of each round in a recursive manner based on the workflow node dependency relationship to obtain the loading data of each workflow node, including:
[0087] Based on the workflow node dependency, the leaf nodes of the workflow nodes in the current round are determined; the leaf nodes are loaded with data in parallel to obtain the loaded data of the leaf nodes; after the leaf nodes of the current round are removed from the workflow nodes, the parallel data loading of the leaf nodes of the next round is recursively executed until the data loading of the root node is completed, thereby obtaining the loaded data of each workflow node.
[0088] In a specific implementation, the platform determines the leaf nodes of the workflow nodes in the current round based on the workflow node dependencies. Specifically, in each round of the workflow, the platform first needs to identify the leaf nodes of the current round. Leaf nodes refer to workflow nodes that have no child nodes and do not depend on other unfinished nodes, that is, they are ready to start executing data loading tasks. Once the leaf nodes are identified, the platform will load data to these nodes in parallel. This means that all leaf nodes can start loading data at the same time instead of waiting for other nodes to complete. Parallel processing can significantly improve processing speed and efficiency.
[0089] Furthermore, each leaf node will generate data during the parallel data loading process, which is called the “loaded data of the leaf node.” After the data loading of the leaf nodes is completed, these nodes will be removed from the workflow nodes, indicating that they have completed their tasks.
[0090] In the specific implementation, the platform will recursively repeat the above process, that is, identify new leaf nodes and perform parallel data loading until all nodes have completed data loading. Recursion is a programming technique that calls itself in a function. Recursion allows the system to automatically process nodes at each level. This process will continue until the root node of the workflow (the top-level node, without a parent node) has also completed data loading. The completion of the root node marks the end of the data loading process of the entire workflow. After the entire recursive process is completed, the system will collect and integrate the loaded data of all workflow nodes, which represents the results of the entire workflow processing.
[0091] In the specific implementation, the above process is a hierarchical, recursive and parallel data processing flow. The platform processes the nodes with the lowest dependencies (leaf nodes) first, and then moves up layer by layer until the top-level nodes (root nodes), thereby efficiently completing the data loading task of the entire workflow. This method is particularly suitable for processing workflows with complex dependencies, and can ensure the order and integrity of data loading.
[0092] In a specific implementation, the platform determines the leaf node of the workflow node in the current round based on the workflow node dependency, including:
[0093] The workflow node dependency is subjected to a node inversion conversion to obtain a converted workflow node dependency, wherein the leaf node in the converted workflow node dependency is the root node in the workflow node dependency, and the root node in the converted workflow node dependency is the leaf node in the workflow node dependency; based on the converted workflow node dependency, the leaf node of the workflow node in the current round is determined.
[0094] In a specific implementation, the platform performs a node inversion conversion on the workflow node dependency to obtain a converted workflow node dependency, wherein in the original workflow, the node dependency defines the execution order between tasks, wherein the root node is the starting point of the workflow, the leaf node is the end point of the workflow, and there is no node with child nodes. The process of node inversion involves inverting the node structure of the original workflow. In the inverted workflow, the original leaf node (end point) becomes a new root node (starting point), and the original root node (starting point) becomes a new leaf node (end point), thereby obtaining the converted workflow node dependency. Specifically, the purpose of the conversion is usually to change the execution strategy, for example, to change the original parallel execution strategy to serial execution, or to adapt to new business logic and processes. After the conversion, the original root node now becomes a leaf node, which depends on the completion of all other nodes; the original leaf node becomes a root node, which will be executed first, and the execution of other nodes depends on it. After completing the node inversion conversion, the platform will determine the execution order of the tasks based on this new dependency.
[0095] In the specific implementation, the platform determines the leaf nodes in the current round. In the converted workflow, the current round refers to which nodes can be executed first under the new dependency relationship. In the converted workflow, leaf nodes refer to tasks that have no child nodes and do not depend on other nodes. They can be executed immediately because all their predecessor tasks have been completed.
[0096] In the specific implementation, the above process describes a workflow reconfiguration method, which can change the execution order and strategy of tasks by reversing node dependencies. This method can be used to optimize the performance of workflows or adapt to new business needs. In practical applications, this conversion may involve complex logic and data operations, requiring the workflow management system to have flexible configuration capabilities and efficient scheduling mechanisms.
[0097] In the specific implementation, refer to Figure 2First, the platform interface configures the sequential workflows to be executed, initializes the data for concurrent rules, initializes the alarm rules, etc. Furthermore, the processing of the entire workflow is controlled by the control center scheduler in the platform. The entire workflow node depends on the tree structure. Figure 3 , leaf nodes are executed first. After the leaf nodes are executed, they are removed from the tree structure, and then the remaining leaf nodes are executed recursively until the last root node is executed.
[0098] It is understandable that in the leaf node, the processing of loading logic specifically includes:
[0099] (1) Set tasks for source file data and generate corresponding tasks for the file data that needs to be imported into the target library;
[0100] (2) The timing debugging program distributes the generated tasks according to the rules and sends them to the queue through MQ messages;
[0101] (3) The loader consumes the MQ queue information and executes file data loading in parallel;
[0102] (4) Perform statistical verification on the loaded data to ensure the accuracy of the data.
[0103] Compared with the related art, which usually sets corresponding data loading and warehousing rules on the terminal nodes of each database to realize the warehousing of a large amount of text data. However, in this method, the resource overhead between nodes in a decentralized environment is large when it is necessary to frequently check the resource usage, resulting in low efficiency of file data warehousing. In comparison, the present application proposes to control the scheduling platform to assign the task set generated by the file data to be loaded to the workflow node under the preset tree structure model, and then load the data in parallel on the workflow node to obtain the loaded target data, and finally write the target data into the corresponding database to obtain the data warehousing result. It can be understood that the present application realizes the centralized control of file data warehousing in the database through the control scheduling platform, specifically, the control scheduling platform is used to assign the task set to multiple workflow nodes, so that the workflow nodes can process data loading tasks in parallel, so as to realize that each workflow node executes data loading at the same time, reduces waiting time, improves the overall processing speed, and optimizes the execution order of tasks by using the tree structure model, thereby improving the concurrent execution capability, and thus improving the efficiency of file data warehousing.
[0104] Based on the above first embodiment, the present application also proposes another embodiment, referring to Figure 4 The file data storage method includes the following steps A100-A300:
[0105] Step A100, during the data loading process of each workflow node, determining in real time whether an abnormality occurs in the data loading task of each workflow node;
[0106] In the specific implementation, during the data loading process at each node of the workflow, the platform will monitor the execution status of these tasks in real time. The purpose of real-time monitoring is to promptly discover problems or anomalies that may occur during the data loading process.
[0107] Step A200: if an exception occurs in the data loading task, the abnormal workflow node corresponding to the data loading task is marked, and the state of the data loading task is reset to the initial state;
[0108] In the specific implementation, if a data loading task is found to be abnormal during the monitoring process (for example, loading failure, timeout, data error, etc.), the platform will perform the following operations:
[0109] 1. Mark abnormal workflow nodes: The system will identify abnormal workflow nodes and mark them for subsequent processing and monitoring.
[0110] 2. Reset the data loading task status: The system resets the status of the abnormal task to the initial state, which means that the task will restart execution instead of continuing the current failed state.
[0111] Step A300 , based on a preset allocation strategy, a target workflow node is selected from the workflow node list to re-execute the data loading task to obtain the loading data of the target workflow node.
[0112] In the specific implementation, based on the preset allocation strategy, the platform will select a suitable target workflow node from the workflow node list to re-execute the data loading task. The preset allocation strategy is based on a series of rules or algorithms, such as load balancing, node availability, node processing capacity, etc.
[0113] In the specific implementation, after the platform selects the target workflow node, it will re-execute the data loading task through the target workflow node in order to obtain the correct loading result. After re-executing the task, the platform will obtain the loading data of the target workflow node, which is the result of re-executing the task.
[0114] In the specific implementation, the purpose of the above process is to ensure that the data loading tasks in the workflow can be processed and recovered in a timely manner when an exception occurs, so as to ensure the overall stability of the workflow and the accuracy of the data. Through real-time monitoring, exception marking, state resetting and task reallocation, the system can improve the fault tolerance of data loading tasks and ensure that the execution of key tasks is not affected by individual node exceptions. That is, to avoid the problem of single instance loading failure, after initializing all application instances, if an instance being loaded has an exception, the loading task will be reset to the state after a certain period of time and set to unloaded. The state of the abnormal instance is set to the abnormal state, and the task will be reassigned to a new normal instance for loading, thereby avoiding the impact of a single instance loading failure on the overall loading.
[0115] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the method of storing file data in the present application. More simple transformations based on this technical concept are all within the scope of protection of the present application.
[0116] This application also provides a file data storage device, please refer to Figure 6 , the file data storage device comprises:
[0117] The acquisition module 10 is used to acquire the file data to be loaded, and generate a corresponding task set based on the file data to be loaded;
[0118] An allocation module 20, configured to allocate the task set to a corresponding workflow node based on preset workflow configuration information;
[0119] The loading module 30 is used to perform parallel data loading on the workflow nodes to obtain loaded target data, and write the target data into a corresponding database to obtain a data storage result.
[0120] Optionally, the loading module 30 includes:
[0121] A dependency acquisition module is used to obtain workflow node dependencies;
[0122] A parallel loading module is used to load data in parallel on workflow nodes of each round in a recursive manner based on the workflow node dependency relationship to obtain loading data of each workflow node;
[0123] The merging module is used to merge the loaded data of each workflow node to obtain the loaded target data.
[0124] Optionally, the parallel loading module includes:
[0125] A determination module, configured to determine the leaf nodes of the workflow nodes in the current round based on the workflow node dependency relationship;
[0126] A node loading module, used for performing parallel data loading on the leaf nodes to obtain loading data of the leaf nodes;
[0127] The recursive loading module is used to recursively perform parallel data loading of leaf nodes of the next round after removing the leaf nodes of the current round from the workflow nodes, until the data loading of the root node is completed, thereby obtaining the loading data of each workflow node.
[0128] Optionally, the determining module includes:
[0129] A conversion module, used for performing node inversion conversion on the workflow node dependency to obtain a converted workflow node dependency, wherein the leaf node in the converted workflow node dependency is the root node in the workflow node dependency, and the root node in the converted workflow node dependency is the leaf node in the workflow node dependency;
[0130] The leaf node determination module is used to determine the leaf nodes of the workflow nodes in the current round based on the converted workflow node dependencies.
[0131] Optionally, the file data storage device further includes:
[0132] A configuration acquisition module, used to obtain task information to be updated and workflow configuration information before updating in response to a workflow update instruction;
[0133] A configuration update information generation module, used to generate corresponding configuration update information based on the task information to be updated, wherein the configuration update information includes update task configuration information and target dependency relationship of the update task configuration information;
[0134] An updating module is used to update the workflow configuration information before the update based on the update task configuration information and the target dependency relationship to obtain the updated workflow configuration information.
[0135] Optionally, the file data storage device further includes:
[0136] A judgment module, used to judge in real time whether an abnormality occurs in the data loading task of each workflow node during the data loading process of each workflow node;
[0137] A reset module, used for marking the abnormal workflow node corresponding to the data loading task and resetting the state of the data loading task to an initial state if an abnormality occurs in the data loading task;
[0138] The selection module is used to select a target workflow node from the workflow node list based on a preset allocation strategy to re-execute the data loading task to obtain the loading data of the target workflow node.
[0139] The file data storage device provided by the present application adopts the file data storage method in the above embodiment to solve the technical problem of file data storage. Compared with the prior art, the beneficial effects of the file data storage device provided by the present application are the same as the beneficial effects of the file data storage method provided by the above embodiment, and other technical features in the file data storage device are the same as the features disclosed in the above embodiment method, which will not be repeated here.
[0140] The present application provides a file data storage device, which includes: at least one processor; and a memory that is communicatively connected to the at least one processor; wherein the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the file data storage method in the above-mentioned embodiment one.
[0141] Reference below Figure 7 , which shows a schematic diagram of the structure of a file data storage device suitable for implementing the embodiment of the present application. The file data storage device in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 7 The file data storage device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0142] like Figure 7As shown, the file data storage device may include a processing device 1001 (such as a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM: Read Only Memory) 1002 or the program loaded from the storage device 1003 to the random access memory (RAM: Random Access Memory) 1004. In the RAM 1004, various programs and data required for the operation of the file data storage device are also stored. The processing device 1001, the ROM 1002 and the RAM 1004 are connected to each other through a bus 1005. The input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the file data storage device to communicate with other devices wirelessly or by wire to exchange data. Although the figure shows a file data storage device with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or provided instead.
[0143] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.
[0144] The file data storage device provided by the present application adopts the file data storage method in the above embodiment to solve the technical problem of file data storage. Compared with the prior art, the beneficial effects of the file data storage device provided by the present application are the same as the beneficial effects of the file data storage method provided by the above embodiment, and other technical features in the file data storage device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.
[0145] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.
[0146] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
[0147] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, wherein the computer-readable program instructions are used to execute the file data warehousing method in the above-mentioned embodiment.
[0148] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the above.
[0149] The computer-readable storage medium may be included in the file data storage device; or may exist independently without being assembled into the file data storage device.
[0150] The computer-readable storage medium carries one or more programs. When the one or more programs are executed by the file data storage device, the file data storage device is enabled to store file data.
[0151] Computer program code for performing the operations of the present application may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0152] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0153] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.
[0154] The readable storage medium provided in the present application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned file data storage method, and can solve the technical problem of file data storage. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in the present application are the same as the beneficial effects of the file data storage method provided in the above-mentioned embodiment, and will not be described in detail here.
[0155] The present application also provides a computer program product, including a computer program, which implements the steps of the above-mentioned file data storage method when executed by a processor.
[0156] The computer program product provided by the present application can solve the technical problem of storing file data. Compared with the prior art, the beneficial effects of the computer program product provided by the present application are the same as the beneficial effects of the file data storing method provided by the above embodiment, which will not be described in detail here.
[0157] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.
Claims
1. A method for storing file data, characterized in that: Applied to the control and dispatching platform, the method for storing file data includes: Acquire file data to be loaded, and generate a corresponding task set based on the file data to be loaded; Based on the preset workflow configuration information, the task set is assigned to the workflow node under the preset tree structure model; The workflow nodes are loaded with data in parallel to obtain loaded target data, and the target data is written into a corresponding database to obtain a data storage result.
2. The method for storing file data as claimed in claim 1, characterized in that: The step of performing parallel data loading on the workflow nodes to obtain loaded target data includes: Get workflow node dependencies; Based on the workflow node dependency, data of each round of workflow nodes is loaded in parallel in a recursive manner to obtain loading data of each workflow node; The loaded data of each workflow node are merged to obtain loaded target data.
3. The method for storing file data in a database according to claim 2, wherein: The step of performing parallel data loading on workflow nodes of each round in a recursive manner based on the workflow node dependency to obtain loading data of each workflow node includes: Based on the workflow node dependency, determining the leaf nodes of the workflow nodes in the current round; Performing parallel data loading on the leaf nodes to obtain loaded data of the leaf nodes; After the leaf nodes of the current round are removed from the workflow nodes, the parallel data loading of the leaf nodes of the next round is recursively executed until the data loading of the root node is completed, and the loading data of each workflow node is obtained.
4. The method for storing file data in a database according to claim 3, wherein: The step of determining the leaf nodes of the workflow nodes in the current round based on the workflow node dependency relationship includes: Performing node inversion conversion on the workflow node dependency to obtain a converted workflow node dependency, wherein a leaf node in the converted workflow node dependency is a root node in the workflow node dependency, and a root node in the converted workflow node dependency is a leaf node in the workflow node dependency; Based on the converted workflow node dependency, the leaf nodes of the workflow nodes in the current round are determined.
5. The method for storing file data in a database according to claim 1, characterized in that: Before the step of allocating the task set to the workflow node under the tree structure model based on the preset workflow configuration information, the method includes: In response to the workflow update instruction, obtaining task information to be updated and workflow configuration information before updating; Based on the task information to be updated, generating corresponding configuration update information, wherein the configuration update information includes update task configuration information and target dependency relationship of the update task configuration information; Based on the updated task configuration information and the target dependency relationship, the workflow configuration information before the update is updated to obtain the updated workflow configuration information.
6. The method for storing file data in a database according to any one of claims 1 to 5, characterized in that: The method for storing file data further includes: During the data loading process of each workflow node, determining in real time whether an abnormality occurs in the data loading task of each workflow node; If an exception occurs in the data loading task, the abnormal workflow node corresponding to the data loading task is marked, and the state of the data loading task is reset to the initial state; Based on a preset allocation strategy, a target workflow node is selected from the workflow node list to re-execute the data loading task to obtain the loading data of the target workflow node.
7. A file data storage device, characterized in that: The device comprises: An acquisition module, used for acquiring file data to be loaded, and generating a corresponding task set based on the file data to be loaded; An allocation module, used to allocate the task set to a corresponding workflow node based on preset workflow configuration information; The loading module is used to load data in parallel to the workflow nodes to obtain the loaded target data, and write the target data into the corresponding database to obtain the data storage result.
8. A file data storage device, characterized in that: The device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the file data storage method according to any one of claims 1 to 6.
9. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the file data storage method according to any one of claims 1 to 6 are implemented.
10. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the steps of the method for storing file data in a database as claimed in any one of claims 1 to 6 are implemented.
