Data import and export method and device, electronic equipment and storage medium
Through the configuration interface, the data import and export service is configured, which solves the problem of long development time of traditional methods and dependent on technicians, and achieves a more efficient data import and export process and higher accuracy.
Patent Information
- Application Number
- CN202411705862.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-26
- Publication Date
- 2025-03-14
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The development workload of traditional data import and export methods is huge and depends on technicians, which leads to long development time and prone to errors.
Through the configuration interface configuration, import and export services, avoid relying on technicians, and realize the mapping relationship and field mapping rules between the source data source and the target data source, and perform mapping verification.
It reduces the development workload and development time, improves the accuracy of import and export, simplifies the configuration process, and reduces the dependence on technicians.
Smart Images

Figure CN119621035A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, and in particular to a method, device, electronic device and storage medium for importing and exporting data. Background Art
[0002] Traditional data import and export methods require a complex process, including demand analysis, development implementation, testing and debugging, and online use. Technicians write dedicated scripts for each import and export business. This method has a huge development workload and relies on technicians, resulting in long development time and prone to errors. Summary of the invention
[0003] In view of this, the purpose of this application is to provide a data import and export method, device, electronic device and storage medium, which can configure import and export services through a configuration interface, avoid relying on technical personnel, reduce development workload and development time, and improve import and export accuracy.
[0004] In a first aspect, an embodiment of the present application provides a method for importing and exporting data, the method comprising:
[0005] In response to a configuration request for a target import and export service initiated by a service configuration personnel on an import and export service configuration interface, the service configuration interface is displayed to the service configuration personnel, so that the service configuration personnel configures a mapping relationship between a source data field in a source data source and a target data field in a target data source and a field mapping rule corresponding to the mapping relationship for the target import and export service;
[0006] Performing mapping verification on the mapping relationship between the source data field and the target data field and the field mapping rule corresponding to the mapping relationship;
[0007] If the mapping verification is successful, the configuration of the target import and export business is completed;
[0008] After the configuration is completed, the user role bound to the target import and export service is determined as the target user role; each user role corresponds to one or more import and export users;
[0009] In the import and export interface of the import and export user corresponding to the target user role, a component button corresponding to the target import and export business is displayed, so that the import and export user can import and export data through the component button.
[0010] In a possible implementation, the business configuration interface includes a data source configuration interface and a field mapping configuration interface; the business configuration interface is displayed to the business configuration personnel so that the business configuration personnel configures the mapping relationship between the source data field in the source data source and the target data field in the target data source for the target import and export business, and the field mapping rules corresponding to the mapping relationship, including:
[0011] Displaying the data source configuration interface to the business configuration personnel so that the business configuration personnel can configure the source data source parameter information and the target data source parameter information on the data source configuration interface;
[0012] The source data fields in the data source corresponding to the source data source parameter information and the target data fields in the data source corresponding to the target data source parameter information are displayed in the field mapping configuration interface, so that the business configuration personnel can configure the mapping relationship between the source data fields and the target data fields and the field mapping rules corresponding to the mapping relationship in the field mapping configuration interface.
[0013] In a possible implementation, the mapping verification includes data type verification; the mapping verification of the mapping relationship between the source data field and the target data field and the field mapping rule corresponding to the mapping relationship includes:
[0014] Determine whether the data type corresponding to the source data field can be converted to the data type corresponding to the target data field according to a preset data type conversion table, and obtain a first determination result;
[0015] If the first judgment result is that the data type corresponding to the source data field cannot be converted into the data type corresponding to the target data field, then judging whether the field mapping rule corresponding to the mapping relationship can convert the data type corresponding to the source data field into the data type corresponding to the target data field, to obtain a second judgment result;
[0016] If the second judgment result is that the data type corresponding to the source data field cannot be converted into the data type corresponding to the target data field, the mapping check fails.
[0017] In a possible implementation, the method further includes:
[0018] In response to an execution request of a target import and export business initiated by an import and export user in the import and export interface, an execution configuration interface is displayed to the import and export user, so that the import and export user configures the execution time parameters of the target import and export task;
[0019] The target import and export task is executed according to the execution time parameter.
[0020] In a possible implementation, displaying the execution configuration interface to the import / export user so that the import / export user configures the execution time parameters of the target import / export task includes:
[0021] Obtain the execution frequency type selected by the import and export user in the execution configuration interface;
[0022] If the execution frequency type is an immediate execution type, the execution time parameter is set to the current time;
[0023] If the execution frequency type is a scheduled execution type, the execution time field is displayed in the execution configuration interface, so that the import and export user can input the execution time of the target import and export task according to the execution time field.
[0024] In a possible implementation, the target import and export service is performed through the following steps:
[0025] Create a target import and export task corresponding to the target import and export business;
[0026] The target import and export task is executed according to the mapping relationship between the source data fields in the source data source and the target data fields in the target data source configured by the business configuration personnel for the target import and export business and the field mapping rules corresponding to the mapping relationship.
[0027] In a possible implementation, the method further includes:
[0028] After creating the target import and export task, monitor the execution status of the target import and export task in real time;
[0029] The execution status of the target import and export task is sent to the import and export user.
[0030] In a second aspect, an embodiment of the present application further provides a data import and export device, the device comprising:
[0031] A response module, used to respond to a configuration request of a target import and export business initiated by a business configuration personnel in the import and export business configuration interface, and display the business configuration interface to the business configuration personnel, so that the business configuration personnel can configure a mapping relationship between a source data field in a source data source and a target data field in a target data source and a field mapping rule corresponding to the mapping relationship for the target import and export business;
[0032] A mapping verification module, used to perform mapping verification on the mapping relationship between the source data field and the target data field and the field mapping rule corresponding to the mapping relationship;
[0033] A configuration module, used to complete the configuration of the target import and export business if the mapping verification is successful;
[0034] A determination module, used to determine the user role bound to the target import and export business as the target user role after the configuration is completed; each user role corresponds to one or more import and export users;
[0035] The display module is used to display the component buttons corresponding to the target import and export business in the import and export interface of the import and export user corresponding to the target user role, so that the import and export user can import and export data through the component buttons.
[0036] In the third aspect, an embodiment of the present application also provides an electronic device, comprising: a processor, a storage medium and a bus, wherein the storage medium stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor communicates with the storage medium through the bus, and the processor executes the machine-readable instructions to perform the steps of the data import and export method as described in any one of the first aspects.
[0037] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the data import and export method as described in any one of the first aspects are executed.
[0038] The embodiment of the present application provides a method, device, electronic device and storage medium for importing and exporting data, the method comprising: in response to a configuration request of a target import and export business initiated by a business configuration personnel in an import and export business configuration interface, the business configuration interface is displayed to the business configuration personnel, so that the business configuration personnel configures the mapping relationship between the source data field in the source data source and the target data field in the target data source for the target import and export business and the field mapping rule corresponding to the mapping relationship; the mapping relationship between the source data field and the target data field and the field mapping rule corresponding to the mapping relationship are mapped and verified; if the mapping verification is successful, the configuration of the target import and export business is completed; after the configuration is completed, the user role bound to the target import and export business is determined as the target user role; each user role corresponds to one or more import and export users; in the import and export interface of the import and export user corresponding to the target user role, the component button corresponding to the target import and export business is displayed, so that the import and export user can import and export data through the component button. The present application can configure the import and export business through the configuration interface, avoid relying on technical personnel, reduce the development workload and development time, and improve the accuracy of import and export. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0040] Figure 1 A flow chart of a method for importing and exporting data provided by an embodiment of the present application is shown;
[0041] Figure 2 A flowchart showing another method for importing and exporting data provided by an embodiment of the present application is shown;
[0042] Figure 3 A schematic diagram showing the structure of a data import and export device provided in an embodiment of the present application is shown;
[0043] Figure 4 A schematic structural diagram of an electronic device provided in an embodiment of the present application is shown. DETAILED DESCRIPTION
[0044] To make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. It should be understood that the drawings in the present application only serve the purpose of explanation and description and are not used to limit the scope of protection of the present application. In addition, it should be understood that the schematic drawings are not drawn in real proportion. The flowchart used in this application shows the operations implemented according to some embodiments of the present application. It should be understood that the operations of the flowchart can be implemented out of sequence, and the steps without logical context can be reversed in order or implemented simultaneously. In addition, those skilled in the art can add one or more other operations to the flowchart under the guidance of the content of the present application, or remove one or more operations from the flowchart.
[0045] In addition, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. The components of the embodiments of the present application described and shown in the drawings here can be arranged and designed in various configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.
[0046] In order to enable those skilled in the art to use the content of this application, the following implementation is provided in conjunction with the specific application scenario "data processing technology field". For those skilled in the art, the general principles defined herein can be applied to other embodiments and application scenarios without departing from the spirit and scope of this application. Although this application is mainly described around the "data processing technology field", it should be understood that this is only an exemplary embodiment.
[0047] It should be noted that the term "comprising" will be used in the embodiments of the present application to indicate the existence of the features declared thereafter, but does not exclude the addition of other features.
[0048] A data processing technology method provided in an embodiment of the present application is described in detail below.
[0049] Reference Figure 1 As shown, it is a flowchart of a data processing technology method provided by an embodiment of the present application. The exemplary steps of the embodiment of the present application are described below:
[0050] S101. In response to a configuration request for a target import and export business initiated by a business configuration personnel in an import and export business configuration interface, the business configuration interface is displayed to the business configuration personnel so that the business configuration personnel can configure a mapping relationship between source data fields in a source data source and target data fields in a target data source and field mapping rules corresponding to the mapping relationship for the target import and export business.
[0051] In the implementation manner of the present application, the business configuration personnel refers to the personnel who configure the business parameters for the target import and export business; the business parameters refer to the mapping relationship between the source data field in the source data source and the target data field in the target data source and the field mapping rules corresponding to the mapping relationship. The business configuration personnel can be any person who can configure the business parameters, and can be a technical person (i.e., a program developer), or other non-technical person who can configure the business parameters according to the needs of the import and export business. Therefore, the import and export method provided by the present application does not need to rely on technical personnel, simplifies the configuration process of the import and export business, and shortens the development time of the import and export business; the data import and export business is to import or export the data in the source data source to the target data source.
[0052] Among them, the business configuration interface includes the data source configuration interface and the field mapping configuration interface.
[0053] Specifically, the business configuration interface is displayed to the business configuration personnel so that the business configuration personnel configure the mapping relationship between the source data field in the source data source and the target data field in the target data source for the target import and export business, and the field mapping rules corresponding to the mapping relationship, including:
[0054] Step 1: Display the data source configuration interface to the business configuration personnel, so that the business configuration personnel can configure the source data source parameter information and the target data source parameter information on the data source configuration interface.
[0055] In the implementation manner of the present application, the source data source parameter information may include the source data source identifier, the file type of the source data source, and the connection information of the source data source. The target data source parameter information may include the target data source file type and the target data source template.
[0056] Specifically, the data source configuration interface includes a target data source file type field, a source data source identification field, and a target data source template file field. The business configuration personnel selects the file type of the target data source (such as CSV, Excel, text, etc.) from multiple file types for the target data source type field; the business configuration personnel selects the target data source identifier from multiple data source corresponding identifiers for the source data source identification field. The source data source file type (such as CSV, Excel, text, etc.) and connection information (such as file path, database connection string, etc.) corresponding to the source data source identifier are queried from the data source information library; the business configuration personnel upload the target data source template for the target data source template file field.
[0057] Here, React.js and Formik are used to create a form. Multiple file types can be displayed for the target data source type field, and multiple data source corresponding identifiers can be displayed for the source data source identifier field.
[0058] In addition, the data source configuration interface may also include a configuration time field of the target data source, and the configuration time field is used to record the timestamp of its creation (automatically set to the current time).
[0059] Optionally, the source data source is connected according to the connection information; if the connection is successful, the execution continues; if the connection fails, the business configuration personnel are prompted that the configuration failed due to the failure to connect to the data source.
[0060] Step 2: Display the source data fields in the data source corresponding to the source data source parameter information and the target data fields in the data source corresponding to the target data source parameter information in the field mapping configuration interface, so that the business configuration personnel can configure the mapping relationship between the source data fields and the target data fields and the field mapping rules corresponding to the mapping relationship in the field mapping configuration interface.
[0061] In the implementation of the present application, the data field in the data source corresponding to the source data source parameter information (i.e., the source data source) is used as the source data field, and the data field in the data source corresponding to the target data source parameter information (i.e., the data field in the target data source template) is used as the target data field.
[0062] For example, the source data field is displayed on the left side of the field mapping configuration interface, and the target data field is displayed on the right side of the field mapping configuration interface. The business configuration personnel use React DnD to implement drag-and-drop operations, map the source data field to the target data field, and obtain the mapping relationship between the source data field and the target data field. It can be understood that the mapping relationship can be multiple source data fields mapped to one target data field; one source data field is mapped to multiple target data fields; one source data field is mapped to one target mapping field, etc. Business configuration personnel can configure source data fields and target data fields through an intuitive graphical interface and drag-and-drop operations, simplifying the operation process, improving the user experience, and enhancing the user's convenience and satisfaction.
[0063] There are multiple field mapping rules in this application, and the business configuration personnel can select a field mapping rule for each mapping relationship; the business configuration personnel configures corresponding mapping parameters for the field mapping rule corresponding to each mapping relationship to obtain a configured field mapping rule.
[0064] Here, the field mapping rules include: (1) Date format conversion (DateFormat): Date format conversion is used to convert the date of the source data into the target format according to the specified format. The mapping parameters corresponding to the date format conversion include the date format of the source data; for example: `yyyyMMdd` (year-month-day) or `MM / dd / yyyy` (month / day / year). The date format of the source data helps the system to correctly parse the date of the source data. The mapping parameters corresponding to the date format conversion also include the target date format of the target source data source (the date format that the business configuration personnel want to display, and multiple date formats can be selected for output. Example: `dd / MM / yyyy`). For example, convert `20241001` to `01 / 10 / 2024`.
[0065] (2) Case Transformation: Case transformation is used to convert the text field of the source data to uppercase, all lowercase, or first letter capitalized. The mapping parameters corresponding to case transformation include the transformation type. Case transformation types include Uppercase (convert text to all uppercase), Lowercase (convert text to all lowercase), and Capitalize (capitalize the first letter of the text and lowercase the rest). Example: If the transformation type is `Uppercase`, the input "helloworld" will be converted to "HELLO WORLD".
[0066] (3) Number Formatting: Number formatting is used to display numeric fields in a specified format, which is commonly used in the conversion of prices, percentages or currency values. The mapping parameters corresponding to number formatting include the number of decimal places (the number of decimal places reserved by the target data field); for example: retain 2 decimal places (`123.456` will be formatted as `123.46`). The mapping parameters corresponding to number formatting also include whether to enable the thousands separator (options: `Enable` or `Disable`), and the unit symbol added before or after the number (such as `$`, `%`, etc.).
[0067] (4) Text Replacement: Text replacement allows users to specify that certain characters or strings in the source text be replaced with other content.
[0068] Parameter configuration for text replacement: source string (source string to be searched and replaced, example: `"OldValue"`), target string (target string to be replaced, example: `"NewValue"`), case sensitivity (whether to distinguish between upper and lower case when replacing, options: `Yes` or `No`). Example configuration: source string is `"Inactive"`, target string is `"Active"`, case sensitivity is `No`.
[0069] (5) Range Validation: Range validation is used to ensure that the imported or exported values are within a specific range. It is commonly used in numerical fields such as quantity and price in business data.
[0070] Parameter configurations for value range check: minimum value (the minimum value allowed. If the value is lower than this value, a check error is triggered. Example: `0`), maximum value (the maximum value allowed. If the value is higher than this value, a check error is triggered. Example: `10000`), default value (if the value is out of range, you can choose to use a default value to replace it. Example: `100`).
[0071] (6) Substring: String substring is used to extract a substring of a specific length from the source text. For example, extract the first 6 digits of the ID card number as the area code.
[0072] Parameter configuration corresponding to string truncation: starting position (the starting position of the substring to be extracted. Example: `0`, indicating that counting starts from 0), length (the number of characters to be extracted. Example: `6`, indicating that the first 6 characters are extracted).
[0073] (7)Regex Replacement: Search and replace text using regular expressions, suitable for complex text matching and processing.
[0074] Parameter configuration corresponding to regular expression replacement: regular expression (regular expression pattern used for search. Example: `\d{3}\d{2}\d{4}`, which means matching a string in SSN format, such as "123456789"), replacement string (string used to replace the matching result. Example: `XXXXX$1`).
[0075] (8) String concatenation: String concatenation concatenates the values of multiple source fields into one target field and is often used to generate composite values.
[0076] Parameter configuration corresponding to string concatenation: source data field (select multiple source data fields for concatenation), delimiter (delimiter used for concatenation, such as space, comma, etc.). Example: `""` (such as concatenating "John" and "Doe" into "JohnDoe").
[0077] (9) Unit Conversion: Unit conversion is used to convert values from one unit to another, for example, converting kilograms to pounds or kilometers to miles.
[0078] Parameter configuration corresponding to unit conversion: source unit (unit type of source data. Example: `kilogram kg`), target unit: (unit type of target data. Example: `pound lb`.
[0079] (10) Null Value Handling: Null value handling allows users to specify how to handle null values or missing values. Common handling methods include filling values, ignoring, etc.
[0080] Parameter configuration corresponding to null value processing: default value (the default value used when the source data is null. Example: `"N / A"`), skip processing: (when the source data is null, you can choose to skip records containing null values).
[0081] It is understandable that the above are some examples of field mapping rules. By providing detailed parameter configuration for each mapping relationship, a flexible and easy-to-use field mapping rule setting function is provided for business configuration personnel. Business configuration personnel can select the appropriate conversion type according to business needs and configure the corresponding parameters through the graphical interface to complete complex data conversion operations.
[0082] In addition, when the business configuration personnel configure the mapping relationship between the source data field in the source data source and the target data field in the target data source for the target import and export business, and the field mapping rules corresponding to the mapping relationship, the mapping relationship between the source data field in the source data source and the target data field in the target data source configured by the business configuration personnel and the field mapping rules corresponding to the mapping relationship will be mapped and verified in real time. If the verification fails, the business configuration personnel will be prompted with a configuration error, and the solution suggestions corresponding to the verification failure reasons will be sent to the business configuration personnel. For example, if the field types do not match, the business configuration personnel may be advised to select an appropriate field for mapping conversion.
[0083] S102: Perform mapping verification on the mapping relationship between the source data field and the target data field and the field mapping rule corresponding to the mapping relationship.
[0084] In an implementation manner of the present application, after the business configuration personnel confirms that all configurations are correct, the business configuration personnel initiates a mapping verification request by clicking a "Verify" or "Confirm" button. In response to a mapping verification request initiated by the business configuration personnel, a mapping verification is performed on the mapping relationship between the source data field and the target data field and the field mapping rules corresponding to the mapping relationship.
[0085] Specifically, the mapping check includes data type check; the mapping relationship between the source data field and the target data field and the field mapping rule corresponding to the mapping relationship are checked for data type, including: judging whether the data type corresponding to the source data field can be converted to the data type corresponding to the target data field according to the preset data type conversion table, and obtaining a first judgment result; if the first judgment result is that the data type corresponding to the source data field cannot be converted to the data type corresponding to the target data field, then judging whether the field mapping rule corresponding to the mapping relationship can convert the data type corresponding to the source data field to the data type corresponding to the target data field, and obtaining a second judgment result; if the second judgment result is that the data type corresponding to the source data field cannot be converted to the data type corresponding to the target data field, the mapping check fails. For example, if the source field is `integer` and the target field is `string`, the first judgment result is that the source data field cannot be converted to the target field data conversion type, thereby judging the field mapping rule. If the conversion between the types of `integer` to `string` is allowed during the check, the mapping passes. If the mapping rule does not exist, the mapping check fails, and the system prompts whether a specific mapping rule needs to be added according to the configuration.
[0086] Specifically, mapping verification also includes field existence verification; the mapping relationship between the source data field and the target data field and the field mapping rule corresponding to the mapping relationship are verified for field existence, including: if the source data field does not exist in the source data source or the target data field does not exist in the target data source, the mapping verification fails. If the source data field exists in the source data source and the target data field exists in the target data source, the mapping verification succeeds.
[0087] Specifically, the mapping verification also includes field mapping verification (verifying whether the mapping logic between the source data field and the target data field is reasonable); the mapping relationship between the source data field and the target data field and the field mapping rules corresponding to the mapping relationship are subjected to field mapping verification, including: when the mapping relationship is that multiple source data fields are mapped to one target data field, judging whether it is allowed to merge all source data fields in the mapping relationship into the target data field according to the preset field mapping rules; if allowed, the mapping verification succeeds; if not allowed, the mapping verification fails. When the mapping relationship is that one source data field is mapped to multiple target data fields, judging whether it is allowed to split the source data field in the mapping relationship into target data fields according to the preset field mapping rules; if allowed, the mapping verification succeeds; if not allowed, the mapping verification fails.
[0088] Specifically, mapping verification also includes conversion rule legitimacy verification (ensuring that the configured field mapping rules are legal and valid and will not cause errors in data processing), including: checking whether the field mapping rules are complete and logical to ensure that data errors will not be caused by format parsing failures. If the field mapping rules are complete and logical, check whether the configuration parameters of the field mapping rules are reasonable for the source data fields and target data fields; for example, whether the conversion mode is correctly selected in the case conversion rules; whether there is a valid configuration for the source string and the target string in the text replacement rules; if reasonable, the mapping verification is successful. By performing a mapping verification when the configuration is completed, the legitimacy of the configuration and the integrity of the mapping rules are ensured.
[0089] In addition, the method also includes: extracting a preset number of sample data from a source data source; importing and exporting the sample data according to the mapping relationship between the source data field and the target data field and the field mapping rules corresponding to the mapping relationship; and displaying the sample data before conversion and the target data after conversion on a data preview interface for business configuration personnel.
[0090] Here, if there are problems with certain fields or rules when they are applied, the erroneous data rows will be marked on the preview interface, and the business configuration personnel will be prompted with the specific cause of the error.
[0091] S103: If the mapping verification is successful, the configuration of the target import and export service is completed.
[0092] In the implementation manner of the present application, the mapping relationship between the source data field in the source data source and the target data field in the target data source configured by the business configuration personnel for the target import and export business and the field mapping rules corresponding to the mapping relationship are saved.
[0093] S104: After the configuration is completed, the user role bound to the target import and export service is determined as the target user role; each user role corresponds to one or more import and export users.
[0094] In the implementation mode of the present application, after the configuration is completed, the business configuration personnel will bind the target import and export business to the user role, and the import and export users corresponding to the user role bound to the target import and export business can perform import and export operations of the target import and export business.
[0095] Here, the embodiment of the present application can assign the use rights of the target import and export business to the import and export users through binding. The import and export users who have the use rights of the target import and export business can implement the target import and export business; the import and export users can be business configuration personnel or any user other than business configuration personnel who needs to implement the import and export business. Therefore, the import and export users do not need to learn how to configure the business parameters and can use it directly, which improves the user experience and enhances the user's convenience and satisfaction.
[0096] S105. Displaying component buttons corresponding to the target import and export business in the import and export interface of the import and export user corresponding to the target user role, so that the import and export user can import and export data through the component buttons.
[0097] In the implementation mode of the present application, in the import and export interface of each import and export user, for each import and export service that the import and export user has the right to use, a corresponding component button is displayed. By means of this graphical component button method, an interface for using the target import and export service is provided to the import and export user, thereby improving the user experience and enhancing the user's convenience and satisfaction.
[0098] In addition, the method also provides an API calling interface, through which the external system can import and export data.
[0099] The embodiment of the present application provides a method for importing and exporting data, the method comprising: in response to a configuration request of a target import and export business initiated by a business configuration personnel in an import and export business configuration interface, the business configuration interface is displayed to the business configuration personnel, so that the business configuration personnel configures the mapping relationship between the source data field in the source data source and the target data field in the target data source for the target import and export business and the field mapping rule corresponding to the mapping relationship; the mapping relationship between the source data field and the target data field and the field mapping rule corresponding to the mapping relationship are mapped and verified; if the mapping verification is successful, the configuration of the target import and export business is completed; after the configuration is completed, the user role bound to the target import and export business is determined as the target user role; each user role corresponds to one or more import and export users; in the import and export interface of the import and export user corresponding to the target user role, the component button corresponding to the target import and export business is displayed, so that the import and export user can import and export data through the component button. The present application can configure the import and export business through the configuration interface, avoid relying on technical personnel, reduce the development workload and development time, and improve the accuracy of import and export.
[0100] Reference Figure 2 As shown, it is a flowchart of another data processing technology method provided in an embodiment of the present application. The exemplary steps of the embodiment of the present application are described below:
[0101] S201. In response to an execution request for a target import and export business initiated by an import and export user in an import and export interface, an execution configuration interface is displayed to the import and export user, so that the import and export user configures execution time parameters of the target import and export task.
[0102] In the implementation manner of the present application, the import and export interface corresponding to the import and export user displays a component button corresponding to the bound import and export business, and the import and export user initiates an execution request for the target import and export business by clicking the component button.
[0103] Specifically, the execution frequency type selected by the import and export user in the execution configuration interface is obtained; if the execution frequency type is an immediate execution type, the execution time parameter is set to the current time; if the execution frequency type is a scheduled execution type, the execution time field is displayed in the execution configuration interface, so that the import and export user can enter the execution time of the target import and export task for the execution time field.
[0104] S202: Execute the target import and export task according to the execution time parameters.
[0105] In an implementation manner of the present application, executing a target import and export task includes: creating a target import and export task corresponding to a target import and export business; executing the target import and export task according to the mapping relationship between the source data field in the source data source and the target data field in the target data source configured by the business configuration personnel for the target import and export business and the field mapping rules corresponding to the mapping relationship.
[0106] Specifically, according to the mapping relationship between the source data fields in the source data source and the target data fields in the target data source configured by the business configuration personnel for the target import and export business and the field mapping rules corresponding to the mapping relationship, it includes: obtaining source data from the source data source; according to the mapping relationship between the source data fields in the source data source and the target data fields in the target data source configured by the business configuration personnel for the target import and export business and the field mapping rules corresponding to the mapping relationship, mapping and converting the source data to obtain the target data source; importing or exporting the target data source according to the task type (import type or export type) corresponding to the target import and export task.
[0107] Furthermore, the method also includes: after creating the target import and export task, monitoring the execution status of the target import and export task in real time (pending, completed, failed); sending the execution status of the target import and export task to the import and export user.
[0108] Furthermore, the method also includes: displaying the number of processed import and export tasks, processed import and export tasks, and import and export task failure information in the task progress monitoring interface of the import and export user.
[0109] The embodiment of the present application provides another method for importing and exporting data, through which an import and export user can import and export data.
[0110] Based on the same inventive concept, the embodiment of the present application also provides a data import and export device corresponding to the data import and export method. Since the principle of solving the problem by the device in the embodiment of the present application is similar to the above-mentioned data import and export method in the embodiment of the present application, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be repeated.
[0111] Reference Figure 3 FIG. 1 is a schematic diagram of a data import and export device provided in an embodiment of the present application, wherein the data import and export device includes:
[0112] A response module 301 is used to respond to a configuration request of a target import and export business initiated by a business configuration personnel in the import and export business configuration interface, and display the business configuration interface to the business configuration personnel, so that the business configuration personnel can configure a mapping relationship between a source data field in a source data source and a target data field in a target data source and a field mapping rule corresponding to the mapping relationship for the target import and export business;
[0113] A mapping verification module 302 is used to perform mapping verification on the mapping relationship between the source data field and the target data field and the field mapping rule corresponding to the mapping relationship;
[0114] Configuration module 303, used to complete the configuration of the target import and export service if the mapping verification is successful;
[0115] A determination module 304 is used to determine the user role bound to the target import and export service as the target user role after the configuration is completed; each user role corresponds to one or more import and export users;
[0116] The display module 305 is used to display the component buttons corresponding to the target import and export business in the import and export interface of the import and export user corresponding to the target user role, so that the import and export user can import and export data through the component buttons.
[0117] In a possible implementation, the business configuration interface includes a data source configuration interface and a field mapping configuration interface; the response module 301 is specifically used to display the data source configuration interface to the business configuration personnel, so that the business configuration personnel can configure the source data source parameter information and the target data source parameter information on the data source configuration interface; the source data field in the data source corresponding to the source data source parameter information and the target data field in the data source corresponding to the target data source parameter information are displayed on the field mapping configuration interface, so that the business configuration personnel can configure the mapping relationship between the source data field and the target data field and the field mapping rules corresponding to the mapping relationship on the field mapping configuration interface.
[0118] In one possible implementation, the mapping verification includes data type verification; the mapping verification module 302 is specifically used to determine whether the data type corresponding to the source data field can be converted into the data type corresponding to the target data field according to a preset data type conversion table, and obtain a first judgment result; if the first judgment result is that the data type corresponding to the source data field cannot be converted into the data type corresponding to the target data field, then determine whether the field mapping rule corresponding to the mapping relationship can convert the data type corresponding to the source data field into the data type corresponding to the target data field, and obtain a second judgment result; if the second judgment result is that the data type corresponding to the source data field cannot be converted into the data type corresponding to the target data field, then the mapping verification fails.
[0119] In a possible implementation, the method further includes: an execution module 306;
[0120] The response module 301 is further used to respond to the execution request of the target import and export business initiated by the import and export user in the import and export interface, and display the execution configuration interface to the import and export user, so that the import and export user can configure the execution time parameters of the target import and export task;
[0121] The execution module 306 is used to execute the target import and export task according to the execution time parameter.
[0122] In one possible implementation, the response module 301 is specifically used to obtain the execution frequency type selected by the import and export user in the execution configuration interface; if the execution frequency type is an immediate execution type, the execution time parameter is set to the current time; if the execution frequency type is a scheduled execution type, the execution time field is displayed in the execution configuration interface, so that the import and export user can enter the execution time of the target import and export task for the execution time field.
[0123] In one possible implementation, the execution module 306 is specifically used to create a target import and export task corresponding to the target import and export business; the target import and export task is executed according to the mapping relationship between the source data field in the source data source and the target data field in the target data source configured by the business configuration personnel for the target import and export business and the field mapping rules corresponding to the mapping relationship.
[0124] In a possible implementation manner, the apparatus further includes: a creating module 307, a sending module 308;
[0125] A creation module 307, which is used to monitor the execution status of the target import and export task in real time after the target import and export task is created;
[0126] The sending module 308 is used to send the execution status of the target import and export task to the import and export user.
[0127] The embodiment of the present application provides a data import and export device, which includes: a response module 301, which is used to respond to a configuration request of a target import and export business initiated by a business configuration personnel in an import and export business configuration interface, and display the business configuration interface to the business configuration personnel, so that the business configuration personnel configures the mapping relationship between the source data field in the source data source and the target data field in the target data source and the field mapping rule corresponding to the mapping relationship for the target import and export business; a mapping verification module 302, which is used to perform mapping verification on the mapping relationship between the source data field and the target data field and the field mapping rule corresponding to the mapping relationship; a configuration module 303, which is used to complete the configuration of the target import and export business if the mapping verification is successful; a determination module 304, which is used to determine the user role bound to the target import and export business as the target user role after the configuration is completed; each user role corresponds to one or more import and export users; a display module 305, which is used to display the component button corresponding to the target import and export business in the import and export interface of the import and export user corresponding to the target user role, so that the import and export user can import and export data through the component button. This application can configure import and export services through the configuration interface, avoiding reliance on technical personnel, reducing development workload and development time, and improving import and export accuracy.
[0128] like Figure 4 As shown, an electronic device 400 provided in an embodiment of the present application includes: a processor 401, a memory 402 and a bus, wherein the memory 402 stores machine-readable instructions executable by the processor 401, and when the electronic device is running, the processor 401 communicates with the memory 402 through the bus, and the processor 401 executes the machine-readable instructions to perform the steps of the import and export method as described above.
[0129] Specifically, the above-mentioned memory 402 and processor 401 can be general-purpose memories and processors, which are not specifically limited here. When the processor 401 runs the computer program stored in the memory 402, the above-mentioned import and export method can be executed.
[0130] Corresponding to the above-mentioned import and export method, an embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the above-mentioned import and export method are executed.
[0131] Those skilled in the art can clearly understand that, for the convenience and simplicity of description, the specific working process of the system and device described above can refer to the corresponding process in the method embodiment, and will not be repeated in this application. In the several embodiments provided in this application, it should be understood that the disclosed system, device and method can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the modules is only a logical function division. There may be other division methods in actual implementation. For example, multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, indirect coupling or communication connection of devices or modules, which can be electrical, mechanical or other forms.
[0132] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0133] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0134] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that is executable by a processor. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the information processing method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard drives, ROM, RAM, magnetic disks, or optical disks.
[0135] The above are only specific implementations of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the 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.
Claims
1. A method for importing and exporting data, characterized in that: The method comprises: In response to a configuration request for a target import and export service initiated by a service configuration personnel on an import and export service configuration interface, the service configuration interface is displayed to the service configuration personnel, so that the service configuration personnel configures a mapping relationship between a source data field in a source data source and a target data field in a target data source and a field mapping rule corresponding to the mapping relationship for the target import and export service; Performing mapping verification on the mapping relationship between the source data field and the target data field and the field mapping rule corresponding to the mapping relationship; If the mapping verification is successful, the configuration of the target import and export business is completed; After the configuration is completed, the user role bound to the target import and export service is determined as the target user role; each user role corresponds to one or more import and export users; In the import and export interface of the import and export user corresponding to the target user role, a component button corresponding to the target import and export business is displayed, so that the import and export user can import and export data through the component button.
2. The data import and export method according to claim 1, characterized in that: The business configuration interface includes a data source configuration interface and a field mapping configuration interface; the business configuration interface is displayed to the business configuration personnel so that the business configuration personnel can configure the mapping relationship between the source data field in the source data source and the target data field in the target data source for the target import and export business, and the field mapping rules corresponding to the mapping relationship, including: Displaying the data source configuration interface to the business configuration personnel so that the business configuration personnel can configure the source data source parameter information and the target data source parameter information on the data source configuration interface; The source data fields in the data source corresponding to the source data source parameter information and the target data fields in the data source corresponding to the target data source parameter information are displayed in the field mapping configuration interface, so that the business configuration personnel can configure the mapping relationship between the source data fields and the target data fields and the field mapping rules corresponding to the mapping relationship in the field mapping configuration interface.
3. The data import and export method according to claim 1, characterized in that: The mapping check includes data type check; the mapping check on the mapping relationship between the source data field and the target data field and the field mapping rule corresponding to the mapping relationship includes: Determine whether the data type corresponding to the source data field can be converted into the data type corresponding to the target data field according to a preset data type conversion table, and obtain a first determination result; If the first judgment result is that the data type corresponding to the source data field cannot be converted into the data type corresponding to the target data field, then judging whether the field mapping rule corresponding to the mapping relationship can convert the data type corresponding to the source data field into the data type corresponding to the target data field, to obtain a second judgment result; If the second judgment result is that the data type corresponding to the source data field cannot be converted into the data type corresponding to the target data field, the mapping check fails.
4. The data import and export method according to any one of claims 1 to 3, characterized in that: The method further comprises: In response to an execution request of a target import and export business initiated by an import and export user in the import and export interface, an execution configuration interface is displayed to the import and export user, so that the import and export user configures the execution time parameters of the target import and export task; The target import and export task is executed according to the execution time parameter.
5. The data import and export method according to claim 4, characterized in that: The step of displaying the execution configuration interface to the import / export user so that the import / export user configures the execution time parameters of the target import / export task includes: Obtain the execution frequency type selected by the import and export user in the execution configuration interface; If the execution frequency type is an immediate execution type, the execution time parameter is set to the current time; If the execution frequency type is a scheduled execution type, the execution time field is displayed in the execution configuration interface, so that the import and export user can input the execution time of the target import and export task according to the execution time field.
6. The data import and export method according to claim 4, characterized in that: Perform target import and export operations through the following steps: Create a target import and export task corresponding to the target import and export business; The target import and export task is executed according to the mapping relationship between the source data fields in the source data source and the target data fields in the target data source configured by the business configuration personnel for the target import and export business and the field mapping rules corresponding to the mapping relationship.
7. The data import and export method according to claim 6, characterized in that: The method further comprises: After creating the target import and export task, monitor the execution status of the target import and export task in real time; The execution status of the target import and export task is sent to the import and export user.
8. A data import and export device, characterized in that: The device comprises: A response module, used to respond to a configuration request of a target import and export business initiated by a business configuration personnel in the import and export business configuration interface, and display the business configuration interface to the business configuration personnel, so that the business configuration personnel can configure a mapping relationship between a source data field in a source data source and a target data field in a target data source and a field mapping rule corresponding to the mapping relationship for the target import and export business; A mapping verification module, used to perform mapping verification on the mapping relationship between the source data field and the target data field and the field mapping rule corresponding to the mapping relationship; A configuration module, used to complete the configuration of the target import and export business if the mapping verification is successful; A determination module, used to determine the user role bound to the target import and export business as the target user role after the configuration is completed; each user role corresponds to one or more import and export users; The display module is used to display the component buttons corresponding to the target import and export business in the import and export interface of the import and export user corresponding to the target user role, so that the import and export user can import and export data through the component buttons.
9. An electronic device, characterized in that: include: A processor, a storage medium and a bus, wherein the storage medium stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor and the storage medium communicate through the bus, and the processor executes the machine-readable instructions to perform the steps of the data import and export method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method for importing and exporting data according to any one of claims 1 to 7 are executed.
Citation Information
Patent Citations
Table content mapping system and method and non-transitory storage medium
CN111522817A
Method for checking conversion field types between data sources
CN111858647A
Form data processing method and device, computer equipment and storage medium
CN112434006A
Data generation method and device, electronic equipment and storage medium
CN115525707A
Mapping Between Different Delta Handling Patterns
US20130198103A1