Business data access method, device, electronic device and storage medium

By configuring read and write components, the problem of long development cycle and low efficiency when adjusting business data is solved, and rapid adjustment of business data and improvement of development efficiency are achieved.

CN113656474BActive Publication Date: 2024-09-20JINGDONG TECH HLDG CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110897097.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-08-05
Publication Date
2024-09-20
Estimated Expiration
2041-08-05

AI Technical Summary

Technical Problem

In business processing systems, when business data is adjusted, developers need to re-modify the access code and redeploy it, resulting in a long development cycle and low efficiency.

Method used

By receiving the configuration information of the read component and the write component input by the user, the read component and the write component are configured to read and write business data from the source data source to the target data source, avoiding re-modification of code and deployment. .

Benefits of technology

It achieves rapid adjustment of business data, improves development efficiency, and reduces the development cycle.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113656474B
    Figure CN113656474B
Patent Text Reader

Abstract

The embodiments of the present invention relate to a method, device, electronic device and storage medium for accessing business data, which receives configuration information of a read component and configuration information of a write component input by a user; in response to an access signal of the business data, configures the read component according to the configuration information of the read component, and configures the write component according to the configuration information of the write component; reads the business data from a corresponding source data source through the configured read component; and writes the read business data into a target data source through the configured write component; that is, when the business data is adjusted, it is only necessary to receive the configuration information of the read component and the configuration information of the write component input by the user, and then configure the corresponding component according to the configuration information, without the need to re-modify the code and redeploy it online, and the adjustment requirements of the business data can be quickly realized only through configuration, thereby improving development efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing, and in particular to a method, device, electronic device and storage medium for accessing business data. Background Art

[0002] Business data in a business processing system usually comes from a data source (database or file). For business data of different business types, developers will develop adaptive access codes to achieve smooth access from the corresponding data source.

[0003] However, when business data is adjusted, developers are required to re-modify the access code and redeploy it online, which results in a long development cycle and low efficiency. Summary of the invention

[0004] The present invention provides a business data access method, device, electronic device and storage medium to solve the technical problems of long development cycle and low efficiency when business data is adjusted.

[0005] In a first aspect, the present invention provides a method for accessing business data, comprising: receiving configuration information of a read component and configuration information of a write component input by a user; in response to an access signal of the business data, configuring the read component according to the configuration information of the read component, and configuring the write component according to the configuration information of the write component; reading the business data from a corresponding source data source through the configured read component; and writing the read business data to a target data source through the configured write component.

[0006] As an optional embodiment, the configuration information of the reading component includes the address information of the source data source and the data reading configuration information; the configuration information of the writing component includes the address information of the target data source and the data writing configuration information; then, configuring the reading component according to the configuration information of the reading component and configuring the writing component according to the configuration information of the writing component include: determining the corresponding source data source according to the address information of the source data source, and determining the reading method of the business data according to the data reading configuration information; determining the corresponding target data source according to the address information of the target data source, and determining the writing method of the business data according to the data writing configuration information.

[0007] As an optional embodiment, the reading component includes a database reading component; for the database reading component, the data reading configuration information includes a database table name, a table field list and a first restriction condition, or includes a second structured data query language that meets a second restriction condition; then determining a reading method for business data based on the data reading configuration information includes: determining a first structured data query language or determining the second structured data query language based on the database table name, a table field list and the first restriction condition; reading business data from a source data source through the reading component includes: reading business data from a corresponding source data source according to the first structured data query language or the second structured data query language.

[0008] As an optional embodiment, the data reading configuration information further includes read data scale information and a segmentation key; wherein the segmentation key is used in conjunction with the read data scale information.

[0009] As an optional embodiment, the reading component includes a file reading component; for the file reading component, the data reading configuration information includes a file name, a file content field list and a file content separator; then determining the reading method of the business data according to the data reading configuration information includes: determining the reading method of the business data according to the file name, the file content field list and the file content separator; reading the business data from the source data source through the reading component includes: reading the business data in the file content field list corresponding to the file name line by line, and segmenting the read business data according to the file content separator.

[0010] As an optional embodiment, the data reading configuration information also includes remote configuration information; then the business data is read from the source data source through the reading component, including: if it is determined that the data reading configuration information also includes remote configuration information, the corresponding file is downloaded to the local according to the remote configuration information, and the business data is read from the local.

[0011] As an optional embodiment, the data reading configuration information also includes file compression information; then the business data is read from the source data source through the reading component, including: if it is determined that the data reading configuration information also includes file compression information, the file is decompressed according to the file compression information, and the business data is read from the decompressed file.

[0012] As an optional embodiment, the write component includes a database write component; for the database write component, the data write configuration information includes a database table name, a table field list, a write mode and a maximum number of threads; then configuring the write component according to the configuration information of the write component includes: determining a structured data write language according to the table name, table field list and write mode of the database; generating a thread pool according to the maximum number of threads; then writing the read business data to the target data source through the write component includes: concurrently executing the structured data write language according to the thread pool to achieve writing of the read business data to the target data source.

[0013] As an optional embodiment, the data writing configuration information also includes writing data scale information.

[0014] As an optional embodiment, the writing component includes a file writing component; for the file writing component, the data writing configuration information includes a file name, a file content field list, a file content separator and a file writing mode; then configuring the writing component according to the configuration information of the writing component includes: determining a writing method for business data according to the file name, the file content field list, the file content separator and the file writing mode; writing the read business data to the target data source through the writing component includes: writing the read business data to the corresponding content field list in the file name according to the file content separator and the writing mode.

[0015] As an optional embodiment, the data writing configuration information also includes remote configuration information; writing the read business data into the target data source through the writing component includes: determining the remote target data source according to the remote configuration information; and writing the business data into the remote target data source.

[0016] As an optional embodiment, the data writing configuration information also includes compressed file information; writing the read business data into the target data source through the writing component includes: compressing the business data according to the compressed file information; and writing the compressed business data into the target data source.

