A node-service-based data synchronization method and related device

By deploying node services across multi-node systems and utilizing decryption, logic processing, and encryption assembly modules, the security and complexity issues in data synchronization are resolved, enabling efficient, secure, and flexible data transmission. This adapts to the synchronization needs of heterogeneous databases and improves system performance and reliability.

CN120750951BActive Publication Date: 2025-11-18NINGBO PORT INFORMATION COMM CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202511254785.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-09-04
Publication Date
2025-11-18
Estimated Expiration
2045-09-04

AI Technical Summary

Technical Problem

Existing technologies for data synchronization between multi-node application systems suffer from security risks, high complexity, network latency, bandwidth limitations, difficulty in maintaining data consistency, excessive consumption of computing resources, and insufficient synchronization frequency and quality control, especially when synchronizing between heterogeneous databases.

Method used

A node-based data synchronization method is adopted, which deploys node services on each system and uses parameter configuration tables, data transceiver layers and service layers for data transmission, including decryption modules, logic processing modules and encryption assembly modules, to achieve secure and flexible data transmission.

Benefits of technology

It optimizes network resource utilization, reduces operation and maintenance costs, improves system stability and reliability, ensures data transmission security and consistency, enhances system performance and response speed, and adapts to the synchronization needs of different database platforms.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120750951B_ABST
    Figure CN120750951B_ABST
Patent Text Reader

Abstract

The application discloses a kind of data synchronization method based on node service and related equipment, it is related to data synchronization field;The method of the application deploys node service on each system, executes decryption operation to the message received by decryption module in node service, whether meeting forwarding condition is identified by logic processing module using node meta information table and to-be-processed content, this intelligent forwarding condition discrimination mechanism avoids unnecessary data transmission, and optimizes the use of network resources;And when meeting forwarding condition, receiving party information is determined based on to-be-processed content using association configuration table and / or message receiving address configuration table, that is, the application flexibly adjusts receiving party information according to specific application scenario, to ensure that each node can receive correct message;In addition, the integration process between different systems is simplified by unified node service architecture and detailed configuration table. In summary, the application realizes efficient, safe and flexible data synchronization method.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data synchronization, and more particularly to a data synchronization method and related equipment based on node services. Background Technology

[0002] In existing technologies, achieving real-time synchronization of business information across multi-node application systems typically relies on message middleware (such as ActiveMQ, RabbitMQ, and Kafka). While these middleware solutions offer advantages like rapid deployment, mature and stable technology stacks, and professional support, they also present significant technical challenges. First, third-party message middleware poses security risks; the need to trust service providers to protect data security and privacy can lead to potential data breaches. Second, dependence on external services increases system complexity and can affect the continuity of data synchronization in the event of middleware failure. Furthermore, network latency and bandwidth limitations also affect synchronization speed, while integration difficulties and customization requirements further increase implementation costs and technical challenges.

[0003] On the other hand, handling data synchronization between heterogeneous databases also presents a series of technical challenges. Different types of databases (such as relational databases and NoSQL databases) differ in their data models, platforms, and vendor implementations, which increases the complexity of cross-database synchronization. Although heterogeneous database synchronization offers advantages such as data integration, flexibility, and scalability, maintaining data consistency is particularly difficult in practice, especially when transactions span multiple databases. Furthermore, the data synchronization process itself requires additional computing resources, which may lead to performance bottlenecks. Meanwhile, low synchronization frequency and insufficient data quality control are also common problems, especially since data loss or format conversion errors may occur during transmission, posing a threat to data integrity and security. Therefore, a new solution is needed to overcome these technical obstacles and ensure efficient, secure, and flexible data synchronization. Summary of the Invention

[0004] To address the aforementioned technical problems, this invention proposes a data synchronization method based on node services, applicable to a multi-system platform. The multi-system platform includes a master system and one or more slave systems. Each system has node services deployed, wherein the node services deployed on the master system are master nodes, and the node services deployed on the slave systems are slave nodes. The node services include a parameter configuration table, a data transceiver layer, and a service layer.

[0005] The parameter configuration table is created in the database of the corresponding system; the parameter configuration table includes: a node metadata table, a node service and system association table, a message push rule configuration table, a message receiving address configuration table, and a password book configuration table; the data transceiver layer includes a receiver and a repeater; the service layer includes a decryption module, a logic processing module, and an encryption assembly module; the data synchronization method includes:

[0006] The receiver receives messages from other node services and corresponding system backend business data.

[0007] The decryption module uses the password configuration table of the corresponding node service to perform decryption operations on the messages received by the receiver from other node services.

[0008] The logic processing module uses its corresponding node metadata table and the content to be processed to identify whether the content meets the forwarding conditions. If it does, it uses the associated configuration table and / or message receiving address configuration table to determine the recipient information based on the content to be processed, and constructs the message to be encrypted based on the recipient information and the content to be processed. The associated configuration table includes a message push rule configuration table and a node service and system association table.

[0009] The encryption assembly module uses the codebook configuration table to encrypt and assemble the message to be encrypted to obtain the target message; the target message is then forwarded to the target node service by the repeater.

[0010] The content to be processed is business data from the system backend or decrypted message data.

[0011] Furthermore, the node metadata table includes: the node code corresponding to the node service, the node name, the node type, the system code of the system to which it belongs, and an identifier indicating whether it is a master node;

[0012] The fields of the message push rule configuration table include: message type, the node type of the sender and the node type of the receiver under each message type, and the corresponding forwarding rules;

[0013] The fields in the message receiving address configuration table include: the receiver's node name, receiving address, node type, and the system code of the system to which it belongs;

[0014] The fields of the password configuration table include: encryption method and its corresponding key index, public key and private key; the fields of the node service and system association table include: node code and its corresponding node type, node name and system code.

[0015] Furthermore, the forwarding rules include:

[0016] First forwarding rule: Send the message to all node services under the corresponding receiver node type;

[0017] The second forwarding rule is to send the message to all node services under the corresponding receiver node type, excluding the sender.

[0018] Furthermore, the step of using the corresponding node metadata table and the content to be processed by the logic processing module to identify whether the content meets the forwarding conditions specifically involves:

[0019] When the content to be processed is business data from the system backend, based on the preset correspondence between message type and forwarding object, the business data is used to determine whether the business data meets the forwarding conditions; the forwarding object includes two states: local and master node.

[0020] When the current node is identified as the master node through the node metadata table, and the content to be processed is decrypted message data, it is determined whether the message meets the forwarding conditions based on the content of the message data.

[0021] Furthermore, when the content to be processed is business data from the system backend, based on the preset correspondence between message type and forwarding object, the system determines whether the business data meets the forwarding conditions using the message type corresponding to the business data. Specifically:

