Disclosure of Invention
The application provides a data processing method and device, electronic equipment and a storage medium, and aims to solve the problem that in the prior art, account checking efficiency is low when the data volume in an account checking file is large.
In a first aspect, an embodiment of the present application provides a data processing method, including:
receiving an account checking request, wherein the account checking request comprises an account checking task;
dividing the reconciliation task into a plurality of sub-reconciliation tasks through a main node, and issuing each sub-reconciliation task to the sub-node through a message queue for processing so as to obtain processing data of each sub-reconciliation task, wherein the main node corresponds to a plurality of sub-nodes;
and each sub-node sends the processing data corresponding to the processed sub-reconciliation tasks to the main node so as to summarize and store the processing data through the main node.
In the embodiment of the application, when the account checking task is processed, the account checking task is divided into the plurality of sub-account checking tasks, and each sub-account checking task is issued to the plurality of sub-nodes through the message queue to be processed, so that the processing speed of the account checking task can be improved.
In one possible implementation, after issuing each sub-reconciliation task to the child node through the message queue, the method includes:
and each sub-node performs task splitting on the received sub-reconciliation task, generates difference data of the sub-reconciliation task by performing multi-thread processing on the sub-reconciliation task after the task splitting, and records the task state of the sub-reconciliation task as a processed state until the state of each sub-reconciliation task is the processed state, so as to obtain the processing data of each sub-reconciliation task.
In the embodiment of the application, in the process of processing the sub account checking task by each sub node, the sub account checking task is further split into a plurality of tasks, so that the sub account checking task after the split task is processed through multithreading, and the processing efficiency of the sub account checking task can be further improved. And after the child reconciliation task is processed and completed, the task state of the child reconciliation task is recorded to prevent the processing of the child reconciliation task from being missed, so that the reliability of the reconciliation task processing is improved.
In a possible implementation manner, the reconciliation task includes multiple sets of data to be compared, and the reconciliation task is divided into multiple sub-reconciliation tasks by the main node, including:
according to the main key sequence of the multiple groups of data to be compared, dividing the data to be compared of a preset number in the multiple groups of data to be compared into one sub-reconciliation task in sequence, and acquiring a plurality of sub-reconciliation tasks.
In the embodiment of the application, the sub-reconciliation tasks are divided according to the main key sequence of the multiple groups of data to be compared, so that the multiple groups of data to be compared are all divided into the sub-reconciliation tasks.
In a possible implementation manner, after the splitting of the reconciliation task into a plurality of sub-reconciliation tasks by the master node, the method further includes:
randomly exchanging part of data to be compared in each sub-reconciliation task with data to be compared in other sub-reconciliation tasks to obtain a plurality of exchanged sub-reconciliation tasks;
issuing each sub account checking task to a child node through a message queue for processing, wherein the processing comprises the following steps:
and issuing each exchanged sub account checking task to the sub node through the message queue for processing.
In the embodiment of the application, by randomly exchanging part of data to be compared in each sub-reconciliation task with data to be compared in other sub-reconciliation tasks, the problem of hot spots of the data to be compared in one sub-reconciliation task in a sub-base and sub-table scene can be avoided.
In one possible implementation, the reconciliation request is triggered by receiving a user operation or by scheduling a task at regular time.
In the embodiment of the application, the rapidness and flexibility of scheduling the reconciliation task can be improved by receiving the reconciliation request triggered by the user operation, and the efficiency of triggering the reconciliation request can be improved by regularly scheduling the reconciliation request triggered by the task.
In a possible implementation, before receiving the reconciliation request, the method further includes:
acquiring data source information of the reconciliation task, wherein the data source information comprises information of a first data source and information of a second data source, the first data source is a reference data source, and the second data source is a data source to be compared;
and configuring the reconciliation task according to the information of the first data source and the information of the second data source.
In one possible implementation, the information of the first data source includes a database address of the first data source, the information of the second data source includes a database address of the second data source, and the configuring the reconciliation task according to the information of the first data source and the information of the second data source includes:
reading a first data table through a database address of a first data source, and reading a second data table through a database address of a second data source;
and configuring the associated fields and the comparison fields in the first data table and the second data table to generate the reconciliation task.
In one possible implementation, configuring the reconciliation task further comprises:
configuring a comparison mode of the reconciliation task, wherein the comparison mode comprises one-way comparison or two-way comparison, and/or configuring one or more combinations of the following information of the first data table and the second data table: data table primary keys, multi-table association clauses, data grouping, or definitions of contrasting fields.
In one possible embodiment, the data source information further includes: a data source type, a username, a user password, a Uniform Resource Locator (URL), and a data source driver.
In one possible embodiment, the data source type includes any one of: a single library single table, a sub-library sub-table, a distributed Database middleware (CDS) data source, or a distributed Search Engine (ES) data source.
In a possible embodiment, the reconciliation task further includes a comparison mode, the comparison mode includes a one-way comparison or a two-way comparison, and before the processing data is summarized and stored by the master node, the method further includes:
judging whether the comparison mode of the account checking task is bidirectional comparison;
if the comparison mode is bidirectional comparison, configuring and executing a reverse reconciliation task by taking the first data source as a data source to be compared and taking the second data source as a reference data source, and generating reverse processing data, wherein the reverse reconciliation task is configured according to the information of the first data source and the information of the second data source;
aggregating and storing, by the master node, the process data, comprising: the process data and the reverse process data are summarized and stored by the master node.
In a possible implementation manner, the data processing method provided in the embodiment of the present application further includes:
receiving a processing data acquisition request;
and sending the processing data of the account checking task to the terminal equipment of the user.
In a possible implementation manner, the data processing method provided in the embodiment of the present application further includes:
and pushing an alarm message to the terminal equipment of the user, wherein the alarm message is used for indicating that the account checking task is processed and completed, and/or carrying abnormal data in the processed data in the alarm message for indicating the user to process the abnormal data.
In a second aspect, an embodiment of the present application provides a data processing method, which may be implemented by a terminal device, and includes:
the method comprises the steps that a reconciliation request is sent to a server, the reconciliation request comprises a reconciliation task, so that the server divides the reconciliation task into a plurality of sub-reconciliation tasks through a main node, and each sub-reconciliation task is issued to a sub-node through a message queue to be processed, so that processing data of each sub-reconciliation task is obtained, wherein the main node corresponds to the plurality of sub-nodes, and each sub-node sends the processing data corresponding to the processed sub-reconciliation task to the main node so as to summarize and store the processing data through the main node.
In a possible implementation manner, the data processing method provided in the embodiment of the present application further includes:
sending a processing data acquisition request to a server, wherein the processing data acquisition request is used for indicating the server to send processing data of the reconciliation task to terminal equipment of a user;
and receiving and displaying the processing data of the account checking task, and/or receiving and downloading the processing data of the account checking task.
The apparatus, the electronic device, the computer-readable storage medium, and the computer program product provided in the embodiments of the present application are described below, and contents and effects thereof may refer to the data processing method provided in the embodiments of the present application, and are not described again.
In a third aspect, an embodiment of the present application provides a data processing apparatus, including:
the system comprises a first receiving module, a second receiving module and a control module, wherein the first receiving module is used for receiving a reconciliation request which comprises a reconciliation task;
the processing module is used for dividing the reconciliation task into a plurality of sub-reconciliation tasks through the main node, and issuing each sub-reconciliation task to the sub-node through the message queue for processing so as to obtain processing data of each sub-reconciliation task, wherein the main node corresponds to a plurality of sub-nodes; and each sub-node sends the processing data corresponding to the processed sub-reconciliation tasks to the main node so as to summarize and store the processing data through the main node.
In a possible implementation, the processing module is specifically configured to:
and each sub-node performs task splitting on the received sub-reconciliation task, generates difference data of the sub-reconciliation task by performing multi-thread processing on the sub-reconciliation task after the task splitting, and records the task state of the sub-reconciliation task as a processed state until the state of each sub-reconciliation task is the processed state, so as to obtain the processing data of each sub-reconciliation task.
In a fourth aspect, an embodiment of the present application provides a data processing apparatus, including:
the sending module is used for sending a reconciliation request to the server, wherein the reconciliation request comprises a reconciliation task, so that the server divides the reconciliation task into a plurality of sub-reconciliation tasks through the main node, and issues each sub-reconciliation task to the sub-nodes through the message queue for processing, so as to obtain processing data of each sub-reconciliation task, the main node corresponds to a plurality of sub-nodes, and each sub-node sends the processing data corresponding to the processed sub-reconciliation task to the main node, so as to summarize and store the processing data through the main node.
In a fifth aspect, an embodiment of the present application provides an electronic device, including:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein
The memory stores instructions executable by the at least one processor to cause the at least one processor to perform a method as provided by the first aspect or the first aspect realizable manner, or to perform a method as provided by the second aspect or the second aspect realizable manner.
In a sixth aspect, embodiments of the present application provide a non-transitory computer readable storage medium storing computer instructions for causing a computer to perform a method as provided by the first aspect or the first aspect realizable manner, or perform a method as provided by the second aspect or the second aspect realizable manner.
In a seventh aspect, an embodiment of the present application provides a computer program product, including: executable instructions for implementing a method as provided in the first aspect or an alternative to the first aspect, or for performing a method as provided in the second aspect or an alternative to the second aspect.
According to the data processing method, the data processing device, the electronic equipment and the storage medium, the account checking request is received, and the account checking request comprises an account checking task; dividing the reconciliation task into a plurality of sub-reconciliation tasks through a main node, and issuing each sub-reconciliation task to the sub-node through a message queue for processing so as to obtain processing data of each sub-reconciliation task, wherein the main node corresponds to a plurality of sub-nodes; and each sub-node sends the processing data corresponding to the processed sub-reconciliation tasks to the main node so as to summarize and store the processing data through the main node. In the embodiment of the application, when the account checking task is processed, the account checking task is divided into the plurality of sub-account checking tasks, and each sub-account checking task is issued to the plurality of sub-nodes through the message queue to be processed, so that the processing speed of the account checking task can be improved.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The terms "first," "second," "third," "fourth," and the like in the description and in the claims of the present application and in the drawings described above, if any, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the application described herein are, for example, capable of operation in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
As e-commerce develops, more and more trade orders are made in the form of online transactions, and thus reconciliation of data interactions across applications becomes increasingly important. Reconciliation can be divided into information flow reconciliation and fund flow reconciliation. The information flow reconciliation is generally a reconciliation of an internal system, for example, a reconciliation is performed on payment data of a payment system and business data of a business system, so that the consistency of fund transaction and business transaction is ensured. A fund flow reconciliation is generally a reconciliation of fund transactions between a payment system and a bank or third party payment system. In the prior art, the reconciliation is usually performed in the following manner, that is, first, a reconciliation file is acquired, then, the reconciliation file is analyzed according to an acquisition channel of the reconciliation file and an analysis template corresponding to a file type by creating different analysis templates, and then, the reconciliation file after the analysis is performed. However, in the prior art, when the data volume in the account checking file is large, the account checking efficiency is low.
The data processing method, the data processing device, the electronic equipment and the storage medium provided by the embodiment of the application have the advantages that when the reconciliation task is processed, the reconciliation task is divided into a plurality of sub-reconciliation tasks, and each sub-reconciliation task is issued to a plurality of sub-nodes through a message queue for processing, so that the processing speed of the reconciliation task can be increased, and the reconciliation efficiency is improved. Furthermore, the embodiment of the application also solves the problem that account checking modules are not universal in the prior art due to different service scenes by configuring the account checking task before the account checking task is executed.
An exemplary application scenario of the embodiments of the present application is described below.
The data processing method provided by the embodiment of the application can be executed by the data processing device provided by the embodiment of the application, the data processing device provided by the embodiment of the application can be integrated on a server or a terminal device, or the data processing device can be the server or the terminal device itself, the number and the type of the servers are not limited in the embodiment of the application, the specific type of the terminal device is not limited, and for example, the terminal device can be a smart phone, a personal computer, a tablet computer, a wearable device and the like. Fig. 1 is an exemplary application scenario architecture diagram provided in an embodiment of the present application, and as shown in fig. 1, the architecture mainly includes: a terminal device 11 and a server 12. The data processing method provided in this embodiment of the present application may be applied to the server 12, where the server starts to execute the reconciliation task by receiving the reconciliation request sent by the terminal device, and may store and send the processing data to the terminal device 11, which is not limited in this embodiment of the present application.
Fig. 2 is a schematic flowchart of a data processing method according to an embodiment of the present application, where the method may be executed by a data processing apparatus, and the apparatus may be implemented in software and/or hardware, and the data processing method is described below with a server as an execution subject, as shown in fig. 2, the data processing method according to the embodiment of the present application may include:
step S101: and receiving an account checking request, wherein the account checking request comprises an account checking task.
The server receives a reconciliation request from the terminal equipment, wherein the reconciliation request comprises a reconciliation task. The triggering mode of the reconciliation request is not limited in the embodiment of the application, and in a possible implementation mode, the reconciliation request is triggered by receiving user operation or by scheduling a task at fixed time. For example, the terminal device receives a user operation for instructing to send a reconciliation request to the server, and then the terminal device sends the reconciliation request to the server. According to the embodiment of the application, the rapidness and flexibility of scheduling the account checking task can be improved by receiving the account checking request triggered by user operation. For example, when the reconciliation task needs to be restarted when the reconciliation task fails, a reconciliation request can be triggered by receiving user operation, so that the reconciliation task can be started more quickly.
For another example, the terminal device sets a timing scheduling task, for example, an account checking request is triggered every preset period, or an account checking request is triggered every fixed time point every day, which is not limited in this embodiment of the application. The specific implementation manner of setting the timing scheduling task for the terminal device is not limited, and for example, the specific implementation manner may be implemented by a configuration planning task (CRON), and exemplarily, the management and automatic scheduling functions of the reconciliation task are completed by a CRON task scheduling system, and the management and automatic scheduling functions may be implemented by a scheduler (scheduler), a timing trigger (trigger), and a reconciliation task (jobb), where the scheduler is responsible for general control, manages the reconciliation task and the timing trigger of the reconciliation task, for example, the reconciliation task is automatically started at a specified time and at a specified time interval, and is automatically stopped after the reconciliation task is run for a fixed number of times. In the embodiment of the application, the efficiency of triggering the reconciliation request can be improved by triggering the reconciliation request through the timed scheduling task.
After the terminal device sends the reconciliation request to the server, the server receives the reconciliation request. The reconciliation request comprises a reconciliation task, wherein the reconciliation task can be an information flow reconciliation task or a fund flow reconciliation task, and the embodiment of the application is not limited to this. The reconciliation task comprises a plurality of groups of data to be compared, each group of data to be compared comprises first data in the reference data source and second data in the data source to be compared, and the processing of the reconciliation task is realized by comparing the first data with the second data.
Step S102: dividing the reconciliation task into a plurality of sub-reconciliation tasks through the main node, and issuing each sub-reconciliation task to the sub-node through the message queue for processing so as to obtain processing data of each sub-reconciliation task, wherein the main node corresponds to a plurality of sub-nodes.
The reconciliation tasks may include a large amount of data to be compared, in order to improve the efficiency of processing the reconciliation tasks, the main node of the server divides the reconciliation tasks into a plurality of sub-reconciliation tasks, each sub-reconciliation task includes a plurality of groups of data to be compared, and then each sub-reconciliation task is issued to the sub-node through a message queue for processing until all the sub-reconciliation tasks are processed, so as to obtain the processing data of each sub-reconciliation task. For convenience of introduction, fig. 3 is a schematic flow diagram of reconciliation task processing provided in an embodiment of the present application, and as shown in fig. 3, when the master node receives a reconciliation task, the reconciliation task is divided to obtain a plurality of sub-reconciliation tasks. In a possible implementation manner, a preset number of the sub-reconciliation tasks can be configured, then a plurality of groups of data to be compared in the reconciliation tasks are divided into a preset number of data to be compared, and each piece of data to be compared is a sub-reconciliation task. In another possible implementation manner, the preset number of the data to be compared in the multiple groups of data to be compared in the reconciliation task can be divided into one sub-reconciliation task by configuring the preset number of the data to be compared in the sub-reconciliation task. In another possible implementation manner, the reconciliation task includes multiple sets of data to be compared, and the reconciliation task is divided into multiple sub-reconciliation tasks by the main node, including: according to the main key sequence of the multiple groups of data to be compared, dividing the data to be compared of a preset number in the multiple groups of data to be compared into one sub-reconciliation task in sequence, and acquiring a plurality of sub-reconciliation tasks. In the embodiment of the application, the sub-reconciliation tasks are divided according to the main key sequence of the multiple groups of data to be compared, so that the multiple groups of data to be compared are all divided into the sub-reconciliation tasks, the complexity of dividing the sub-reconciliation tasks is reduced, and omission of the data to be compared can be avoided.
In order to monitor the sub-reconciliation task, in a possible implementation manner, after the main node divides the reconciliation task into a plurality of sub-reconciliation tasks, the state of the sub-reconciliation tasks can be monitored in a distributed locking manner. After the sub account checking tasks are divided, setting the value of a countdown timer (Count Down Latch) as the number of the sub account checking tasks, calling the countdown timer after each time the sub node completes the processing of one sub account checking task, identifying that the sub account checking tasks are completed, and reducing the value of the countdown timer by one until the value of the countdown timer is 0, which indicates that the processing of all the sub account checking tasks is completed.
The main node issues each sub-reconciliation task to the sub-nodes through the message queue, wherein the implementation mode of the message queue is not limited in the embodiment of the application, for example, the sub-reconciliation tasks can be issued through a blocking queue in the message queue, and the repeated consumption of the sub-reconciliation tasks is avoided. In addition, the master node corresponds to a plurality of child nodes, the number of the child nodes is not limited in the embodiment of the present application, only the number of the child nodes is 3 in fig. 3 as an example for description, each child node may be allocated with one or more child reconciliation tasks, and the embodiment of the present application does not limit the number of the child reconciliation tasks processed by each child node. Fig. 3 illustrates only one sub-reconciliation task processed by each sub-node as an example. The child node 1 processes the child reconciliation task 1, and a specific implementation manner of the child node for processing the child reconciliation task is not limited in the embodiment of the application, and in a possible implementation manner, the child node processes the child reconciliation task, including: and each sub-node performs task splitting on the received sub-reconciliation task, generates difference data of the sub-reconciliation task by performing multi-thread processing on the sub-reconciliation task after the task splitting, and records the task state of the sub-reconciliation task as a processed state until the state of each sub-reconciliation task is the processed state, so as to obtain the processing data of each sub-reconciliation task.
For example, after monitoring the sub-reconciliation task, the child nodes in the sub-task layer perform task splitting on the received sub-reconciliation task, for example, if the sub-reconciliation task includes 2000 groups of data to be compared, the sub-reconciliation task can be split into ten sub-tasks, each sub-task includes 200 groups of data to be compared, and then the ten sub-tasks are processed through multiple threads, so as to improve the processing speed on the sub-reconciliation task. After the sub-reconciliation tasks are processed, recording the task state of the sub-reconciliation tasks as a processed state, and reducing the value of the countdown timer by one until all the sub-reconciliation tasks are processed, wherein the value of the countdown timer is 0.
In the embodiment of the application, in the process of processing the sub account checking task by each sub node, the sub account checking task is further split into a plurality of tasks, so that the sub account checking task after the split task is processed through multithreading, and the processing efficiency of the sub account checking task can be further improved. And after the child reconciliation task is processed and completed, the task state of the child reconciliation task is recorded to prevent the processing of the child reconciliation task from being missed, so that the reliability of the reconciliation task processing is improved.
In a possible implementation manner, when the sub-reconciliation task is processed by the child node, the child node further splits the sub-reconciliation task, and the split sub-reconciliation task is processed by multiple threads. When the sub-reconciliation task after splitting the task is processed through multithreading, a situation that most data requests of a certain sub-task simultaneously request on one database may exist, so that pressure is applied to the database, and online business may be influenced. In order to solve the above problem, after the reconciliation task is divided by the main node, in a possible implementation manner, the data processing method provided in the embodiment of the present application may further break up the sub-reconciliation tasks by the main node, specifically, part of the data to be compared in each sub-reconciliation task may be randomly exchanged with the data to be compared in other sub-reconciliation tasks to obtain a plurality of exchanged sub-reconciliation tasks, and then each exchanged sub-reconciliation task is issued to the sub-node through the message queue, so as to implement distribution of the sub-reconciliation tasks. In the embodiment of the application, part of data to be compared in each sub-reconciliation task is randomly exchanged with data to be compared in other sub-reconciliation tasks, the data to be compared in each sub-task is dispersed, and data requests of the sub-tasks at the same time are dispersed and fall on a plurality of databases, so that the hot spot problem in a sub-database and sub-table scene can be avoided, and the pressure of the databases is further reduced.
Step S103: and each sub-node sends the processing data corresponding to the processed sub-reconciliation tasks to the main node so as to summarize and store the processing data through the main node.
As shown in fig. 3, after the sub-reconciliation task is processed, the master node is called back, each sub-node sends the processing data corresponding to the processed sub-reconciliation task to the master node, and the master node summarizes and stores the processing data, and can also update the status of the reconciliation task to be the processed status. At this time, the server finishes processing the reconciliation task, and in a possible implementation manner, the data processing method provided in the embodiment of the present application may further include: and pushing an alarm message to the terminal equipment of the user, wherein the alarm message is used for indicating that the account checking task is processed and completed, and/or carrying abnormal data in the processed data in the alarm message for indicating the user to process the abnormal data.
The embodiment of the present application does not limit the specific implementation manner of pushing the alarm message to the terminal device of the user by the server, for example, the alarm message may be pushed to the terminal device of the user by a message pushing manner, an email manner, a short message manner, a voice call manner, and the like. The embodiment of the present application does not limit the specific information included in the alarm message, and in a possible implementation manner, the alarm message includes information that the reconciliation task has been processed and completed, and is used to notify the user that the reconciliation task has been processed and completed. In another possible implementation manner, the alarm message may further include abnormal data in the processing data to indicate the user to process the abnormal data, which is taken as an example and not limited in this application.
In the embodiment of the application, when the account checking task is processed, the account checking task is divided into the plurality of sub-account checking tasks, and each sub-account checking task is issued to the plurality of sub-nodes through the message queue to be processed, so that the processing speed of the account checking task can be improved. And moreover, by pushing the alarm message to the terminal equipment of the user and timely informing the relevant personnel to further process the processing data, the timeliness of finding the problem is improved.
On the basis of the embodiment shown in fig. 2, fig. 4 is a flowchart of a data processing method provided in another embodiment of the present application, where the method may be executed by a data processing apparatus, the apparatus may be implemented by software and/or hardware, and the following describes the data processing method with a server as an execution subject, as shown in fig. 4, before step S101, that is, before receiving an account checking request, the data processing method provided in the embodiment of the present application may further include:
step S201: and acquiring data source information of the reconciliation task, wherein the data source information comprises information of a first data source and information of a second data source.
The embodiment of the present application does not limit the specific content included in the data source information, and in a possible implementation manner, the data source information may further include: the present disclosure is not limited to this, and the examples include a data source type, a user name, a user password, a uniform resource locator URL, and a data source driver. Wherein the data source type comprises any one of the following types: single library single table, sub-library sub-table, CDS data source or ES data source, etc. The data source information comprises information of a first data source and information of a second data source, wherein the first data source is a reference data source, and the second data source is a data source to be compared. The information of the first data source may include a database address of the first data source, a data table in a database of the first data source, and the like.
Step S202: and configuring the reconciliation task according to the information of the first data source and the information of the second data source.
After the information of the first data source and the information of the second data source are determined, the reconciliation task is configured according to the information of the first data source and the information of the second data source. In one possible implementation, configuring the reconciliation task according to the information of the first data source and the information of the second data source includes: reading a first data table through a database address of a first data source, and reading a second data table through a database address of a second data source; and configuring the associated fields and the comparison fields in the first data table and the second data table to generate the reconciliation task.
For convenience of introduction, fig. 5 is a schematic diagram of a configuration reconciliation task provided in another embodiment of the present application, and taking a first data table including three columns of data ID, name, and age, and a second data table including three columns of data ID1, length, and nianling as an example, the reconciliation task is to compare whether the ages of the same person in the first data table and the second data table are consistent, then as shown in fig. 5, the associated fields of the first data table and the second data table are name and length, respectively, and the comparison fields are age and nianling, respectively, to generate the reconciliation task.
In one possible implementation, as shown in fig. 5, configuring the reconciliation task further includes: configuring a comparison mode of the reconciliation task, and/or configuring one or more combinations of the following information of the first data table and the second data table: data table primary keys, multi-table association clauses, data grouping, or definitions of contrasting fields. The comparison manner includes unidirectional comparison or bidirectional comparison, and fig. 5 only takes bidirectional comparison as an example. The configuration reconciliation task also can comprise configuration of a data table main key of the first data table and the second data table, and if the first data table or the second data table comprises a multi-library multi-table, a multi-table association clause of the first data table and the second data table can be set. If a plurality of data tables exist in the second data table, the data grouping of the plurality of data tables in the second data table can be further set. If it is not necessary to compare all data in the first data table and the second data table, a limiting condition of the comparison field may be further set to realize that the data that needs to be compared is the data to be compared, taking the data shown in fig. 5 as an example, the reconciliation task is to compare data in the first data table whose age is less than 18 with data in the second data table, and the limiting condition may be set to age <18, which is not limited in this embodiment of the application. The specific content of configuring the reconciliation task in the embodiment of the application is not limited to this, and for example, the task name of the reconciliation task may also be configured.
In the embodiment of the application, by acquiring the data source information of the reconciliation task, and configuring the reconciliation tasks of different data sources and data tables, comparison fields, limiting conditions and the like which need to be compared by the two parties according to the information of the first data source and the information of the second data source, the problem that the reconciliation module is not universal due to different service scenes is solved through simple configuration, the determination of development work is often related, and the development work of the reconciliation module is reduced.
In a possible implementation manner, the reconciliation task further includes a comparison manner, where the comparison manner includes a one-way comparison or a two-way comparison, and on the basis of the embodiment shown in any one of fig. 2 or fig. 4, before the processing data is summarized and stored by the master node in step S103, the data processing method provided in the embodiment of the present application may further include:
and judging whether the comparison mode of the account checking task is bidirectional comparison. If the comparison mode is bidirectional comparison, configuring and executing a reverse reconciliation task by taking the first data source as a data source to be compared and taking the second data source as a reference data source, and generating reverse processing data, wherein the reverse reconciliation task is configured according to the information of the first data source and the information of the second data source; aggregating and storing, by the master node, the process data, comprising: the process data and the reverse process data are summarized and stored by the master node.
And judging whether the comparison mode of the account checking task is bidirectional comparison or not, and reading the information of the account checking task. Taking the example as in fig. 5, the first data source in fig. 5 is a reference data source, and the second data source is a data source to be compared, if the comparison mode is bidirectional comparison, the first data source is used as the data source to be compared, and the second data source is used as the reference data source, and the reverse reconciliation task is configured and executed according to the method provided in the above embodiment, so as to generate reverse processing data. And the server collects and stores the processing data of the reconciliation task and the reverse processing data of the reverse reconciliation task through the main node.
In the embodiment of the application, all difference data of the first data source and the second data source can be compared by setting the reconciliation task as bidirectional comparison, so that the reliability of data processing is improved.
On the basis of any of the foregoing embodiments, fig. 6 is an interaction flowchart of a data processing method provided in yet another embodiment of the present application, and the following describes the data processing method provided in the embodiment of the present application by taking an interaction between a server and a terminal device as an example, as shown in fig. 6, the data processing method provided in the embodiment of the present application may include:
step S301: the terminal device sends a processing data acquisition request to the server.
Step S302: the server receives a processing data acquisition request.
Step S303: and the server sends the processing data of the account checking task to the terminal equipment of the user.
Step S304: and the terminal equipment receives and displays the processing data of the account checking task and/or receives and downloads the processing data of the account checking task.
When the processing data of the account checking task needs to be checked, the processing data can be obtained by sending a processing data acquisition request to the server through the terminal equipment, wherein the processing data acquisition request is used for indicating the server to send the processing data of the account checking task to the terminal equipment of the user. And after receiving a processing data acquisition request sent by the terminal equipment, the server acquires the processing data of the reconciliation task from the storage address of the processing data and sends the processing data of the reconciliation task to the terminal equipment of the user. After receiving the processing data of the reconciliation task, the terminal device can display the processing data of the reconciliation task on a display interface of the terminal device and/or download the processing data of the reconciliation task.
The embodiment of the application realizes the functions of checking, downloading and the like of the processing data of the account checking task.
The following are embodiments of the apparatus of the present application that may be used to perform embodiments of the method of the present application. For details which are not disclosed in the embodiments of the apparatus of the present application, reference is made to the embodiments of the method of the present application.
Fig. 7 is a schematic structural diagram of a data processing apparatus provided in an embodiment of the present application, where the apparatus may be implemented by software and/or hardware, for example, by a server, as shown in fig. 7, the data processing apparatus provided in the embodiment of the present application may include: a first receiving module 71, a processing module 72 and a pushing module 73.
The first receiving module 71 is configured to receive a reconciliation request, where the reconciliation request includes a reconciliation task.
The processing module 72 is configured to divide the reconciliation task into a plurality of sub-reconciliation tasks by the master node, and issue each sub-reconciliation task to a sub-node through a message queue for processing, so as to obtain processing data of each sub-reconciliation task, where the master node corresponds to a plurality of sub-nodes; and each sub-node sends the processing data corresponding to the processed sub-reconciliation tasks to the main node so as to summarize and store the processing data through the main node.
In a possible implementation manner, the data processing method provided in the embodiment of the present application further includes:
and the pushing module 73 is configured to push an alarm message to the terminal device of the user, where the alarm message is used to indicate that the reconciliation task is completed, and/or carry abnormal data in the processed data in the alarm message, and is used to indicate the user to process the abnormal data.
In a possible implementation, the processing module 72 is specifically configured to:
and each sub-node performs task splitting on the received sub-reconciliation task, generates difference data of the sub-reconciliation task by performing multi-thread processing on the sub-reconciliation task after the task splitting, and records the task state of the sub-reconciliation task as a processed state until the state of each sub-reconciliation task is the processed state, so as to obtain the processing data of each sub-reconciliation task.
In a possible implementation manner, the reconciliation task includes a plurality of sets of data to be compared, and the processing module 72 is specifically configured to:
and according to the data table main keys of the multiple groups of data to be compared, dividing the data to be compared of a preset number in the multiple groups of data to be compared into one sub-reconciliation task in sequence, and acquiring a plurality of sub-reconciliation tasks.
In one possible implementation, the processing module 72 is further configured to:
randomly exchanging part of data to be compared in each sub-reconciliation task with data to be compared in other sub-reconciliation tasks to obtain a plurality of exchanged sub-reconciliation tasks; and issuing each exchanged sub account checking task to the sub node through the message queue for processing.
In one possible implementation, the reconciliation request is triggered by receiving a user operation or by scheduling a task at regular time.
The apparatus of this embodiment may perform the method embodiment shown in fig. 2, and the technical principle and technical effect are similar to those of the above embodiment, which are not described herein again.
On the basis of the embodiment shown in fig. 7, further, in another embodiment of the data processing apparatus provided by the present application,
the first receiving module 71 is further configured to obtain data source information of the reconciliation task, where the data source information includes information of a first data source and information of a second data source, the first data source is a reference data source, and the second data source is a data source to be compared.
The processing module 72 is further configured to configure the reconciliation task according to the information of the first data source and the information of the second data source.
In a possible implementation, the information of the first data source includes a database address of the first data source, the information of the second data source includes a database address of the second data source, and the processing module 72 is further configured to:
reading a first data table through a database address of a first data source, and reading a second data table through a database address of a second data source; and configuring the associated fields and the comparison fields in the first data table and the second data table to generate the reconciliation task.
In a possible implementation, the processing module 72 is further configured to: configuring a comparison mode of the reconciliation task, wherein the comparison mode comprises one-way comparison or two-way comparison, and/or configuring one or more combinations of the following information of the first data table and the second data table: data table primary keys, multi-table association clauses, data grouping, or definitions of contrasting fields.
In one possible embodiment, the data source information further includes: data source type, username, user password, URL, and data source driver.
In one possible embodiment, the data source type includes any one of: a single library single table, a sub-library sub-table, a CDS data source or an ES data source.
The apparatus of this embodiment may perform the method embodiment shown in fig. 4, and the technical principle and technical effect are similar to those of the above embodiment, which are not described herein again.
On the basis of the embodiment shown in fig. 7, further, in another embodiment of the data processing apparatus provided in this application, the reconciliation task further includes a comparison manner, where the comparison manner includes a one-way comparison or a two-way comparison, and the processing module 72 is further configured to:
judging whether the comparison mode of the account checking task is bidirectional comparison; if the comparison mode is bidirectional comparison, configuring and executing a reverse reconciliation task by taking the first data source as a data source to be compared and taking the second data source as a reference data source, and generating reverse processing data, wherein the reverse reconciliation task is configured according to the information of the first data source and the information of the second data source; the process data and the reverse process data are summarized and stored by the master node.
On the basis of the embodiment shown in fig. 7, further, in another embodiment of the data processing apparatus provided in this application, in the data processing method provided in this application, the first receiving module 71 is further configured to receive and process a data obtaining request; the pushing module 73 is further configured to send processing data of the reconciliation task to the terminal device of the user.
Fig. 8 is a schematic structural diagram of a data processing apparatus provided in another embodiment of the present application, where the apparatus may be implemented by software and/or hardware, for example, by a server, as shown in fig. 7, the data processing apparatus provided in the embodiment of the present application may include: a sending module 81.
The sending module 81 is configured to send a reconciliation request to the server, where the reconciliation request includes a reconciliation task, so that the server divides the reconciliation task into multiple sub-reconciliation tasks through the master node, and issues each sub-reconciliation task to a sub-node through a message queue for processing, so as to obtain processing data of each sub-reconciliation task, where the master node corresponds to multiple sub-nodes, and each sub-node sends processing data corresponding to the processed sub-reconciliation task to the master node, so as to sum and store the processing data through the master node.
On the basis of the embodiment shown in fig. 8, further, in another embodiment of the data processing apparatus provided in this application, the data processing apparatus provided in this application further includes a second receiving module 82.
The sending module 81 is further configured to send a processing data obtaining request to the server, where the processing data obtaining request is used to instruct the server to send the processing data of the reconciliation task to the terminal device of the user;
and the second receiving module 82 is configured to receive and display the processing data of the reconciliation task, and/or receive and download the processing data of the reconciliation task.
The device embodiments provided in the present application are merely schematic, and the module division in fig. 7 and fig. 8 is only one logic function division, and there may be other division ways in actual implementation. For example, multiple modules may be combined or may be integrated into another system. The coupling of the various modules to each other may be through interfaces that are typically electrical communication interfaces, but mechanical or other forms of interfaces are not excluded. Thus, modules described as separate components may or may not be physically separate, may be located in one place, or may be distributed in different locations on the same or different devices.
Fig. 9 is a schematic structural diagram of an electronic device provided in an embodiment of the present application, where the electronic device may be a server or a terminal device in the foregoing embodiment, and as shown in fig. 9, the electronic device includes:
a processor 91, a memory 92, a transceiver 93, and a computer program; wherein the transceiver 93 implements data transmission with other devices, a computer program is stored in the memory 92 and configured to be executed by the processor 91, the computer program comprising instructions for executing the data processing method, the contents and effects thereof refer to the method embodiment.
In addition, embodiments of the present application further provide a computer-readable storage medium, in which computer-executable instructions are stored, and when at least one processor of the user equipment executes the computer-executable instructions, the user equipment performs the above-mentioned various possible methods.
Computer-readable media includes both computer storage media and communication media including any medium that facilitates transfer of a computer program from one place to another. A storage media may be any available media that can be accessed by a general purpose or special purpose computer. An exemplary storage medium is coupled to the processor such the processor can read information from, and write information to, the storage medium. Of course, the storage medium may also be integral to the processor. The processor and the storage medium may reside in an ASIC. Additionally, the ASIC may reside in user equipment. Of course, the processor and the storage medium may reside as discrete components in a communication device.
Those of ordinary skill in the art will understand that: all or a portion of the steps of implementing the above-described method embodiments may be performed by hardware associated with program instructions. The program may be stored in a computer-readable storage medium. When executed, the program performs steps comprising the method embodiments described above; and the aforementioned storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic or optical disks.
Finally, it should be noted that: the above embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present application.