[0017] As an optional embodiment, before the access signal of the response to the business data, it also includes: constructing an abstract parent class component, the parent class component defines an initialization function and a startup function; constructing a first-generation subclass read component inherited from the parent class component, the initialization function in the first-generation subclass read component is a first initialization function, and the startup function is a read function; constructing a first-generation subclass write component inherited from the parent class component, the initialization function in the first-generation subclass write component is a second initialization function, and the startup function is a write function; constructing a second-generation subclass read component inherited from the first-generation subclass read component, the second-generation subclass read component serves as the read component; wherein the second-generation subclass read component defines a first initialization read function and a read function for a database or a file respectively; constructing a second-generation subclass write component inherited from the first-generation subclass write component, the second-generation subclass read component serves as The write component; wherein the second-generation subclass write component defines a second initialization function and a write function for a database or a file respectively; then the read component is configured according to the configuration information of the read component, and the write component is configured according to the configuration information of the write component, including: running the first initialization function corresponding to the database or the file to call the configuration information of the corresponding read component to configure the read component, and running the second initialization function corresponding to the database or the file to call the configuration information of the corresponding write component to configure the write component; the business data is read from the corresponding source data source through the configured read component; and the read business data is written to the target data source through the configured write component, including: running the read function corresponding to the database or the file to read the business data from the corresponding source data source; running the write function corresponding to the database or the file to write the read business data to the target data source.

[0018] In a second aspect, the present invention provides a business data access device, comprising: a receiving module for receiving configuration information of a read component and configuration information of a write component input by a user; a configuration module for responding to an access signal of the business data, configuring the read component according to the configuration information of the read component, and configuring the write component according to the configuration information of the write component; a reading module for reading business data from a corresponding source-end data source through a configured reading component; and a writing module for writing the read business data into a target-end data source through a configured writing component.

[0019] The third invention, the present invention provides an electronic device, including a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; the memory is used to store computer programs; the processor is used to implement the steps of the service data access method described in any one of the first aspects when executing the program stored in the memory.

[0020] In a fourth aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the steps of the service data access method as described in any one of the first aspects are implemented.

[0021] The business data access method, device, electronic device and storage medium provided by the embodiments of the present invention receive the configuration information of the read component and the configuration information of the write component input by the user; in response to the access signal of the business data, configure the read component according to the configuration information of the read component, and configure the write component according to the configuration information of the write component; read the business data from the corresponding source data source through the configured read component; write the read business data to the target data source through the configured write component; that is, in the embodiments of the present invention, when the business data is adjusted, it is only necessary to receive the configuration information of the read component and the configuration information of the write component input by the user, and then configure the read component according to the configuration information of the read component, and configure the write component according to the configuration information of the write component, without the need to re-modify the code and redeploy it online, and the adjustment requirements of the business data can be quickly realized only through configuration, thereby improving development efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.

[0023] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0024] Figure 1 A schematic diagram of a flow chart of a method for accessing service data provided by an embodiment of the present invention;

[0025] Figure 2 A schematic diagram of a flow chart of another method for accessing service data provided by an embodiment of the present invention;

[0026] Figure 3 A schematic diagram of a flow chart of another service data access method provided in an embodiment of the present invention;

[0027] Figure 4 A schematic diagram of a flow chart of another service data access method provided by an embodiment of the present invention;

[0028] Figure 5A schematic diagram of component configuration and service data access provided by an embodiment of the present invention;

[0029] Figure 6 An example diagram of a combination of a read-write component provided by an embodiment of the present invention;

[0030] Figure 7 A schematic diagram of the structure of a service data access device provided by an embodiment of the present invention;

[0031] Figure 8 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0032] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0033] Business data in business processing systems usually come from data sources (databases or files). For business data of different business types, developers will develop adaptive access codes to achieve smooth access from the corresponding data sources. However, when business data is adjusted, developers need to modify the access code and redeploy it online, which takes a long development cycle and is inefficient.

[0034] For example, in the asset-backed security (ABS) system, the source of asset data is from database tables or files. Different asset data has different processing logics. In order to process these asset data, different codes need to be developed to adapt to these asset data. When adding fields to asset data, the code needs to be modified to process the new fields and then deployed online, which may lead to slow development and affect the business. This model is also inflexible and not conducive to the rapid development and growth of the business.

[0035] In response to the above technical problems, the technical concept of the present invention is to extract the same code in the access function of business data into a reading component and a writing component respectively, adapt the differentiated content through configuration, and improve development efficiency.

[0036] Figure 1 A flow chart of a method for accessing service data provided by an embodiment of the present invention is shown as follows: Figure 1 As shown, the access method of the service data includes:

[0037] Step S101: receiving configuration information of a read component and configuration information of a write component input by a user.

[0038] Generally speaking, to successfully access business data to the business processing system, it includes two functions: reading and writing, that is, reading business data from the source data source, and then writing the read business data to the target data source. In this step, the code that implements the reading function can be encapsulated as a reading component, and the code that implements the writing function can be encapsulated as a writing component. For some differentiated content in the reading component or the writing component, the user can input the configuration information of the reading component and the configuration information of the writing component. These input configuration information can be stored in the server where the business processing system is deployed for subsequent use.

[0039] Preferably, the user can input the configuration information of the read component and the configuration information of the write component through the front-end configuration interface, thereby realizing visual configuration and facilitating the operation of non-developers.

[0040] Step S102: In response to an access signal of the service data, the read component is configured according to the configuration information of the read component, and the write component is configured according to the configuration information of the write component.

[0041] Specifically, when an access signal of service data is received, the components are first initialized according to the input configuration information, that is, the read component is configured according to the configuration information of the read component, and the write component is configured according to the configuration information of the write component.

[0042] As an optional embodiment, the configuration information of the reading component includes the address information of the source data source and the data reading configuration information; the configuration information of the writing component includes the address information of the target data source and the data writing configuration information; then the step S102 of configuring the reading component according to the configuration information of the reading component and configuring the writing component according to the configuration information of the writing component includes: determining the corresponding source data source according to the address information of the source data source, and determining the reading method of the business data according to the data reading configuration information; determining the corresponding target data source according to the address information of the target data source, and determining the writing method of the business data according to the data writing configuration information.

[0043] Specifically, the configuration information of the reading component includes the address information of the source data source and the data reading configuration information. For example, if the source data source is a database, the corresponding address information can be a uniform resource locator (URL), and can also include a username and password linked to the URL; the corresponding data reading configuration information includes information such as the database table name, table field list, and table data restriction conditions (where); when configuring, the database to be read and the link channel between the reading component and the database can be determined based on the URL, username, password and other information, and the business data that meets the restriction conditions in which field list in which table in the database is to be read can be determined based on the table, columns, where and other information. If the source data source is a file, the corresponding address information can be the file path (path), and the corresponding data reading configuration information includes the file name (filename), the file content field list (columns), the file content delimiter (fieldDelimiter), etc.; when configuring, the file to be read and the link channel between the reading component and the file are determined according to the path, and the business data in which content field list of which file is read and how to read the business data are determined according to the filename, columns, and fieldDelimiter.