[0022] By using the message type of the business data and the preset correspondence between message type and forwarding object, the forwarding object corresponding to the business data is obtained. When the forwarding object is local, the forwarding condition is not met, and the local business processing logic is triggered. When the forwarding object is the master node, it is determined whether the current node service is the master node. If not, it is determined that the business data meets the forwarding condition. If so, the forwarding condition is not met, and the local business processing logic is triggered.

[0023] Furthermore, the step of determining the recipient information based on the content to be processed using an association configuration table and / or a message receiving address configuration table specifically involves:

[0024] When the current node service is a slave node and the content to be processed is business data from the system backend, the field content of the target recipient corresponding to the business data is set based on the preset correspondence between message type and target recipient; the field content is either empty or the target node name, i.e., the node name served by the target node; the recipient information is determined based on the field content of the target recipient and the row information corresponding to the master node in the message receiving address configuration table.

[0025] When the current node is the master node and the content to be processed is business data from the system backend, the recipient information is determined by the association configuration table and the message receiving address configuration table.

[0026] When the current node is the master node and the content to be processed is decrypted message data, determine whether the target recipient field in the message data is empty. If not, obtain the corresponding recipient information from the message receiving address configuration table based on the field content. If yes, determine the recipient information by associating the configuration table and the message receiving address configuration table.

[0027] Furthermore, the determination of the receiver information through the association configuration table and the message receiving address configuration table specifically involves:

[0028] Based on the message type corresponding to the content to be processed, obtain the node type of the receiver and the corresponding forwarding rules from the message push rule configuration table;

[0029] Based on the obtained node type and forwarding rules, retrieve the included node names from the node service and system association table;

[0030] The corresponding receiver information is obtained from the message receiving address configuration table by acquiring the node name;

[0031] Each obtained node name has a unique corresponding recipient information.

[0032] Furthermore, the recipient information includes: the field content of the receiving address and the target recipient; the encryption methods in the password book configuration table include at least two.

[0033] Furthermore, when the current node is the master node and the content to be processed is decrypted message data, if the field content of the target receiver is not empty, then the receiving address in the receiver information is the receiving address corresponding to the target receiver.

[0034] Furthermore, the step of using the codebook configuration table to encrypt and assemble the message to be encrypted into the target message specifically involves:

[0035] Obtain the first public key and its corresponding first key index, the second public key and its corresponding second key index through the cryptographic book configuration table;

[0036] The message header and message body are constructed by combining the content to be processed and the recipient information, and the message header and message body are encapsulated in JSON format to obtain the message structure.

[0037] The above JSON-formatted message structure is encrypted using the first public key.

[0038] The encrypted message structure is stored in the HTTP request body to obtain the encrypted request body;

[0039] The request structure is obtained by assembling the receiver information and the first key index;

[0040] The request ciphertext is obtained by encrypting the request structure using the second public key.

[0041] The request ciphertext, request ID, and second key index are assembled into an encrypted request header;

[0042] The encryption request body and encryption request header are assembled into a target message; the target message corresponds one-to-one with the recipient information.

[0043] Furthermore, the message header includes: message type, sender's node name, and target receiver's field content; the request structure includes: receiver address, timestamp, receiver's system code, and first key index.

[0044] Further, the step of obtaining the first public key and its corresponding first key index, the second public key and its corresponding second key index through the cryptographic configuration table is specifically as follows:

[0045] Two encryption methods are randomly obtained from the password configuration table, and one is set as the first encryption method and the other as the second encryption method. The key index and public key of the first encryption method are set as the first public key and the first key index. The key index and public key of the second encryption method are set as the second public key and the second key index.

[0046] Furthermore, the step of randomly obtaining two encryption methods from the password configuration table, and setting one as the first encryption method and the other as the second encryption method; specifically:

[0047] Perform a random sorting of the data rows in the password book configuration table;

[0048] The encryption method corresponding to the first data row in the sorted table is used as the first encryption method;

[0049] From the sorted table, select the next data row with a different encryption method as the second encryption method.

[0050] Furthermore, when the current node is identified as the master node through the node metadata table and the content to be processed is decrypted message data, the forwarding condition is determined based on the content of the message data. Specifically, it is determined whether the target recipient field in the decrypted message data is the name of the node served by the current node. If so, it indicates that the forwarding condition is not met, and the local business processing logic is triggered; otherwise, it is determined that the message meets the forwarding condition.

[0051] Furthermore, the step of using the decryption module to perform decryption operations on messages received by the receiver from other node services using the corresponding node service's password book configuration table specifically involves:

[0052] Obtain the second key index from the encryption request header of the message;

[0053] The corresponding private key is obtained from the password book configuration table of the current node service using the second key index. The private key is then used to decrypt the ciphertext in the encryption request header to obtain the first key index.

[0054] The corresponding private key is obtained from the password book configuration table of the current node service using the first key index. The encrypted request body of the message is then decrypted using the private key to obtain the JSON format message body and message header.

[0055] Furthermore, the parameter configuration table also includes: a mapping relationship table;

[0056] The mapping table is used to record the data table corresponding to each message type;

[0057] The logic processing module is also used to pre-set a data structure model for each data table in the corresponding system database; the data structure model is constructed based on the definition of the corresponding data table, and it contains all fields of the corresponding data table and their corresponding data type information.

[0058] Furthermore, the node service also includes an adaptation layer, which is used for:

[0059] Parse the decrypted JSON format message body and header;

[0060] By analyzing the message type in the parsed message header, the corresponding data table is determined in the mapping table, and the data structure model corresponding to the data table is obtained as the target model.

[0061] The parsed data undergoes data type conversion and field mapping, and the converted data is then populated into the target model based on the field mapping results.

[0062] Based on the constructed data structure model, the database driver of the system database corresponding to the current node service is called to complete the data writing.

[0063] Furthermore, the data type conversion means converting the parsed message body data into a data type and format that conforms to the data table defined in the corresponding data table of the system database of the current node service;

[0064] The field mapping refers to mapping the fields in the parsed message body to the fields in the corresponding data table in the system database of the current node service.

[0065] To address the aforementioned technical problems, embodiments of the present invention also provide an electronic device, including: a processor and a memory storing a program, the program including instructions that, when executed by the processor, cause the processor to perform the method described above.

[0066] To address the aforementioned technical problems, embodiments of the present invention also provide a non-transitory machine-readable medium storing computer instructions for causing the computer to perform the methods described above.

[0067] Compared with the prior art, the present invention has at least the following beneficial effects:

