Data transfer method, device, computer readable storage medium and computer equipment
The data to be transferred is generated through filtering and configuration file retrieval, which solves the problem of insufficient flexibility in data transfer operations, improves processing efficiency, and avoids the waste of time in hard coding.
Patent Information
- Application Number
- CN202010097427.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-02-17
- Publication Date
- 2024-09-10
- Estimated Expiration
- 2040-02-17
AI Technical Summary
The data transfer operation in the existing technology lacks flexibility and low processing efficiency. It needs to be hard-coded for each application scenario, resulting in a lot of time consumption.
By obtaining business data, filter out the data that meets the data generation task, and use the filtered data to retrieve the action objects, data types and rules related to the application scenarios recorded in the configuration file, generate the data to be transferred, and perform transfer operations based on the action objects. .
It improves the efficiency and flexibility of data transfer processing, avoids hard coding for each application scenario, saves coding time, and achieves fast and accurate data transfer.
Smart Images

Figure CN113268480B
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a data transfer method, device, computer-readable storage medium and computer equipment. Background Art
[0002] With the development of computer technology, database technology has emerged. A large amount of business data can be stored in the database. By pulling business data from the database for analysis, subsequent operations such as data transfer can be performed. In the traditional way, the data to be transferred is usually obtained by hard coding. However, the data to be transferred is usually closely related to the application scenario. As the application scenarios increase, the demand for data transfer also increases. If the hard coding method continues to be used, it will take a lot of time to hard code each application scenario. As a result, the flexibility of the data transfer operation is insufficient and the processing efficiency is affected. Summary of the invention
[0003] Based on this, it is necessary to provide a data transfer method, apparatus, computer-readable storage medium and computer equipment to address the technical problems of insufficient flexibility in data transfer operations and low transfer processing efficiency.
[0004] A data transfer method, comprising:
[0005] Get business data;
[0006] Acquire a data generation task, and filter the business data according to the data generation task;
[0007] Retrieving a corresponding configuration file using the filtered business data, wherein the configuration file records the action object, data type and rules corresponding to the application scenario;
[0008] Generate data to be transferred corresponding to the data type by using the screened business data and the rule;
[0009] The data to be transferred is transferred according to the action object.
[0010] A data transfer device, characterized in that the device comprises:
[0011] Acquisition module, used to acquire business data; acquire data generation tasks;
[0012] A screening module, used for screening the business data according to the data generation task;
[0013] A retrieval module, used to retrieve a corresponding configuration file using the filtered business data, wherein the configuration file records the action object, data type and rules corresponding to the application scenario;
[0014] The transfer operation module is used to generate data to be transferred corresponding to the data type by using the filtered business data and the rules; and perform a transfer operation on the data to be transferred according to the action object.
[0015] A computer-readable storage medium stores a computer program, which, when executed by a processor, causes the processor to perform the following steps:
[0016] Get business data;
[0017] Acquire a data generation task, and filter the business data according to the data generation task;
[0018] Retrieving a corresponding configuration file using the filtered business data, wherein the configuration file records the action object, data type and rules corresponding to the application scenario;
[0019] Generate data to be transferred corresponding to the data type by using the screened business data and the rule;
[0020] The data to be transferred is transferred according to the action object.
[0021] A computer device comprises a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor performs the following steps:
[0022] Get business data;
[0023] Acquire a data generation task, and filter the business data according to the data generation task;
[0024] Retrieving a corresponding configuration file using the filtered business data, wherein the configuration file records the action object, data type and rules corresponding to the application scenario;
[0025] Generate data to be transferred corresponding to the data type by using the screened business data and the rule;
[0026] The data to be transferred is transferred according to the action object.
[0027] The above-mentioned data transfer method, device, computer-readable storage medium and computer equipment can filter the business data through the data generation task, so that the filtered business data meets the requirements of the data generation task. Since the business data is associated with the application scenario, the corresponding configuration file can be retrieved using the filtered business data, and the configuration information corresponding to the application scenario can be quickly obtained. Therefore, the filtered business data and rules can be used to quickly and accurately generate the data to be transferred corresponding to the data type, and the data to be transferred can be transferred in time according to the object of action. In this process, since the configuration information corresponding to the application scenario is pre-recorded in the configuration file, the required configuration information can be obtained by retrieving the configuration file, and there is no need to hard code for each application scenario, which not only effectively saves the coding time, but also improves the flexibility of generating the data to be transferred in different application scenarios, as well as the efficiency of data transfer processing. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] Figure 1 An application environment diagram of a data transfer method in an embodiment;
[0029] Figure 2 A schematic diagram of a link of a data transfer method in one embodiment;
[0030] Figure 3 A schematic diagram of a flow chart of a data transfer method in an embodiment;
[0031] Figure 4 is a schematic diagram of an application scenario in an embodiment;
[0032] Figure 5 is a schematic diagram of a rule template in an embodiment;
[0033] Figure 6 A schematic diagram of configuring information retrieval results in one embodiment;
[0034] Figure 7 It is an execution sequence diagram of a data generation task in one embodiment;
[0035] Figure 8 A schematic diagram of a flow chart of batch task processing steps in an embodiment;
[0036] Fig. 9 A schematic diagram of scheduling batch tasks to computing resources in one embodiment;
[0037] Fig.10 A schematic diagram of the architecture of remote disaster recovery backup in one embodiment;
[0038] Fig.11 is a structural block diagram of a data transfer device in another embodiment;
[0039] Fig.12 FIG. 4 is a structural block diagram of a computer device in one embodiment. DETAILED DESCRIPTION
[0040] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0041] Figure 1 This is an application environment diagram of a data transfer method in an embodiment, including a business platform 110 (server 110), a server 120 and a database 130. The business platform 110 generates business data, and the business data is stored in the database 130. The server 120 pulls business data from the database 130. The server 120 obtains a data generation task, and filters the business data according to the data generation task. The server 120 uses the filtered business data to retrieve a corresponding configuration file in the database 130, and the configuration file records the action object, data type and rules corresponding to the application scenario. The server 120 uses the filtered business data and the rules to generate data to be transferred corresponding to the data type, and performs a transfer operation on the data to be transferred according to the action object. The corresponding link schematic diagram is shown in FIG. Figure 2 The service platform 110 (server 110) and the server 120 can be implemented by using an independent server or a server cluster composed of multiple servers.
[0042] like Figure 2 As shown, in one embodiment, a data transfer method is provided, which is executed by a computer device, and the computer device includes but is not limited to a server or a terminal. This embodiment mainly applies the method to the above Figure 1 The server 120 in FIG. Figure 3 , the data transfer method specifically includes the following steps:
[0043] S302, obtaining business data.
[0044] The server pulls business data from the database. Business data can be data generated after being processed by the business platform. Business data includes user identification, data source, business type, business operation data, etc. Different business types generate different business data. Business types can also be configured with one or more application scenarios. Different business types can be configured with different application scenarios. In different application scenarios, the data to be transferred generated based on the business data is different.
[0045] Furthermore, as the business data increases, to prevent the business data from being accumulated, the server can pull the business data from the database at a fixed time interval, and the business data pulled within the fixed time interval can be marked as a batch. By batch processing the business data, the data to be transferred can be generated in time, so as to improve the transfer processing efficiency of the data to be transferred.
[0046] S304, obtaining a data generation task, and filtering the business data according to the data generation task.
[0047] A task script is run on the server. When the preset task execution time is reached, the corresponding data generation task is created through the task script. Among them, the task script can create a data generation task using preset task parameters. Different task parameters result in different data generation tasks. Task parameters include data source, data type, transfer mode, etc. Task parameters can be the same as some business parameters. When the execution time of the data generation task is reached, the business data corresponding to the data generation task is filtered through the task script, and the business data corresponding to the task parameters is filtered. For example, the task parameters include payment type and transfer mode. The task script uses the task parameters to generate filtering conditions: "Payment type" = "Online" & "Data source" = "Source object", and the business data is filtered through this filtering condition.
[0048] The task script can generate a batch task table with data generation tasks at preset time intervals, wherein the fixed time interval for pulling business data and the preset time interval for generating batch tasks can be the same time interval or different time intervals. Since the business platform can generate a large amount of business data at any time, by processing the data generation tasks in batches, it is possible to generate the data to be transferred in a timely manner when faced with massive amounts of business data, thereby improving the transfer processing efficiency of the data to be transferred. When the execution time corresponding to the batch task table is reached, the business data corresponding to each data generation task is screened through the task script, and the business data corresponding to the task parameters is screened.
[0049] S306: Retrieve a corresponding configuration file using the filtered business data. The configuration file records the action objects, data types and rules corresponding to the application scenario.
[0050] Since different users face different application scenarios, the rules involved in different application scenarios are different. In order to facilitate flexible adjustment of the rules for various application scenarios and avoid hard coding for each application scenario, the server can pre-store configuration files corresponding to the application scenarios. Among them, the configuration file can be generated by calling the rule template corresponding to the application scenario after the terminal uploads the configuration request. It can be understood that the same terminal can upload multiple configuration requests to the server to generate different configuration files. In order to quickly and accurately retrieve the required configuration files when executing data generation tasks, the server can pre-establish the corresponding relationship between the configuration file identifier and the business parameters. Furthermore, when the rules corresponding to the application scenario change, the server can also change the configuration file based on the configuration change request uploaded by the terminal.
[0051] The server retrieves the corresponding configuration file based on the filtered business data. The server can obtain the parameter value corresponding to the preset business parameter in the filtered business data by using the preset parameters, generate the corresponding business parameter sequence by using the preset business parameters and the parameter value, and query the configuration file identifier by using the business parameter sequence. Since the configuration file identifier has established a corresponding relationship with the business parameter sequence in advance, the configuration file uniquely corresponding to the filtered business data can be quickly and accurately located.
[0052] S308: Generate data to be transferred corresponding to the data type using the screened business data and rules.
[0053] S310, performing a transfer operation on the data to be transferred according to the object of action.
[0054] A variety of configuration information is recorded in the configuration file. The configuration information includes the object of action, the data type of the data to be transferred, and the rules. The rules in the configuration information are set according to the rule template corresponding to the application scenario. Therefore, different rules can reflect different application scenarios. The data type of the data to be transferred in the configuration information includes at least one. Each data type of the data to be transferred has a corresponding rule. The server can use the filtered business data to generate the data to be transferred of the corresponding data type according to the data type and rules of the data to be transferred. Among them, the filtered business data includes business operation data. Different operation processing in the business platform generates different business operation data. Taking payment as an example, when making a payment, the business operation data generated may include the payment amount and the number of payments. When refunding, the business operation data generated includes the payment amount and the refund amount.
[0055] The configuration file also records the action objects corresponding to the application scenario. The action objects include source objects and target objects. The server can transfer the generated data to be transferred to the file corresponding to the target object. At the same time, the server will also update the business operation data corresponding to the source object according to the data to be transferred.
[0056] In this embodiment, the business data is screened through the data generation task, so that the screened business data can meet the requirements of the data generation task. Since the business data is associated with the application scenario, the corresponding configuration file can be retrieved using the screened business data to quickly obtain the configuration information corresponding to the application scenario. Therefore, the screened business data and rules can be used to quickly and accurately generate the data to be transferred corresponding to the data type, and the data to be transferred can be transferred in time according to the object of action. In this process, since the configuration information corresponding to the application scenario is pre-recorded in the configuration file, the required configuration information can be obtained by retrieving the configuration file, and there is no need to hard code for each application scenario, which not only effectively saves the coding time, but also improves the flexibility of generating the data to be transferred in different application scenarios, as well as the efficiency of data transfer processing.
[0057] In one embodiment, using the filtered business data to retrieve the corresponding configuration file includes: using the filtered business data to generate a business parameter sequence; querying the configuration file identifier according to the business parameter sequence; and retrieving the corresponding configuration file according to the configuration file identifier.
[0058] Different business types can correspond to different data sources, different business operation modes, and different data transfer modes, etc., and different configuration files can be generated in advance. The configuration file can set the effective time. Among them, the terminal can upload a configuration request to the server, and the configuration request contains multiple configuration parameters. Multiple items refer to two or more items. Configuration parameters include user information, data source, business type, business operation mode, application scenario, etc. The server calls the configuration creation interface according to the configuration request, loads the rule template corresponding to the application scenario through the configuration creation interface, and generates the corresponding configuration file using the rule template and configuration parameters. The rule template includes multiple rules. Each rule includes the corresponding standard and the data generation method of the data to be transferred. The configuration file is sent to the audit terminal for audit through the server. After the audit is passed, the server stores the configuration file in the database. The configuration file may include basic configuration information and configuration sub-files. Among them, the basic configuration information includes user identification, data source, business type, etc. The configuration sub-file may include the object of action corresponding to the application scenario, the data type and rules corresponding to the data to be transferred, etc.
[0059] Since different configuration files include many configuration parameters, in order to quickly and accurately retrieve the configuration file corresponding to the application scenario, the server can use the preset business parameters to generate a business parameter sequence and establish a corresponding relationship between the business parameter sequence and the configuration file identifier. When the server retrieves the corresponding configuration file based on the filtered business data, the server can use the preset parameters to obtain the parameter values corresponding to the preset business parameters in the filtered business data, use the preset business parameters and the parameter values to generate the corresponding business parameter sequence, and query the configuration file identifier through the business parameter sequence. In this way, the configuration file that uniquely corresponds to the filtered business data can be quickly and accurately located.
[0060] Taking payment as an example, the corresponding application scenarios include fee billing, etc. Fee billing includes single billing scenario and aggregate billing scenario. Figure 4 As shown, the single billing scenarios include fixed percentage billing scenarios, billing scenarios based on the number of transactions, fixed amount billing scenarios, floor price billing scenarios, and ceiling price billing scenarios. The aggregated billing scenarios include volume-guaranteed billing scenarios, tiered billing scenarios, and package billing scenarios. In the application scenarios of multiple handling fee billing, the required data to be transferred can include handling fees. Different application scenarios have different rule templates when generating configuration files. In the application scenario of handling fee billing, the rule template can be a rate template, and the schematic diagram can be as follows Figure 5 As shown. The rule template includes multiple rules. Each rule includes corresponding standards and data generation methods. For example, the standard can be: refer to the net transaction amount of the previous year (package): 500,000 packages and 200 million are charged at 1% above the limit, and the corresponding data generation method for the data to be transferred is: package billing. The standard can also be a percentage: 0.01%, and the corresponding data generation method for the data to be transferred is: ordinary billing. The configuration file is retrieved by the method provided in this embodiment, and the configuration information retrieved from the configuration file is as follows Figure 6 As shown. Among them, the basic configuration information includes user identification (merchant), configuration file identification (contract number), data source (business channel), business type (payment business), business operation method (payment method), etc. The configuration sub-file can be a billing sub-contract, including the data type of the data to be transferred (billing item), the object of action (billing object), and the billing standard. Among them, the billing standard includes the billing method, billing unit, billing details, etc. In this way, when calculating the handling fee, which is the data to be transferred, the unique configuration file can be quickly and accurately located.
[0061] In one embodiment, using the filtered business data and rules to generate data to be transferred corresponding to the data type includes: determining the corresponding source object and target object according to the object of action; obtaining the priority corresponding to the data type, and using the filtered business data to generate the corresponding data to be transferred between the source object and the target object according to the priority and the rules.
[0062] The configuration information includes at least one data type of the data to be transferred. Each data type of the data to be transferred has a corresponding rule. The rule includes a corresponding standard and a data generation method. When the data type of the data to be transferred includes multiple types, multiple types means two or more types, and the configuration information also records the priority corresponding to each data type. The priority can be set to multiple levels, and each level has a corresponding code. For example, the priority code can be expressed in numbers, and the smaller the number, the higher the level.
[0063] The server can obtain the rules corresponding to the filtered business data in the configuration file in the manner provided in the above embodiment. The rules include standards, data generation methods, and corresponding business parameters. The server can generate the data to be transferred of the corresponding data type using the business operation data corresponding to the business parameters according to the data type, standard, and data generation method of the data to be transferred.
[0064] The configuration file also records the objects of action corresponding to the application scenario. The objects of action include source objects and target objects. The server can transfer the generated data to be transferred to the file corresponding to the target object. At the same time, the server will also update the business operation data corresponding to the source object according to the data to be transferred. The target object can be a source account, and the target object can be a target account. The server transfers the data to be transferred to the target data table corresponding to the target account according to the data type corresponding to the data to be transferred. Different data types correspond to different target data tables. At the same time, the server updates the source data table corresponding to the source account according to the data to be transferred. This includes subtracting the value corresponding to the data to be transferred from the value of the business operation data. Since the data to be transferred is generated according to the priority of its data type and the pre-configured rules and the filtered business data, the accuracy of the data to be transferred between the action objects can be ensured.
[0065] Taking the data to be transferred as a handling fee as an example, the data type corresponding to the data to be transferred can also be called a billing item. For example, the 'handling fee deducted from the transaction amount', the 'transaction post-paid handling fee', and the 'revenue and expenditure separation handling fee' that is deducted from a separate expenditure account for 100% settlement of the transaction amount. The billing items and priorities are shown in Table 1 below. Among them, the billing items corresponding to a data generation task can be part or all of those in Table 1.
[0066] Billing Items Priority Classification Product 1 Product Transaction fee deduction 2 Fees Post-transaction fee 2 Fees Income and expenditure separation fee 0 Fees Fee rebate 2 Special handling fees
[0067] Table 1
[0068] Assume that the billing items corresponding to the data generation task are "commodity payment" and "transaction payment deduction fee", where the priority of "commodity payment" is 1 and the priority of "transaction payment deduction fee" is 2. Then first generate the data to be transferred according to the standard and data generation method corresponding to "commodity payment", such as commodity payment - 100% by amount percentage, calculate the corresponding commodity payment, and then calculate the standard and data generation method corresponding to "transaction payment deduction fee", such as the standard is 0.6% by amount percentage and the data generation method is ordinary billing. The rules retrieved from the configuration file are shown in Table 2 below. Taking the standard in the rule as charging 1 yuan per transaction as an example, the rules retrieved from the configuration file are shown in Table 3 below.
[0069]
[0070] Table 2
[0071]
[0072] Table 3
[0073] Different application scenarios have different standards and data generation methods retrieved from the configuration file. Let's continue to take the data to be transferred as a handling fee as an example. For example, in the application scenario of small transactions, such as merchants in the bus and subway categories, a single transaction is a few yuan. You can select the rule template of the floor price to generate a configuration file. For example, the standard in the rule is: 0.60% by percentage, minimum 1 yuan. The data generation method is: basic billing floor judgment. The server can first calculate the handling fee by transaction amount * 0.60%, and then check whether the handling fee is less than the floor price of 1 yuan. If it is less than 1 yuan, it will be charged at 1 yuan. In the application scenario of large transactions, such as merchants in the financial insurance category, a single transaction is several thousand or tens of thousands of yuan. You can select the rule template of the ceiling price to generate a configuration file. For example, the standard in the rule is: 0.6% by percentage, 15 yuan capped. The data generation method is: basic billing ceiling judgment. The server can first calculate the handling fee by transaction amount * 0.60%, and then check whether the handling fee is greater than the ceiling price of 15 yuan. If it is greater than 1 yuan, it will be charged at 15 yuan. For another example, in the application scenario of group buying, the business data of group buying merchants surged over a period of time, and a large number of refund operations were generated after the group buying failed. You can select a rule template that does not refund the handling fee for refunds to generate a configuration file. For example, the standard in the rule is to charge 1 yuan per transaction, and the data generation method is: refunds are not charged. The server can charge 1 yuan per transaction based on the operational business data of the refund operation (number of refunds).
[0074] The timing diagram of the server executing the data generation task can be as follows Figure 7As shown. The business platform calls the task processing interface and initiates a task processing request to the server. The server pulls the business data according to the task processing request and generates a data generation task. The server transfers the pulled business data to the data table to be processed, obtains the business data in the data table to be processed, filters the business data in accordance with the method provided in the above embodiment, and stores the filtered business data in the instance table to be transferred. The server uses the filtered business data to retrieve the corresponding configuration file in accordance with the method provided in the above embodiment, uses the configuration file to execute the data generation task, generates the data to be transferred, and adds the data to be transferred to the target data table corresponding to its data type. The server executes multiple data generation tasks in a loop, and adds each item of data to be transferred to the corresponding target data table. Correspondingly, the server updates the data table to be processed corresponding to the source account according to the data to be transferred. After completing the data transfer, the server can return the transfer result to the business platform. The transfer result may include a transfer status, such as success, failure, etc.
[0075] In one embodiment, the method further includes: a batch task processing step, such as Figure 8 As shown, the step includes:
[0076] Step S802: generating batch tasks from data generation tasks at preset time intervals, wherein the batch tasks include task scheduling identifiers.
[0077] Step S804, obtaining the mapping relationship between the task scheduling identifier and the computing resources.
[0078] Step S806: Schedule the batch tasks to the corresponding computing resources for processing according to the mapping relationship.
[0079] The server generates batch tasks from the data generation tasks at the preset time interval, and records the task identifier of the data generation task in the batch task table. The batch task can be named according to the preset naming rules to obtain the batch task identifier. Among them, the preset naming rules include the execution time and computing resource identifier corresponding to the batch task. The server uses the batch task identifier as the task scheduling identifier to establish a mapping relationship with the computing resource. The server dispatches the batch task to the corresponding computing resource for processing according to the mapping relationship. The computing resource can process each data generation task in the batch task separately in the manner provided in the above embodiment until all data generation tasks in the batch task are executed. When executing each data generation task, if some rules in the configuration file need to be updated, the existing configuration file is updated using the rules to be updated, and the data generation task is executed using the updated rules to generate the corresponding data to be transferred. For example, if the rebate rule needs to be updated, the rebate handling fee is generated using the updated rebate rule as the corresponding data to be transferred. By dispatching different batch tasks to different computing resources for processing, the processing efficiency of the data generation task can be effectively improved.
[0080] The schematic diagram of batch task scheduling to computing resources is as follows Fig. 9 shown. Fig. 9 In the example of two batches, the batch business data is loaded in each batch (the first batch and the second batch), wherein the batch business data can be recorded in the batch business data table, which belongs to one of the data tables to be processed. After loading, the computing resource executes each data generation task in the manner provided in the above embodiment to generate the corresponding data to be transferred. According to the data type corresponding to the data to be transferred, the data to be transferred is transferred to the target data table corresponding to the target account. Different data types correspond to different target data tables. After the data to be transferred is written to the target data table corresponding to the target account, multiple target data tables can also be summarized. After the batch task is executed, the batch task check can be performed to prevent the omission or repeated execution of the data generation task. When summarizing, due to the huge amount of data, it may not be possible to identify whether each target data table has been summarized. A log table can be generated for the summary of each target data table, and the target data tables of the same batch can be summarized to the database in the form of database transactions and log tables. Thus, the summary of the batch can be quickly identified through the log table.
[0081] Furthermore, the server can also generate batch tasks for data generation tasks at preset time intervals according to the task type of the data generation task, so that the batch tasks can correspond to the same task type. Taking into account that different task types require different computing resources, the server can obtain the correspondence between the pre-configured task types and computing resources, and name the batch tasks corresponding to each task type according to the preset naming rules to obtain the batch task identifier. The server uses the batch task identifier as the task scheduling identifier to establish a mapping relationship with the computing resource. Therefore, the batch task can be scheduled to the computing resources suitable for its task type according to the mapping relationship. Thereby, the performance of the computing resources can be fully utilized and the task processing efficiency can be effectively improved.
[0082] In one embodiment, after scheduling the batch tasks to the corresponding computing resources for processing according to the mapping relationship, the method also includes: obtaining a transfer distinguishing dimension, and using the transfer distinguishing dimension to generate a batch task execution information file corresponding to the batch task; parsing the batch task execution information file to obtain a parsed file; and identifying the processing status corresponding to the batch task through the parsed file.
[0083] When executing a data generation task, the data to be transferred can be transferred to the corresponding target data table according to the data type of the data to be transferred and the target account. After the data to be transferred is written into the corresponding target data table, multiple target data tables can also be summarized. In order to effectively identify the status of data transfer, the server can also obtain the summary dimension as the transfer distinguishing dimension, use the transfer distinguishing dimension to obtain the corresponding dimension data in the target data table, and generate a batch task execution information file according to the preset rules. The transfer distinguishing dimension can be represented by a corresponding preset character or string. For example, the preset rule can be batch data identifier + "transfer distinguishing dimension" + fee, such as 11201611021111222201_feesum. The batch task execution information file records the summary data and result status corresponding to the batch task. Among them, the result status includes success, failure, and unprocessed.
[0084] The server uses a preset format to parse the batch task execution information file to obtain the result status of each task in the batch task. If there is a failed or unprocessed result status, the data table to be processed is reloaded and the corresponding data generation task is executed again. By identifying the processing status of the information file corresponding to the batch task, the execution status of each data generation task in the batch task can be accurately identified, thereby effectively preventing the missed execution and repeated execution of the data generation task.
[0085] In one embodiment, the method also includes: a configuration file change step, which includes: receiving a configuration change request uploaded by a terminal; carrying configuration change parameters in the configuration change request; the configuration change parameters include an application scenario; calling a corresponding configuration service interface according to the configuration change request; calling configuration information corresponding to the application scenario through the configuration service interface, and generating a changed configuration file using the configuration information and the configuration change parameters.
[0086] When the application scenario corresponding to the user changes, or the rules corresponding to the application scenario change, the terminal can upload a configuration change request to the server to change the existing configuration file. The server pre-deploys the corresponding configuration service interface according to the configuration file and application scenario. The configuration service interface corresponding to different application scenarios is different. After receiving the configuration change request uploaded by the terminal, the server parses the configuration change request to obtain the configuration change parameters. The configuration change parameters include the configuration file identifier before the change, the application scenario before the change, and the application scenario after the change. The server calls the file query interface according to the configuration file identifier before the change to obtain the configuration file before the change. The server calls the corresponding configuration service interface according to the application scenario after the change to obtain the configuration information corresponding to the application scenario after the change. The server searches for the configuration information corresponding to the application scenario in the configuration file before the change, that is, searches for the configuration information corresponding to the application scenario before the change, replaces the configuration information before the change with the configuration information corresponding to the application scenario after the change, and generates the configuration file after the change. The server sends the changed configuration file to the review terminal for review. After the review is passed, the changed configuration file is used as a valid configuration file.
[0087] In this embodiment, by using the configuration service interface to call the configuration information corresponding to the application scenario, the changed configuration file can be quickly generated using the configuration information corresponding to the changed application scenario, thereby effectively improving the change processing efficiency of the configuration file.
[0088] In one embodiment, after performing a transfer operation on the data to be transferred according to the action object, the method further includes: calling a disaster recovery strategy corresponding to the configuration file, the business data, and the result data generated after the transfer operation, and performing disaster recovery backup through the disaster recovery strategy.
[0089] In order to effectively prevent data loss or to enable timely recovery in the event of an accident, after performing the data transfer operation in the above embodiment, remote disaster recovery backup will also be performed. The server that performs the data transfer operation can be called the primary server. The server used for remote disaster recovery backup can be called the backup server. The architecture diagram of remote disaster recovery backup is shown in FIG. Fig.10As shown. The primary server and the backup server are connected to the corresponding data center through the routing configuration center. The data center corresponding to the primary server can be called the primary data center, and the data center corresponding to the backup server can be called the backup data center. The primary data center stores all the data of the primary server performing data transfer operations, including the configuration data in the configuration file, the pulled business data, and the various result data generated after the data generation task. Configuration data, business data, and result data can be collectively referred to as data to be backed up for disaster recovery. Due to the different orders of magnitude of configuration data, business data, and result data, for example, the order of magnitude of configuration data is several thousand per day on average, and the order of magnitude of business data is about 100 million per day on average. Therefore, the corresponding disaster recovery strategies are called for the different orders of magnitude of data to be backed up for disaster recovery, and remote disaster recovery is backed up to the backup data center corresponding to the backup server.
[0090] For configuration data, a configuration request may be received in the manner provided in the above embodiments to generate a configuration file, or a configuration change request may be received to change the configuration file. When the configuration file is changed, the changed configuration data may be written into a configuration change data table to record the corresponding configuration change data. The configuration change data includes user identification, change time, rules corresponding to the application scenario, etc. The master server may perform remote disaster recovery backup of the configuration file and the configuration change data table in an asynchronous manner.
[0091] For business data, after the main server pulls the business data in batches from the database, it writes the batch business data into the data table to be processed, and adds a unique batch data identifier to the batch business data in the data table to be processed. In order to ensure that the same batch of business data in the same time period is pulled during disaster recovery backup, the batch data identifier can be optimized according to the preset rules. For example, the time of pulling the batch business data is added to the batch data identifier, such as yyyymmdd, and it can also include the start time-end time, such as yyyymmdd110000-120000. The business data corresponding to the optimized batch data identifier is aggregated and merged. After the main server writes the data to be transferred into the corresponding target data table in the manner provided in the above embodiment, the main server also needs to optimize the file identifier corresponding to the target data table. Among them, the main server obtains the file identifier format corresponding to the target data table, including file identifier, time, and sequence number. The main server replaces the sequence number with the batch data identifier corresponding to the batch business data, and the optimized file identifier format is file identifier, time, and batch data identifier. This allows the target data table and the batch-processed business data to maintain data consistency. After optimization, the master server can remotely back up the corresponding business data to the slave data center in batches for disaster recovery.
[0092] When a disaster occurs on the main server and a remote switch is required, the backup server can perform full data recovery in batches, that is, re-execute the data transfer process for one or several batches of business data in the manner provided in the above embodiment. The backup server can also perform incremental data recovery in batches, that is, re-execute the business data in one or several batches that have not undergone data transfer processing. In this way, remote disaster recovery can be achieved quickly and accurately.
[0093] For the result data generated after the data transfer process, the primary server can add corresponding remark information to the result data, and can identify the corresponding data transfer operation status based on the remark information, including success, failure, unprocessed, etc. The primary server remotely backs up the result data with the added remark information to the secondary data center for disaster recovery. When a disaster occurs on the primary server and needs to be switched to a different location, the secondary server can quickly identify the corresponding operation status based on the remark information corresponding to the result data, thereby avoiding problems such as repeated execution and missed execution after the disaster recovery switch.
[0094] It should be understood that although Figure 3 and Figure 8 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 3 and Figure 8 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.
[0095] In one embodiment, Fig.11 As shown, a data transfer device is provided, which can be a computer program (including program code) running in a computer device, for example, the data transfer device is an application software; the device can be used to execute the corresponding steps in the method provided in the embodiment of the present application. The data transfer device includes: an acquisition module 1102, a screening module 1104, a retrieval module 1106, and a transfer operation module 1108, wherein:
[0096] The acquisition module 1102 is used to acquire business data and acquire data generation tasks.
[0097] The screening module 1104 is used to screen the business data according to the data generation task.
[0098] The search module 1106 is used to use the filtered business data to search for a corresponding configuration file, in which the action object, data type and rules corresponding to the application scenario are recorded.
[0099] The transfer operation module 1108 is used to generate the data to be transferred corresponding to the data type by using the filtered business data and the rules; and perform a transfer operation on the data to be transferred according to the action object.
[0100] In this embodiment, the business data is screened through the data generation task, so that the screened business data can meet the requirements of the data generation task. Since the business data is associated with the application scenario, the corresponding configuration file can be retrieved using the screened business data to quickly obtain the configuration information corresponding to the application scenario. Therefore, the screened business data and rules can be used to quickly and accurately generate the data to be transferred corresponding to the data type, and the data to be transferred can be transferred in time according to the object of action. In this process, since the configuration information corresponding to the application scenario is pre-recorded in the configuration file, the required configuration information can be obtained by retrieving the configuration file, and there is no need to hard code for each application scenario, which not only effectively saves the coding time, but also improves the flexibility of generating the data to be transferred in different application scenarios, as well as the efficiency of data transfer processing.
[0101] In one embodiment, the retrieval module is further used to generate a service parameter sequence using the screened service data; query a configuration file identifier according to the service parameter sequence; and retrieve a corresponding configuration file according to the configuration file identifier.
[0102] In one embodiment, the transfer operation module is also used to determine the corresponding source object and target object based on the action object; obtain the priority corresponding to the data type, and use the filtered business data to generate the corresponding data to be transferred between the source object and the target object according to the priority and the rule.
[0103] In one embodiment, the device also includes: a task scheduling module, which is used to generate batch tasks from data generation tasks at preset time intervals, and the batch tasks include a task scheduling identifier; obtain a mapping relationship between the task scheduling identifier and the computing resources; and schedule the batch tasks to the corresponding computing resources for processing according to the mapping relationship.
[0104] In one embodiment, the device also includes: a task inspection module, used to obtain a transfer distinguishing dimension, and use the transfer distinguishing dimension to generate a batch task execution information file corresponding to the batch task; parse the batch task execution information file to obtain a parsed file; and identify the processing status corresponding to the batch task through the parsed file.
[0105] In one embodiment, the device also includes: a configuration module, used to receive a configuration change request uploaded by a terminal; the configuration change request carries configuration change parameters; the configuration change parameters include an application scenario; calling a corresponding configuration service interface according to the configuration change request; calling the configuration information corresponding to the application scenario through the configuration service interface, and generating a changed configuration file using the configuration information and the change parameters.
[0106] In one embodiment, the device further includes: a disaster recovery backup module, which is used to call a disaster recovery strategy corresponding to the configuration file, the business data, and the result data generated after the transfer operation, and perform disaster recovery backup through the disaster recovery strategy.
[0107] In one embodiment, the disaster recovery backup module is further used to add a batch data identifier to the business data; obtain a file identifier of the target data table, and optimize the file identifier using the batch data identifier; and perform remote disaster recovery backup on the target data table after the file identifier is optimized.
[0108] Fig.12 The internal structure diagram of a computer device in one embodiment is shown. The computer device may specifically be Figure 1 The server 120 in FIG. Fig.12 As shown, the computer device includes a processor, a memory and a network interface connected through a system bus. Among them, the memory includes a non-volatile storage medium and an internal memory. The non-volatile storage medium of the computer device stores an operating system and may also store a computer program, which, when executed by the processor, enables the processor to implement a data transfer method. The internal memory may also store a computer program, which, when executed by the processor, enables the processor to execute a data transfer method.
[0109] Those skilled in the art will understand that Fig.12 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0110] In one embodiment, the 11 device provided in the present application can be implemented in the form of a computer program, and the computer program can be Fig.12 The computer device shown in the figure is run. The memory of the computer device can store various program modules constituting the data transfer device. The computer program composed of various program modules enables the processor to execute the steps of the data transfer method of each embodiment of the present application described in this specification.
[0111] For example, Fig.12 The computer device shown can be Fig.11 The retrieval module execution step in the data transfer device shown uses the filtered business data to retrieve the corresponding configuration file, and the configuration file records the action object, data type and rules corresponding to the application scenario. The computer device can use the filtered business data and the rules to generate the data to be transferred corresponding to the data type through the transfer operation module execution step, and perform a transfer operation on the data to be transferred according to the action object.
[0112] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the above-mentioned data transfer method. The steps of the data transfer method here may be the steps of the data transfer method in the above-mentioned various embodiments.
[0113] In one embodiment, a computer-readable storage medium is provided, storing a computer program, and when the computer program is executed by a processor, the processor executes the steps of the above-mentioned data transfer method. The steps of the data transfer method here may be the steps in the data transfer method of each of the above-mentioned embodiments. As an example, the computer program may be deployed to be executed on one computing device, or on multiple computing devices located at one location, or on multiple computing devices distributed at multiple locations and interconnected by a communication network. Multiple computing devices distributed at multiple locations and interconnected by a communication network may constitute a blockchain system.
[0114] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the program can be stored in a non-volatile computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0115] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0116] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A data transfer method, comprising: Get business data; Acquire a data generation task, and filter the business data according to the data generation task; Retrieving a corresponding configuration file using the filtered business data, wherein the configuration file records the action object, data type and rules corresponding to the application scenario; Generate data to be transferred corresponding to the data type by using the screened business data and the rule; Transferring the data to be transferred to a target data table according to the data type corresponding to the data to be transferred; Performing a transfer operation on the data to be transferred according to the action object; Calling a disaster recovery strategy corresponding to the configuration file, the business data, and the result data generated after the transfer operation, and performing disaster recovery backup through the disaster recovery strategy includes: Adding a batch data identifier to the business data; Obtaining a file identifier of the target data table, and optimizing the file identifier using the batch data identifier; The target data table marked with optimized files is backed up remotely for disaster recovery.
2. The method according to claim 1, characterized in that: The method of retrieving the corresponding configuration file using the filtered business data includes: Generating a service parameter sequence using the screened service data; Querying a configuration file identifier according to the service parameter sequence; The corresponding configuration file is retrieved according to the configuration file identifier.
3. The method according to claim 1, characterized in that The generating the data to be transferred corresponding to the data type by using the filtered business data and the rule comprises: Determine the corresponding source object and target object according to the action object; The priority corresponding to the data type is obtained, and the filtered business data is used to generate corresponding data to be transferred between the source object and the target object according to the priority and the rule.
4. The method according to claim 1, characterized in that: The method further comprises: Generating batch tasks from data generation tasks at preset time intervals, wherein the batch tasks include task scheduling identifiers; Obtaining a mapping relationship between the task scheduling identifier and the computing resource; The batch tasks are dispatched to corresponding computing resources for processing according to the mapping relationship.
5. The method according to claim 4, characterized in that After performing a transfer operation on the data to be transferred according to the action object, the method further includes: Acquire a transfer distinguishing dimension, and use the transfer distinguishing dimension to generate a batch task execution information file corresponding to the batch task; Parsing the batch task execution information file to obtain a parsed file; The processing status corresponding to the batch task is identified through the parsed file.
6. The method according to claim 1, characterized in that The method further comprises: Receiving a configuration change request uploaded by a terminal; the configuration change request carries configuration change parameters; the configuration change parameters include application scenarios; Calling a corresponding configuration service interface according to the configuration change request; The configuration information corresponding to the application scenario is called through the configuration service interface, and the changed configuration file is generated using the configuration information and the changed parameters.
7. A data transfer device, characterized in that: The device comprises: Acquisition module, used to acquire business data; acquire data generation tasks; A screening module, used for screening the business data according to the data generation task; A retrieval module, used to retrieve a corresponding configuration file using the filtered business data, wherein the configuration file records the action object, data type and rules corresponding to the application scenario; A transfer operation module, used to generate data to be transferred corresponding to the data type by using the filtered business data and the rules; transfer the data to be transferred to a target data table according to the data type corresponding to the data to be transferred; and perform a transfer operation on the data to be transferred according to the action object; A disaster recovery backup module is used to call a disaster recovery strategy corresponding to the configuration file, the business data, and the result data generated after the transfer operation. Performing disaster recovery backup through the disaster recovery strategy includes: adding a batch data identifier to the business data; obtaining the file identifier of the target data table, and optimizing the file identifier using the batch data identifier; and performing remote disaster recovery backup on the target data table after the file identifier is optimized.
8. The device according to claim 7, characterized in that The retrieval module is further used to generate a service parameter sequence using the screened service data; query a configuration file identifier according to the service parameter sequence; and retrieve a corresponding configuration file according to the configuration file identifier.
9. The device according to claim 7, characterized in that The transfer operation module is also used to determine the corresponding source object and target object according to the action object; obtain the priority corresponding to the data type, and use the filtered business data to generate the corresponding data to be transferred between the source object and the target object according to the priority and the rule.
10. The device according to claim 7, characterized in that The device also includes: The task scheduling module is used to generate batch tasks from data generation tasks at preset time intervals, wherein the batch tasks include task scheduling identifiers; obtain the mapping relationship between the task scheduling identifiers and computing resources; and schedule the batch tasks to corresponding computing resources for processing according to the mapping relationship.
11. The device according to claim 10, characterized in that The device also includes: a task checking module, which is used to obtain a transfer distinguishing dimension, and use the transfer distinguishing dimension to generate a batch task execution information file corresponding to the batch task; parse the batch task execution information file to obtain a parsed file; and identify a processing status corresponding to the batch task through the parsed file.
12. The device according to claim 7, characterized in that The device also includes: A configuration module is used to receive a configuration change request uploaded by a terminal; the configuration change request carries configuration change parameters; the configuration change parameters include application scenarios; a corresponding configuration service interface is called according to the configuration change request; configuration information corresponding to the application scenario is called through the configuration service interface, and a changed configuration file is generated using the configuration information and the change parameters.
13. A computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, the processor is caused to perform the steps of the method according to any one of claims 1 to 6.
14. A computer device comprising a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Service data processing method and device and server
CN109614409A
Task issuing method and device
CN110162386A
Data table migration method and device, computer equipment and storage medium
CN110209652A
Data migration method and device
CN110555012A
System and method for data integration
US10019468B1