[0044] The configuration information of the write component includes the address information of the target data source and the data write configuration information. For example, if the target data source is a database, the address information also includes information such as the database URL, username and password; the corresponding data write configuration information includes information such as the database table name (table), table field list (columns); when configuring, the database to be written and the link channel between the write component and the database are determined according to the information such as the URL, username and password, and the field list in which table in the database to write the business data is determined according to the information such as the table and columns. If the target data source is a file, the corresponding address information can also be the file path (path), and the corresponding data write configuration information includes the file name (filename), the file content field list (columns), the file content delimiter (fieldDelimiter), etc.; when configuring, the file to be written and the link channel between the write component and the file are determined according to the path, and the file name, columns and fieldDelimiter are determined according to which file and content field list the business data is written into, and how to write the business data.

[0045] Step S103: read the business data from the corresponding source data source through the configured reading component.

[0046] Step S104: Write the read business data into the target data source through the configured writing component.

[0047] Specifically, after the configuration is completed, the business data is read from the source data source (database or file) according to the configured reading component, and the business data is written to the target data source (database or file) according to the configured writing component.

[0048] The business data access method provided by the embodiment of the present invention receives the configuration information of the read component and the configuration information of the write component input by the user; in response to the access signal of the business data, configures the read component according to the configuration information of the read component, and configures the write component according to the configuration information of the write component; reads the business data from the corresponding source data source through the configured read component; writes the read business data to the target data source through the configured write component; that is, in the embodiment of the present invention, when the business data is adjusted, it is only necessary to receive the configuration information of the read component and the configuration information of the write component input by the user, and then configure the read component according to the configuration information of the read component, and configure the write component according to the configuration information of the write component, without the need to re-modify the code and redeploy it online, and the adjustment requirements of the business data can be quickly realized only through configuration, thereby improving development efficiency.

[0049] Based on the above embodiments, Figure 2 A flow chart of another method for accessing service data provided by an embodiment of the present invention is shown as follows: Figure 2 As shown, the access method of the service data includes:

[0050] Step S201: receiving configuration information of a read component and configuration information of a write component input by a user.

[0051] The configuration information of the reading component includes address information of the source data source and data reading configuration information.

[0052] The reading component includes a database reading component; for the database reading component, the data reading configuration information includes a database table name, a table field list, and a first limiting condition or includes a second structured data query language that meets a second limiting condition. Optionally, the reading component includes a file reading component; for the file reading component, the data reading configuration information includes a file name, a file content field list, and a file content separator.

[0053] If it is a database reading component, then execute step S202, step S204 and step S205; if it is a file reading component, then execute step S203, step S204 and step S206.

[0054] Step S202: In response to an access signal of the business data, determine the corresponding source data source according to the address information of the source data source, and determine the first structured data query language or the second structured data query language according to the table name, table field list and first restriction condition of the database.

[0055] Step S203, in response to the access signal of the business data, determine the corresponding source data source according to the address information of the source data source, and determine the reading method of the business data according to the file name, file content field list and file content separator.

[0056] Step S204: configure the writing component according to the configuration information of the writing component.

[0057] Step S205: Read the business data from the corresponding source data source according to the first structured data query language or the second structured data query language.

[0058] Step S206: Read the business data in the file content field list corresponding to the file name line by line, and segment the read business data according to the file content separator.

[0059] Step S207: Write the read business data into the target end data source through the configured writing component.

[0060] The implementation methods of step S201, step S204 and step S207 in this embodiment are respectively similar to the implementation methods of step S101, configuring the write component according to the configuration information of the write component in step S102, and step S104 in the above-mentioned embodiment, and are not repeated here.

[0061] The difference from the above embodiment is that, considering that the source data source includes two types, namely, a database or a file, in this embodiment, the reading component includes a database reading component; for the database reading component, the data reading configuration information includes a database table name, a table field list, and a first limiting condition or includes a second structured data query language that meets the second limiting condition; the first structured data query language is determined or the second structured data query language is determined according to the table name, the table field list, and the first limiting condition of the database; the business data is read from the corresponding source data source according to the first structured data query language or the second structured data query language; the reading component includes a file reading component; for the file reading component, the data reading configuration information includes a file name, a file content field list, and a file content separator; the reading method of the business data is determined according to the file name, the file content field list, and the file content separator; the business data in the file content field list corresponding to the file name is read line by line, and the read business data is segmented according to the file content separator.

[0062] Specifically, if the source data source is a database (especially a relational database), the corresponding reading component is a database reading component; for the database reading component, the user's configuration information for the database reading component is received, and the configuration information includes the database address information (dataSourceProp) and data reading configuration information, wherein the address information may be a database URL, a user name username and a password password, etc., and the data reading configuration information may be a database table name table, a table field list columns, and a first limiting condition where; the database to be read may be determined according to dataSourceProp, the first structured data query language (useQuerySql) may be determined according to the above data reading configuration information, and the corresponding business data may be read from the database through the first structured query language; or, if the query conditions for the business data are relatively complex, the user may directly enter a structured query statement that meets the complex conditions in the front-end configuration interface, that is, a second structured data query language (querySql) that meets the second limiting condition, and after determining the database to be read according to the database address information, the corresponding business data may be directly read from the database through the second structured query language.

[0063] As an optional embodiment, for the database reading component, the data reading configuration information also includes read data scale information and a segmentation key; wherein the segmentation key is used in conjunction with the read data scale information.

[0064] Specifically, the configuration information of the read component may also include read data scale information (pageSize), which is used to characterize the data size of each structured query language read data table, and the default pageSize=1000; and also includes a split key (splitPk), which can be used in conjunction with pageSize.

[0065] Table 1 is the configuration information of the database reading component, and its configuration information is as follows:

[0066] Table 1

[0067] dataSourceProp The address information of the data source read: Url, username, password table Database table name columns Table Field List where Table data restrictions pageSize The size of table data read each time, default is 1000 splitPk Use split key and pageSize together querySql Complex conditional data query sql (optional)

[0068] If the source data source is a file, the corresponding reading component is a file reading component. For the file reading component, the user's configuration information for the file reading component is received, and the configuration information includes the file address information (dataSourceProp) and data reading configuration information, wherein the address information can be a file path path, and the corresponding data reading configuration information includes the file name filename, the file content field list columns, the file content delimiter fieldDelimiter, etc.; the reading method of the business data can be determined according to the filename, columns and fieldDelimiter; then the file to be read is determined according to the file path, and the business data in the corresponding columns in the corresponding filename is read line by line, and the read business data is segmented according to the fieldDelimiter, and the segmented business data is written into the writing component.

[0069] Optionally, for the file reading component, the data reading configuration information also includes: file format (fileFormat), including txt, csv, tsv, etc., file encoding (encoding) and other information. That is, in this embodiment, the fileFormat and encoding and other information input by the user can also be received, so that the file reading component reads the business data corresponding to the fileFormat and the encoding from the file.