[0068] (1) This invention deploys node services on each system. The decryption module in the node service performs decryption operations on the received messages. The logic processing module uses the node metadata table and the content to be processed to identify whether the forwarding conditions are met. This intelligent forwarding condition discrimination mechanism avoids unnecessary data transmission and optimizes the use of network resources. When the forwarding conditions are met, the receiver information is determined based on the content to be processed using the association configuration table and / or the message receiving address configuration table. That is, this invention flexibly adjusts the receiver information according to the specific application scenario to ensure that each node can receive the correct message. In addition, the unified node service architecture and detailed configuration table simplify the integration process between different systems, reduce operation and maintenance costs, and enhance the stability and reliability of the system. In summary, this invention realizes an efficient, secure and flexible data synchronization method, significantly improves the performance and reliability of the system, and avoids the use of third-party message middleware.

[0069] (2) In this invention, when the content to be processed is business data from the system backend, based on the preset correspondence between message type and forwarding object, the logic processing module can accurately determine whether the business data needs to be forwarded: by obtaining the corresponding forwarding object through the message type of the business data, if the forwarding object is local, the forwarding condition is not met, and the local business processing logic is triggered; if the forwarding object is the master node, if the current node is not the master node, the business data is determined to meet the forwarding condition and forwarded, otherwise the local business processing logic is triggered. In addition, when the content to be processed is decrypted message data and the current node serves the master node, the logic processing module can directly determine whether the forwarding condition is met based on the content in the message data, ensuring that only data that meets the condition will be further processed and forwarded. This intelligent forwarding condition discrimination mechanism avoids unnecessary data transmission, optimizes the use of network resources, and improves the overall performance and response speed of the system.

[0070] (3) When the current node serves as a slave node and the content to be processed is business data from the system backend, this invention sets the field content of the target recipient corresponding to the business data based on the preset correspondence between message type and target recipient, and determines the recipient information by combining the row information of the master node in the message receiving address configuration table, ensuring that the data can be accurately sent to the correct node. When the current node serves as a master node and the content to be processed is business data from the system backend, the recipient information is determined by the association configuration table and the message receiving address configuration table, so that the data can be accurately distributed according to the forwarding rules. In addition, when the current node serves as a master node and the content to be processed is decrypted message data, if the field content of the target recipient in the message data is not empty, the corresponding recipient information is directly obtained from the message receiving address configuration table based on the field content; if the field content is empty, the recipient information is determined by combining the association configuration table and the message receiving address configuration table. This mechanism flexibly adjusts the recipient information according to the specific application scenario, ensuring that each node can receive the correct message and avoiding unnecessary duplicate transmission.

[0071] (4) This invention significantly improves the security and integrity of data transmission by employing a layered encryption and key cross-use mechanism. Specifically, during the encryption assembly process, the first public key is used to encrypt the JSON format message structure consisting of the message header and message body, and the encryption result is encapsulated in the HTTP request body to form an encrypted request body. At the same time, the first key index and the recipient information are assembled into a request structure, and the second public key is used to encrypt the structure to form an encrypted request header, which contains the key index information used to decrypt the request body. By placing the key index used to decrypt the request body in the encrypted request header, the decryption information and data content are separated, and different encryption methods are used to encrypt the request body and request header separately, forming a dual protection mechanism. This key cross-placement encryption method not only enhances the security of data transmission and prevents the key information from being directly exposed, but also ensures that the recipient can decrypt the data in the correct key order, thereby improving the security level of the system and the reliability of data processing.

[0072] (5) This invention effectively solves the technical problems of data model differences, field inconsistencies, and type conversion difficulties faced in data synchronization between heterogeneous databases by introducing a mapping relationship table and pre-setting a corresponding data structure model for each data table. After receiving the decrypted JSON format message, the adaptation layer first finds the corresponding data table in the mapping relationship table according to the message type and obtains the pre-set data structure model of the data table. Subsequently, the adaptation layer performs data type conversion and field mapping on the parsed data, and fills the converted data into the target model based on the field mapping result, and finally completes the data writing through the database driver. This mechanism realizes automatic adaptation and standardization of heterogeneous database structures, ensures the consistency and integrity of data when synchronizing between different database platforms, avoids data loss or errors caused by data format mismatch, and improves the stability and reliability of the synchronization process. At the same time, through the pre-setting of the data structure model and the automatic mapping processing of the adaptation layer, the system's dependence on specific database platforms is reduced, the flexibility and scalability of data synchronization are improved, and the needs for efficient, secure, and flexible data synchronization in a multi-system environment are met. Attached Figure Description

[0073] Figure 1 This is a flowchart of a data synchronization method based on node services according to an embodiment of the present invention;

[0074] Figure 2 This is a flowchart illustrating the encrypted assembly process according to an embodiment of the present invention;

[0075] Figure 3 This is a flowchart illustrating the decryption operation in an embodiment of the present invention.

[0076] Figure 4 This is a schematic diagram of the structure of an electronic device according to an embodiment of the present invention. Detailed Implementation

[0077] The following are specific embodiments of the present invention, which are described in conjunction with the accompanying drawings. However, the present invention is not limited to these embodiments.

[0078] Given the security risks associated with using third-party messaging middleware, its increased complexity to the system architecture, and the potential impact on the continuity and stability of data synchronization in the event of middleware failure, a solution is needed to address these technical issues and enable efficient, secure, and flexible data synchronization between systems without relying on third-party messaging middleware. Figure 1 As shown, this invention proposes a data synchronization method based on node services, applicable to multiple system platforms;

[0079] The multi-system platform includes: a master system and one or more slave systems; each system has node services deployed, wherein the node services deployed on the master system are master nodes and the node services deployed on the slave systems are slave nodes;

[0080] This invention deploys independent node services in each participating system. These node services include a parameter configuration table, a data transceiver layer, and a service layer, without relying on any third-party message middleware. The data transceiver layer communicates with other node services via the HTTP protocol, forming a data synchronization channel based on the receiver, i.e., the API interface.

[0081] This architecture design avoids the software licensing fees, resource consumption, and operational complexity associated with introducing external middleware, thus reducing the overall system cost. Simultaneously, because the data transmission paths between systems are clearly defined, troubleshooting does not rely on middleware logs or additional monitoring tools, significantly improving the efficiency of problem location and resolution. Furthermore, this independent deployment mode offers excellent scalability, facilitating the integration of new functional modules or the replacement of existing components, supporting continuous system evolution and technological iteration, and enhancing the overall architecture's flexibility and adaptability. Specifically:

[0082] The parameter configuration table is created in the database of the corresponding system; the parameter configuration table includes: node metadata table, node service and system association table, message push rule configuration table, message receiving address configuration table and password book configuration table; the data transceiver layer includes receiver and repeater; the service layer includes decryption module, logic processing module and encryption assembly module;

[0083] The node metadata table includes: the node code corresponding to the node service, the node name, the node type, the system code of the system to which it belongs, and an identifier indicating whether it is a master node;

[0084] The fields of the message push rule configuration table include: message type, the node type of the sender and the node type of the receiver under each message type, and the corresponding forwarding rules;

[0085] The forwarding rules include:

