Data processing method and device
The decoupling of data synchronization in the microservice architecture is achieved through the message bus and re-delivery mechanism, which solves the problems of complex data synchronization and poor reliability in the microservice architecture, improves the reliability and efficiency of data transmission, and simplifies system maintenance.
Patent Information
- Application Number
- CN202110484671.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-04-30
- Publication Date
- 2024-09-27
- Estimated Expiration
- 2041-04-30
AI Technical Summary
The coupling between subsystems in the microservice architecture is too strong, resulting in complex data synchronization and poor reliability. It is difficult to ensure that data is correctly delivered to the computer room, and system maintenance and resource consumption are large.
Data synchronization is performed through the message queue of the message bus to achieve decoupling of the source system and the target system. A re-delivery mechanism and a fault-tolerant mechanism are used to ensure the reliability of data transmission. Data that fails to be delivered is re-delivered and query processed according to the message type and times for group storage and processing.
It simplifies the data transmission channel, improves the reliability and efficiency of data transmission, reduces the error rate, reduces system resource consumption, and clarifies the service calling relationship.
Smart Images

Figure CN113176960B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing, and in particular to a data processing method and device. Background Art
[0002] Under the existing microservice framework, the coupling between services is too strong, and the calling links between them are complicated. Especially when a single application service connects to multiple services, multiple sets of interfaces need to be provided to meet the data required by the business. Once a problem occurs, it is difficult to troubleshoot and solve it.
[0003] In the context of microservices as the mainstream architecture of large projects, functions are broken down into different microservices to enable them to continue to provide services to the outside world when a single node fails without affecting the overall process. At this time, various microservices are needed to support the various functional applications of the system. On the one hand, this greatly improves the overall fault tolerance and robustness of the system, but it also creates tangled calling relationships between services. The main problems highlighted are:
[0004] 1) The subsystems in the microservices are logically and physically isolated. There is a large amount of dynamic and static data that needs to be synchronized between the subsystems. Traditional interfaces or cache data output and sharing methods are prone to errors and data inconsistency. How to distinguish user access traffic and ensure that data falls into the correct computer room?
[0005] 2) The service relationships in the microservice architecture are complex and changeable, and it is difficult to obtain real-time topological relationships to distinguish user access traffic and ensure that data falls into the correct computer room;
[0006] 3) There are a large number of microservices, and the communication between them is complicated. It is difficult to track error information. How to distinguish user access traffic and ensure that data falls into the correct computer room.
[0007] 4) Each subsystem needs to maintain and synchronize data resources independently, resulting in high system maintenance and resource consumption.
[0008] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention
[0009] The embodiments of the present invention provide a data processing method and device to at least solve the technical problems in the related art that the connections between microservice subsystems are complicated, the reliability of data synchronization is poor, and errors are prone to occur.
[0010] According to one aspect of an embodiment of the present invention, a data processing method is provided, including: receiving synchronization data of a source system to which synchronization data is to be sent; delivering the synchronization data to a data sending interface through a message queue of a message bus; and, when the message queue is successfully delivered to the data sending interface, sending the synchronization data to a corresponding target system through the data sending interface.
[0011] Optionally, the method further includes: when the message queue fails to deliver to the data sending interface, re-delivering the synchronization data that failed to be delivered.
[0012] Optionally, when the message queue fails to deliver the data to the data sending interface, redelivering the failed synchronous data includes: determining the number of failed synchronous data delivery attempts, and determining whether the number of failed synchronous data delivery attempts reaches a preset number; when the number of failed synchronous data delivery attempts does not reach the preset number, adding one to the number, and redelivering the failed synchronous data through the message bus.
[0013] Optionally, the method further includes: when the number of synchronization data delivery failures reaches the preset number, querying the synchronization data.
[0014] Optionally, when the number of synchronization data delivery failures reaches the preset number, query processing of the synchronization data includes: querying whether the message type of the synchronization data whose delivery failures reach the preset number is a real-time message or a non-real-time message; when the message type is a real-time message, sending the synchronization data directly to the data sending interface, and sending it to the target system through the data sending interface.
[0015] Optionally, the method also includes: when the message type of the synchronization data whose delivery failure times reach the preset number is a non-real-time message, grouping the synchronization data according to the corresponding target system; uploading the grouped synchronization data to a file server for group storage; sending the synchronization data to the data sending interface at the file path of the file server, and sending the file path to the target system through the data sending interface.
[0016] Optionally, after determining that the message type of the synchronization data whose number of delivery failures reaches the preset number of times is a real-time message or a non-real-time message, it also includes: determining whether the synchronization data whose number of delivery failures reaches the preset number of times is locked data; if the synchronization data whose number of delivery failures reaches the preset number of times is locked data, unlocking the synchronization data whose number of delivery failures reaches the preset number of times.
[0017] According to another aspect of an embodiment of the present invention, a data processing device is also provided, including: a receiving module, used to receive synchronization data of a source system to which synchronization data is to be sent; a delivery module, used to deliver the synchronization data to a data sending interface through a message queue of a message bus; and a sending module, used to send the synchronization data to a corresponding target system through the data sending interface when the message queue is successfully delivered to the data sending interface.
[0018] According to another aspect of an embodiment of the present invention, a processor is further provided, wherein the processor is used to run a program, wherein the program executes any one of the above-mentioned data processing methods when running.
[0019] According to another aspect of an embodiment of the present invention, a computer storage medium is further provided, wherein the computer storage medium includes a stored program, wherein when the program is executed, the device where the computer storage medium is located is controlled to execute any one of the data processing methods described above.
[0020] In an embodiment of the present invention, the synchronous data of the source system to which the synchronous data is to be sent is received; the synchronous data is delivered to the data sending interface through the message queue of the message bus; when the message queue is successfully delivered to the data sending interface, the synchronous data is sent to the corresponding target system through the data sending interface. By delivering the synchronous data of the source system through the message queue of the message bus and sending it to the target system of the object through the data sending interface, the source system and the target system are decoupled through the message bus and the synchronous data of the source system is effectively sent to the target system, thereby achieving the technical effect of simplifying the data transmission channel between the source system and the target system, improving the reliability of data transmission between the source system and the target system, and reducing the error rate of data transmission, thereby solving the technical problems of complex connections between the subsystems of microservices in the related technology, poor reliability of data synchronization, and easy errors. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0022] Figure 1 is a flow chart of a data processing method according to an embodiment of the present invention;
[0023] Figure 2 is a schematic diagram of a data synchronization architecture of a microservice system according to an embodiment of the present invention;
[0024] Figure 3is a schematic diagram of a data fault-tolerant architecture according to an embodiment of the present invention;
[0025] Figure 4 is a schematic diagram of a data fault-tolerant architecture according to an embodiment of the present invention;
[0026] Figure 5 is a schematic diagram of a data processing device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0027] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0028] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0029] The following is a description of the professional terms that appear in this embodiment:
[0030] Source system: refers to the data initiator through the data synchronization device. The party that generates the data needs to transfer the data to other systems.
[0031] Target system: refers to the party where the final data of the data synchronization device lands, and it receives the data sent by the data generator.
[0032] Message bus: Simply put, it is a message center. Many microservice instances can be connected to the bus, and the instances can send or receive information to the message center (through monitoring). For example, instance A sends a message to the bus, and instance B on the bus can receive the message (instance B subscribes to instance A). In this way, the message bus acts as an intermediary, decoupling instance A and instance B, which is very convenient.
[0033] Message transmission service: refers to a service device in a synchronization device used to receive data transmitted by a subsystem and send data to the target system.
[0034] According to an embodiment of the present invention, a method embodiment of a data processing method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0035] Figure 1 is a flow chart of a data processing method according to an embodiment of the present invention. Figure 1 As shown, the method comprises the following steps:
[0036] Step S102, receiving synchronization data of a source system to which synchronization data is to be sent;
[0037] Step S104, delivering the synchronization data to the data sending interface through the message queue of the message bus;
[0038] Step S106, when the message queue is successfully delivered to the data sending interface, the synchronization data is sent to the corresponding target system through the data sending interface.
[0039] Through the above steps, the synchronous data of the source system to which the synchronous data is to be sent is received; the synchronous data is delivered to the data sending interface through the message queue of the message bus; when the message queue is successfully delivered to the data sending interface, the synchronous data is sent to the corresponding target system through the data sending interface. By delivering the synchronous data of the source system through the message queue of the message bus and sending it to the target system of the object through the data sending interface, the source system and the target system are decoupled through the message bus, and the synchronous data of the source system is effectively sent to the target system, thereby achieving the technical effect of simplifying the data transmission channel between the source system and the target system, improving the reliability of data transmission between the source system and the target system, and reducing the error rate of data transmission, thereby solving the technical problems of complex connections between the subsystems of microservices in related technologies, poor reliability of data synchronization, and easy errors.
[0040] The executor of the above steps can be a microservice system. Under the microservice framework, the coupling between application services is too strong, that is, the calling links between application services are complicated. Especially when a single application service is connected to multiple application services, multiple sets of interfaces need to be provided to meet the data required by the business. Once a problem occurs, it is difficult to troubleshoot and solve.
[0041] The microservice system may include a data receiving interface, a message bus and a data sending interface, through which the synchronization data of the source system to which the synchronization data is to be sent is received. The data receiving interface may be a microservice in the microservice system, specifically a data receiving subservice of the data transmission service in the microservice system. The data sending interface may be a data sending subservice of the data transmission service.
[0042] The data receiving sub-service directly connects with the source system and directly receives the synchronization data of the source system, thereby improving the efficiency of obtaining the synchronization data of the source system. The received synchronization data is then sent to the message bus and delivered to the data sending sub-service.
[0043] The above-mentioned data sending sub-service is directly connected to the target system. When the message bus successfully delivers the data sending sub-service, the data sending sub-service directly sends the synchronization data to the target system, which improves the efficiency of sending data to the target system. The decoupling of the source system and the target system is achieved. The source system and the target system are connected in series through the message bus, avoiding the problem of low efficiency and poor reliability of data transmission caused by the complex communication link between the source system and the target system.
[0044] After receiving the above synchronization data, the synchronization data is sent to the message bus, and the message bus delivers the synchronization data to the above sending interface through the internal message queue MQ (message queue), and sends the synchronization data to the target system through the sending interface, thereby realizing the effective and fast transmission of the synchronization data of the source system to the target system.
[0045] Optionally, the method further includes: when the message queue fails to deliver the data to the data sending interface, re-delivering the synchronization data that failed to be delivered.
[0046] In the event that the message queue of the message bus fails to deliver the data to the data sending interface, the failed synchronization data is re-delivered through the fault-tolerant mechanism to ensure the transmission consistency and reliability of the synchronization data.
[0047] Optionally, when the message queue fails to deliver to the data sending interface, re-delivering the failed synchronization data includes: determining the number of failed synchronization data delivery attempts, and determining whether the number of failed synchronization data delivery attempts reaches a preset number; when the number of failed synchronization data delivery attempts does not reach the preset number, adding one to the number, and re-delivering the failed synchronization data through the message bus.
[0048] The above fault-tolerant mechanism can re-deliver the failed synchronization data when the message queue fails to deliver to the data sending interface. Specifically, the failed synchronization data of the message bus is stored in the database, and the failed synchronization data in the message bus is scanned at a predetermined frequency through a scheduled polling task.
[0049] Synchronous data may fail to be delivered due to various reasons. It is impossible to repeat the delivery of the failed synchronous data, which will also waste more system resources. Therefore, after obtaining the failed synchronous data, it is determined whether the number of failed delivery of the failed synchronous data has reached the preset number.
[0050] When the number of synchronization data delivery failures does not reach the preset number, it means that the number of synchronization data delivery failures is small, and the possibility of successful delivery is greater by redeliving. The number of synchronization data delivery failures is increased by one, and the failed synchronization data is redelivered through the message bus.
[0051] Optionally, the method further includes: when the number of synchronization data delivery failures reaches a preset number, querying the synchronization data.
[0052] When the number of synchronization data delivery failures reaches the preset number, it means that the synchronization data delivery failures are large. The possibility of successful delivery is small by re-delivery. The synchronization data will not be re-delivered to avoid falling into an endless cycle of continuous delivery failure and re-delivery. By querying the synchronization data, the target system can query the synchronization data. In this way, the purpose of sending the synchronization data to the target system is achieved.
[0053] Optionally, when the number of synchronization data delivery failures reaches a preset number, query processing of the synchronization data includes: querying whether the message type of the synchronization data whose delivery failures reach a preset number is a real-time message or a non-real-time message; when the message type is a real-time message, sending the synchronization data directly to the data sending interface, and sending it to the target system through the data sending interface.
[0054] Specifically, the query processing of the synchronization data can first determine the message type of the synchronization data whose delivery failure times reach the preset times, whether it is a real-time message or a non-real-time message. In the case where the message type is a real-time message, it means that the timeliness of the synchronization data is strong and needs to be sent to the target system as soon as possible, so the synchronization data is directly sent to the data sending interface and sent to the target system through the data sending interface. This ensures the time validity of the synchronization data of the real-time message.
[0055] Optionally, the method also includes: when the message type of the synchronization data whose delivery failure times reach a preset number is a non-real-time message, grouping the synchronization data according to the corresponding target system; uploading the grouped synchronization data to a file server for group storage; sending the file path of the synchronization data on the file server to a data sending interface, and sending the file path to the target system through the data sending interface.
[0056] In the case where the message type of the synchronization data that has failed to be delivered for a preset number of times is a non-real-time message, it means that the timeliness of the synchronization data is low, and when the target system needs the synchronization data, it is sufficient to find the synchronization data. Then the synchronization data is grouped according to the corresponding target system; the grouped synchronization data is uploaded to the file server for group storage, so that the file server can group and store different synchronization data, which not only facilitates the storage of the file storage, but also facilitates the subsequent target system to read the synchronization data from the file storage.
[0057] The file path of the synchronization data in the file server is sent to the data sending interface, and the file path is sent to the target system through the data sending interface. When the target system needs the synchronization data later, the synchronization data is obtained from the file storage through the file path to achieve the purpose of sending the synchronization data to the target system.
[0058] Optionally, after determining that the message type of the synchronization data whose delivery failures reach a preset number of times is a real-time message or a non-real-time message, it also includes: determining whether the synchronization data whose delivery failures reach a preset number of times is locked data; if the synchronization data whose delivery failures reach a preset number of times is locked data, unlocking the synchronization data whose delivery failures reach the preset number of times.
[0059] When searching for synchronization data that failed to be delivered through the polling task mentioned above, since the distributed scheduled task will cause repeated reading when querying data, it is necessary to add an optimistic lock to lock the current data to prevent repeated reading of the data. However, this may also cause the locked data to fail in the program operation in a certain period of time. After locking, the delivery operation cannot be performed. The subsequent scheduled tasks cannot be queried because these data are locked. In this case, manual lock release is required.
[0060] Specifically, after determining that the message type of the synchronization data whose delivery failure times reach the preset times is a real-time message or a non-real-time message, determine whether the synchronization data whose delivery failure times reach the preset times is locked data; if it is locked data, subsequent delivery operations cannot be performed after being locked, and it cannot be queried further. In order to avoid subsequent operations being unable to be performed, the synchronization data needs to be unlocked.
[0061] It should be noted that the embodiment of the present application also provides an optional implementation, which is described in detail below.
[0062] This implementation method realizes data synchronization between microservice subsystems based on microservices and message bus, decouples the data call relationship between the microservices, and implements a high fault tolerance mechanism within the data synchronization to ensure data transmission consistency.
[0063] The data content that microservices need to synchronize includes basic system information, parameter information, transaction information, file information, etc. Professional data synchronization software is too complex and consumes a lot of system resources. At the same time, it cannot flexibly meet personalized requirements. In response to this defect between subsystems of large microservice architectures, a lightweight data synchronization technology device is specially constructed to realize subsystems. This data synchronization device can be integrated and deployed in limited microservice resources to save system resources.
[0064] The device of this embodiment provides four services to the outside world: synchronous receiving service, data fault tolerance service, data query service, and synchronous sending service. All services need to be registered to the microservice registration center. The source system and the target system realize data interaction through the message bus. When data transmission fails, the data will be temporarily stored in the DB (database date base) and the file server.
[0065] Figure 2 is a schematic diagram of a microservice system data synchronization architecture according to an embodiment of the present invention, such as Figure 2 As shown, the architecture of this implementation is as follows:
[0066] 1) Data transmission services;
[0067] The data transmission service is divided into data receiving (that is, the above-mentioned data receiving interface) and data sending service (that is, the above-mentioned data sending interface). These two services directly connect the source system and the target system, and realize data interaction through MQ (message queue) internally to transmit data from the source to the target system. The data transmission service is registered with the registration center, and other microservices only need to call the data transmission microservice to realize data transmission. The interface is simple and easy to implement.
[0068] 2) Message bus service;
[0069] The core component service of data synchronization implements high-reliability data transmission services based on real-time message synchronization, and can eliminate peak traffic in high-concurrency situations and buffer concurrent data, thereby better ensuring the overall robustness of the system.
[0070] 3) Data fault-tolerant service;
[0071] Figure 3 is a schematic diagram of a data fault-tolerant architecture according to an embodiment of the present invention, such as Figure 3 As shown in the figure, when data transmission fails, the fault tolerance mechanism is triggered, and the fault tolerance mechanism processing flow is as follows:
[0072] 1. The producer receives data. The producer is also the message receiving service. For a synchronous data sending device, the message receiving service is the device receiving synchronous data and is the message producer of the entire device. Then the message bus is sent for transmission. If the transmission fails, the data status is modified;
[0073] 2. Through the scheduled polling task, scan the data with failed status and perform secondary delivery. The situation is as follows:
[0074] A: Delivery is successful, and the data status is modified to success, ensuring that the polling task cannot query this message data;
[0075] B: If delivery fails, the number of message delivery failures will be increased by 1. The default upper limit is 3 times.
[0076] 3. When the number of delivery failures reaches the limit, the data will be processed accordingly according to the message type.
[0077] 4)Data query service;
[0078] Figure 4 is a schematic diagram of a data fault-tolerant architecture according to an embodiment of the present invention, such as Figure 4 As shown, the detailed records of all synchronized data can be queried through the data query service, and the synchronized data can be processed according to different situations. The specific processing flow is as follows:
[0079] 1. The number of delivery times reaches the limit, but it still shows failure. At this time, it is processed according to the type of message.
[0080] A: When the message type is a real-time message (the message type is specified when receiving data from the original system), the processing method is to directly send the message to the target system without using the transmission queue or message bus.
[0081] B: When the message type is a non-real-time message, the message will be grouped according to the target system, uploaded to the file server, and the corresponding file path will be sent to the target system through the synchronous sending application.
[0082] 2. Since distributed scheduled tasks will cause repeated reading when querying data, it is necessary to add an optimistic lock to lock the current data to prevent repeated reading of the data. However, this may also cause the locked data to fail in a certain period of time. After locking, the delivery operation cannot be performed. The next scheduled task cannot be queried because the data is locked. In this case, we need to release the lock manually.
[0083] 5) Simple and convenient service deployment;
[0084] Since this synchronization device is also developed based on microservices, it can be very convenient and fast and easy to maintain during production deployment.
[0085] Data synchronization technology between microservice subsystems in this implementation. The data synchronization is implemented based on the microservice registration center and the message bus. The reliability of each step of data synchronization is guaranteed, and the distributed call tasks are reasonably applied. When performing internal data transmission, the high fault tolerance is used to ensure the reliability of data delivery through the locking and unlocking mechanism. The monitoring management is used to summarize the transmission data and display the detailed information of the failed data.
[0086] Due to the existence of this synchronization mechanism, the calling relationship between services is decoupled, and the calling relationship is clearer. The configurability of the source system and target system parameters makes it easier and faster to add and modify the calling parties. The visualization of the front-end page makes the information statistics of the calling parties clearer. High-reliability transmission of data synchronization is achieved through high fault tolerance, which improves concurrent processing capabilities. Precious system and operation and maintenance resources are saved.
[0087] Figure 5 is a schematic diagram of a data processing device according to an embodiment of the present invention. Figure 5 As shown, according to another aspect of an embodiment of the present invention, a data processing device is provided, including: a receiving module 52, a delivery module 54 and a sending module 56. The device is described in detail below.
[0088] The receiving module 52 is used to receive the synchronization data of the source system to which the synchronization data is to be sent; the delivery module 54 is connected to the above-mentioned receiving module 52, and is used to deliver the synchronization data to the data sending interface through the message queue of the message bus; the sending module 56 is connected to the above-mentioned delivery module 54, and is used to send the synchronization data to the corresponding target system through the data sending interface when the message queue is successfully delivered to the data sending interface.
[0089] Through the above-mentioned device, the receiving module 52 is used to receive the synchronization data of the source system to which the synchronization data is to be sent; the delivery module 54 delivers the synchronization data to the data sending interface through the message queue of the message bus; the sending module 56 sends the synchronization data to the corresponding target system through the data sending interface when the message queue is successfully delivered to the data sending interface. By delivering the synchronization data of the source system through the message queue of the message bus and sending it to the target system of the object through the data sending interface, the source system and the target system are decoupled through the message bus, and the synchronization data of the source system is effectively sent to the target system, thereby achieving the technical effect of simplifying the data transmission channel between the source system and the target system, improving the reliability of data transmission between the source system and the target system, and reducing the error rate of data transmission, thereby solving the technical problems of complex connections between the subsystems of microservices in related technologies, poor reliability of data synchronization, and easy errors.
[0090] Optionally, the device further includes: a redelivery module, configured to redeliver the synchronization data that has failed to be delivered when the message queue fails to deliver the message to the data sending interface.
[0091] Optionally, the redelivery module includes: a first determination unit, used to determine the number of synchronization data delivery failures, and determine whether the number of synchronization data delivery failures reaches a preset number; a redelivery unit, used to increase the number by one when the number of synchronization data delivery failures does not reach the preset number, and redeliver the synchronization data that failed to be delivered through the message bus.
[0092] Optionally, the device further includes: a query module, configured to perform query processing on the synchronization data when the number of synchronization data delivery failures reaches a preset number.
[0093] Optionally, the query module includes: a query unit, used to query whether the message type of the synchronization data whose delivery failure times reach a preset number is a real-time message or a non-real-time message; a sending unit, used to send the synchronization data directly to the data sending interface when the message type is a real-time message, and send it to the target system through the data sending interface.
[0094] Optionally, the device also includes: a grouping module, which is used to group the synchronization data according to the corresponding target system when the message type of the synchronization data whose delivery failure times reach a preset number is a non-real-time message; a storage module, which is used to upload the grouped synchronization data to the file server for group storage; and a second sending module, which is used to send the file path of the synchronization data on the file server to the data sending interface, and send the file path to the target system through the data sending interface.
[0095] Optionally, the query module also includes: a second determination unit, used to determine whether the synchronization data whose delivery failure times reach a preset number of times is locked data; and an unlocking unit, used to unlock the synchronization data whose delivery failure times reach a preset number of times if the synchronization data is locked data.
[0096] According to another aspect of an embodiment of the present invention, a processor is further provided, and the processor is used to run a program, wherein any one of the above-mentioned data processing methods is executed when the program is run.
[0097] According to another aspect of an embodiment of the present invention, a computer storage medium is provided, the computer storage medium includes a stored program, wherein when the program is running, the device where the computer storage medium is located is controlled to execute any one of the above data processing methods.
[0098] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0099] In the above embodiments of the present invention, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0100] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units can be a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0101] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0102] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0103] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and other media that can store program codes.
[0104] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A data processing method, It is characterized in that include: Receiving synchronization data from a source system to which synchronization data is to be sent; Delivering the synchronization data to the data sending interface through the message queue of the message bus; When the message queue is successfully delivered to the data sending interface, the synchronization data is sent to the corresponding target system through the data sending interface; The method further comprises: In the case where the message queue fails to deliver the data to the data sending interface, re-delivering the synchronization data that failed to deliver; In the case where the message queue fails to deliver the data to the data sending interface, re-delivering the synchronization data that failed to deliver includes: Determine the number of synchronization data delivery failures, and determine whether the number of synchronization data delivery failures reaches a preset number; When the number of synchronization data delivery failures does not reach the preset number, the number is increased by one, and the synchronization data that failed to be delivered is re-delivered through the message bus; The method further comprises: When the number of synchronization data delivery failures reaches the preset number, querying the synchronization data; When the number of synchronization data delivery failures reaches the preset number, querying the synchronization data includes: Query the message type of the synchronization data whose delivery failure times reaches the preset times as a real-time message or a non-real-time message; In the case where the message type is a real-time message, the synchronization data is directly sent to the data sending interface, and is sent to the target system through the data sending interface.
2. The method according to claim 1, It is characterized in that The method further comprises: In the case where the message type of the synchronization data whose delivery failure times reaches the preset times is a non-real-time message, grouping the synchronization data according to the corresponding target system; Uploading the grouped synchronization data to a file server for group storage; The synchronization data is sent to the data sending interface at the file path of the file server, and the file path is sent to the target system through the data sending interface.
3. The method according to claim 1, It is characterized in that After determining that the message type of the synchronization data whose number of delivery failures reaches the preset number is a real-time message or a non-real-time message, the method further includes: Determine whether the synchronization data whose delivery failure times reach the preset times is locked data; In a case where the synchronization data whose delivery failure times reach the preset times is locked data, the synchronization data whose delivery failure times reach the preset times is unlocked.
4. A data processing device, It is characterized in that include: A receiving module, used for receiving synchronization data from a source system to which synchronization data is to be sent; A delivery module, used for delivering the synchronization data to the data sending interface through the message queue of the message bus; A sending module, configured to send the synchronization data to a corresponding target system through the data sending interface when the message queue is successfully delivered to the data sending interface; The device further comprises: a re-delivery module, configured to re-deliver the synchronization data that failed to be delivered when the message queue fails to deliver to the data sending interface; The re-delivery module includes: a first determination unit, configured to determine the number of synchronization data delivery failures, and determine whether the number of synchronization data delivery failures reaches a preset number; a re-delivery unit, configured to increase the number by one if the number of synchronization data delivery failures does not reach the preset number, and re-deliver the synchronization data that failed to be delivered through the message bus; The device further comprises: a query module, configured to query the synchronization data when the number of synchronization data delivery failures reaches the preset number; The query module includes: a query unit, used to query whether the message type of the synchronization data whose delivery failure times reach the preset times is a real-time message or a non-real-time message; a sending unit, used to send the synchronization data directly to the data sending interface when the message type is a real-time message, and send it to the target system through the data sending interface.
5. A computer storage medium, It is characterized in that The computer storage medium includes a stored program, wherein when the program is executed, the device where the computer storage medium is located is controlled to execute the data processing method according to any one of claims 1 to 3.