[0070] As an optional embodiment, for the file reading component, the data reading configuration information also includes remote configuration information; then the step S206 includes: if it is determined that the data reading configuration information also includes remote configuration information, downloading the corresponding file to the local according to the remote configuration information, and reading the business data from the local.

[0071] Specifically, the remote configuration information includes information such as the remote ftp address (ftpHost), the remote ftp port (ftpPort), the remote ftp type (protocol, including ftp, sftp, etc.), the ftp username (ftpUsername), and the ftp password (ftpPassword). When the user enters the remote configuration information through the front-end configuration interface, it indicates that the corresponding business data needs to be read from the file stored in the remote server. In this embodiment, the file can be downloaded to the local server according to the above remote configuration information, and then the corresponding business data can be read from the local server.

[0072] As an optional embodiment, for the file reading component, the data reading configuration information also includes file compression information; then the step S206 includes: if it is determined that the data reading configuration information also includes file compression information, the file is decompressed according to the file compression information, and the business data is read from the decompressed file.

[0073] Specifically, the compressed file information includes the file compression format (compress), etc. When the user inputs the above compressed file information through the front-end configuration interface, it means that the corresponding business data needs to be read from the compressed file. In this embodiment, the file can be first decompressed according to the above compressed file information, and then the corresponding business data can be read from the decompressed file.

[0074] If the user enters the remote configuration information and compressed file information at the same time through the front-end configuration interface, the compressed file stored on the remote server can be downloaded to the local server according to the remote configuration information, and then the compressed file can be decompressed on the local server, and finally the corresponding business data can be read from the local decompressed file.

[0075] If the user does not configure remote configuration information and compressed file information, the corresponding uncompressed file can be directly read from the local server.

[0076] Table 2 is the configuration information of the file reading component, and its configuration information is as follows:

[0077] Table 2

[0078] path The file path to read fileName The file name to read fileFormat File format: txt, csv, tsv fieldDelimiter Content separator encoding File Encoding compress File compression format (optional) columns Content Field List ftpHost Remote FTP address (optional) ftpPort Remote FTP port (optional) protocol Remote FTP type: ftp, sftp (optional) ftpUsername ftp username, (optional) ftpPassword ftp password (optional)

[0079] The method for accessing business data provided by an embodiment of the present invention includes a database reading component through the reading component; for the database reading component, the data reading configuration information includes a database table name, a table field list and a first limiting condition or includes a second structured data query language that meets the second limiting condition; the first structured data query language is determined or the second structured data query language is determined according to the table name, the table field list and the first limiting condition of the database; the business data is read from the corresponding source data source according to the first structured data query language or the second structured data query language; the reading component includes a file reading component; for the file reading component, the data reading configuration information includes The invention relates to a method for reading business data according to the file name, the file content field list and the file content separator; the method for reading business data is determined according to the file name, the file content field list and the file content separator; the business data in the file content field list corresponding to the file name is read line by line, and the read business data is segmented according to the file content separator; that is, the embodiment of the present invention divides the reading component into a database reading component and a file reading component according to the type of data source, and for the reading component of each type of data source, the user's configuration information can be received, and the reading component can be configured according to the configuration information, without the need to re-modify the code and redeploy it online, and the adjustment requirements of business data can be quickly realized only through configuration, thereby improving development efficiency.

[0080] Based on the above embodiments, Figure 3 A flow chart of another method for accessing service data provided by an embodiment of the present invention is shown as follows: Figure 3 As shown, the access method of the service data includes:

[0081] Step S301: receiving configuration information of a read component and configuration information of a write component input by a user.

[0082] The configuration information of the write component includes the address information of the target data source and the data write configuration information. The write component includes a database write component, and for the database write component, the data write configuration information includes the database table name, table field list, write mode, and maximum number of threads; the write component includes a file write component, and for the file write component, the data write configuration information includes the file name, file content field list, file content separator, and file write mode.

[0083] Step S302: In response to an access signal of the service data, configure the reading component according to the configuration information of the reading component.

[0084] If it is a database reading component, then execute step S303, step S305 and step S306; if it is a file writing component, then execute step S304, step S305 and step S307.

[0085] Step S303: determining a structured data writing language according to the table name, table field list and writing mode of the database; and generating a thread pool according to the maximum number of threads.

[0086] Step S304: Determine the writing method of the business data according to the file name, the file content field list, the file content separator, and the file writing mode.

[0087] Step S305: read the business data from the corresponding source data source through the configured reading component.

[0088] Step S306: concurrently executing the structured data writing language according to the thread pool to write the read business data into the target end data source.

[0089] Step S307: write the read business data into the corresponding content field list in the file name according to the file content separator and the writing mode.

[0090] The implementation methods of step S301, step S302 and step S305 in this embodiment are respectively similar to the implementation methods of step S101 and step S102 in the above-mentioned embodiments, in which the reading component is configured according to the configuration information of the reading component in response to the access signal of the business data, and step S103, and are not repeated here.

[0091] The difference from the above embodiment is that, considering that the target data source includes two types, namely, a database or a file, in this embodiment, the writing component includes a database writing component; for the database writing component, the data writing configuration information includes a database table name, a table field list, a writing mode and a maximum number of threads; a structured data writing language is determined according to the table name, the table field list and the writing mode of the database; a thread pool is generated according to the maximum number of threads; the structured data writing language is concurrently executed according to the thread pool to write the read business data into the target data source; the writing component includes a file writing component; for the file writing component, the data writing configuration information includes a file name, a file content field list, a file content separator and a file writing mode; a writing method of the business data is determined according to the file name, the file content field list, the file content separator and the file writing mode; the read business data is written into the corresponding content field list in the corresponding file name according to the file content separator and the writing mode.

[0092] Specifically, if the target data source is a database (especially a relational database), the corresponding writing component is a database writing component; for the database writing component, the user's configuration information for the database writing component is received, and the configuration information includes the database address information (dataSourceProp) and data writing configuration information, wherein the address information may be a database URL, a user name username and a password password, etc., and the data writing configuration information may be a database table name table, a table field list columns, a writing mode (writeMode, including insert, replace, update and other modes) and a maximum number of threads (maxPoolSize). The database to be written can be determined according to the database address information, the structured data writing language (writeSql) can be determined according to the table, columns and writeMode, a thread pool can be generated according to maxPoolSize, and the business data can be written to the table field list in the corresponding database table through writeSql, and a thread pool can be generated for concurrent execution of writeSql to improve the writing efficiency of business data.