[0086] First forwarding rule: Send the message to all node services under the corresponding receiver node type;

[0087] The second forwarding rule is to send the message to all node services under the corresponding receiver node type, excluding the sender.

[0088] This invention allows users to configure message data push rules between system nodes according to specific needs. The push rule configuration table contains detailed forwarding rule settings, such as message type, sender node type, receiver node type, and their corresponding forwarding strategies (e.g., sending messages to nodes of all receiver node types or all nodes except the sender). Through this configuration table, users can flexibly set message transmission paths and target node services for different business scenarios.

[0089] The fields in the message receiving address configuration table include: the receiver's node name, receiving address, node type, and the system code of the system to which it belongs;

[0090] The fields in the password configuration table include: encryption method and its corresponding key index, public key and private key;

[0091] The encryption methods in the password configuration table include at least two.

[0092] The fields in the node service and system association table include: node code and its corresponding node type, node name, and system code.

[0093] The data synchronization method includes:

[0094] The receiver receives messages from other node services and corresponding system backend business data.

[0095] The decryption module uses the corresponding node service's password configuration table to perform decryption operations on messages received by the receiver from other node services; for example... Figure 3 As shown, the decryption operation specifically includes:

[0096] Obtain the second key index from the encryption request header of the message;

[0097] The corresponding private key is obtained from the password book configuration table of the current node service using the second key index. The private key is then used to decrypt the ciphertext in the encryption request header to obtain the first key index.

[0098] The corresponding private key is obtained from the password book configuration table of the current node service using the first key index. The encrypted request body of the message is then decrypted using the private key to obtain the JSON format message body and message header.

[0099] In this embodiment, after completing the decryption operation, the logic processing module will also perform double verification to ensure data integrity and security. The double verification steps are as follows:

[0100] 1. System code verification of sender information: effectively prevents identity fraud.

[0101] 1.1 Extract the sender's system code from the request ID (reqId).

[0102] 1.2. Based on the sender's node name in the decrypted message header, extract the corresponding system code from the node service and system association table.

[0103] 1.3. Compare whether the system code extracted in step 1.1 and step 1.2 is consistent. If they are consistent and the system code exists in the predefined list of valid system codes, then the verification is successful.

[0104] 2. Request path verification: Prevents requests from being redirected or tampered with.

[0105] Request path validation verifies whether the request path matches the actual address of the currently processed request, ensuring the request's legitimacy. The specific steps are as follows:

[0106] 2.1 Extract the receiving address, i.e., the request path, from the decrypted request structure.

[0107] 2.2 Compare the extracted request path with the actual address of the current request being processed. If they match, the request is considered valid; otherwise, the request is rejected.

[0108] Data will only be written after the above double verification, thus effectively ensuring the authenticity of the data source and the legitimacy of the request.

[0109] The logic processing module uses its corresponding node metadata table and the content to be processed to identify whether the content meets the forwarding conditions. If it does, it uses the associated configuration table and / or message receiving address configuration table to determine the recipient information based on the content to be processed, and constructs the message to be encrypted based on the recipient information and the content to be processed. The associated configuration table includes a message push rule configuration table and a node service and system association table.

[0110] The content to be processed is business data from the system backend or decrypted message data.

[0111] The step of using the logical processing module to identify whether the content meets the forwarding conditions, based on its corresponding node metadata table and the content to be processed, specifically involves:

[0112] When the content to be processed is business data from the system backend, based on the preset correspondence between message type and forwarding object, the business data is used to determine whether the business data meets the forwarding conditions; the forwarding object includes two states: local and master node.

[0113] It should be noted that, in this embodiment, the logic processing module is also used to assign a specific message type based on the specific information of the business data from the system backend. This process mainly involves parsing the business data and extracting key fields to identify the corresponding message type:

[0114] 1. First, the logic processing module parses the received business data from the system backend and extracts key fields. These key fields may include the operation type (e.g., create, update, delete), the involved business objects (e.g., orders, users, inventory), timestamps, etc. Below is an example of business data from the system backend:

[0115] {

[0116] "operation":"create", -- Operation type: create

[0117] "objectType":"order", -- Business object: Order

[0118] "details":{--Detailed information}

[0119] "orderId":"ORD123456", -- Order number: ORD123456

[0120] "customerId":"CUS987654" -- Customer ID: CUS987654

[0121] },

[0122] "timestamp":"2025-07-29T09:52:00Z" -- Timestamp: July 29, 2025, 09:52:00 (UTC time)

[0123] }

[0124] This example uses business data in JSON format.

[0125] 2. From the above example business data, the logic processing module extracts the following key fields:

[0126] Operation type: create;

[0127] Business object type (objectType): order;

[0128] Timestamp: 2025-07-29T09:52:00Z.

[0129] 3. Identify message type (It should be noted that the parameter configuration table also includes a message type matching table):

[0130] Based on the extracted key fields, the logic processing module searches for matches in the message type matching table. This configuration table contains message type definitions and their identification rules for various business scenarios. For example:

[0131] Order creation: If the operation type of the business data is "create" and the business object involved is "order", then the message type corresponding to the data is ORDER_CREATE.

[0132] User registration: If the operation type of the business data is "create" and the business object involved is "user", then the message type corresponding to the data is USER_REGISTER.

[0133] Configuration update: If the operation type of the business data is "update" and the business object involved is "systemConfig", then the message type corresponding to the data is CONFIG_UPDATE.

[0134] 4. Generate message type identifier:

[0135] Once a match is found, the logic processing module generates a unique message type identifier for the business data. This identifier will be used in subsequent data processing and transmission to ensure that the receiver can recognize and correctly process the message.

[0136] When the content to be processed is business data from the system backend, based on the preset correspondence between message type and forwarding object, the system determines whether the business data meets the forwarding conditions using the message type corresponding to the business data. Specifically:

[0137] By using the message type of the business data and the preset correspondence between message type and forwarding object, the forwarding object corresponding to the business data is obtained. When the forwarding object is local, the forwarding condition is not met, and the local business processing logic is triggered. When the forwarding object is the master node, it is determined whether the current node service is the master node. If not, it is determined that the business data meets the forwarding condition. If so, the forwarding condition is not met, and the local business processing logic is triggered.

[0138] When the current node is identified as the primary node through the node metadata table, and the content to be processed is decrypted message data, the forwarding conditions are determined based on the content of the message data. Specifically:

[0139] Determine whether the target recipient's field content in the decrypted message data is the name of the node served by the current node. If it is, it means that the forwarding conditions are not met, and local business processing logic (such as double verification) is triggered; if not, it is determined that the message meets the forwarding conditions.

