Data transfer method and system
By encapsulating and converting data in the data transfer method, automatic refresh calculation is realized during task planning import and export, and the problem of complex and error-prone import and export process in the existing technology is solved, and the efficiency and accuracy of data migration are improved.
Patent Information
- Application Number
- CN202411977132.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-05-30
AI Technical Summary
The prior art cannot realize automatic refresh calculations during the import and export of task plans, resulting in complex and error-prone users scheduling plans using the system.
Provides a data transfer method, by obtaining the data to be exported from the source database, encapsulate it into a file format supported by the project management software, and converting it into a native file format, so as to realize automatic refresh calculation of task plan, automatic backup and synchronization.
It realizes automatic refresh calculation when importing and exporting tasks, simplifies personnel's arrangement of plans, and improves the efficiency and accuracy of data migration.
Smart Images

Figure CN120067186A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of data processing, and particularly relates to a data transfer method and system. Background Art
[0002] Planning management software is a very useful tool for both individuals and enterprises, which can help improve efficiency, organize work processes, optimize resource allocation, and ensure that projects are completed on time.
[0003] In project management software, the import and export of plans, that is, data migration, is a relatively important function.
[0004] Excel files are commonly used for the import and export of plans. However, Excel files cannot automatically calculate and update plan-related data. Summary of the Invention
[0005] Embodiments of this application provide a data transfer method, which supports automatic refresh calculation during the import and export of task plans and supports automated backup and synchronization.
[0006] In a first aspect, embodiments of this application provide a data transfer method, including:
[0007] Obtaining data to be exported corresponding to selected export fields from a source database;
[0008] Encapsulating the data to be exported according to a first mapping relationship between a first field of the source database and default column fields of project management software to obtain a first file in a first format;
[0009] Converting the first file into a second file according to the selected export fields, where the format of the second file is a second format different from the first format, the first format is a file format supported by the project management software for reading and writing, and the second format is the native file format of the project management software;
[0010] Obtaining data to be imported corresponding to selected import fields from the second file according to a second mapping relationship between a second field of a target database and the default column fields;
[0011] Converting the data to be imported corresponding to the selected import fields into a third format, and updating the target database according to the converted data, where the third format is a file format supported by the target database for reading and writing.
[0012] In some embodiments, the obtaining data to be exported corresponding to selected export fields from a source database includes:
[0013] Determining the selected export fields from multiple first fields of the source database according to input information;
[0014] Screen out the data that meets the selected export fields from the source database to obtain the data to be exported.
[0015] In some embodiments, encapsulating the data to be exported according to the first mapping relationship between the first field of the source database and the default column fields of the project management software to obtain the first file in the first format includes:
[0016] Create multiple data storage areas corresponding to the first format, and name the multiple data storage areas according to the first mapping relationship, the selected export fields, and their field selection order respectively;
[0017] Use the data to be exported corresponding to the selected export fields as data elements, and use the field selection order as data elements and add them to the correspondingly named data storage areas to obtain the first file.
[0018] In some embodiments, converting the first file to the second file includes the steps of:
[0019] Open and parse the first file to obtain the names of the selected export fields, the corresponding data to be exported, and the field selection order;
[0020] Through the project management software, sequentially display the names of the multiple selected export fields in the field selection order, update the display content according to the adjustment instruction, and convert the data to be exported corresponding to the selected export fields into the second file according to the updated content; the display content includes any one or both of the display order and the name of the multiple selected export fields.
[0021] In some embodiments, after encapsulating the data to be exported to obtain the first file and before converting the first file to the second file according to the selected export fields includes:
[0022] Convert the first file into a data stream.
[0023] In some embodiments, after converting the first file to the second file and before obtaining the data to be imported corresponding to the selected import fields from the second file according to the second mapping relationship between the second field of the target database and the default column fields includes:
[0024] Provide the path address for obtaining the second file.
[0025] In some embodiments, the first format is an Extensible Markup Language format, and the second format is a project file format.
[0026] In some embodiments, all or part of the selected import fields are the same as the selected export fields.
[0027] In some embodiments, before obtaining the data to be exported corresponding to the selected export fields from the source database, the following steps are included:
[0028] Create the first mapping relationship and the second mapping relationship.
[0029] In a second aspect, the present application further provides a data migration system, which includes: a memory, a processor, and a computer program stored on the memory and executable on the processor, and the computer program is configured to implement the steps of the data transfer method as described in the first aspect.
[0030] A data transfer method and system provided by an embodiment of the present application obtain data to be exported corresponding to selected export fields from a source database; encapsulate the data to be exported according to the selected export fields to obtain a first file in a first format; convert the first file into a second file according to the selected export fields, where the first format is a file format supported by project management software for reading and writing, and the second format is the native file format of the project management software; according to the second mapping relationship between the second fields of the target database and the default column fields, obtain the data to be imported corresponding to the selected import fields from the second file, convert the data to be imported corresponding to the selected import fields into a third format, and update the target database according to the converted data, where the format of the third file is a file format supported by the target database for reading and writing. The present application supports automatic refreshing and calculation during the import and export of task plans, realizes automated backup and synchronization, and simplifies the personnel's arrangement of plans. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the following drawings are only some embodiments of the present application, and those skilled in the art can obtain other drawings without creative efforts based on these drawings.
[0032] Figure 1 Shows a schematic flowchart of some exemplary data migration methods;
[0033] Figure 2 Is a schematic diagram of the data export scenario in the embodiment of the present application;
[0034] Figure 3 Is a schematic diagram of the data import scenario in the embodiment of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0035] The following will clearly and completely describe the technical solutions in some embodiments of the present application in conjunction with the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments provided in the present application fall within the scope of protection of the present application.
[0036] Unless the context otherwise requires, throughout the specification and claims, the term "comprising" is to be construed in an open, inclusive sense, i.e., "including, but not limited to". In the description of the specification, the terms "one embodiment", "some embodiments", "exemplary embodiments", "exemplarily" or "some examples", etc. are intended to indicate that a particular feature, structure, material or characteristic related to the embodiment or example is included in at least one embodiment or example of the present application. The schematic representations of the above terms are not necessarily referring to the same embodiment or example. In addition, the described particular features, structures, materials or characteristics may be included in any one or more embodiments or examples in any appropriate manner.
[0037] Hereinafter, the terms "first" and "second" are used only for descriptive purposes and should not be construed as indicating or implying relative importance or implicitly specifying the quantity of the indicated technical features. Thus, features defined with "first" and "second" may explicitly or implicitly include one or more of such features. In the description of the embodiments of the present application, unless otherwise specified, the meaning of "a plurality" is two or more.
[0038] "At least one of A, B, and C" has the same meaning as "at least one of A, B, or C", and both include the following combinations of A, B, and C: only A, only B, only C, the combination of A and B, the combination of A and C, the combination of B and C, and the combination of A, B, and C.
[0039] "A and / or B" includes the following three combinations: only A, only B, and the combination of A and B.
[0040] In addition, the use of "based on" means open and inclusive, because a process, step, calculation or other action "based on" one or more of the stated conditions or values may in practice be based on additional conditions or values beyond the stated ones.
[0041] As used in the present application, "about", "substantially" or "approximate" includes the stated value and the average value within an acceptable deviation range of the specific value, where the acceptable deviation range is determined by those of ordinary skill in the art considering the measurement being discussed and the errors associated with the measurement of the specific quantity (i.e., the limitations of the measurement system).
[0042] Project management software is a computer application designed to help individuals or teams effectively manage all aspects of a project, including progress, cost, resources, task allocation, and report generation, etc., so as to better plan, organize, and track project progress, thereby improving work efficiency and project success rate. In project management software, when users migrate from one project management software to another, the import / export function can ensure the continuity of project data and avoid rebuilding the project plan from scratch. Of course, it can also achieve data backup, cross-platform use, etc. In short, the import / export function is very important. Data migration is the process of transferring data between different systems, platforms, or databases, and it is a necessary means for enterprises to achieve digital transformation. Using an Excel file to achieve data migration cannot automatically schedule task time, such as refreshing the planned start time and planned end time of tasks. In this way, when users use the system to schedule the plan, it will be very complicated and the error rate will be relatively high.
[0043] The following describes the data transfer method and system of the present application with reference to the accompanying drawings of the specification to solve the above problems.
[0044] Refer to Figure 1 As shown Figure 1 which shows a schematic flow diagram of some exemplary data migration methods. As Figure 1 shown, the data migration method includes the steps:
[0045] S100. Obtain the data to be exported corresponding to the selected export fields from the source database;
[0046] S200. Package the data to be exported according to the first mapping relationship between the first fields of the source database and the default column fields of the project management software to obtain a first file in a first format;
[0047] S300. Convert the first file into a second file according to the selected export fields. The format of the second file is a second format different from the first format. The first format is a file format supported by the project management software for reading and writing, and the second format is the native file format of the project management software;
[0048] S400. Obtain the data to be imported corresponding to the selected import fields from the second file according to the second mapping relationship between the second fields of the target database and the default column fields;
[0049] S500. Convert the data to be imported corresponding to the selected import fields into a third format, and update the target database according to the converted data. The third format is a file format supported by the target database for reading and writing;
[0050] Specifically, both the source database and the target database can include any one or more of relational databases, and relational databases include structural model databases and data model databases. Both the structural model database and the data model database can include KingbaseES, DM, Mysql, Oracle, PostgreSQL, etc. It should be noted that the database types of the source database and the target database may be different. For example, the source database is a relational database while the target database is a file database. Of course, the database types of the source database and the target database may be the same but the address information of the databases is different. For example, both the source database and the target database are relational databases, but the address information of the source database is the address of the first participant in the task, and the address information of the target database is the address of the second participant in the same task. When the database types of the source database and the target database are the same, the first field and the second field can be the same, and the first mapping relationship and the second mapping relationship can be the same.
[0051] Regardless of the type of database, there is a mapping relationship between a field and data. A field is an attribute in a database table used to store specific types of data, and data is the information actually stored in the field. For example, in a user table, fields may include "username", "password", "email", etc. For example, for the "username" field, the data may be "user123". It should be noted that each field can correspond to a specific piece of data, that is, a one-to-one mapping. For example, each row (record) in a user table has a corresponding "username" field value. A field can be associated with multiple pieces of data, that is, a one-to-many mapping. For example, in a relational database, a field in one table can be associated with a field in another table through a foreign key, thus achieving a one-to-many relationship. Multiple fields can map to the same piece of data, that is, a many-to-one mapping. For example, multiple users may share the same "email" field value.
[0052] The column fields or default column fields built into project management software refer to the standard fields preset by the project management software for organizing and tracking project information. Default column fields usually include but are not limited to task name (a short title describing the task), start date (the date when the task is scheduled to start), end date (the date when the task is scheduled to end), responsible person (the individual or team responsible for completing the task), status (the current progress status of the task, such as to-do, in progress, completed, etc.), priority (the urgency or importance of the task), progress (the percentage of task completion), man-hours (the estimated time required to complete the task), budget (the budget required to complete the task), dependencies (whether the task depends on the completion of other tasks), and custom fields.
[0053] This application can select the required part of the first fields from all the first fields of the source database as the selected export fields. In this way, the data to be exported that matches the selected export fields can be filtered and found from the source database. The data to be exported is encapsulated into a first file in the first format supported by the project management software. Then, open the first file, and according to the selected export fields checked previously, convert the first file into a second file according to the first mapping relationship, which is the second mapping relationship between the first fields of the source database and the default column fields of the project management software. The required part of the second fields can be selected from all the second fields of the target database as the selected import fields. In this way, the corresponding data to be imported can be filtered out from the second file according to the second mapping relationship between the second fields of the target database and the default column fields of the project management software. Then, convert the data to be imported into the third format supported by the target database for reading and writing, and update the data in the target database according to the converted data. In this way, while completing the migration of data from the source database to the target database, it supports automatic refreshing and calculation during the import and export of task plans, realizes automatic backup and synchronization, and simplifies the personnel's arrangement of plans.
[0054] For example, the steps of migrating data from a source database (Database A) to another target database (Database B), and using a second file in the native file format of project management software (such as Microsoft Project Document software, hereinafter referred to as MPD for convenience of description) as an intermediate format to convert and transfer data. First, establish the correspondence relationship, i.e., the first mapping relationship, between the fields of Database A and the default column fields of the MPD software, and the correspondence relationship, i.e., the second mapping relationship, between the fields of Database B and the default column fields of the MPD software. Convert the data to be exported in Database A into a first file. For example, the first file is a file in XML (eXtensible Markup Language) format. Open the XML file and adjust the XML file according to the fields to be exported, i.e., adjust the selected exported fields to be displayed and the order of multiple selected exported fields, and set the column headers (i.e., adjust the names or labels of the selected exported fields in the XML file). According to the first mapping relationship, save the adjusted XML file as a second file in MPP format. Read the content of the MPP file, i.e., the data to be imported corresponding to the selected imported fields, and encapsulate this content into an object according to the second mapping relationship (i.e., convert the data to be imported corresponding to the selected imported fields into a third format). This object represents the converted data, which meets the storage conditions of Database B. Update or add data in Database B according to the converted data encapsulated in the object. If corresponding records already exist in Database B, then update the field values of these records with the converted data. If corresponding records do not exist in Database B, then create new records with the converted data. Using the MPD software, the current project can be saved as an MPP file for sharing or backup. In addition, data can be exported from the source database and then further analyzed and adjusted in the MPD software. Since the MPD software provides an automatic scheduling function, it can simplify the project management process, reduce the time and workload of manual adjustment, and can more effectively manage the project plan, track progress, and allocate resources to ensure improved collaboration efficiency. It can help users arrange tasks and resources more efficiently, better control project risks, and optimize resource utilization.
[0055] Exemplarily, a file in MPP format can be directly exported. After opening it with the MPD software, for the three fields of planned start time, planned end time, and duration, automatic updates can be made. For example, after modifying the planned end time, the duration will be automatically calculated, and predecessor and successor tasks will be added at the same time. It is more convenient and faster in the MPD software, and more functions provided by the software itself can be used for scheduling, greatly reducing the workload of personnel plan scheduling.
[0056] In some embodiments, before obtaining the data to be exported corresponding to the selected export fields from the source database, it includes:
[0057] S010. Create the first mapping relationship and the second mapping relationship.
[0058] Specifically, since the type of the first fields in the source database may be different from the type of the default column fields of the project management software, and the type of the second fields in the target database may be different from the type of the default column fields of the project management software, therefore, the first mapping relationship between all the first fields in the source database and the default column fields of the project management software, and the second mapping relationship between all the second fields in the target database and the default column fields of the project management software are created in advance. The first fields in the source database and the default column fields of the project management software in the first mapping relationship are in a one-to-one mapping relationship, and the second fields in the target database and the default column fields of the project management software in the second mapping relationship are in a one-to-one mapping relationship. The first mapping relationship and the second mapping relationship may be partially the same, may be completely the same, or may be completely different. By creating the first mapping table and the second mapping table in advance in this application, it can ensure that data can be correctly and efficiently transferred from one system (or source database) to another system (or target database), and maintain the consistency and integrity of the data.
[0059] For example, when the project management software is MPD software, the mapping relationship can be matched for each field in the attribute information through the system management model design module in the PPM (Project and Portfolio Management) system. It should be noted that the system fixed fields do not need to be configured, and only the extended fields need to be configured. In the MPD software, users can add and customize new fields to meet specific project requirements. For example, the settings of these new fields can be adjusted by right-clicking on the column header and selecting "Field Settings" or "Custom Fields", including renaming, setting the data format, writing formulas, etc. However, when importing and exporting data, due to the limitations of the MPD software, only its built-in default column fields can be used. Therefore, corresponding configurations need to be made in the PPM system to achieve the mapping and synchronization of custom fields to ensure the accurate transfer and management of data.
[0060] For example, when the project management software is MPD software, the first fields of the source database include "project name", "start date", and "end date", and the default column fields of the MPD software include "task name", "task start time", and "task end time", when exporting the data related to the task time in the source database to the MPD software, so that when importing the data related to the task time in the source database into the target database through the MPD software, it is necessary to match all the first fields of the source database with all the default column fields in the MPD software, and it is necessary to perform corresponding matching between the first fields of the source database and the default column fields in the MPD software to obtain the first mapping relationship, that is, the first field "project name" corresponds to the default column field "task name", the first field "start date" corresponds to the default column field "task start time", and the first field "end date" corresponds to the default column field "task end time". Similarly, the second field of the target database can be correspondingly matched with the default column fields in the MPD software to obtain the second mapping relationship. This can ensure that the data to be exported can be correctly filled into the corresponding positions of the second file, so as to ensure the accuracy and consistency of data migration and the reliability of data backup.
[0061] In some embodiments, obtaining the data to be exported corresponding to the selected export fields from the source database includes:
[0062] S110. Determining the selected export fields from multiple first fields of the source database according to the input information;
[0063] S120. Screening out the data that conforms to the selected export fields from the source database to obtain the data to be exported.
[0064] Specifically, the input information of the user can be manually checking or selecting all the first fields of the source database displayed on the operation page of the project management software, or the user can input through voice information after all the first fields of the source database displayed on the operation page of the project management software. In short, after determining the first fields for which data migration is to be exported from the source database, some of the first fields are checked or selected from all the first fields to obtain the selected import fields. Then, the project management software can query and obtain the data to be exported corresponding to the selected export fields from the source database.
[0065] For example, in a PPM system, after clicking the export button, an operation page will pop up, where users can check the selected export fields that need to be exported. These checked selected export fields will serve as the column headers in the finally generated MPP file, and their checked order, i.e., the field selection order, will also determine the display order of these fields in the MPP file. This mechanism allows users to customize the content and structure of the exported file according to their needs, ensuring that the exported data not only meets the users' expectations but also maintains logical clarity and consistency.
[0066] In some embodiments, the step S200 of encapsulating the data to be exported according to the first mapping relationship between the first fields of the source database and the default column fields of the project management software to obtain a first file in a first format includes:
[0067] S210. Create a plurality of data storage areas corresponding to the first format, and name the plurality of data storage areas respectively according to the first mapping relationship, the selected export fields, and their field selection order;
[0068] S220. Use the data to be exported corresponding to the selected export fields as data elements, and use the field selection order as data elements, and add them to the correspondingly named data storage areas to obtain the first file.
[0069] Specifically, by checking some of the first fields from all the first fields as the selected export fields in the above embodiments, the selected export fields can be name, email, date, etc. Thus, after obtaining the selected export fields, the same number of data storage areas can be created according to the number of the selected export fields checked by the user, and the data storage areas are named according to the selected export fields and the first mapping relationship, that is, the default column fields corresponding to the selected export fields are found according to the first mapping relationship to name the data storage areas. In addition, a data storage area is named according to the checked order of the selected export fields, that is, the field selection order. According to the first mapping relationship, the data to be exported corresponding to the selected export fields is used as data elements, and the field selection order of the selected export fields is used as data elements and added to the correspondingly named data storage areas respectively. The data storage area can be a database table, a file, a memory area, etc.
[0070] For example, if the user sequentially selects the first fields "Name" and "Email" as the selected export fields, assuming that the default column field corresponding to the first field "Name" in the first mapping relationship is "Username", and the default column field corresponding to the first field "Email" is "Email", then name two of the three data storage areas as "Username" and "Email", and name the remaining one of the three data storage areas as the field selection order. Store the data corresponding to the selected export field "Name" as data elements in the data storage area named "Username", store the data corresponding to the selected export field "Email" as data elements in the data storage area named "Email", and store the field selection order as data elements in the data storage area named "Field Selection Order", thus completing the generation of the first component. Since the "Name" field was selected first and then the "Email" field, then in the generated first file, the data in the "Username" field will be displayed or appear before the data in the "Email" field. The first format of the first file may be formats such as XML (eXtensible Markup Language), CSV (Comma-Separated Values), etc. The first file contains the data organized according to the fields and order specified by the user. This application selects specific fields from the source database as the selected export fields according to the specific needs of the user, and exports the data of these selected export fields to a new file according to the field selection order, which helps the user to customize the export and organization of the data for further analysis or use.
[0071] It should be noted that if the first format is XML format, then the corresponding data storage area can be a sub-element. For example, check some fields from multiple fields as the selected export fields: create a sub-element for each selected export field, and name the sub-elements according to the multiple selected export fields. In XML, this can be achieved by setting the tag name of the sub-element. The order of multiple sub-elements will reflect the field selection order for the multiple selected export fields. The data to be exported corresponding to the selected export field is added as a data element in the sub-element named after the selected export field to the corresponding sub-element.
[0072] In some embodiments, step S300 of converting the first file into a second file according to the selected export fields includes the steps of:
[0073] S310. Open and parse the first file to obtain the names of the selected export fields, the corresponding data to be exported, and the field selection order;
[0074] S320. Sequentially display the names of multiple selected export fields in the order of the field selection sequence through the project management software, update the display content according to the adjustment instruction, and convert the to-be-exported data corresponding to the selected export fields into the second file according to the updated content; the display content includes any one or both of the display order and name of multiple selected export fields.
[0075] Specifically, the project management software may include MPD software, etc. The first file can be opened by directly double-clicking on it in the project management software, or by opening a dialog box in the project management software to select the first file for opening, or by using an API (Application Programming Interface) to load and open the first file. In short, after opening the first file, the content in the first file can be parsed to obtain the to-be-exported data, the field selection sequence of the selected export fields, and the names of the selected export fields. The operation page of the project management software sequentially displays the names of multiple selected export fields in the order of the field selection sequence. The project management software may need to obtain an adjustment instruction. In this way, according to the adjustment instruction, the display order of multiple selected export fields can be adjusted, or the names of multiple selected export fields can be adjusted according to the adjustment instruction. Of course, the display order and names of multiple selected export fields can also be adjusted according to the adjustment instruction. Then, the project management software converts the to-be-exported data corresponding to the selected export fields into the second file according to the updated display order and / or name.
[0076] This application rearranges the order of the selected export fields in the first file to ensure that the display order and content of the to-be-exported data meet expectations. This application re-modifies or defines the names of the selected export fields, which helps to correctly identify and process the data in subsequent steps. This application allows customizing the data display method according to requirements. In this way, the data display can be made more intuitive, facilitating users to quickly find the required information.
[0077] Exemplarily, assume that the project management software is MPD software, the first format is XML (eXtensible Markup Language) format, and the second format is MMP (Microsoft Project Plan). Save the adjusted XML file (i.e., a case of the first file of the present application) as a Microsoft Project file (i.e., a case of the second file of the present application). In this way, the data to be exported is encapsulated in a second file in a format that can be read by the MPD software. Adjust the order of rows and columns in the XML file (i.e., the field selection order of multiple selected export fields) and set the column headers (i.e., the names of the selected export fields). A column header is a label at the top of each column in a table, which describes the content of the data in that column. Setting the column headers means that the names of these labels can be customized for easier understanding and identification. For example, the column header can be changed from "Hire Date" to "Employee Hire Date". In the MPP file, the order of the columns and the setting of the column headers are consistent with the definitions in the XML file because these settings determine how the data is presented in the MPP file. For example, if the "Name" column is set as the first column in the XML file, then in the MPP file, this column will also be displayed as the first column, and the column header will be displayed as "Name". In this way, when viewing tasks in the MPP file, the task information can be identified and organized based on these column headers. In summary, the order of the columns and the setting of the column headers in the XML file will directly affect the data presentation in the MPP file. By adjusting the <column>Labels can control the order of columns and the display of column headers in the MPP file.
[0078] In some embodiments, after encapsulating the data to be exported to obtain the first file, before converting the first file into the second file according to the selected export fields, it includes:
[0079] Convert the first file into a data stream.
[0080] Specifically, a data stream refers to a continuous sequence of data. A data stream is a form of data that can be transmitted over a network or other medium, meaning that the file content is read in a format that the project management software can operate on, such as a string or byte stream in memory, so that it can be further processed or transmitted. Read the first file to parse and extract the required data, convert the parsed and extracted data into a format suitable for stream processing, and then use a stream processing framework (such as Java's InputStream or OutputStream, etc.) to publish the converted data as a continuous data stream. Since the data stream allows real-time processing, which means that the data can be processed immediately when it is generated or arrives, without waiting for the entire first file to be read and parsed. In this application, converting the first file into a data stream can ensure the compatibility and portability of the data between different systems and applications, thereby ensuring the efficient and accurate transmission and processing of the data between different systems. Additionally, it can improve the real-time performance, flexibility, and efficiency of data processing, and at the same time facilitate further operations on the data, that is, converting the first file into the second file in the above embodiments.
[0081] For example, if the first file is an XML file and the project management software is MPD software, the exported data can be first encapsulated into an XML file format recognizable by the MPD software. According to the first mapping relationship between the fields of the configured export object, i.e., the first fields of the source database, and the built-in columns of the MPD software (i.e., the default column fields of the project management software), encapsulate the data to be exported into the XML file format and convert it into a data stream. Among them, in Java, InputStream or OutputStream can be used to parse the XML file, convert the parsed data into a format suitable for stream processing, such as a JSON object or simple key-value pairs, and use the stream processing framework to publish the converted data as a continuous data stream.
[0082] For example, when the first file is a CSV file, use a CSV parsing library (such as Apache Commons CSV) to read and parse the CSV file, and convert each row of data in the CSV file into a format suitable for stream processing.
[0083] In some embodiments, before obtaining the data to be imported corresponding to the selected import fields from the second file according to the second mapping relationship between the second field of the target database and the default column fields after converting the first file into the second file, it includes:
[0084] Provide a path address for obtaining the second file.
[0085] Specifically, save the first file as a second file and provide a path address for downloading and obtaining the second file. The path address can be a local storage address or a network download address. The path address can be used as an intermediate archive point during the data migration process to ensure that the second file is saved locally or at a network location. In this way, even if there are problems during the subsequent import process, it is possible to start over from the second file without having to start processing from the first file again. For example, deploy an MPP conversion service, which is a main component of this application. The MPP conversion service is a separate program, a jar package, that does not require a database and only needs to be started on a Windows computer installed with MPD software. After the MPP conversion service is successfully set up, it is necessary to configure the IP and port where the service is located in nacos to facilitate the PPM system to call. After the configuration is completed, it can be used. In the MPP conversion service, the operation of XML files is realized by using the MPD software API. First, open the XML file, adjust the configuration of the columns to be displayed and the order of the columns according to the exported fields, and set the column headers. Then, save the XML file as a second file in MPP format and provide a path address for obtaining the second file. The XML file can be converted and saved as an MPP file, and the MPP file can be downloaded to the local through the File Transfer Protocol (FTP) or by email. In this way, even if team members do not install MPD software, they can view and edit project documents. In addition, using the API for conversion can improve efficiency and reduce the dependence on MPD software.
[0086] In some embodiments, the first format is an Extensible Markup Language format, and the second format is a project file format.
[0087] In some embodiments, all or part of the selected import fields are the same as the selected export fields.
[0088] Specifically, if the database types of the source databases are the same but the address information of the databases is different, the selected import fields and the selected export fields may be all the same. In this case, it is equivalent to synchronously and replicatively migrating all the data in the source databases corresponding to all the selected export fields to the target database. If the database types of the source databases are the same but the address information of the databases is different, the selected import fields and the selected export fields may be partially the same. In this case, it is equivalent to synchronously and partially replicatively migrating the data in the source databases corresponding to all the selected export fields to the target database.
[0089] Exemplarily, please refer to Figure 2 and Figure 3 , Figure 2 which is a schematic diagram of the data export scenario in the embodiment of the present application. Figure 3 And Figure 2 and Figure 3 shown in the figure is the built-in property (i.e., the default column field) of the MPD software configured for the fields of the export object. The user clicks the export button on the operation page of the MPD software on the client, selects the fields to be exported (i.e., the selected export fields), so as to generate an export request to the source database, and obtains the data to be exported corresponding to the selected export fields included in the export request from the source database. The user performs post-processing on the data to be exported through the MPD software on the client, such as adjusting the order of the data to be exported (i.e., updating the display order of multiple selected export fields according to the adjustment instruction), etc., packages the obtained adjusted data into an XML file in the XML format recognizable by the MPD software, and the MPP conversion server uses the MPD software to convert the XML file into an MPP file in the MPP format default of the MPD software, and provides a network download address to complete the data export. The user clicks the import button on the operation page of the MPD software on the client to generate an import request to the target database. The client uploads the MMP file in the MPP format to the target database. The target database obtains the stream data of the uploaded MPP file, obtains the corresponding data to be imported according to the built-in property of the MPD software configured for the fields, and stores the data to be imported into the database to complete the data import. The target database returns the import result to the client. The import and export functions not only improve the availability and flexibility of the data, but also enhance the efficiency and effect of project management, can ensure the continuity and consistency of project data, avoid rebuilding the project plan from scratch, and allow seamless migration of data between different platforms. In addition, the project plan can be exported regularly as a backup to prevent software failures or data loss.
[0090] In a second aspect, the present application further provides a data migration system, which includes: a memory, a processor, and a computer program stored on the memory and executable on the processor, and the computer program is configured to implement the steps of the data transfer method as described in the first aspect.
[0091] In specific implementation, each of the above units or modules can be implemented as an independent entity, or can be arbitrarily combined and implemented as the same or several entities. For the above units or modules, reference can be made to the foregoing method embodiments to implement data collection for supply chain management projects, which will not be elaborated herein.
[0092] Those of ordinary skill in the art can understand that all or part of the steps in the above various methods can be completed by instructions, or by instructions controlling related hardware. The instructions can be stored in a computer-readable storage medium and loaded and executed by a processor to implement the above method embodiments. Among them, the computer-readable storage medium may include: read-only memory (ROM, Read Only Memory), random access memory (RAM, Random Access Memory), magnetic disk or optical disk, etc.
[0093] In the above embodiments, the descriptions of the various embodiments have their own emphases. For the parts not detailed in a certain embodiment, reference can be made to the relevant descriptions of other embodiments. Those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working processes and beneficial effects of the above-described data collection system and its corresponding units can refer to the description of the timing calibration method in the above embodiments, which will not be elaborated herein specifically.
[0094] The above has introduced in detail a timing calibration method and system provided by the embodiments of the present application. Specific examples are used herein to elaborate on the principle and implementation manner of the present application. The descriptions of the above embodiments are only used to help understand the method and its core idea of the present application; at the same time, for those skilled in the art, according to the idea of the present application, there will be changes in the specific implementation manner and application scope. In summary, the content of this specification should not be construed as a limitation to the present application.< / column>
Claims
1. A data transfer method, characterized in that: include: Obtain the data to be exported corresponding to the selected export field from the source database; According to a first mapping relationship between a first field of the source database and a default column field of the project management software, encapsulating the data to be exported to obtain a first file in a first format; Converting the first file into a second file according to the selected export field, wherein the format of the second file is a second format different from the first format, the first format is a file format supported by the project management software for reading and writing, and the second format is a native file format of the project management software; According to a second mapping relationship between a second field of the target database and the default column field, acquiring the to-be-imported data corresponding to the selected import field from the second file; The data to be imported corresponding to the selected import field is converted into a third format, and the target database is updated according to the converted data, wherein the third format is a file format supported by the target database for reading and writing.
2. The data transfer method according to claim 1, characterized in that: The step of obtaining the data to be exported corresponding to the selected export field from the source database includes: Determining the selected export field from a plurality of first fields of the source database according to input information; The data to be exported is obtained by screening out data that matches the selected export field from the source database.
3. The data transfer method according to claim 1, characterized in that: The step of encapsulating the data to be exported to obtain a first file in a first format according to a first mapping relationship between the first field of the source database and the default column field of the project management software comprises: Creating a plurality of data storage areas corresponding to the first format, and naming the plurality of data storage areas respectively according to the first mapping relationship, the selected export fields and the field selection order thereof; The to-be-exported data corresponding to the selected export field is taken as a data element, and the field selection order is taken as a data element and added to the correspondingly named data storage area to obtain the first file.
4. The data transfer method according to claim 1, characterized in that: The step of converting the first file into a second file comprises the following steps: Open and parse the first file to obtain the name of the selected export field and its corresponding data to be exported and field selection order; The project management software sequentially displays the names of multiple selected export fields in the order of field selection, updates the display content according to the adjustment instruction, and converts the data to be exported corresponding to the selected export fields into the second file according to the updated content; the display content includes any one or both of the display order and the names of the multiple selected export fields.
5. The data transfer method according to claim 1, characterized in that: After encapsulating the data to be exported to obtain a first file, before converting the first file into a second file according to the selected export field, the method includes: The first file is converted into a data stream.
6. The data transfer method according to claim 1, characterized in that: After converting the first file into a second file, before acquiring the to-be-imported data corresponding to the selected import field from the second file according to the second mapping relationship between the second field of the target database and the default column field, the method includes: Provide a path address for obtaining the second file.
7. The data transfer method according to claim 1, characterized in that: The first format is an extensible markup language format, and the second format is a project file format.
8. The data transfer method according to claim 1, characterized in that: The selected import field is entirely or partially identical to the selected export field.
9. The data transfer method according to any one of claims 1 to 8, characterized in that: The step of obtaining the data to be exported corresponding to the selected export field from the source database includes: The first mapping relationship and the second mapping relationship are created.
10. A data transfer system, a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: The computer program is configured to implement the steps of the data transfer method according to any one of claims 1 to 9.