[0093] As an optional embodiment, the data writing configuration information further includes writing data scale information (batchSize), which represents the size of data written to the data table each time, and the default batchSize=500.

[0094] Table 3 is the configuration information of the database writing component, and its configuration information is as follows:

[0095] Table 3

[0096] dataSourceProp The data source address information written: Url, username, password table Database table name columns Table Field List batchSize The size of the data written to the table each time, the default is 500 writeMode Write modes: insert, replace, update maxPoolSize Maximum number of threads

[0097] If the target data source is a file, its corresponding writing component is a file writing component; for the file writing component, the user's configuration information for the file writing component is received, and the configuration information includes the file address information (dataSourceProp) and data writing configuration information, wherein the address information can be the file path path, and the corresponding data writing configuration information includes the file name filename, the file content field list columns, the file content delimiter fieldDelimiter and the file writing mode (writeMode, including clearing and then writing, appending, error reporting and other modes); the file to be written can be determined according to the file path, the writing method of the business data can be determined according to the filename, columns, fieldDelimiter and writeMode, and the read business data can be written into the corresponding content field list in the corresponding file name according to fieldDelimiter and writeMode.

[0098] Optionally, for the file writing component, the data writing configuration information also includes: file format (fileFormat), including txt, csv, tsv, etc., file encoding (encoding), file content header (headers), etc. That is, in this embodiment, the fileFormat, encoding, headers and other information input by the user can also be received, so as to write the business data into the file corresponding to the fileFormat, encoding and headers.

[0099] As an optional embodiment, for the file writing component, the data writing configuration information also includes remote configuration information; the step S307 includes: determining the remote target data source according to the remote configuration information; and writing the business data into the remote target data source.

[0100] Specifically, the remote configuration information includes the remote ftp address (ftpHost), the remote ftp port (ftpPort), the remote ftp type (protocol, including ftp, sftp and other types), the ftp username (ftpUsername) and the ftp password (ftpPassword) etc. When the user enters the above remote configuration information through the front-end configuration interface, it means that the business data needs to be written into the file on the remote server. Then, the target data source on the remote server, i.e., the target file, is determined according to the above remote configuration information, and then the business data is sent to the target file.

[0101] As an optional embodiment, for the file writing component, the data writing configuration information also includes compressed file information; the step S307 includes: compressing the business data according to the compressed file information; and writing the compressed business data into the target end data source.

[0102] Specifically, the compressed file information includes the file compression format (compress), etc. When the user enters the above compressed file information through the front-end configuration interface, it means that the business data needs to be written into a compressed file. The business data is first compressed according to the above compressed file information, and then the compressed file is written to the target data source, that is, the target file.

[0103] If the user enters the remote configuration information and compressed file information at the same time through the front-end configuration interface, the read business data can be compressed on the local server first, and then the compressed business data can be sent to the remote server. If the user does not configure the remote configuration information and compressed file information, the business data can be directly written to the target file on the local server.

[0104] Table 4 is the configuration information of the file writing component, and its configuration information is as follows:

[0105] Table 4

[0106] path The file path to write to fileName The file name to be written fileFormat File format: txt, csv, tsv fieldDelimiter Content separator encoding File Encoding writeMode File writing mode: clear then write, append, error reporting compress File compression format (optional) headers Content header (optional) ftpHost Remote FTP address (optional) ftpPort Remote FTP port (optional) protocol Remote FTP type: ftp, sftp (optional) ftpUsername ftp username (optional) ftpPassword ftp password (optional)

[0107] The business data access method provided by an embodiment of the present invention includes a database writing component through the writing component; for the database writing component, the data writing configuration information includes a database table name, a table field list, a writing mode and a maximum number of threads; a structured data writing language is determined according to the table name, the table field list and the writing mode of the database; a thread pool is generated according to the maximum number of threads; the structured data writing language is concurrently executed according to the thread pool to write the read business data to the target end data source; the writing component includes a file writing component; for the file writing component, the data writing configuration information includes a file name, a file content field list ... structured data writing language content separator and file writing mode; determine the writing method of business data according to the file name, the file content field list, the file content separator and the file writing mode; write the read business data into the corresponding content field list in the corresponding file name according to the file content separator and the writing mode; that is, the embodiment of the present invention divides the writing component into a database writing component and a file writing component, etc. according to the type of data source. For the writing component of each type of data source, the user's configuration information can be received, and the writing component can be configured according to the configuration information. There is no need to modify the code again or redeploy it online. The adjustment requirements of business data can be quickly realized only through configuration, thereby improving development efficiency.

[0108] Based on the above embodiments, Figure 4 A flow chart of another method for accessing service data provided by an embodiment of the present invention is shown as follows: Figure 4 As shown, the access method of the service data includes:

[0109] Step S401: construct an abstract parent class component, wherein the parent class component defines an initialization function and a startup function.

[0110] Step S402: construct a first generation subclass reading component that inherits from the parent class component.

[0111] Among them, the initialization function in the first-generation subclass reading component is the first initialization function, and the startup function is the reading function.

[0112] Step S403: construct a first generation child class writing component that inherits from the parent class component.

[0113] Among them, the initialization function in the first-generation subclass writing component is the second initialization function, and the startup function is the writing function.

[0114] Step S404: construct a second-generation subclass reading component that inherits from the first-generation subclass reading component, and the second-generation subclass reading component serves as the reading component.

[0115] The second generation subclass reading component defines a first initialization reading function and a reading function for a database or a file respectively.

[0116] Step S405: construct a second-generation subclass write component that inherits from the first-generation subclass write component, and the second-generation subclass read component serves as the write component.

[0117] The second generation subclass writing component defines a second initialization function and a writing function for a database or a file respectively.

[0118] Step S406: receiving the configuration information of the read component and the configuration information of the write component input by the user.

[0119] Step S407, in response to the access signal of the business data, run the read function corresponding to the database or file to read the business data from the corresponding source data source; run the write function corresponding to the database or file to write the read business data to the target data source.

[0120] Step S408: Run the read function corresponding to the database or file to read the business data from the corresponding source data source.

[0121] Step S409: Run the write function corresponding to the database or file to write the read business data into the target end data source.

[0122] The implementation of step S406 in this embodiment is similar to the implementation of step S101 in the above embodiment, and will not be repeated here.