[0140] In this invention, when the content to be processed is business data from the system backend, the logic processing module can accurately determine whether the business data needs to be forwarded based on the preset correspondence between message type and forwarding object. It obtains the corresponding forwarding object through the message type of the business data. If the forwarding object is local, the forwarding condition is not met, and local business processing logic is triggered. If the forwarding object is the master node, and the current node is not the master node, the business data is determined to meet the forwarding condition and forwarded; otherwise, local business processing logic is triggered. Furthermore, when the content to be processed is decrypted message data and the current node serves the master node, the logic processing module can directly determine whether the forwarding condition is met based on the content of the message data, ensuring that only data that meets the condition is further processed and forwarded. This intelligent forwarding condition discrimination mechanism avoids unnecessary data transmission, optimizes the use of network resources, and improves the overall performance and response speed of the system.

[0141] The process of determining the recipient information based on the content to be processed using an association configuration table and / or a message receiving address configuration table specifically involves:

[0142] When the current node service is a slave node and the content to be processed is business data from the system backend, the field content of the target recipient corresponding to the business data is set based on the preset correspondence between message type and target recipient; the field content is either empty or the target node name, i.e., the node name served by the target node; the recipient information is determined based on the field content of the target recipient and the row information corresponding to the master node in the message receiving address configuration table.

[0143] When the current node is the master node and the content to be processed is business data from the system backend, the recipient information is determined by the association configuration table and the message receiving address configuration table.

[0144] When the current node is the master node and the content to be processed is decrypted message data, determine whether the target recipient field in the message data is empty. If not, obtain the corresponding recipient information from the message receiving address configuration table based on the field content. If yes, determine the recipient information by associating the configuration table and the message receiving address configuration table.

[0145] The process of determining the receiver information through the association configuration table and the message receiving address configuration table is as follows:

[0146] Based on the message type corresponding to the content to be processed, obtain the node type of the receiver and the corresponding forwarding rules from the message push rule configuration table;

[0147] Based on the obtained node type and forwarding rules, retrieve the included node names from the node service and system association table;

[0148] The corresponding receiver information is obtained from the message receiving address configuration table by acquiring the node name;

[0149] Each obtained node name has a unique corresponding recipient information.

[0150] The recipient information includes: the receiving address and the target recipient's field content;

[0151] When the current node is the master node and the content to be processed is decrypted message data, if the target receiver field is not empty, the receiving address in the receiver information is the receiving address corresponding to the target receiver. That is, when point-to-point forwarding is required, the slave node can explicitly specify the target node service by setting the "target receiver" field. After receiving the message, if the master node determines that the current node is the master node and the target receiver field is not empty, it will look up the corresponding target node service based on the content of that field and forward the message to the receiving address configured for that target node service. When the slave node does not specify a target receiver, the master node will determine one or more qualified receiver nodes based on the association configuration table and the message receiving address configuration table, and perform broadcast or rule-matching forwarding based on their receiving addresses.

[0152] This invention addresses the issue of data delivery to the correct node. When the current node is serving as a slave node and the data to be processed is business data from the system backend, it sets the field content of the target recipient based on a preset correspondence between message type and target recipient. This is combined with the row information of the master node in the message receiving address configuration table to determine the recipient information, ensuring data is accurately sent to the correct node. When the current node is serving as a master node and the data to be processed is business data from the system backend, the recipient information is determined through the association configuration table and the message receiving address configuration table, allowing data to be accurately distributed according to forwarding rules. Furthermore, when the current node is serving as a master node and the data to be processed is decrypted message data, if the target recipient field in the message data is not empty, the corresponding recipient information is directly obtained from the message receiving address configuration table based on that field content; if the field content is empty, the recipient information is determined by combining the association configuration table and the message receiving address configuration table. This mechanism flexibly adjusts the recipient information according to specific application scenarios, ensuring each node receives the correct message and avoiding unnecessary duplicate transmissions.

[0153] It should be noted that once a slave node receives a target message sent by a master node, it will not perform any further forwarding operations on that message.

[0154] The encryption assembly module uses the password book configuration table to encrypt and assemble the message to be encrypted to obtain the target message.

[0155] like Figure 2 As shown, the specific steps of using the codebook configuration table to encrypt and assemble the message to be encrypted into the target message are as follows:

[0156] Obtain the first public key and its corresponding first key index, the second public key and its corresponding second key index through the cryptographic book configuration table;

[0157] The step of obtaining the first public key and its corresponding first key index, the second public key and its corresponding second key index through the cryptographic book configuration table is as follows:

[0158] Two encryption methods are randomly obtained from the password configuration table, and one is set as the first encryption method and the other as the second encryption method. The key index and public key of the first encryption method are set as the first public key and the first key index. The key index and public key of the second encryption method are set as the second public key and the second key index.

[0159] The method involves randomly obtaining two encryption methods from a password configuration table, setting one as the first encryption method and the other as the second encryption method; specifically:

[0160] Perform a random sorting of the data rows in the password book configuration table;

[0161] The encryption method corresponding to the first data row in the sorted table is used as the first encryption method;

[0162] From the sorted table, select the next data row with a different encryption method as the second encryption method.

[0163] The message header and message body are constructed by combining the content to be processed and the recipient information, and the message header and message body are encapsulated in JSON format to obtain the message structure.

[0164] The above JSON-formatted message structure is encrypted using the first public key.

[0165] The encrypted message structure is stored in the HTTP request body to obtain the encrypted request body;

[0166] The request structure is obtained by assembling the receiver information and the first key index;

[0167] The request ciphertext is obtained by encrypting the request structure using the second public key.

[0168] The request ciphertext, request ID, and second key index are assembled into an encrypted request header;

[0169] In this embodiment, the request ID (reqId) field adopts the format of "system code:UUID", where the system code is used to identify the sending system and the UUID (Universally Unique Identifier) ​​ensures that each request is unique to avoid duplicate requests.

[0170] The encryption request body and encryption request header are assembled into a target message; the target message corresponds one-to-one with the recipient information.

[0171] This invention employs a multi-layered encryption mechanism during data transmission to ensure data confidentiality and integrity. The node service is configured with a password book table, storing the public and private keys used for encryption and decryption, along with their index information.

[0172] At the data sender, the encryption assembly module encrypts the message structure using the first public key and encapsulates the encryption result in the HTTP request body. Simultaneously, it encrypts the request structure containing the first key index using the second public key, generating an encrypted request header. Finally, the encrypted request body and encrypted request header are combined into the target message for transmission.

[0173] At the data receiver, the decryption module first uses the corresponding private key to decrypt the ciphertext in the encrypted request header to obtain the first key index. Then, it uses this index to obtain the corresponding private key to decrypt the encrypted request body and restore the original message content. This cross-encryption mechanism, where the key index is placed in the encrypted request header and the data body is encrypted independently, effectively prevents key information leakage and improves the overall encryption strength and resistance to attacks.

