Method and apparatus for synchronizing data
By adopting a customer information targeted distribution mechanism in a multi-node system, the same customer request is processed by the same node, and the data is split into parts with different time requirements, which solves the problem of the complexity of multi-node data synchronization and improves the system's response speed and processing performance.
Patent Information
- Application Number
- CN202211671480.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-26
- Publication Date
- 2025-12-05
- Estimated Expiration
- 2042-12-26
AI Technical Summary
In existing technologies, the data synchronization logic of multi-node systems is complex, resulting in high operating pressure on servers and databases.
By having the same customer request processed by the same node, data synchronization between multiple nodes is reduced. A customer information targeted distribution mechanism is adopted, which splits the data into first data and second data with different time requirements, and synchronizes them at different time periods.
It reduces the operating pressure on servers and databases, improves system response speed and processing performance, and simplifies the complex logic at the data storage level.
Smart Images

Figure CN116016561B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of high-performance computing, and in particular to a data synchronization method and device. BACKGROUND
[0002] Many service systems process business requests issued by customers through multiple nodes at the same time to ensure efficient response of the system. In the prior art, the processing requests are randomly distributed to any node for processing based on load balancing, and any node needs to synchronize the related data of the processing request to other nodes after processing the request. In the running process, data synchronization middleware is used to synchronize data between multiple nodes, and the data synchronization logic between multiple nodes is complex, and the running pressure of servers and databases is large. SUMMARY
[0003] Therefore, the embodiments of the present application provide a data synchronization method and device, the same customer request is processed by the same node, and there is no need for data synchronization between multiple nodes, which can reduce the running pressure of servers and databases.
[0004] In a first aspect, the embodiments of the present application provide a data synchronization method, comprising:
[0005] receiving a login request of a target customer;
[0006] determining a processing node corresponding to the target customer from multiple deployment nodes according to customer information of the target customer;
[0007] in response to the processing node needing to perform data synchronization processing for the target customer, obtaining first data of the target customer and synchronizing the first data to the processing node;
[0008] in response to system information of the processing node meeting a synchronization condition, obtaining second data of the target customer and synchronizing the second data to the processing node; wherein the processing node processes a business processing request of the target customer by using the first data and the second data.
[0009] Optionally, before the step of obtaining the first data of the target customer in response to the processing node needing to perform data synchronization processing for the target customer, the method further comprises:
[0010] in response to the processing node meeting any one of the following conditions, determining that the processing node needs to perform data synchronization processing for the target customer:
[0011] the target customer logs in the processing node for the first time;
[0012] the processing node does not store business data of the target customer;
[0013] The service data of the target customer stored by the processing node is expired.
[0014] Optionally, the obtaining the first data of the target customer comprises:
[0015] obtaining the synchronization parameter corresponding to the target customer;
[0016] obtaining the first data of the target customer from the central node according to the synchronization parameter.
[0017] Optionally, the obtaining the first data of the target customer comprises:
[0018] receiving a service processing request of the target customer and determining a request parameter corresponding to the service processing request;
[0019] obtaining the first data of the target customer from the central node according to the request parameter.
[0020] Optionally, the obtaining the first data of the target customer comprises:
[0021] obtaining the first data of the target customer from the central node, the first data comprising at least one of the following: a customer file of the target customer, a customer image and service data in a statistical period.
[0022] Optionally, the synchronization condition comprises:
[0023] a system time of the processing node reaching an end-of-day time point;
[0024] and / or, a system information of the processing node being greater than a resource threshold, the system information comprising at least one of the following: a CPU idle rate, available memory and available space.
[0025] Optionally, in response to the system information of the processing node meeting the synchronization condition, the obtaining the second data of the target customer and synchronizing the second data to the processing node further comprises:
[0026] receiving a service processing request of the target customer;
[0027] the processing node responding to the service processing request of the target customer by using the first data and the second data.
[0028] In a second aspect, an embodiment of the present application provides a data synchronization device, comprising:
[0029] a request receiving module, configured to receive a login request of a target customer;
[0030] A node determining module is configured to determine a processing node corresponding to the target customer from a plurality of deployment nodes according to customer information of the target customer.
[0031] A first synchronization module is configured to acquire first data of the target customer and synchronize the first data to the processing node in response to a requirement of the processing node for data synchronization processing for the target customer.
[0032] A second synchronization module is configured to acquire second data of the target customer and synchronize the second data to the processing node in response to a system information synchronization condition of the processing node, wherein the processing node processes a service processing request of the target customer by using the first data and the second data.
[0033] Optionally, the method further comprises:
[0034] A synchronization determining module is configured to determine that the processing node requires data synchronization processing for the target customer in response to the processing node meeting any one of the following conditions:
[0035] The target customer logs in the processing node for the first time;
[0036] The processing node does not store service data of the target customer;
[0037] Service data of the target customer stored by the processing node has expired.
[0038] Optionally, the first synchronization module is specifically configured to:
[0039] Acquire synchronization parameters corresponding to the target customer;
[0040] Acquire the first data of the target customer from a central node according to the synchronization parameters.
[0041] Optionally, the first synchronization module is specifically configured to:
[0042] Receive a service processing request of the target customer and determine request parameters corresponding to the service processing request;
[0043] Acquire the first data of the target customer from a central node according to the request parameters.
[0044] Optionally, the first synchronization module is specifically configured to:
[0045] Acquire the first data of the target customer from a central node, wherein the first data comprises at least one of the following: a customer file of the target customer, a customer image, and service data in a statistical period.
[0046] In a third aspect, an electronic device is provided, comprising:
[0047] one or more processors;
[0048] a storage configured to store one or more programs,
[0049] When the one or more programs are executed by the one or more processors, the one or more processors implement the method of any of the above embodiments.
[0050] In a fourth aspect, a computer readable medium is provided, which stores a computer program. When the program is executed by a processor, the method of any of the above embodiments is implemented.
[0051] In a fifth aspect, a computer program product is provided, which comprises a computer program. When the program is executed by a processor, the method of any of the above embodiments is implemented.
[0052] One embodiment of the above application has the following advantages or beneficial effects: the login request of a client is distributed according to the information of the client, and the same node is responsible for processing the same client request. Therefore, the processing node does not need to forward the service data of the target client to other nodes, and the running pressure of the server and the database can be reduced.
[0053] In addition, the first data can be data with higher time requirement, and the second data can be data with lower time requirement. The first data is used to respond to the login request and the service processing request issued by the client in time, and the first data can be determined according to the synchronization parameter or the processing request issued by the client. The service data of the target client is divided into the first data and the second data, and the synchronization is performed in different time periods, which can reduce the pressure of the server and the database during the peak period, and improve the response speed of the system.
[0054] The further effects of the above non-conventional optional mode will be described in the following combined with the specific embodiments. BRIEF DESCRIPTION OF DRAWINGS
[0055] The accompanying drawings are used to better understand the application, and do not constitute an improper limitation on the application. Among them:
[0056] Figure 1 is a flowchart of a data synchronization method provided by the first embodiment of the application;
[0057] Figure 2 is a flowchart of a data synchronization method provided by the second embodiment of the application;
[0058] Figure 3 is a flowchart of a service fingerprint library construction method provided by the third embodiment of the application;
[0059] Figure 4 is a structural schematic diagram of a data synchronization device provided by an embodiment of the present application;
[0060] Figure 5 is a structural schematic diagram of a computer system of a terminal device or a server suitable for implementing an embodiment of the present application. DETAILED DESCRIPTION
[0061] Exemplary embodiments of the present application are described herein with reference to the accompanying drawings, which are meant to be exemplary and not limiting. Therefore, it should be recognized that many modifications and variations can be made to the embodiments described herein without departing from the spirit and scope of the application. Also, for the purpose of clarity and the brevity, the description below omits the description of well-known functions and structures.
[0062] It should be noted that in the technical solutions of the present application, the collection, analysis, use, transmission, storage, etc. of user personal information are in line with relevant laws and regulations, are used for legal and reasonable purposes, are not shared, disclosed or sold outside these legal uses, and are subject to supervision and management by regulatory authorities. Necessary measures should be taken to prevent illegal access to such personal information data, to ensure that personnel with access to personal information data comply with relevant laws and regulations, and to ensure the security of user personal information. Once these user personal information data are no longer needed, the risk should be minimized by limiting or even prohibiting data collection and / or deleting data.
[0063] Figure 1 is a flowchart of a data synchronization method provided by a first embodiment of the present application, as shown in Figure 1 The method comprises:
[0064] Step 101: receiving a login request of a target customer.
[0065] Step 102: determining a processing node corresponding to the target customer from a plurality of deployment nodes according to customer information of the target customer.
[0066] The target system responds to the login request and the business processing request of the customer through a plurality of deployment nodes. The login request and the business processing request of the same customer are processed by the processing node corresponding to the customer. The customer and the processing node corresponding to the customer are in a one-to-one correspondence. If the processing node has a problem, the request of the customer will be automatically distributed to other deployment nodes to realize system disaster recovery high availability. In the conversion from a single node to multiple nodes, the distribution of customer requests and the reading and writing of data are realized through software application, avoiding complex logic at the data storage level.
[0067] The processing node corresponding to the target customer can be determined in various ways. For example, the processing node corresponding to the target customer can be determined by taking the modulus of the customer identifier. The region to which the customer belongs can be determined, and the processing node corresponding to the target customer can be determined according to the region.
[0068] Step 103: In response to the processing node needing to perform data synchronization processing for the target customer, first data of the target customer is acquired, and the first data is synchronized to the processing node.
[0069] In the case where the processing node does not store the business data of the target customer or the stored business data of the target customer has expired, it is determined that the processing node needs to perform data synchronization processing for the target customer.
[0070] The business data of the target customer can be divided into first data and second data. The first data can be data with higher timeliness requirements, and the second data can be data with lower timeliness requirements. The second data can also be larger files, such as customer files and customer images of the target customer. The first data is used to respond to login requests and business processing requests issued by the customer in a timely manner. The first data can be determined according to synchronization parameters or processing requests issued by the customer.
[0071] In an embodiment of the present application, acquiring the first data of the target customer includes: acquiring synchronization parameters corresponding to the target customer; and acquiring the first data of the target customer from the original node according to the synchronization parameters.
[0072] The synchronization parameters can be set according to specific needs. For example, the synchronization parameters can include a business type. When the processing node needs to perform data synchronization processing for the target customer, the business data corresponding to the business type of the target customer is acquired from the center node, the original node, the original database, or the original system, and the acquired business data is taken as the first data.
[0073] For another example, the synchronization parameters can include a data synchronization deadline. When the processing node needs to perform data synchronization processing for the target customer, the business data of the target customer within the data synchronization deadline is acquired from the center node, the original node, the original database, or the original system, and the acquired business data is taken as the first data.
[0074] In an embodiment of the present application, acquiring the first data of the target customer includes: receiving a business processing request of the target customer and determining request parameters corresponding to the business processing request; and acquiring the first data of the target customer from the original node according to the request parameters.
[0075] According to the request parameters corresponding to the business processing request, the first data of the target customer is acquired from the center node, the original node, the original database or the original system, so that the first data is used to respond to the business processing request of the target customer in time, the system response speed is improved, and the waiting time of the customer is reduced.
[0076] In an embodiment of the present application, the first data of the target customer is acquired, including: acquiring the first data of the target customer from the center node, and the first data including at least one of the following: customer file of the target customer, customer image and business data in a statistical period. For the customer file, the customer image and the business data in the statistical period, the processing node can call the download service to download the above-mentioned file and data to the local of the processing node. In addition to the above-mentioned file and data, the first data corresponding to the target customer can be acquired and saved according to the synchronization parameters according to the business requirements.
[0077] Step 104: In response to the synchronization condition of the system information of the processing node, the second data of the target customer is acquired, and the second data is synchronized to the processing node.
[0078] The synchronization condition can be set according to specific requirements, such as the synchronization condition can include: the system time of the processing node reaches the end of the day time point; and / or, the system information of the processing node is greater than the resource threshold, and the system information includes at least one of the following: CPU idle rate, available memory and available space. At the end of the day time point or when the system of the processing node is idle, an asynchronous thread is started to acquire the second data of the customer from the master node, the original node or the original system, and the second data is synchronized to the processing node, so as to balance the running pressure of the processing node and improve the processing performance of the processing node.
[0079] After synchronizing the first data and the second data, the processing node can normally process the business processing request of the target customer by using the first data and the second data. The login request of the customer is distributed according to the customer information, and the same customer request is processed by the same node. Therefore, the processing node does not need to forward the business data of the target customer to other nodes, and the running pressure of the server and the database can be reduced.
[0080] In addition, the business data of the target customer is divided into the first data and the second data, and the synchronization is performed in different time periods, so as to reduce the pressure of the server and the database in the peak period, and improve the response speed of the system.
[0081] In addition, the scheme of the embodiment of the present application distributes and synchronizes the data of the customer from the software level, logically separates the database, and realizes the shunt of the request processing.
[0082] Figure 2 is a flow diagram of a data synchronization method provided by the second embodiment of the present application, as Figure 2As shown, the method comprises:
[0083] Step 201: receiving a login request of a target customer.
[0084] Step 202: determining a processing node corresponding to the target customer from a plurality of deployment nodes according to customer information of the target customer.
[0085] Step 203: determining that the processing node needs to perform data synchronization processing for the target customer in response to the processing node meeting a preset condition.
[0086] If the processing node meets the preset condition, it is determined that the processing node needs to perform data synchronization processing for the target customer. The preset condition can include that the target customer logs in the processing node for the first time, the processing node does not store business data of the target customer, the business data of the target customer stored in the processing node is expired, etc.
[0087] Step 204: in response to the processing node needing to perform data synchronization processing for the target customer, obtaining first data of the target customer and synchronizing the first data to the processing node.
[0088] The first data of the target customer can be obtained from the center node, the original system, the original node or the original database. The first data of the target customer is stored in the processing node. The first data can be data with higher time requirement, and the second data can be data with lower time requirement. The first data is used to respond to the login request and the business processing request issued by the customer in time, and the first data can be determined according to the synchronization parameter or the processing request issued by the customer.
[0089] Step 205: in response to the system information of the processing node meeting a synchronization condition, obtaining second data of the target customer and synchronizing the second data to the processing node.
[0090] An asynchronous thread can be started at the end of each day or when the system is idle to synchronize the second data of the target customer from the master node or the original node; a thread pool is set to read the target customer from a migration queue, the migration queue is used to save the customer identifier corresponding to the processing node which needs to be synchronized; the second data is determined according to the synchronization parameter, and the data of the target customer is imported from the master node or the original node to the processing node according to the table cross-database. Specifically, a number threshold is set, and a number threshold number of records of each table are imported each time. The number threshold can be 500, 1000, 1500, etc. If the number of records in the table exceeds the number threshold, the identifier of the last record of the last synchronization is recorded, and the next time the import is started from the next record of the last record, and all records are imported to the processing node.
[0091] In the embodiment of the present application, the preset condition corresponding to the processing node can be set according to the business requirement, so as to determine whether the processing node needs to perform the data synchronization processing for the target customer, to prevent the processing node from returning the error or expired information to the customer, and to avoid the incorrect business processing.
[0092] Figure 3 is a flow diagram of a data synchronization method provided by the third embodiment of the present application, as shown in Figure 3 The method comprises the following steps:
[0093] Step 301: receiving a login request of a target customer.
[0094] Step 302: determining a processing node corresponding to the target customer from a plurality of deployment nodes according to the customer information of the target customer.
[0095] Step 303: in response to the processing node needing to perform the data synchronization processing for the target customer, acquiring first data of the target customer and synchronizing the first data to the processing node.
[0096] Step 304: in response to the system information of the processing node being consistent with the synchronization condition, acquiring second data of the target customer and synchronizing the second data to the processing node.
[0097] Step 305: receiving a business processing request of the target customer.
[0098] Step 306: the processing node responding to the business processing request of the target customer by using the first data and the second data.
[0099] In the embodiment of the present application, after the first data and the second data of the target customer are synchronized to the processing node, the business processing request of the target customer is received, and the business processing request is distributed to the processing node, and the processing node responds to the business processing request of the target customer by using the first data and the second data. Since the business processing request of the target customer is processed by the processing node, the processing node does not need to forward the related data of the target customer to other deployment nodes, and the complex logic of the data synchronization between the nodes is avoided.
[0100] The business data stored in the processing node can be backed up in the master node in a timely manner. When the processing node fails, the business processing request of the target customer is forwarded to other nodes, and the other nodes can respond to the business processing request of the target customer in a timely and effective manner based on the backup business data of the target customer in the master node.
[0101] The embodiment of the present application provides a kind of multi-node multi-live software application scheme, logical database is respectively deployed on multiple nodes, form multiple channels, multiple nodes simultaneously provide service to outside.Can be modulated to customer identification, same customer request is distributed to same channel processing.From single node to the conversion of multiple nodes, the distribution of customer request and the reading and writing of data are implemented by software application, avoid the complex logic in data storage level, it has certain practicality for the implementation of system multi-live deployment.
[0102] Figure 4 It is an embodiment of the present application to provide a kind of data's synchronous device structure schematic diagram, as shown in Figure 4 The device includes:
[0103] Request receiving module 401 is used to receive the login request of target customer;
[0104] Node determination module 402 is used to determine the processing node corresponding to target customer from multiple deployment nodes according to the customer information of target customer;
[0105] First synchronization module 403 is used to obtain the first data of target customer and synchronize the first data to processing node in response to the data synchronization processing of target customer required by processing node;
[0106] Second synchronization module 404 is used to obtain the second data of target customer and synchronize the second data to processing node in response to the system information of processing node synchronization condition;Wherein, processing node uses first data and second data to process the business processing request of target customer.
[0107] Optionally, it further includes:
[0108] Synchronization determination module 405 is used to determine that processing node needs to carry out the data synchronization processing of target customer in response to processing node meeting any one of the following conditions:
[0109] Target customer first logs in processing node;
[0110] Processing node does not store the business data of target customer;
[0111] The business data of target customer stored by processing node has expired.
[0112] Optionally, first synchronization module 403 is specifically used for:
[0113] Obtain the synchronization parameter corresponding to target customer;
[0114] According to synchronization parameter, obtain the first data of target customer from center node.
[0115] Optionally, first synchronization module 403 is specifically used for:
[0116] receive a service processing request of a target customer, and determine a request parameter corresponding to the service processing request;
[0117] obtain first data of the target customer from the central node according to the request parameter.
[0118] Optionally, the first synchronization module 403 is specifically configured to:
[0119] obtain the first data of the target customer from the central node, and the first data comprises at least one of the following: a customer file of the target customer, a customer image, and service data in a statistical period.
[0120] Optionally, the synchronization condition comprises:
[0121] a system time of the processing node reaches a daily terminal time point;
[0122] and / or, system information of the processing node is greater than a resource threshold, and the system information comprises at least one of the following: a CPU idle rate, available memory, and available space.
[0123] Optionally, the method further comprises:
[0124] the request response module 406 is configured to receive the service processing request of the target customer;
[0125] the processing node responds to the service processing request of the target customer by using the first data and the second data.
[0126] An embodiment of the present application provides an electronic device, comprising:
[0127] one or more processors;
[0128] a storage device configured to store one or more programs,
[0129] When the one or more programs are executed by the one or more processors, the one or more processors implement the method of any one of the above embodiments.
[0130] An embodiment of the present application provides a computer program product comprising a computer program, which, when executed by a processor, implements the enterprise risk assessment method in the embodiments of the present application.
[0131] Reference is made below to Figure 5 which shows a structural schematic diagram of a computer system 500 of a terminal device suitable for being used to implement the embodiments of the present application. Figure 5 The terminal device shown is merely an example, and should not bring any limitation to the functions and use range of the embodiments of the present application.
[0132] As Figure 5As shown, the computer system 500 includes a central processing unit (CPU) 501 which can perform various appropriate actions and processes in accordance with programs stored in a read only memory (ROM) 502 or loaded from a storage section 508 into a random access memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the system 500 are also stored. The CPU 501, the ROM 502, and the RAM 503 are connected to each other through a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.
[0133] Connected to the I / O interface 505 are an input section 506 including a keyboard, a mouse, etc.; an output section 507 including a display device such as 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 necessary. A removable recording medium 511 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc. is attached to the drive 510 as necessary, so that a computer program read therefrom is installed into the storage section 508 as necessary.
[0134] In particular, the processes described above with reference to the flowcharts can be implemented as a computer software program in accordance with the embodiments disclosed herein. For example, the embodiments disclosed herein include a computer program product comprising a computer program carried on a computer readable medium, the computer program comprising program code for performing the methods illustrated by the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via the communication section 509 and / or installed from the removable recording medium 511. When the computer program is executed by the central processing unit (CPU) 501, the above-described functions defined in the system of the present application are performed.
[0135] It should be noted that the computer-readable medium shown in the present application can 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, for example, but is not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or component, or any combination of the above. More specific examples of computer-readable storage media can include, but are not limited to, an electrical connection having one or more wires, a portable computer diskette, 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 application, the computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, device or component. In the present application, the computer-readable signal medium can include a data signal carried in a baseband or as a part of a carrier wave, which carries computer-readable program code. Such a propagated data signal can take various forms, including but not limited to an electromagnetic signal, an optical signal or any suitable combination of the above. The computer-readable signal medium can also be any computer-readable medium other than the computer-readable storage medium, which can send, propagate or transmit a program for use by or in conjunction with an instruction execution system, device or component. The program code contained on the computer-readable medium can be transmitted by any suitable medium, including but not limited to wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0136] The flowcharts and block diagrams in the drawings illustrate the possible implementation architectures, functions and operations of the systems, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowcharts or block diagrams can represent a module, a program segment, or a portion of code that contains one or more executable instructions for implementing the specified logical functions. It should also be noted that in some alternative implementations, the functions noted in the blocks can occur in different orders than that shown in the figures. For example, two blocks that are shown in succession can actually be executed substantially concurrently, or they can sometimes be executed in reverse order, depending on the functionality involved. It should also be noted that each block in the block diagrams or flowcharts, and combinations of blocks in the block diagrams or flowcharts, can be implemented by a dedicated hardware-based system that performs specified functions or operations, or can be implemented by a combination of special-purpose hardware and computer instructions.
[0137] The modules described in the embodiments of the present application can be implemented in the form of software or hardware. The modules described can be arranged in a processor, for example, can be described as a request receiving module, a node determining module, a first synchronization module and a second synchronization module. In some cases, the names of these modules do not constitute a limitation on the modules themselves, for example, the request receiving module can also be described as a module that receives a login request of a target customer.
[0138] As another aspect, the present application also provides a computer readable medium, which can be included in the device described in the above embodiments, or can exist independently without being assembled into the device. The computer readable medium carries one or more programs, which, when executed by the device, cause the device to include:
[0139] receiving a login request of a target customer;
[0140] determining a processing node corresponding to the target customer from a plurality of deployment nodes according to customer information of the target customer;
[0141] in response to the processing node needing to perform data synchronization processing for the target customer, obtaining first data of the target customer and synchronizing the first data to the processing node;
[0142] in response to the system information of the processing node meeting a synchronization condition, obtaining second data of the target customer and synchronizing the second data to the processing node; wherein the processing node processes a service processing request of the target customer by using the first data and the second data.
[0143] According to the technical solution of the embodiments of the present application, the login request of the customer is distributed according to the customer information, and the same node processes the same customer request. Therefore, the processing node does not need to forward the service data of the target customer to other nodes, and the running pressure of the server and the database can be reduced.
[0144] In addition, the first data can be data with higher timeliness requirement, and the second data can be data with lower timeliness requirement. The first data is used to respond to the login request and the service processing request issued by the customer in time, and the first data can be determined according to the synchronization parameter or the processing request issued by the customer. Splitting the service data of the target customer into the first data and the second data and synchronizing them at different time periods can reduce the pressure of the server and the database during peak periods and improve the response speed of the system.
[0145] The foregoing detailed description has set forth various embodiments of the devices and / or processes via the use of specific terminology. However, embodiments thereof can be practiced with the exact description not being presented in detail. The term "device" should be understood to encompass devices operating in various modes, such as active mode, sleep mode, hibernate mode, and the like. The terms "coupled" and "connected," along with derivatives thereof, can be used. It should be understood that these terms are not intended as synonyms for each other. Rather, particular circuitry that can be said to be coupled to, or connected with, other circuitry can be some of the other circuitry that can communicate in some way, while other circuitry can be some of the other circuitry that can not be in communication with that particular circuitry.
Claims
1. A method of synchronizing data, characterized by, The method comprises: receiving a login request of a target customer; determining a processing node corresponding to the target customer from a plurality of deployment nodes according to customer information of the target customer, so that the login request and service processing request of the target customer are processed by the processing node; in response to the processing node needing to perform data synchronization processing for the target customer, splitting service data of the target customer into first data and second data according to time requirement, obtaining the first data of the target customer, and synchronizing the first data to the processing node; wherein, a larger file in the service data is taken as the second data, and service data for responding to the login request and service processing request sent by the customer in time is taken as the first data; in response to a system information synchronization condition of the processing node, obtaining the second data of the target customer and synchronizing the second data to the processing node, comprising: setting a thread pool, reading the target customer from a migration queue, and the migration queue is used to save the customer identifier corresponding to the processing node needing to be synchronized; determining the second data according to a synchronization parameter, and importing the data of the target customer from the master node or the original node into the processing node according to the table cross-database; wherein, the processing node processes the service processing request of the target customer by using the first data and the second data; the synchronization parameter comprises a business type and a data synchronization period, and when the processing node needs to perform data synchronization processing for the target customer, the business data corresponding to the business type of the target customer within the data synchronization period is obtained from the center node, the original node, the original database or the original system, and the obtained business data is taken as the first data.
2. The method of claim 1, wherein, Before the response to the processing node needing to perform data synchronization processing for the target customer, the method further comprises: in response to the processing node meeting any one of the following conditions, determining that the processing node needs to perform data synchronization processing for the target customer: the target customer logs in the processing node for the first time; the processing node does not store the service data of the target customer; the service data of the target customer stored in the processing node has expired.
3. The method of claim 1, wherein, The method further comprises: obtaining the first data of the target customer from the center node according to the synchronization parameter. The method further comprises:
4. The method of claim 1, wherein, receiving the service processing request of the target customer and determining the request parameter corresponding to the service processing request; obtaining the first data of the target customer from the center node according to the request parameter. The method further comprises:
5. The method of claim 1, wherein, obtaining the first data of the target customer from the center node, and the first data comprises at least one of the following: customer file, customer image and service data in a statistical period of the target customer. The synchronization condition comprises:
6. The method of claim 1, wherein, the system time of the processing node reaches the end of day time point; and / or, the system information of the processing node is greater than the resource threshold, and the system information comprises at least one of the following: CPU idle rate, available memory and available space. 7. The method of claim 1, wherein, The method further comprises: receiving a service processing request of the target customer; the processing node uses the first data and the second data to respond to the service processing request of the target customer.
8. A data synchronization apparatus, characterized by comprising: The method further comprises: receiving a login request of a target customer; a node determination module is configured to determine a processing node corresponding to the target customer from a plurality of deployment nodes according to customer information of the target customer, so that the login request and the service processing request of the target customer are processed by the processing node; a first synchronization module is configured to, in response to a requirement of the processing node for data synchronization processing for the target customer, split service data of the target customer into first data and second data according to time effectiveness requirements, acquire the first data of the target customer, and synchronize the first data to the processing node; wherein, larger files in the service data are taken as the second data, and service data for responding to login requests and service processing requests sent by the customer in a timely manner are taken as the first data; when the processing node requires data synchronization processing for the target customer, a synchronization parameter corresponding to the target customer is acquired, the synchronization parameter comprises a service type and a data synchronization deadline, service data of the target customer corresponding to the service type within the data synchronization deadline is acquired from a center node, an original node, an original database, or an original system, and the acquired service data is taken as the first data; a second synchronization module is configured to, in response to a system information symbol synchronization condition of the processing node, acquire second data of the target customer, and synchronize the second data to the processing node, comprising: setting a thread pool, reading the target customer from a migration queue, and determining the second data according to a synchronization parameter; the data of the target customer is imported from a master node or an original node into the processing node according to a table and a library; the synchronization parameter comprises a service type and a data synchronization deadline; wherein, the processing node uses the first data and the second data to process the service processing request of the target customer.
9. The apparatus of claim 8, wherein, The method further comprises: a synchronization determination module is configured to determine that the processing node requires data synchronization processing for the target customer in response to any one of the following conditions being met: the target customer logs in the processing node for the first time; the processing node does not store service data of the target customer; service data of the target customer stored in the processing node has expired.
10. The apparatus of claim 8, wherein, The first synchronization module is specifically configured to: receive a service processing request of the target customer, and determine a request parameter corresponding to the service processing request; acquire the first data of the target customer from the center node according to the request parameter.
11. The apparatus of claim 8, wherein, The first synchronization module is specifically configured to: acquire the first data of the target customer from the center node, the first data comprising at least one of the following: a customer file of the target customer, a customer image, and service data within a statistical period.
12. An electronic device, comprising: The method further comprises: one or more processors; a storage device for storing one or more programs, when the one or more programs are executed by the one or more processors, cause the one or more processors to carry out the method of any one of claims 1-7.
13. A computer readable medium having stored thereon a computer program, characterized in that when the program is executed by the processor, the program causes the processor to carry out the method of any one of claims 1-7.
14. A computer program product comprising a computer program, characterized in that, when the program is executed by the processor, the program causes the processor to carry out the method of any one of claims 1-7. when the program is executed by the processor, the program causes the processor to carry out the method of any one of claims 1-7.
Citation Information
Patent Citations
Cluster system and service processing method thereof
CN102148850A
Data synchronization method, apparatus, computer device, and storage medium
CN109271447A
Data processing method and device and storage medium
CN113157207A
Data synchronization method and device, server and storage medium
CN113901076A