[0123] The difference from the above embodiment is that this embodiment further defines the specific acquisition method of the read component and the write component. In this embodiment, an abstract parent class component is constructed, and the parent class component defines an initialization function and a startup function; a first-generation subclass read component inherited from the parent class component is constructed, and the initialization function in the first-generation subclass read component is a first initialization function, and the startup function is a read function; a first-generation subclass write component inherited from the parent class component is constructed, and the initialization function in the first-generation subclass write component is a second initialization function, and the startup function is a write function; a second-generation subclass read component inherited from the first-generation subclass read component is constructed, and the second-generation subclass read component is used as the read component; wherein the second-generation subclass read component defines respectively A first initialization read function and a read function for a database or a file; constructing a second-generation subclass write component inherited from the first-generation subclass write component, and the second-generation subclass read component serves as the write component; wherein the second-generation subclass write component defines a second initialization function and a write function for the database or the file respectively; running the first initialization function corresponding to the database or the file calls the configuration information of the corresponding read component to configure the read component, and running the second initialization function corresponding to the database or the file calls the configuration information of the corresponding write component to configure the write component; running the read function corresponding to the database or the file reads the business data from the corresponding source data source; running the write function corresponding to the database or the file writes the read business data to the target data source.

[0124] Specifically, for many identical functional codes in the process of business data access, a public abstract class AbstPlugin can be abstracted as a parent class component. In the AbstPlugin, public functions such as component initialization (dolnit) and startup (start) can be defined, as well as public functions such as preprocessing (prepare) and destruction (destroy). In addition, the class tool PluginConfig is defined to perform initialization preprocessing and other operations.

[0125] Then, a subclass reading component ReaderPlugin (i.e., the first-generation subclass reading component) inherited from AbstPlugin is constructed, and ReaderPlugin inherits the functions of AbstPlugin, including the first initialization function and the reading function; a subclass writing component WriterPlugin (i.e., the first-generation subclass writing component) inherited from AbstPlugin is constructed, and WriterPlugin inherits the functions of AbstPlugin, including the second initialization function and the writing function. Figure 5 A schematic diagram of component configuration and service data access provided by an embodiment of the present invention; Figure 5As shown, the ReaderPlugin and WriterPlugin are configured separately through the class tool PluginConfig, so that the business data (DataRecord) flows out of the ReaderPlugin and flows into the WriterPlugin.

[0126] Then, for database, we built a second-generation subclass reading component inherited from ReaderPlugin, namely, database reading component (JdbcReader), and built a second-generation subclass writing component inherited from WriterPlugin, namely, database writing component (JdbcWriter). For files, we built a second-generation subclass reading component inherited from ReaderPlugin, namely, file reading component (FileReader), and built a second-generation subclass writing component inherited from WriterPlugin, namely, file writing component (FileWriter).

[0127] Among them, the reading component and the writing component can be matched arbitrarily to meet various needs. Figure 6 An example diagram of a combination of a read-write component provided by an embodiment of the present invention, such as Figure 6 As shown, a database reading component (JdbcReader) is selected to read the business data in the MySQL table; a file writing component (FileWriter) is selected to write the business data (DataRecord) read from the MySQL table into the Ftp remote file; and a database writing component (JdbcWriter) is selected to write the business data (DataRecord) read from the MySQL table into the SQLServer table.

[0128] After building the reading component and writing component, if it is for the database reading component JdbcReader, the user can enter the configuration parameters shown in Table 1 in the front-end configuration interface, and then in response to the access signal of the business data, the database reading component can call the doInit method to complete the initialization configuration operation, that is, generate the structured data query statement useQuerySql (the SQL that actually obtains the data) and the source dataSource data source; then after the component start is started, the reading function doReading is called to send the read DataRecord to the subsequent WriterPlugin.

[0129] For the file reading component FileReader, the user can enter the configuration parameters shown in Table 2 in the front-end configuration interface. Then, in response to the access signal of the business data, FileReader calls the doInit initialization method to complete the initialization configuration operation, and initializes the ftp client of the corresponding ftp type according to whether the remote ftp address is configured. When it is subsequently started, it will first download the file to the local computer. If the file is compressed, it needs to be decompressed. After starting, FileReader will read the data line by line, and divide the data according to fieldDelimiter to assemble DataRecord. In other words, JdbcReader or FileReader encapsulates the function of reading the database table into a system that only needs to provide the configuration information in Table 1 or Table 2 to complete the reading of the database table data.

[0130] If the database writing component JdbcWriter is used, the user can enter the configuration parameters shown in Table 3 in the front-end configuration interface, and then the database writing component can call the doInit method to complete the initialization configuration operation, that is, generate the structured data writing statement writeSql and the target end dataSource data source; then after the component start is started, the writing function doWrite is called to write DataRecord into WriterPlugin.

[0131] For the file writing component FileWriter, the user can enter the configuration parameters shown in Table 4 in the front-end configuration interface, and then FileWriter calls the doInit initialization method to complete the initialization configuration operation, and initializes the ftp client of the corresponding ftp type according to whether the remote ftp address is configured. When it is started later, the file will be sent to the remote server. If the file is compressed, it will be compressed before sending; after FileWriter is started, DataRecord will be written to the target file. In other words, JdbcWriter or FileWriter encapsulates the business data writing function into a system that only needs to provide configuration information such as Table 3 or Table 4 to complete the writing of business data to the target data source.

[0132] The method for accessing business data provided by an embodiment of the present invention comprises the following steps: constructing an abstract parent class component, wherein the parent class component defines an initialization function and a startup function; constructing a first-generation subclass read component inherited from the parent class component, wherein the initialization function in the first-generation subclass read component is a first initialization function, and the startup function is a read function; constructing a first-generation subclass write component inherited from the parent class component, wherein the initialization function in the first-generation subclass write component is a second initialization function, and the startup function is a write function; constructing a second-generation subclass read component inherited from the first-generation subclass read component, wherein the second-generation subclass read component serves as the read component; wherein the second-generation subclass read component defines a first initialization read function and a read function for a database or a file respectively; constructing a second-generation subclass write component inherited from the first-generation subclass write component, wherein the second-generation subclass read component serves as the write component; Among them, the second-generation subclass write component defines a second initialization function and a write function for the database or file respectively; the first initialization function corresponding to the database or file is run to call the configuration information of the corresponding read component to configure the read component, and the second initialization function corresponding to the database or file is run to call the configuration information of the corresponding write component to configure the write component; the read function corresponding to the database or file is run to read the business data from the corresponding source data source; the write function corresponding to the database or file is run to write the read business data to the target data source; that is, in the embodiment of the present invention, the same or similar codes in the process of accessing the business data are extracted and encapsulated into a read component and a write component, and then the different contents are adapted in a configured manner, and the read component and the write component are configured according to the configuration information, so as to realize rapid adaptation, modification and access of different business data, thereby improving development efficiency.