[0174] Specifically, during the encrypted assembly process, the first public key is used to encrypt the JSON-formatted message structure consisting of a header and a body, and the encryption result is encapsulated in the HTTP request body to form an encrypted request body. Simultaneously, the first key index and recipient information are assembled into a request structure, and this structure is encrypted using the second public key to form an encrypted request header, which contains the key index information used to decrypt the request body. By placing the key index used to decrypt the request body in the encrypted request header, the decryption information and data content are separated. Furthermore, using different encryption methods to encrypt both the request body and the request header separately forms a dual protection mechanism. This cross-key encryption method not only enhances the security of data transmission and prevents the direct exposure of key information, but also ensures that the recipient can decrypt the data sequentially according to the correct key order, improving the system's security level and the reliability of data processing.

[0175] Furthermore, since inter-system communication does not rely on third-party middleware, the data transmission path is controllable and occurs only between trusted nodes, avoiding trust risks from external services and further enhancing the system's security boundary.

[0176] The message header includes: message type, sender's node name, and target receiver's field content; the request structure includes: receiver address, timestamp, receiver's system code, and first key index.

[0177] The target packet is forwarded to the target node service via a repeater;

[0178] In this embodiment, data synchronization uses a direct call method instead of an asynchronous message mechanism. When new business data is generated in the system background, the service layer of the current node service immediately triggers the synchronization process, encapsulates the content to be processed into a target message, and sends it to the target node service, thereby realizing the real-time push of incremental data.

[0179] Specifically, the logic processing module identifies whether the content to be processed meets the forwarding conditions, and determines the recipient information if it does. After the encryption assembly module encrypts the message, the forwarder sends the target message to the recipient node via an HTTP request. The recipient node receives the message through the receiver, and completes the data storage after decryption and adaptation.

[0180] This real-time synchronization mechanism avoids the data lag problem caused by message backlog or network delay in traditional asynchronous middleware, ensuring that critical business information (such as approval data) can be delivered to relevant units in a timely manner, thus guaranteeing the timeliness of business processing.

[0181] The parameter configuration table also includes: a mapping relationship table;

[0182] The mapping table is used to record the data table corresponding to each message type;

[0183] The logic processing module is also used to pre-set a data structure model for each data table in the corresponding system database; the data structure model is constructed based on the definition of the corresponding data table, and it contains all fields of the corresponding data table and their corresponding data type information.

[0184] The node service also includes an adaptation layer, which is used for:

[0185] Parse the decrypted JSON format message body and header;

[0186] By analyzing the message type in the parsed message header, the corresponding data table is determined in the mapping table, and the data structure model corresponding to the data table is obtained as the target model.

[0187] The parsed data undergoes data type conversion and field mapping, and the converted data is then populated into the target model based on the field mapping results.

[0188] The data type conversion refers to converting the parsed message body data into a data type and format that conforms to the data table defined in the corresponding data table of the system database of the current node service;

[0189] The field mapping refers to mapping the fields in the parsed message body to the fields in the corresponding data table in the system database of the current node service.

[0190] Based on the constructed data structure model, the database driver of the system database corresponding to the current node service is called to complete the data writing.

[0191] To address the differences in data models, field definitions, and data types among heterogeneous databases used in different systems, this invention establishes an adaptation layer to uniformly handle data format conversion issues. This mechanism achieves automatic adaptation to heterogeneous data structures, effectively solving the data synchronization challenges across systems and database types, reducing the risk of errors during data conversion, and improving data consistency and system compatibility.

[0192] Specifically, this invention effectively solves the technical challenges of data model differences, field inconsistencies, and type conversion difficulties encountered in data synchronization between heterogeneous databases by introducing a mapping relationship table and pre-setting a corresponding data structure model for each data table. Upon receiving a decrypted JSON message, the adaptation layer first locates the corresponding data table in the mapping relationship table based on the message type and obtains the pre-set data structure model for that table. Subsequently, the adaptation layer performs data type conversion and field mapping on the parsed data, and fills the converted data into the target model based on the field mapping results. Finally, the data is written through the database driver. This mechanism achieves automatic adaptation and standardization of heterogeneous database structures, ensuring the consistency and integrity of data during synchronization across different database platforms, avoiding data loss or errors due to data format mismatches, and improving the stability and reliability of the synchronization process. Simultaneously, the pre-set data structure model and the automatic mapping processing of the adaptation layer reduce the system's dependence on specific database platforms, enhance the flexibility and scalability of data synchronization, and meet the needs of efficient, secure, and flexible data synchronization in multi-system environments.

[0193] It should be noted that, in order to build an efficient and reliable central node service, this embodiment chooses Spring Boot as the basic framework and introduces the BeetlSQL lightweight ORM framework to handle database operations. The specific steps for building the node service are described in detail below:

[0194] 1. In a Linux environment, use the yum package manager to install the Java Development Kit (JDK).

[0195] 2. Edit the system environment variable configuration file / etc / profile, and set JAVA_HOME and update the PATH variable.

[0196] 3. Initialize the parameter configuration table in the system database:

[0197] 3.1. Add the system code, corresponding organization ID, and whether it is a central node to the node metadata table.

[0198] 3.2 Initialize key configuration: Initialize the various encryption methods corresponding to the current node and their corresponding key indexes, public key keys and private key keys in the password book configuration table, and synchronize these data to the password book configuration table of the central node.

[0199] 3.3 Configure forwarding rules: Configure relevant information for various types of messages in the message push rule configuration table.

[0200] 4. Run the node service.

[0201] 4.1 Extract the pre-packaged node service archive to a specified directory on the server. For example, assume the extraction directory is / opt / node-service.

[0202] 4.2. Enter the extracted directory and execute the startup script in the bin subdirectory.

[0203] After executing the above startup script, the node service will start according to the settings in the configuration file and begin listening for data requests from other node services.

[0204] This invention deploys node services on various systems. The decryption module within each node service decrypts received messages, and the logic processing module uses the node metadata table and the content to be processed to identify whether forwarding conditions are met. This intelligent forwarding condition determination mechanism avoids unnecessary data transmission and optimizes network resource utilization. When forwarding conditions are met, the receiver information is determined based on the content to be processed using an association configuration table and / or a message receiving address configuration table. In other words, this invention flexibly adjusts receiver information according to specific application scenarios, ensuring that each node receives the correct message. Furthermore, the unified node service architecture and detailed configuration tables simplify the integration process between different systems, reduce operational costs, and enhance system stability and reliability. In summary, this invention achieves an efficient, secure, and flexible data synchronization method, significantly improving system performance and reliability, and avoiding the use of third-party message middleware.

[0205] This invention also provides an electronic device, including: at least one processor; and a memory communicatively connected to the at least one processor. The memory stores a computer program executable by the at least one processor, which, when executed by the at least one processor, causes the electronic device to perform the method of this invention.

