Data splicing method, device, medium and electronic equipment
By determining the change data of the log file from the source database, adding it to the message queue and splicing it according to the foreign key, the problem of non-real-time data query and large intrusion into the business system in the existing technology is solved, and efficient real-time data query and tracking are realized.
Patent Information
- Application Number
- CN201810975664.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2018-08-24
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2038-08-24
AI Technical Summary
In the existing technology, data query is not real-time and has great intrusion into the business system, making it difficult to meet the needs of real-time data splicing.
Determine the change data of the log file from the source database, add it to the message queue for preprocessing, splice the data to be spliced according to the foreign keys of the preset database table, and synchronize it to the target database to achieve real-time data splicing.
Through non-intrusive modification methods, efficient real-time query of distributed database data is achieved, and the response speed of data query and tracking is improved.
Smart Images

Figure CN110895534B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a data splicing method, device, medium and electronic equipment. Background Art
[0002] With the promotion and popularization of the Internet and big data technology, distributed cluster data warehouses have gradually become mainstream. At present, the data sources of data warehouses mainly include structured data such as members and orders stored in relational databases, as well as unstructured data stored in the form of files such as user behavior, application logs, images and videos. Among them, structured data such as members and orders stored in relational databases are the most important part of the data warehouse data source, and are also the most valuable part of data analysis and mining.
[0003] For the sake of system performance and high scalability, existing construction systems are built in a building block manner, mostly in the form of microservices, and the database is split very finely. However, after the system is microserviced, a complete business document (such as an order in an e-commerce system) has its status distributed in various systems (logistics information of the order, payment information of the order, settlement information of the order, and invoicing status). At this time, when business personnel want to track this order throughout the entire process, they need to check it in various systems, which is difficult and cumbersome to implement.
[0004] In the prior art, the order information is generally spliced in the following manner:
[0005] Method 1: Through offline data processing, data modeling is carried out, a data warehouse is established, and a system is provided for query. This modeling can solve the multi-dimensional storage and splicing query of data.
[0006] Method 2: Each business system sends its own message, which is then received by one system. After receiving the message, the data is spliced in real time. This can also be used as a quasi-real-time splicing solution.
[0007] The above-mentioned prior art has the following problems:
[0008] (1) The technical solution of method 1 has obvious lag and cannot meet the real-time scenario.
[0009] (2) Although the technical solution of method 2 solves the real-time nature of splicing, it has a significant intrusion into the business system and the message must be triggered by the business system.
[0010] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present invention, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention
[0011] The purpose of the embodiments of the present invention is to provide a data splicing method, device, medium and electronic device, thereby overcoming one or more problems in the related art, that is, data query is not real-time and has a large intrusion on the business system, at least to a certain extent.
[0012] Other features and advantages of the present invention will become apparent from the following detailed description, or may be learned in part by practice of the present invention.
[0013] According to a first aspect of an embodiment of the present invention, a data splicing method is provided, comprising:
[0014] Determine the changed data of the log file from the source database and add the changed data to the message queue;
[0015] Pre-process the changed data in the message queue to determine the data to be spliced in the changed data;
[0016] Each piece of data to be spliced is spliced according to the foreign key of the preset database table, and the spliced data obtained after splicing is synchronized to the target database.
[0017] In one embodiment of the present invention, determining the change data of the log file from the source database includes:
[0018] The log files in the relational database are detected in real time to determine the changed data of the database table and the changed content in the log files.
[0019] In one embodiment of the present invention, the preprocessing of the changed data to determine the data to be spliced in the changed data includes:
[0020] After the preset Strom cluster obtains the changed data in the message queue, it distributes the changed data;
[0021] Identify the distributed change data according to the preset target field, and obtain the change data that meets the target field;
[0022] The changed data that matches the target field is determined as the data to be spliced, and the data to be spliced is encapsulated by map.
[0023] In one embodiment of the present invention, the above-mentioned splicing of the data to be spliced according to the foreign key of the preset database table and synchronizing the spliced data obtained after the splicing to the target database includes:
[0024] Determine the association between each piece of data to be spliced based on the preset business table foreign key;
[0025] Splicing the determined data to be spliced that have a correlation relationship to obtain spliced data;
[0026] Synchronize the stitched data to the target database.
[0027] In one embodiment of the present invention, the method further comprises:
[0028] Determine whether the splicing data needs to continue splicing;
[0029] When it is determined that the spliced data needs to be further spliced, the spliced data is imported into the transit database, and it is detected whether the spliced data that needs to be further spliced is obtained;
[0030] After obtaining the data to be spliced that needs to be spliced further, taking out the spliced data in the transit database and splicing it with the data to be spliced that needs to be spliced further, obtaining the spliced data after the second splicing;
[0031] Synchronize the spliced data after the second splicing to the target database.
[0032] According to a second aspect of an embodiment of the present invention, there is provided a data splicing device, comprising:
[0033] A determination module is used to determine the change data of the log file from the source database and add the change data to the message queue;
[0034] A preprocessing module is used to preprocess the changed data in the message queue and determine the data to be spliced in the changed data;
[0035] The splicing module is used to splice the various data to be spliced according to the foreign keys of the preset database table, and synchronize the spliced data obtained after splicing to the target database.
[0036] In one embodiment of the present invention, the above-mentioned determination module is specifically used for:
[0037] The log files in the relational database are detected in real time to determine the changed data of the database table and the changed content in the log files.
[0038] In one embodiment of the present invention, the preprocessing module is specifically used for:
[0039] After the preset Strom cluster obtains the changed data in the message queue, it distributes the changed data;
[0040] Identify the distributed change data according to the preset target field, and obtain the change data that meets the target field;
[0041] The changed data that matches the target field is determined as the data to be spliced, and the data to be spliced is encapsulated by map.
[0042] In one embodiment of the present invention, the above-mentioned splicing module is specifically used for:
[0043] Determine the association between each piece of data to be spliced based on the preset business table foreign key;
[0044] Splicing the determined data to be spliced that have a correlation relationship to obtain spliced data;
[0045] Synchronize the stitched data to the target database.
[0046] In one embodiment of the present invention, the above-mentioned splicing module is also used for:
[0047] Determine whether the splicing data needs to continue splicing;
[0048] When it is determined that the spliced data needs to be further spliced, the spliced data is imported into the transit database, and it is detected whether the spliced data that needs to be further spliced is obtained;
[0049] After obtaining the data to be spliced that needs to be spliced further, taking out the spliced data in the transit database and splicing it with the data to be spliced that needs to be spliced further, obtaining the spliced data after the second splicing;
[0050] Synchronize the spliced data after the second splicing to the target database.
[0051] According to a third aspect of an embodiment of the present invention, a computer-readable medium is provided, on which a computer program is stored. When the program is executed by a processor, the data splicing method of the first aspect of the above embodiment is implemented.
[0052] According to a fourth aspect of an embodiment of the present invention, there is provided an electronic device, comprising: one or more processors; a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the data splicing method of the first aspect of the above embodiment.
[0053] The technical solution provided by the embodiment of the present invention may have the following beneficial effects:
[0054] The embodiment of the present invention provides a data splicing method, device, medium and electronic device, the data splicing method comprising: determining the change data of the log file from the source database, adding the change data to the message queue; preprocessing the change data in the message queue, determining the data to be spliced in the change data; splicing each data to be spliced according to the foreign key of the preset database table, and synchronizing the spliced data obtained after splicing to the target database. The technical solution of the embodiment of the present invention can realize the splicing operation of distributed database data in a non-invasive modification to the existing business system, provide efficient real-time query, and improve the response speed of data query and tracking.
[0055] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0056] The drawings herein are incorporated into and constitute a part of the specification, showing embodiments consistent with the present invention, and together with the specification, are used to explain the principles of the present invention. Obviously, the drawings described below are only some embodiments of the present invention, and for those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative work. In the drawings:
[0057] Figure 1 A flowchart of a data splicing method according to an embodiment of the present invention is schematically shown;
[0058] Figure 2 A schematic diagram of determining data to be spliced according to an embodiment of the present invention is shown schematically;
[0059] Figure 3 A schematic diagram of splicing data according to an embodiment of the present invention is schematically shown;
[0060] Figure 4 A block diagram of a data splicing device according to an embodiment of the present invention is schematically shown;
[0061] Figure 5 A schematic diagram of the structure of a computer system suitable for implementing an electronic device of an embodiment of the present invention is shown. DETAILED DESCRIPTION
[0062] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in many forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that the present invention will be more comprehensive and complete and fully convey the concept of the example embodiments to those skilled in the art.
[0063] In addition, the described features, structures or characteristics may be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present invention. However, those skilled in the art will appreciate that the technical solution of the present invention can be practiced without one or more of the specific details, or other methods, components, devices, steps, etc. may be adopted. In other cases, known methods, devices, implementations or operations are not shown or described in detail to avoid blurring various aspects of the present invention.
[0064] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities may be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.
[0065] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps can be decomposed, and some operations / steps can be combined or partially combined, so the actual execution order may change according to actual conditions.
[0066] Figure 1 A flow chart of a data splicing method according to an embodiment of the present invention is schematically shown.
[0067] Reference Figure 1 As shown, a data splicing method according to an embodiment of the present invention includes the following steps:
[0068] In step S110, the changed data of the log file is determined from the source database, and the changed data is added to the message queue.
[0069] In one embodiment of the present invention, a log file in a relational database is detected in real time to determine the change data of the changed database table and the changed content in the log file.
[0070] In one embodiment of the present invention, the source database may be a plurality of service units and a plurality of databases in a microservice framework. The database may be a relational database, for example, Oracle, DB2, Microsoft SQL Server, Microsoft Access, MySQL and other relational databases. In the microservice framework, each service business runs in its own process, and the update of the source database such as the addition, deletion, modification and query of data during the operation process is recorded in a log file, for example, a binlog file. By analyzing the log file, the changed data in the source database can be determined, and the changed data can be added to the corresponding message queue in the Strom cluster.
[0071] In step S120, the changed data in the message queue is preprocessed to determine the data to be spliced in the changed data.
[0072] In one embodiment of the present invention, after the preset Strom cluster obtains the change data in the message queue, it distributes the change data; identifies the distributed change data according to the preset target field to obtain the change data that conforms to the target field; determines the change data that conforms to the target field as the data to be spliced, and maps and encapsulates the data to be spliced.
[0073] In one embodiment of the present invention, the structure of the preset Strom cluster is a master-slave structure consisting of a master node and multiple working nodes. The master node is statically specified through configuration or dynamically elected at runtime. The master node can be the Spout of the Strom cluster, which is used to obtain change data from the message queue corresponding to the source database and distribute the change data to the working node (for example: the bolt of the Strom cluster). The working node pre-processes the change data. During the pre-processing process, the working node determines whether the change data contains the target field, that is, the data required by the user. If the target field is contained, the change data is mapped and encapsulated, and the encapsulated change data is sent to the working node for splicing processing according to the preset distribution strategy.
[0074] Figure 2 The following schematic diagram shows a schematic diagram of determining data to be spliced according to an embodiment of the present invention.
[0075] Reference Figure 2 As shown, according to an embodiment of the present invention, determining the data to be spliced includes: monitoring the binlog log of the source relational database from the library in real time, sending the database change data to its own message queue (MQ, Message Queue) in real time, and then receiving the change data of each database MQ through the Strom cluster, and then distributing it to multiple bolts for preprocessing. In the preprocessing, the change data is compared with the fields of local concern. If it is determined that the field is concerned, the change data is map-encapsulated, and then the encapsulated change data is handed over to the splicing processing bolt through fieldsGrouping for data splicing.
[0076] In step S130, each piece of data to be spliced is spliced according to the foreign key of the preset database table, and the spliced data obtained after splicing is synchronized to the target database.
[0077] In one embodiment of the present invention, the association relationship between each piece of data to be spliced is determined according to a preset business table foreign key; the determined data to be spliced with an association relationship are spliced to obtain spliced data; and the spliced data is synchronized to a target database.
[0078] In one embodiment of the present invention, it is determined whether the spliced data needs to be further spliced; when it is determined that the spliced data needs to be further spliced, the spliced data is imported into a transit database, and it is detected whether the data to be spliced that needs to be further spliced is obtained; when the data to be spliced that needs to be further spliced is obtained, the spliced data in the transit database is taken out and spliced with the data to be spliced that needs to be further spliced to obtain the spliced data after the second splicing; the spliced data after the second splicing is synchronized to the target database.
[0079] Figure 3 The following schematically shows a schematic diagram of data splicing according to an embodiment of the present invention.
[0080] Reference Figure 3 As shown, according to an embodiment of the present invention, data splicing includes: when the bolt for splicing processing obtains the change data to be spliced, the attribute information that needs to be paid attention to and is stored in the local memory is obtained, and necessary data processing is performed on the change data. After the processing is completed, a splicing object is generated, and the object is handed over to the next bolt for splicing processing, and the core data splicing operation is performed in the bolt, wherein the basis of data splicing is: splicing through the logical foreign keys in each business table. Specifically, in the process of data splicing, the configuration information can be put into the transit database (which can be a database such as redis) to increase the acquisition speed. In the process of splicing, if the splicing object 1 and the splicing object 2 have a dependent relationship and need to be entered into the target database (which can be an ES database) at the same time, the first data can be stored in the transit database at this time, and when the subsequent splicing object is obtained, the splicing is performed and synchronized to the target database, and then the data stored in the transit database is deleted; if there is no mutual dependency between the splicing objects, or splicing does not need to be performed at the same time, it can be updated in segments to the target database.
[0081] The following introduces an embodiment of a device of the present invention, which can be used to execute the above-mentioned data splicing method of the present invention.
[0082] Figure 4 A block diagram of a data splicing device according to an embodiment of the present invention is schematically shown.
[0083] Reference Figure 4 As shown, a data splicing device 400 according to an embodiment of the present invention includes:
[0084] The determination module 401 is used to determine the change data of the log file from the source database and add the change data to the message queue;
[0085] A preprocessing module 402 is used to preprocess the changed data in the message queue to determine the data to be spliced in the changed data;
[0086] The splicing module 403 is used to splice the data to be spliced according to the foreign key of the preset database table, and synchronize the spliced data obtained after splicing to the target database.
[0087] In one embodiment of the present invention, the determination module 401 is specifically used for:
[0088] The log files in the relational database are detected in real time to determine the changed data of the database table and the changed content in the log files.
[0089] In one embodiment of the present invention, the preprocessing module 402 is specifically used for:
[0090] After the preset Strom cluster obtains the changed data in the message queue, it distributes the changed data;
[0091] Identify the distributed change data according to the preset target field, and obtain the change data that meets the target field;
[0092] The changed data that matches the target field is determined as the data to be spliced, and the data to be spliced is encapsulated by map.
[0093] In one embodiment of the present invention, the splicing module 403 is specifically used for:
[0094] Determine the association between each piece of data to be spliced based on the preset business table foreign key;
[0095] Splicing the determined data to be spliced that have a correlation relationship to obtain spliced data;
[0096] Synchronize the stitched data to the target database.
[0097] In one embodiment of the present invention, the splicing module 403 is further used for:
[0098] Determine whether the splicing data needs to continue splicing;
[0099] When it is determined that the spliced data needs to be further spliced, the spliced data is imported into the transit database, and it is detected whether the spliced data that needs to be further spliced is obtained;
[0100] After obtaining the data to be spliced that needs to be spliced further, taking out the spliced data in the transit database and splicing it with the data to be spliced that needs to be spliced further, obtaining the spliced data after the second splicing;
[0101] Synchronize the spliced data after the second splicing to the target database.
[0102] Since the various functional modules of the data splicing device of the exemplary embodiment of the present invention correspond to the steps of the exemplary embodiment of the data splicing method of the first aspect mentioned above, for details not disclosed in the embodiment of the device of the present invention, please refer to the data splicing method of the first aspect of the present invention mentioned above.
[0103] Reference below Figure 5 , which shows a schematic diagram of the structure of a computer system 500 of an electronic device suitable for implementing an embodiment of the present invention. Figure 5 The computer system 500 of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0104] like Figure 5 As shown, computer system 500 includes a central processing unit (CPU) 501, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 502 or a program loaded from a storage part 508 into a random access memory (RAM) 503. Various programs and data required for system operation are also stored in RAM 503. CPU 501, ROM 502 and RAM 503 are connected to each other via a bus 504. An input / output (I / O) interface 505 is also connected to bus 504.
[0105] The following components are connected to the I / O interface 505: an input section 506 including a keyboard, a mouse, etc.; an output section 507 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 508 including a hard disk, etc.; and a communication section 509 including a network interface card such as a LAN card, a modem, etc. The communication section 509 performs communication processing via a network such as the Internet. A drive 510 is also connected to the I / O interface 505 as needed. A removable medium 511, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 510 as needed, so that a computer program read therefrom is installed into the storage section 508 as needed.
[0106] In particular, according to an embodiment of the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present invention includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication section 509, and / or installed from a removable medium 511. When the computer program is executed by a central processing unit (CPU) 501, the above-mentioned functions defined in the system of the present application are executed.
[0107] It should be noted that the computer-readable medium shown in the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0108] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0109] The units involved in the embodiments of the present invention may be implemented by software or hardware, and the units described may also be arranged in a processor. The names of these units do not, in some cases, limit the units themselves.
[0110] As another aspect, the present application also provides a computer-readable medium, which may be included in the electronic device described in the above embodiment; or may exist independently without being assembled into the electronic device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by an electronic device, the electronic device implements the data splicing method in the above embodiment.
[0111] For example, the electronic device described above can be implemented as follows: Figure 1 As shown in: Step S110, determine the change data of the log file from the source database and add the change data to the message queue; Step S120, pre-process the change data in the message queue and determine the data to be spliced in the change data; Step 130, splice each data to be spliced according to the foreign key of the preset database table, and synchronize the spliced data obtained after splicing to the target database.
[0112] It should be noted that, although several modules or units of the equipment for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to an embodiment of the present invention, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into being embodied by multiple modules or units.
[0113] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present invention can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a touch terminal, or a network device, etc.) to execute the method according to the implementation of the present invention.
[0114] Those skilled in the art will readily appreciate other embodiments of the present invention after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses or adaptations of the present invention that follow the general principles of the present invention and include common knowledge or customary techniques in the art that are not disclosed by the present invention. The specification and examples are to be considered exemplary only, and the true scope and spirit of the present invention are indicated by the following claims.
[0115] It should be understood that the present invention is not limited to the exact construction that has been described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present invention is limited only by the appended claims.
Claims
1. A data splicing method, characterized in that: include: Determine the change data of the log file from the source database, and add the change data to the message queue; Preprocessing the changed data in the message queue to determine the data to be spliced in the changed data; Splicing each of the to-be-spliced data according to the foreign key of the preset database table, and synchronizing the spliced data obtained after the splicing to the target database; The changed data in the message queue is preprocessed to determine that the data to be spliced in the changed data includes: After the preset Storm cluster obtains the changed data in the message queue, it distributes the changed data; Identify the distributed change data according to a preset target field, and obtain the change data that conforms to the target field; The changed data that conforms to the target field is determined as the data to be spliced, and the data to be spliced is map-encapsulated.
2. The data splicing method according to claim 1, characterized in that: Determining the change data of the log file from the source database includes: The log files in the relational database are detected in real time to determine the changed data of the changed database table and the changed content in the log files.
3. The data splicing method according to claim 1, characterized in that: The step of splicing the data to be spliced according to the foreign key of the preset database table and synchronizing the spliced data obtained after the splicing to the target database includes: Determine the association relationship between each of the to-be-joined data according to the preset business table foreign key; Splicing the determined data to be spliced that have a correlation relationship to obtain spliced data; The spliced data is synchronized to a target database.
4. The data splicing method according to claim 3, characterized in that: The method further comprises: Determining whether the spliced data needs to be further spliced; When it is determined that the spliced data needs to be further spliced, the spliced data is imported into a transit database, and it is detected whether the spliced data that needs to be further spliced is obtained; After obtaining the data to be spliced that needs to be further spliced, taking out the spliced data in the transfer database and splicing it with the data to be spliced that needs to be further spliced, to obtain the spliced data after the second splicing; The spliced data after the second splicing is synchronized to the target database.
5. A data splicing device, characterized in that: include: A determination module, used to determine the change data of the log file from the source database, and add the change data to the message queue; A preprocessing module, used for preprocessing the changed data in the message queue to determine the data to be spliced in the changed data; A splicing module, used for splicing the data to be spliced according to the foreign key of the preset database table, and synchronizing the spliced data obtained after splicing to the target database; Wherein, the preprocessing module is set to: After the preset Storm cluster obtains the changed data in the message queue, it distributes the changed data; Identify the distributed change data according to a preset target field, and obtain the change data that conforms to the target field; The changed data that conforms to the target field is determined as the data to be spliced, and the data to be spliced is map-encapsulated.
6. The data splicing device according to claim 5, characterized in that the determination module is specifically used for: The log files in the relational database are detected in real time to determine the changed data of the changed database table and the changed content in the log files.
7. The data splicing device according to claim 5, characterized in that the preprocessing module is specifically used for: After the preset Storm cluster obtains the changed data in the message queue, it distributes the changed data; Identify the distributed change data according to a preset target field, and obtain the change data that conforms to the target field; The changed data that conforms to the target field is determined as the data to be spliced, and the data to be spliced is map-encapsulated.
8. The data splicing device according to claim 5, characterized in that: The splicing module is specifically used for: Determine the association relationship between each of the to-be-joined data according to the preset business table foreign key; Splicing the determined data to be spliced that have a correlation relationship to obtain spliced data; The spliced data is synchronized to a target database.
9. The data splicing device according to claim 5, characterized in that the splicing module is further used for: Determining whether the spliced data needs to be further spliced; When it is determined that the spliced data needs to be further spliced, the spliced data is imported into a transit database, and it is detected whether the spliced data that needs to be further spliced is obtained; After obtaining the data to be spliced that needs to be further spliced, taking out the spliced data in the transfer database and splicing it with the data to be spliced that needs to be further spliced, to obtain the spliced data after the second splicing; The spliced data after the second splicing is synchronized to the target database.
10. A computer readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the data splicing method as described in any one of claims 1 to 4 is implemented.
11. An electronic device, characterized in that: include: one or more processors; A storage device for storing one or more programs, which, when executed by the one or more processors, enables the one or more processors to implement the data splicing method as described in any one of claims 1 to 4.
Citation Information
Patent Citations
Automatic data query, synchronization and storage method
CN106250543A
Workflow-based data integration system
CN107103448A
Data pattern conversion and parallel framework-based relational data query optimization method
CN107169033A
A distributed hierarchical extracting and multi-application method and a data extracting and application device
CN107169069A
Data processing method and device
CN107544984A