[0133] Figure 7 A schematic diagram of a structure of a service data access device provided by an embodiment of the present invention, such as Figure 7 As shown, the access device for the service data includes:

[0134] The receiving module 10 is used to receive the configuration information of the reading component and the configuration information of the writing component input by the user; the configuration module 20 is used to configure the reading component according to the configuration information of the reading component and configure the writing component according to the configuration information of the writing component in response to the access signal of the business data; the reading module 30 is used to read the business data from the corresponding source data source through the configured reading component; the writing module 40 is used to write the read business data into the target data source through the configured writing component.

[0135] As an optional embodiment of the present invention, the configuration information of the reading component includes the address information of the source data source and the data reading configuration information; the configuration information of the writing component includes the address information of the target data source and the data writing configuration information; then the configuration module 20 is specifically used to: determine the corresponding source data source according to the address information of the source data source, and determine the reading method of the business data according to the data reading configuration information; determine the corresponding target data source according to the address information of the target data source, and determine the writing method of the business data according to the data writing configuration information.

[0136] As an optional embodiment of the present invention, the reading component includes a database reading component; for the database reading component, the data reading configuration information includes a database table name, a table field list and a first restriction condition or includes a second structured data query language that meets a second restriction condition; then the configuration module 20 is specifically used to: determine the first structured data query language or determine the second structured data query language according to the table name, table field list and first restriction condition of the database; the reading module 30 is specifically used to: read the business data from the corresponding source data source according to the first structured data query language or the second structured data query language.

[0137] As an optional embodiment of the present invention, the data reading configuration information further includes read data scale information and a segmentation key; wherein the segmentation key is used in conjunction with the read data scale information.

[0138] As an optional embodiment of the present invention, the reading component includes a file reading component; for the file reading component, the data reading configuration information includes a file name, a file content field list and a file content separator; the configuration module 20 is specifically used to: determine the reading method of the business data according to the file name, the file content field list and the file content separator; the reading module 30 is specifically used to: read the business data corresponding to the file content field list in the file name line by line, and split the read business data according to the file content separator.

[0139] As an optional embodiment of the present invention, the data reading configuration information also includes remote configuration information; then the reading module 30 is specifically used to: if it is determined that the data reading configuration information also includes remote configuration information, then download the corresponding file to the local according to the remote configuration information, and read the business data from the local.

[0140] As an optional embodiment of the present invention, the data reading configuration information also includes file compression information; the reading module 30 is specifically used to: if it is determined that the data reading configuration information also includes file compression information, decompress the file according to the file compression information, and read the business data from the decompressed file.

[0141] As an optional embodiment of the present invention, the writing component includes a database writing component; for the database writing component, the data writing configuration information includes a database table name, a table field list, a writing mode and a maximum number of threads; then the configuration module 20 is specifically used to: determine the structured data writing language according to the table name, table field list and writing mode of the database; generate a thread pool according to the maximum number of threads; then the writing module 40 is specifically used to: concurrently execute the structured data writing language according to the thread pool to realize writing the read business data into the target data source.

[0142] As an optional embodiment of the present invention, the data writing configuration information also includes writing data scale information.

[0143] As an optional embodiment of the present invention, the writing component includes a file writing component; for the file writing component, the data writing configuration information includes a file name, a file content field list, a file content separator and a file writing mode; then the configuration module 20 is specifically used to: determine the writing method of the business data according to the file name, the file content field list, the file content separator and the file writing mode; the writing module 40 is specifically used to: write the read business data into the corresponding content field list in the file name according to the file content separator and the writing mode.

[0144] As an optional embodiment of the present invention, the data writing configuration information also includes remote configuration information; the writing module 40 is specifically used to: determine the remote target data source according to the remote configuration information; and write the business data into the remote target data source.

[0145] As an optional embodiment of the present invention, the data writing configuration information also includes compressed file information; the writing module 40 is specifically used to: compress the business data according to the compressed file information; and write the compressed business data into the target end data source.

[0146] As an optional embodiment of the present invention, the device also includes a construction module 50, which is used to construct an abstract parent class component before the access signal in response to the business data, the parent class component defines an initialization function and a startup function; construct a first-generation subclass read component inherited from the parent class component, the initialization function in the first-generation subclass read component is a first initialization function, and the startup function is a read function; construct a first-generation subclass write component inherited from the parent class component, the initialization function in the first-generation subclass write component is a second initialization function, and the startup function is a write function; construct a second-generation subclass read component inherited from the first-generation subclass read component, the second-generation subclass read component serves as the read component; wherein the second-generation subclass read component defines a first initialization function for a database or a file, respectively. Initialize the read function and the read function; construct a second-generation subclass write component inherited from the first-generation subclass write component, and the second-generation subclass read component serves as the write component; wherein the second-generation subclass write component defines a second initialization function and a write function for the database or file respectively; then the configuration module 20 includes: running the first initialization function corresponding to the database or file to call the configuration information of the corresponding read component to configure the read component, and running the second initialization function corresponding to the database or file to call the configuration information of the corresponding write component to configure the write component; the read module 30 is used to run the read function corresponding to the database or file to read the business data from the corresponding source data source; the write module is used to run the write function corresponding to the database or file to write the read business data into the target data source.

[0147] The implementation principle and technical effects of the service data access device provided in this embodiment are similar to those of the above embodiments and will not be described in detail here.

[0148] like Figure 8 As shown, an embodiment of the present invention provides an electronic device, including a processor 111, a communication interface 112, a memory 113 and a communication bus 114, wherein the processor 111, the communication interface 112, and the memory 113 communicate with each other through the communication bus 114.

[0149] Memory 113, used for storing computer programs;

[0150] In one embodiment of the present invention, the processor 111 is used to implement the steps of the service data access method provided by any one of the aforementioned method embodiments when executing the program stored in the memory 113.

[0151] An embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the service data access method provided in any of the aforementioned method embodiments are implemented.

[0152] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0153] The foregoing is merely a specific embodiment of the present invention, which enables those skilled in the art to understand or implement the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features claimed herein.

Claims