[0206] The present invention also provides a non-transitory machine-readable medium storing a computer program, wherein the computer program, when executed by a computer's processor, is used to cause the computer to perform the method of the present invention.

[0207] This invention also provides a computer program product, including a computer program, wherein the computer program, when executed by a computer's processor, is used to cause the computer to perform the method of this invention.

[0208] refer to Figure 4 The present invention will now describe a structural block diagram of an electronic device that can serve as a server or client in embodiments of the present invention, which is an example of a hardware device that can be applied to various aspects of the present invention. The electronic device is intended to represent various forms of digital electronic computer devices, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.

[0209] like Figure 4 As shown, the electronic device includes a computing unit 401, which can perform various appropriate actions and processes based on a computer program stored in a read-only memory (ROM) 402 or a computer program loaded from a storage unit 408 into a random access memory (RAM) 403. The RAM 403 may also store various programs and data required for the operation of the electronic device. The computing unit 401, ROM 402, and RAM 403 are interconnected via a bus 404. An input / output (I / O) interface 405 is also connected to the bus 404.

[0210] Multiple components in the electronic device are connected to I / O interface 405, including: input unit 406, output unit 407, storage unit 408, and communication unit 409. Input unit 406 can be any type of device capable of inputting information into the electronic device. Input unit 406 can receive input digital or character information and generate key signal inputs related to user settings and / or function control of the electronic device. Output unit 407 can be any type of device capable of presenting information and may include, but is not limited to, a display, speaker, video / audio output terminal, vibrator, and / or printer. Storage unit 408 may include, but is not limited to, disks and optical discs. Communication unit 409 allows the electronic device to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks, and may include, but is not limited to, modems, network cards, infrared communication devices, wireless communication transceivers, and / or chipsets, such as Bluetooth devices, WiFi devices, WiMax devices, cellular communication devices, and / or the like.

[0211] The computing unit 401 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 401 include, but are not limited to, CPUs, graphics processing units (GPUs), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any suitable processor, controller, microcontroller, etc. The computing unit 401 performs the methods and processes described above. For example, in some embodiments, the method embodiments of the present invention may be implemented as a computer program tangibly contained in a machine-readable medium, such as storage unit 408. In some embodiments, part or all of the computer program may be loaded and / or installed on an electronic device via ROM 402 and / or communication unit 409. In some embodiments, the computing unit 401 may be configured to perform the methods described above by any other suitable means (e.g., by means of firmware).

[0212] Computer programs for implementing the methods of embodiments of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus, such that when executed by the processor or controller, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0213] In the context of embodiments of the present invention, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable signal medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0214] It should be noted that all directional indications (such as up, down, left, right, front, back, etc.) in the embodiments of the present invention are only used to explain the relative positional relationship and movement of each component in a certain specific posture (as shown in the figure). If the specific posture changes, the directional indication will also change accordingly.

[0215] Furthermore, in this invention, descriptions involving terms such as "first," "second," and "a" are for descriptive purposes only and should not be construed as indicating or implying their relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this invention, "a plurality of" means at least two, such as two, three, etc., unless otherwise explicitly specified.

[0216] In this invention, unless otherwise explicitly specified and limited, the terms "connection," "fixed," etc., should be interpreted broadly. For example, "fixed" can mean a fixed connection, a detachable connection, or an integral part; it can mean a mechanical connection or an electrical connection; it can mean a direct connection or an indirect connection through an intermediate medium; it can mean the internal communication of two components or the interaction between two components, unless otherwise explicitly limited. Those skilled in the art can understand the specific meaning of the above terms in this invention according to the specific circumstances.

[0217] Furthermore, the technical solutions of the various embodiments of the present invention can be combined with each other, but only if they are feasible for those skilled in the art. If the combination of technical solutions is contradictory or cannot be implemented, it should be considered that such combination of technical solutions does not exist and is not within the scope of protection claimed by the present invention.

Claims

1. A data synchronization method based on node services, applied to multiple system platforms; characterized in that, The multi-system platform includes: a master system and one or more slave systems; each system has node services deployed, wherein the node services deployed on the master system are master nodes, and the node services deployed on the slave systems are slave nodes; the node services include: a parameter configuration table, a data transceiver layer, and a service layer; wherein: The parameter configuration table is created in the database of the corresponding system; the parameter configuration table includes: a node metadata table, a node service and system association table, a message push rule configuration table, a message receiving address configuration table, and a password book configuration table; the data transceiver layer includes a receiver and a repeater; the service layer includes a decryption module, a logic processing module, and an encryption assembly module; the data synchronization method includes: The receiver receives messages from other node services and corresponding system backend business data. The decryption module uses the password configuration table of the corresponding node service to perform decryption operations on the messages received by the receiver from other node services. The logic processing module uses its corresponding node metadata table and the content to be processed to identify whether the content to be processed meets the forwarding conditions. If it does, it uses the associated configuration table and / or message receiving address configuration table to determine the recipient information based on the content to be processed, and constructs a message to be encrypted based on the recipient information and the content to be processed. The associated configuration table includes a message push rule configuration table and a node service and system association table. The encryption assembly module uses the codebook configuration table to encrypt and assemble the message to be encrypted to obtain the target message; the target message is then forwarded to the target node service by the repeater. The process of encrypting and assembling the message to be encrypted using the codebook configuration table to obtain the target message is as follows: Obtain the first public key and its corresponding first key index, second public key and its corresponding second key index through the password book configuration table; The message header and message body are constructed by combining the content to be processed and the recipient information, and the message header and message body are encapsulated in JSON format to obtain the message structure. The above JSON-formatted message structure is encrypted using the first public key. The encrypted message structure is stored in the HTTP request body to obtain the encrypted request body; The request structure is obtained by assembling the receiver information and the first key index; The request ciphertext is obtained by encrypting the request structure using the second public key. The request ciphertext, request ID, and second key index are assembled into an encrypted request header; The encryption request body and encryption request header are assembled into a target message; the target message corresponds one-to-one with the recipient information. The content to be processed is business data from the system backend or decrypted message data.

2. The data synchronization method based on node services according to claim 1, characterized in that, The node metadata table includes: the node code corresponding to the node service, the node name, the node type, the system code of the system to which it belongs, and an identifier indicating whether it is a master node; The fields of the message push rule configuration table include: message type, the node type of the sender and the node type of the receiver under each message type, and the corresponding forwarding rules; The fields in the message receiving address configuration table include: the receiver's node name, receiving address, node type, and the system code of the system to which it belongs; The fields of the password configuration table include: encryption method and its corresponding key index, public key and private key; the fields of the node service and system association table include: node code and its corresponding node type, node name and system code.

3. The data synchronization method based on node services according to claim 2, characterized in that, The forwarding rules include: First forwarding rule: Send the message to all node services under the corresponding receiver node type; The second forwarding rule is to send the message to all node services under the corresponding receiver node type, excluding the sender.

4. The data synchronization method based on node services according to claim 3, characterized in that, The step of using the logical processing module to identify whether the content meets the forwarding conditions, based on its corresponding node metadata table and the content to be processed, specifically involves: When the content to be processed is business data from the system backend, based on the preset correspondence between message type and forwarding object, the business data is used to determine whether the business data meets the forwarding conditions. The forwarding object includes two states: local and master node. When the current node is identified as the master node through the node metadata table, and the content to be processed is decrypted message data, it is determined whether the message meets the forwarding conditions based on the content of the message data.

5. The data synchronization method based on node services according to claim 4, characterized in that, When the content to be processed is business data from the system backend, based on the preset correspondence between message type and forwarding object, the system determines whether the business data meets the forwarding conditions using the message type corresponding to the business data. Specifically: By using the message type of the business data and the preset correspondence between message type and forwarding object, the forwarding object corresponding to the business data is obtained. When the forwarding object is local, the forwarding condition is not met, and the local business processing logic is triggered. When the forwarding object is the master node, it is determined whether the current node service is the master node. If not, it is determined that the business data meets the forwarding condition. If so, the forwarding condition is not met, and the local business processing logic is triggered.

6. The data synchronization method based on node services according to claim 5, characterized in that, The process of determining the recipient information based on the content to be processed using an association configuration table and / or a message receiving address configuration table specifically involves: When the current node service is a slave node and the content to be processed is business data from the system backend, based on the preset correspondence between message type and target receiver, the field content corresponding to the target receiver of the business data is set; the field content is either empty or the target node name, i.e., the node name served by the target node. The receiver information is determined based on the field content of the target receiver and the row information of the master node in the message receiving address configuration table; When the current node is the master node and the content to be processed is business data from the system backend, the recipient information is determined by the association configuration table and the message receiving address configuration table. When the current node is the master node and the content to be processed is decrypted message data, determine whether the target recipient field in the message data is empty. If not, obtain the corresponding recipient information from the message receiving address configuration table based on the content of that field. If so, the receiver information is determined by the association configuration table and the message receiving address configuration table.

7. The data synchronization method based on node services according to claim 6, characterized in that, The process of determining the receiver information through the association configuration table and the message receiving address configuration table is as follows: Based on the message type corresponding to the content to be processed, obtain the node type of the receiver and the corresponding forwarding rules from the message push rule configuration table; Based on the obtained node type and forwarding rules, retrieve the included node names from the node service and system association table; The corresponding receiver information is obtained from the message receiving address configuration table by acquiring the node name; Each obtained node name has a unique corresponding recipient information.

8. The data synchronization method based on node services according to claim 7, characterized in that, The recipient information includes: the receiving address and the target recipient field content; the encryption methods in the password configuration table include at least two.

9. A data synchronization method based on node services according to claim 8, characterized in that, When the current node is the master node and the content to be processed is decrypted message data, if the target receiver's field is not empty, then the receiving address in the receiver information is the receiving address corresponding to the target receiver.

10. A data synchronization method based on node services according to claim 8, characterized in that, The message header includes: message type, sender's node name, and target receiver's field content; the request structure includes: receiver address, timestamp, receiver's system code, and first key index.

11. A data synchronization method based on node services according to claim 1, characterized in that, The step of obtaining the first public key and its corresponding first key index, the second public key and its corresponding second key index through the cryptographic book configuration table is as follows: Two encryption methods are randomly obtained from the password configuration table, and one is set as the first encryption method and the other as the second encryption method. The key index and public key of the first encryption method are set as the first public key and the first key index. The key index and public key of the second encryption method are set as the second public key and the second key index.

12. The data synchronization method based on node services according to claim 11, characterized in that, The method involves randomly obtaining two encryption methods from a password configuration table, setting one as the first encryption method and the other as the second encryption method; specifically: Perform a random sorting of the data rows in the password book configuration table; The encryption method corresponding to the first data row in the sorted table is used as the first encryption method; From the sorted table, select the next data row with a different encryption method as the second encryption method.

13. The data synchronization method based on node services according to claim 10, characterized in that, When the current node is identified as the master node through the node metadata table, and the content to be processed is decrypted message data, the forwarding condition is determined based on the content of the message data. Specifically, it is determined whether the target recipient field in the decrypted message data is the name of the node served by the current node. If so, it means that the forwarding condition is not met, and the local business processing logic is triggered; if not, it is determined that the message meets the forwarding condition.

14. A data synchronization method based on node services according to claim 10, characterized in that, The process of using the decryption module to perform decryption on messages received by the receiver from other node services using the corresponding node service's password book configuration table is as follows: Obtain the second key index from the encryption request header of the message; The corresponding private key is obtained from the password book configuration table of the current node service using the second key index. The private key is then used to decrypt the ciphertext in the encryption request header to obtain the first key index. The corresponding private key is obtained from the password book configuration table of the current node service using the first key index. The encrypted request body of the message is then decrypted using the private key to obtain the JSON format message body and message header.

15. A data synchronization method based on node services according to claim 2, characterized in that, The parameter configuration table also includes: a mapping relationship table; The mapping table is used to record the data table corresponding to each message type; The logic processing module is also used to pre-set a data structure model for each data table in the corresponding system database; the data structure model is constructed based on the definition of the corresponding data table, and it contains all fields of the corresponding data table and their corresponding data type information.

16. A data synchronization method based on node services according to claim 15, characterized in that, The node service also includes an adaptation layer, which is used for: Parse and decrypt the message body and header; By analyzing the message type in the parsed message header, the corresponding data table is determined in the mapping table, and the data structure model corresponding to the data table is obtained as the target model. The parsed data undergoes data type conversion and field mapping, and the converted data is then populated into the target model based on the field mapping results. Based on the constructed data structure model, the database driver of the system database corresponding to the current node service is called to complete the data writing.

17. A data synchronization method based on node services according to claim 16, characterized in that, The data type conversion refers to converting the parsed message body data into a data type and format that conforms to the data table defined in the corresponding data table of the system database of the current node service; The field mapping refers to mapping the fields in the parsed message body to the fields in the corresponding data table in the system database of the current node service.

18. An electronic device comprising: A processor and a memory storing a program, characterized in that the program includes instructions that, when executed by the processor, cause the processor to perform the method according to any one of claims 1 to 17.

19. A non-transitory machine-readable medium storing computer instructions, characterized in that, The computer instructions are used to cause the computer to perform the method according to any one of claims 1 to 17.

Citation Information

Patent Citations

  • Automatic synchronization achieving method for business data between heterogeneous systems

    CN105787057A

  • Communication method, device and equipment based on option list

    CN118612310A

  • Method and Apparatus for Policy Based Routing in Information Centric Networking Based Home Networks

    US20140173076A1