1. A method for accessing business data, characterized in that: include: Receive configuration information of the read component and configuration information of the write component input by the user; In response to an access signal of the service data, configuring the reading component according to the configuration information of the reading component, and configuring the writing component according to the configuration information of the writing component; The business data is read from the corresponding source data source through the configured reading component; The configured write component writes the read business data to the target data source; The configuration information of the read component includes the address information of the source data source and the data read configuration information; the configuration information of the write component includes the address information of the target data source and the data write configuration information; Then, configuring the reading component according to the configuration information of the reading component and configuring the writing component according to the configuration information of the writing component includes: Determine the corresponding source data source according to the address information of the source data source, and determine the reading method of the business data according to the data reading configuration information; Determine the corresponding target data source according to the address information of the target data source, and determine the writing mode of the business data according to the data writing configuration information, wherein the writing mode includes at least one of the following: insert, replace; The reading component includes a database reading component and a file reading component, and the writing component includes a database writing component and a file writing component; For the database reading component, the data reading configuration information includes a database table name, a table field list, a first limiting condition, a second structured data query language that meets the second limiting condition, read data scale information, and a segmentation key; wherein the segmentation key is used in conjunction with the read data scale information, and the second structured data query language is an optional configuration; For the file reading component, the data reading configuration information includes a file name, a file content field list, a file content separator, first remote configuration information, and file compression information, wherein the first remote configuration information and file compression information are optional configurations; For the database writing component, the data writing configuration information includes database table name, table field list, writing mode, maximum number of threads and writing data scale information; For the file writing component, the data writing configuration information includes file name, file content field list, file content separator, file writing mode, second remote configuration information and compressed file information, and the second remote configuration information and compressed file information are optional configurations.

2. The method according to claim 1, characterized in that For the database reading component, determining the reading method of the business data according to the data reading configuration information includes: Determine the first structured data query language or the second structured data query language according to the table name, the table field list and the first limiting condition of the database; The configured reading component reads the business data from the source data source, including: The business data is read from the corresponding source data source according to the first structured data query language or the second structured data query language.

3. The method according to claim 1, characterized in that For the file reading component, determining the reading method of the business data according to the data reading configuration information includes: Determine a method for reading business data according to the file name, the file content field list, and the file content separator; The configured reading component reads the business data from the source data source, including: The business data in the file content field list corresponding to the file name is read line by line, and the read business data is segmented according to the file content separator.

4. The method according to claim 3, characterized in that The configured reading component reads the business data from the source data source, including: If it is determined that the data reading configuration information also includes the first remote configuration information, the corresponding file is downloaded to the local according to the first remote configuration information, and the business data is read from the local.

5. The method according to claim 3, characterized in that: The configured reading component reads the business data from the source data source, including: If it is determined that the data reading configuration information also includes file compression information, the file is decompressed according to the file compression information, and the business data is read from the decompressed file.

6. The method according to claim 1, characterized in that For the database writing component, configuring the writing component according to the configuration information of the writing component includes: Determine a structured data writing language according to a table name, a table field list, and a writing mode of the database; Generate a thread pool according to the maximum number of threads; The configured writing component writes the read business data to the target data source, including: The structured data writing language is concurrently executed according to the thread pool to write the read business data into the target end data source.

7. The method according to claim 1, characterized in that For the file writing component, configuring the writing component according to the configuration information of the writing component includes: Determine the writing method of business data based on the file name, file content field list, file content separator, and file writing mode; The configured writing component writes the read business data to the target end data source, including: The read business data is written into the corresponding content field list in the corresponding file name according to the file content separator and the writing mode.

8. The method according to claim 7, characterized in that The configured writing component writes the read business data to the target end data source, including: Determine a remote target end data source according to the second remote configuration information; The business data is written to the remote target data source.

9. The method according to claim 7, characterized in that: The configured writing component writes the read business data to the target end data source, including: Compressing the business data according to the compressed file information; Write the compressed business data to the target data source.

10. The method according to claim 1, characterized in that Before the access signal in response to the service data, the method further comprises: Construct an abstract parent class component, wherein the parent class component defines an initialization function and a startup function; Constructing a first-generation subclass reading component inherited from the parent class component, wherein the initialization function in the first-generation subclass reading component is a first initialization function, and the startup function is a reading function; Constructing a first-generation subclass writing component inherited from the parent class component, wherein the initialization function in the first-generation subclass writing component is the second initialization function, and the startup function is the writing function; Constructing a second-generation subclass reading component inherited from the first-generation subclass reading component, the second-generation subclass reading component serving as the reading component; wherein the second-generation subclass reading component defines a first initialization reading function and a reading function for a database or a file respectively; Constructing a second-generation subclass writing component inherited from the first-generation subclass writing component, the second-generation subclass writing component serving as the writing component; wherein the second-generation subclass writing component defines a second initialization function and a writing function for a database or a file respectively; Then, configuring the reading component according to the configuration information of the reading component and configuring the writing component according to the configuration information of the writing component includes: The first initialization function corresponding to the running database or file calls the configuration information of the corresponding reading component to configure the reading component, and the second initialization function corresponding to the running database or file calls the configuration information of the corresponding writing component to configure the writing component; The process of reading the business data from the corresponding source data source through the configured reading component and writing the read business data to the target data source through the configured writing component includes: Run the read function corresponding to the database or file to read the business data from the corresponding source data source; run the write function corresponding to the database or file to write the read business data to the target data source.

11. A device for accessing business data, characterized in that: include: A receiving module, used for receiving configuration information of a reading component and configuration information of a writing component input by a user; a configuration module, configured to configure the reading component according to the configuration information of the reading component and to configure the writing component according to the configuration information of the writing component in response to an access signal of the service data; The reading module is used to read business data from the corresponding source data source through the configured reading component; The write module is used to write the read business data into the target data source through the configured write component; The configuration information of the read component includes the address information of the source data source and the data read configuration information; the configuration information of the write component includes the address information of the target data source and the data write configuration information; The configuration module is specifically used to: determine the corresponding source data source according to the address information of the source data source, and determine the reading mode of the business data according to the data reading configuration information; determine the corresponding target data source according to the address information of the target data source, and determine the writing mode of the business data according to the data writing configuration information, and the writing mode includes at least one of the following: insert, replace; The reading component includes a database reading component and a file reading component, and the writing component includes a database writing component and a file writing component; For the database reading component, the data reading configuration information includes a database table name, a table field list, a first limiting condition, a second structured data query language that meets the second limiting condition, read data scale information, and a segmentation key; wherein the segmentation key is used in conjunction with the read data scale information, and the second structured data query language is an optional configuration; For the file reading component, the data reading configuration information includes a file name, a file content field list, a file content separator, first remote configuration information, and file compression information, wherein the first remote configuration information and file compression information are optional configurations; For the database writing component, the data writing configuration information includes database table name, table field list, writing mode, maximum number of threads and writing data scale information; For the file writing component, the data writing configuration information includes file name, file content field list, file content separator, file writing mode, second remote configuration information and compressed file information, and the second remote configuration information and compressed file information are optional configurations.

12. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor is used to implement the steps of the service data access method described in any one of claims 1-10 when executing a program stored in a memory.

13. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the service data access method according to any one of claims 1 to 10 are implemented.