Data synchronization method based on node service and related equipment
By deploying node services among multi-node systems and adopting layered encryption and key cross-use mechanisms, the security, complexity and consistency issues of data synchronization in existing technologies are solved, efficient, secure and flexible data synchronization is achieved, and the performance and reliability of the system are improved.
Patent Information
- Application Number
- CN202511254785.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-04
- Publication Date
- 2025-10-03
- Estimated Expiration
- 2045-09-04
AI Technical Summary
Existing technologies for data synchronization between multi-node application systems have security risks, high complexity, network delays and bandwidth limitations, difficulty in maintaining data consistency, large computing resource usage, and insufficient synchronization frequency and quality control, which are particularly prominent when synchronizing between heterogeneous databases.
A node-based data synchronization approach is employed. By deploying node services on each system and utilizing decryption, logic processing, and encryption assembly modules, secure, flexible, and efficient data transmission is achieved. Node services include parameter configuration tables, a data transceiver layer, and a service layer. They utilize HTTP communication to avoid reliance on third-party middleware. Layered encryption and key cross-use mechanisms, combined with mapping tables, enable adaptation to heterogeneous databases.
It optimizes the use of network resources, reduces operation and maintenance costs, improves system stability and reliability, ensures the security and integrity of data transmission, achieves data consistency and flexible synchronization between heterogeneous databases, and improves system performance and response speed.
Smart Images

Figure CN120750951A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data synchronization, and in particular to a data synchronization method based on node service and related equipment. Background Art
[0002] Existing technologies typically rely on messaging middleware (such as ActiveMQ, RabbitMQ, and Kafka) to achieve real-time synchronization of business information across multi-node application systems. While these middleware offer advantages such as rapid deployment, a mature and stable technology stack, and professional support, they also present significant technical challenges. First, third-party messaging middleware presents security risks. Trust in the service provider to protect data security and privacy can lead to potential data leaks. Second, reliance on external services increases system complexity and can impact data synchronization continuity in the event of middleware failures. Furthermore, network latency and bandwidth limitations can impact synchronization speed, while integration difficulties and customization restrictions further increase implementation costs and technical challenges.
[0003] On the other hand, 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 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. In addition, the data synchronization process itself requires additional computing resources, which may lead to performance bottlenecks. At the same time, low synchronization frequency and insufficient data quality control are also common problems. In particular, data loss or format conversion errors may occur during data 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] In order to solve the above technical problems, the present invention proposes a data synchronization method based on node services, which is applied to a multi-system platform; the multi-system platform includes: a master system and one or more slave systems; each system is deployed with a node service, wherein the node service deployed on the master system is a master node, and the node service deployed on the slave system is a slave node; the node service includes: 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 meta-information table, a node service and system association table, a message push rule configuration table, a message receiving address configuration table, and a password configuration table; the data transceiver layer includes a receiver and a forwarder; the service layer includes a decryption module, a logic processing module, and an encryption assembly module; the data synchronization method includes: Receive messages from other node services and business data from the corresponding system background through the receiver; Decryption module uses the cipher 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 the corresponding node meta-information table and the content to be processed to identify whether the content meets the forwarding conditions. If so, the association configuration table and / or the message receiving address configuration table are used to determine the recipient information based on the content to be processed, and the encrypted message is constructed based on the recipient information and the content to be processed; the association 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 encrypted message to obtain the target message; the target message is forwarded to the target node service through the forwarder; The content to be processed is business data from the system background or decrypted message data.
[0005] Furthermore, the node meta information 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 of 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 corresponding to each message type, and the corresponding forwarding rules; The fields of the message receiving address configuration table include: the node name of the receiver, the receiving address, the node type and the system code of the system to which it belongs; The fields of the codebook configuration table include: encryption mode 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.
[0006] Furthermore, the forwarding rules include: First forwarding rule: send the message to all node services under the corresponding receiver node type; Second forwarding rule: Send the message to all node services under the corresponding receiver node type except the sender.
[0007] Furthermore, the logic processing module uses the corresponding node meta-information table and the content to be processed to identify whether the content meets the forwarding condition, specifically: When the content to be processed is business data from the system background, based on the preset correspondence between the message type and the forwarding object, the message type corresponding to 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 node meta-information table identifies that the current node serves as the master node and the content to be processed is decrypted message data, it is determined whether the message meets the forwarding condition based on the content in the message data.
[0008] Furthermore, when the content to be processed is business data from the system background, based on the preset correspondence between the message type and the forwarding object, the message type corresponding to the business data is used to determine whether the business data meets the forwarding conditions, specifically: The forwarding object corresponding to the business data is obtained by using the preset correspondence between the message type and the forwarding object through the message type of the business data; 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.
[0009] Furthermore, the determining of the recipient information based on the content to be processed using the association configuration table and / or the message receiving address configuration table is specifically as follows: When the current node service is a slave node and the content to be processed is business data from the system background, based on the preset correspondence between the message type and the target recipient, the field content of the business data corresponding to the target recipient is set; the field content is empty or the target node name, that is, the node name of the target node service; 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; When the current node serves as the master node and the content to be processed is business data from the system background, the recipient information is determined by associating the configuration table with the message receiving address configuration table; When the current node serves as the main node and the content to be processed is the decrypted message data, determine whether the field content of the target recipient in the message data is empty. If not, obtain the corresponding recipient information through the message receiving address configuration table based on the field content; if so, determine the recipient information through the association configuration table and the message receiving address configuration table.
[0010] Furthermore, the determining of the recipient information by associating the configuration table with the message receiving address configuration table is specifically as follows: Obtain the recipient's node type and corresponding forwarding rules from the message push rule configuration table based on the message type corresponding to the content to be processed; Obtain the node names included in the node service and system association table based on the obtained node type and forwarding rule; Obtain the corresponding receiver information in the message receiving address configuration table through the obtained node name; Each acquired node name has unique corresponding receiver information.
[0011] Furthermore, the recipient information includes: the field contents of the receiving address and the target recipient; and the encryption methods in the codebook configuration table include at least two.
[0012] Furthermore, when the current node serves as the master node and the content to be processed is decrypted message data, if the field content of the target recipient is not empty, the receiving address in the recipient information is the receiving address corresponding to the target recipient.
[0013] Furthermore, the target message is obtained by encrypting and assembling the message to be encrypted using the codebook configuration table, specifically: Obtaining the first public key and the first key index corresponding to the key, the second public key and the second key index corresponding to the key through the codebook configuration table; Construct the message header and message body based on the content to be processed and the recipient information, and encapsulate the message header and message body in JSON format to obtain the message structure; Encrypt the message structure in the JSON format using the first public key; Store the encrypted message structure into the HTTP request body to obtain the encrypted request body; Obtain a request structure by assembling the recipient information and the first key index; Encrypt the request structure using the second public key to obtain a request ciphertext; Assemble the request ciphertext, request ID, and second key index into an encrypted request header; The encrypted request body and the encrypted request header are assembled into a target message; the target message corresponds one-to-one with the receiver information.
[0014] Furthermore, the message header includes: message type, sender's node name and target receiver's field content; the request structure includes: receiving address, timestamp, receiver's system code and first key index.
[0015] Furthermore, the first public key and the first key index corresponding to the key, the second public key and the second key index corresponding to the key are obtained through the codebook configuration table; specifically: Two encryption methods are randomly obtained through the code book configuration table, and one of them is set as the first encryption method and the other is set 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.
[0016] Furthermore, two encryption modes are randomly obtained through the codebook configuration table, and one of them is set as the first encryption mode and the other is set as the second encryption mode; specifically: Randomly sort the data rows in the codebook 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.
[0017] Furthermore, when the node meta-information table identifies that the current node service is the main node and the content to be processed is decrypted message data, it is determined whether the message meets the forwarding conditions based on the content in the message data. Specifically, it is determined whether the field content of the target recipient in the decrypted message data is the node name of the current node service. If so, it indicates that the forwarding conditions are not met, triggering the local business processing logic; if not, it is determined that the message meets the forwarding conditions.
[0018] Furthermore, the decryption module performs a decryption operation on the message received by the receiver from other node services using the cipher book configuration table of the corresponding node service, specifically: Obtaining a second key index from the encryption request header of the message; Obtain the corresponding private key from the password configuration table of the current node service through the second key index, and decrypt the request ciphertext in the encrypted request header through the private key to obtain the first key index; The first key index is used to obtain the corresponding private key in the password configuration table of the current node service, and the encrypted request body of the message is decrypted using the private key to obtain the message body and message header in JSON format.
[0019] Furthermore, the parameter configuration table also includes: a mapping relationship table; The mapping relationship table is used to record the data table corresponding to each message type; The logic processing module is further configured to preset 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 includes all fields of the corresponding data table and their corresponding data type information.
[0020] Furthermore, the node service further includes: an adaptation layer, which is used to: Parse the decrypted JSON format message body and message header; By parsing the message type in the message header, determine the data table corresponding to the type in the mapping relationship table, and obtain the data structure model corresponding to the data table as the target model; Convert the parsed data into different data types and perform field mapping, and then fill the converted data 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.
[0021] Furthermore, the data type conversion means converting the data of the parsed message body into a data type and format that conforms to the data table defined in the corresponding system database of the current node service; The field mapping means mapping the fields in the parsed message body to the fields in the corresponding data table in the system database corresponding to the current node service.
[0022] In order to solve the above technical problems, an embodiment of the present invention further provides an electronic device, including: a processor, and a memory storing a program, wherein the program includes instructions, and when the instructions are executed by the processor, the processor executes the method described above.
[0023] In order to solve the above technical problem, an embodiment of the present invention further provides a non-transitory machine-readable medium storing computer instructions, where the computer instructions are used to enable the computer to execute the method described above.
[0024] Compared with the prior art, the present invention has at least the following beneficial effects:
[0025] (1) The present invention deploys node services on each system, performs decryption operations on received messages through the decryption module in the node service, and uses the node meta-information table and the content to be processed to identify whether the forwarding conditions are met through the logic processing module. This intelligent forwarding condition judgment mechanism avoids unnecessary data transmission and optimizes the use of network resources. When the forwarding conditions are met, the recipient 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, the present invention flexibly adjusts the recipient 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, the present 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.
[0026] (2) In the present invention, when the content to be processed is business data from the system background, based on the preset correspondence between the message type and the forwarding object, the logic processing module can accurately determine whether the business data needs to be forwarded: the corresponding forwarding object is obtained through the message type of the business data. 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, if the current node is not the master node, it is determined that the business data meets 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 as 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 conditions will be further processed and forwarded. This intelligent forwarding condition judgment mechanism avoids unnecessary data transmission, optimizes the use of network resources, and improves the overall performance and response speed of the system.
[0027] (3) When the current node serves as a slave node and the content to be processed is business data from the system background, the present invention sets the field content of the target recipient corresponding to the business data based on the preset correspondence between the message type and the target recipient, and determines the recipient information in combination with 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 background, the recipient information is determined by associating the 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 through the message receiving address configuration table based on the field content; if the field content is empty, the recipient information is comprehensively determined through the associating 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 repeated transmission.
[0028] (4) The present invention significantly improves the security and integrity of data transmission by adopting a mechanism of layered encryption and cross-key use. Specifically, during the encryption assembly process, the JSON format message structure consisting of the message header and the message body is first encrypted using the first public key, 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 structure is encrypted using the second public key to form an encrypted request header, which contains the key index information for decrypting the request body. By placing the key index for decrypting the request body in the encrypted request header, the decryption information is separated from the data content, and different encryption methods are used to encrypt the request body and the request header respectively, forming a dual protection mechanism. This encryption method with cross-key placement not only enhances the security during data transmission and prevents the key information from being directly exposed, but also ensures that the recipient can decrypt in sequence according to the correct key sequence, thereby improving the security level of the system and the reliability of data processing.
[0029] (5) The present invention effectively solves the technical problems faced by data synchronization between heterogeneous databases, such as data model differences, field inconsistencies, and type conversion difficulties, by introducing a mapping relationship table and presetting a corresponding data structure model for each data table. After receiving the decrypted JSON format message, the adaptation layer first searches for the corresponding data table in the mapping relationship table according to the message type and obtains the data structure model preset for 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 result of the field mapping, and finally completes the data writing through the database driver. This mechanism realizes the 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 presetting of the data structure model and the automatic mapping processing of the adaptation layer, the system's dependence on a specific database platform is reduced, the flexibility and scalability of data synchronization are improved, and the requirements for efficient, secure, and flexible data synchronization in a multi-system environment are met. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] Figure 1 This is a flow chart of a data synchronization method based on node services according to an embodiment of the present invention;
[0031] Figure 2 This is a flowchart of the encryption assembly of an embodiment of the present invention;
[0032] Figure 3 This is a flow chart of the decryption operation according to an embodiment of the present invention;
[0033] Figure 4Schematic diagram of the structure of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0034] The following are specific embodiments of the present invention and the accompanying drawings to further describe the technical solutions of the present invention, but the present invention is not limited to these embodiments.
[0035] Given that third-party message middleware poses security risks during use and increases the complexity of the system architecture, and may also affect the continuity and stability of data synchronization when the middleware fails, in order to solve the above technical problems, it is necessary to achieve efficient, secure and flexible data synchronization between systems without relying on third-party message middleware. Figure 1 As shown, the present invention proposes a data synchronization method based on node service, which is applied to multi-system platforms; The multi-system platform includes: a master system and one or more slave systems; each system is deployed with a node service, wherein the node service deployed on the master system is a master node, and the node service deployed on the slave system is a slave node; The present 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, independent of any third-party messaging middleware. The data transceiver layer communicates with other node services via the HTTP protocol, forming a data synchronization channel based on a receiver or API interface.
[0036] This architectural design avoids the software licensing fees, resource usage, and operational complexity associated with the introduction of external middleware, reducing the overall cost of the system. Furthermore, since the data transmission paths between systems are clear, troubleshooting does not require reliance on middleware logs or additional monitoring tools, significantly improving problem location and resolution efficiency. Furthermore, this independent deployment model offers excellent scalability, facilitating the integration of new functional modules or replacement of existing components, supporting the continuous evolution of the system and technological iteration, and enhancing the flexibility and adaptability of the overall architecture. Among them: The parameter configuration table is created in the database of the corresponding system; the parameter configuration table includes: node meta-information 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 a receiver and a forwarder; the service layer includes a decryption module, a logic processing module and an encryption assembly module; The node meta information 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 of 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 corresponding to each message type, and the corresponding forwarding rules; The forwarding rules include: First forwarding rule: send the message to all node services under the corresponding receiver node type; Second forwarding rule: Send the message to all node services under the corresponding receiver node type except the sender.
[0037] This invention allows users to configure message data push rules between system nodes based on specific needs. The push rule configuration table contains detailed forwarding rule settings, such as message type, sender node type, receiver node type, and corresponding forwarding policies (for example, sending messages to all nodes of the receiver node type 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.
[0038] The fields of the message receiving address configuration table include: the node name of the receiver, the receiving address, the node type and the system code of the system to which it belongs; The fields of the codebook configuration table include: encryption mode and its corresponding key index, public key and private key; The encryption methods in the password book configuration table include at least two.
[0039] The fields of the node service and system association table include: node code and its corresponding node type, node name and system code.
[0040] The data synchronization method includes: Receive messages from other node services and business data from the corresponding system background through the receiver; 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; Figure 3 As shown, the decryption operation specifically includes: Obtaining a second key index from the encryption request header of the message; Obtain the corresponding private key from the password configuration table of the current node service through the second key index, and decrypt the request ciphertext in the encrypted request header through the private key to obtain the first key index; The first key index is used to obtain the corresponding private key in the password configuration table of the current node service, and the encrypted request body of the message is decrypted using the private key to obtain the message body and message header in JSON format.
[0041] In this embodiment, after completing the decryption operation, the logic processing module will also perform a double check to ensure the integrity and security of the data. The steps of the double check are as follows:
[0042] 1. System code verification of sender information: effectively prevent identity forgery.
[0043] 1.1. Extract the sender's system code from the request ID (reqId).
[0044] 1.2. Based on the sender's node name in the decrypted message header, the corresponding system code is extracted from the node service and system association table.
[0045] 1.3. Compare the system codes extracted in step 1.1 with those extracted in step 1.2. If they are consistent and the system code exists in the predefined legal system code enumeration list, the verification passes.
[0046] 2. Request path verification: prevent requests from being redirected or tampered with.
[0047] Request path verification is used to confirm whether the request path matches the actual address of the current request to ensure the legitimacy of the request. The specific steps are as follows:
[0048] 2.1. Extract the receiving address, i.e. the request path, from the decrypted request structure.
[0049] 2.2. Compare the extracted request path with the actual address of the current request. If the two are consistent, the request is considered legitimate; otherwise, the request is rejected.
[0050] Data will only be written after passing the above double verification, which effectively guarantees the authenticity of the data source and the legitimacy of the request.
[0051] The logic processing module uses the corresponding node meta-information table and the content to be processed to identify whether the content meets the forwarding conditions. If so, the association configuration table and / or the message receiving address configuration table are used to determine the recipient information based on the content to be processed, and the encrypted message is constructed based on the recipient information and the content to be processed; the association configuration table includes a message push rule configuration table and a node service and system association table; The content to be processed is business data from the system background or decrypted message data.
[0052] The logic processing module uses the corresponding node meta-information table and the content to be processed to identify whether the content meets the forwarding conditions, specifically: When the content to be processed is business data from the system background, based on the preset correspondence between the message type and the forwarding object, the message type corresponding to 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; It should be noted that, in this embodiment, the logic processing module is also used to assign a specific message type to the service data according to the specific information from the system background. This process mainly involves parsing the service data and extracting key fields to identify the corresponding message type:
[0053] 1. First, the logic processing module parses the business data received from the system backend and extracts key fields. These key fields may include the operation type (such as create, update, delete), the business object involved (such as order, user, inventory), and timestamp. The following is an example of business data from the system backend: { "operation":"create",--Operation type: create (create) "objectType":"order",--Business object: order "details":{--Detailed information "orderId":"ORD123456",--Order number: ORD123456 "customerId":"CUS987654"--Customer ID: CUS987654 }, "timestamp":"2025-07-29T09:52:00Z" -- Timestamp: July 29, 2025, 09:52:00 (UTC time) }.
[0054] This example shows business data in JSON format.
[0055] 2. From the above sample business data, the logic processing module extracts the following key fields: Operation type (operation): create; Business object type (objectType): order; Timestamp: 2025-07-29T09:52:00Z.
[0056] 3. Identify the message type (it should be noted that the parameter configuration table also includes a message type matching table): Based on the extracted key fields, the logic processing module searches for matching items in the message type matching table. This configuration table contains the corresponding message type definitions and identification rules for various business scenarios. For example:
[0057] Order creation: If the operation type of the business data is "create" and the business object involved is "order", the message type corresponding to the data is ORDER_CREATE.
[0058] User registration: If the operation type of the business data is "create" and the business object involved is "user", the message type corresponding to the data is USER_REGISTER.
[0059] Configuration update: If the operation type of the business data is "update" and the business object involved is "systemConfig", the corresponding message type of the data is CONFIG_UPDATE.
[0060] 4. Generate message type identifier: Once a match is found, the logic processing module generates a unique message type identifier for the service data. This identifier will be used in subsequent data processing and transmission to ensure that the recipient can identify and correctly process the message.
[0061] When the content to be processed is business data from the system background, based on the preset correspondence between the message type and the forwarding object, the message type corresponding to the business data is used to determine whether the business data meets the forwarding conditions, specifically: The forwarding object corresponding to the business data is obtained by using the preset correspondence between the message type and the forwarding object through the message type of the business data; 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.
[0062] When the node meta-information table identifies the current node as the master node and the content to be processed is decrypted message data, the message is determined to determine whether it meets the forwarding conditions based on the content of the message data. Specifically: Determine whether the target recipient field in the decrypted message data is the node name served by the current node. If so, it means that the forwarding conditions are not met, triggering the local business processing logic (such as double verification); if not, determine that the message meets the forwarding conditions.
[0063] In the present invention, when the content to be processed is business data from the system background, based on the preset correspondence between the message type and the forwarding object, the logic processing module can accurately determine whether the business data needs to be forwarded: the corresponding forwarding object is obtained through the message type of the business data. 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, if the current node is not the master node, it is determined that the business data meets 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 as 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 conditions will be further processed and forwarded. This intelligent forwarding condition judgment mechanism avoids unnecessary data transmission, optimizes the use of network resources, and improves the overall performance and response speed of the system.
[0064] The determining of the recipient information based on the content to be processed using the association configuration table and / or the message receiving address configuration table is specifically: When the current node service is a slave node and the content to be processed is business data from the system background, based on the preset correspondence between the message type and the target recipient, the field content of the business data corresponding to the target recipient is set; the field content is empty or the target node name, that is, the node name of the target node service; 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; When the current node serves as the master node and the content to be processed is business data from the system background, the recipient information is determined by associating the configuration table with the message receiving address configuration table; When the current node serves as the main node and the content to be processed is the decrypted message data, determine whether the field content of the target recipient in the message data is empty. If not, obtain the corresponding recipient information through the message receiving address configuration table based on the field content; if so, determine the recipient information through the association configuration table and the message receiving address configuration table.
[0065] The receiver information is determined by associating the configuration table with the message receiving address configuration table, specifically: Obtain the recipient's node type and corresponding forwarding rules from the message push rule configuration table based on the message type corresponding to the content to be processed; Obtain the node names included in the node service and system association table based on the obtained node type and forwarding rule; Obtain the corresponding receiver information in the message receiving address configuration table through the obtained node name; Each acquired node name has unique corresponding receiver information.
[0066] The recipient information includes: the receiving address and the target recipient field content; When the current node serves as the master node and the content to be processed is the decrypted message data, if the field content of the target recipient is not empty, the receiving address in the recipient information is the receiving address corresponding to the target recipient. In other words, when point-to-point forwarding is required, the slave node can set the "target recipient" field to clearly specify the target node service; after the master node receives the message, if it determines that the current node is the master node and the target recipient field is not empty, it will search for the corresponding target node service based on the content of the field and forward the message to the receiving address configured for the target node service. When the slave node does not specify the target recipient, the master node determines one or more qualified recipient nodes based on the association configuration table and the message receiving address configuration table, and performs broadcast or rule matching forwarding based on their receiving addresses.
[0067] The present invention sets the field content of the target recipient corresponding to the business data based on the preset correspondence between the message type and the target recipient, and determines the recipient information in combination with the row information of the master node in the message receiving address configuration table when the current node serves as the master node and the content to be processed is business data from the system background, so as to ensure that the data can be accurately sent to the correct node. When the current node serves as the master node and the content to be processed is business data from the system background, the recipient information is determined by associating the 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 the 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 through the message receiving address configuration table based on the field content; if the field content is empty, the recipient information is comprehensively determined through the associating 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 repeated transmission.
[0068] It should be noted that, after receiving the target message sent by the master node, the slave node will no longer perform further forwarding operations on the message.
[0069] The encryption assembly module uses the codebook configuration table to encrypt and assemble the encrypted message to obtain the target message; like Figure 2 As shown, the target message is obtained by encrypting and assembling the encrypted message using the codebook configuration table, specifically: Obtaining the first public key and the first key index corresponding to the key, the second public key and the second key index corresponding to the key through the codebook configuration table; The first public key and the first key index corresponding to the key, the second public key and the second key index corresponding to the key are obtained through the codebook configuration table; specifically: Two encryption methods are randomly obtained through the code book configuration table, and one of them is set as the first encryption method and the other is set 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.
[0070] The method randomly obtains two encryption modes through the codebook configuration table, and sets one of them as the first encryption mode and the other as the second encryption mode; specifically: Randomly sort the data rows in the codebook 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.
[0071] Construct the message header and message body based on the content to be processed and the recipient information, and encapsulate the message header and message body in JSON format to obtain the message structure; Encrypt the message structure in the JSON format using the first public key; Store the encrypted message structure into the HTTP request body to obtain the encrypted request body; Obtain a request structure by assembling the recipient information and the first key index; Encrypt the request structure using the second public key to obtain a request ciphertext; Assemble the request ciphertext, request ID, and second key index into an encrypted request header; In this embodiment, the request ID (reqId): This field adopts the format of "system code: UUID", where the system code is used to identify the sender system, and the UUID (universally unique identifier) ensures that each request is unique to avoid duplicate requests.
[0072] The encrypted request body and the encrypted request header are assembled into a target message; the target message corresponds one-to-one with the receiver information.
[0073] The present invention adopts a multi-level encryption mechanism during data transmission to ensure the confidentiality and integrity of data. The node service is configured with a codebook configuration table to store the public key, private key and index information used for encryption and decryption.
[0074] On the data sender's side, the encryption assembly module encrypts the message structure using the first public key and encapsulates the encrypted result in the HTTP request body. Simultaneously, the second public key is used to encrypt the request structure containing the first key index to generate an encrypted request header. Finally, the encrypted request body and encrypted request header are combined into the target message for transmission.
[0075] On the data receiving end, the decryption module first uses the corresponding private key to decrypt the ciphertext in the encrypted request header to obtain the first key index. Using this index, the module then retrieves the corresponding private key to decrypt the encrypted request body, restoring the original message content. This cross-encryption mechanism, where the key index is placed in the encrypted request header and the data body is independently encrypted, effectively prevents key information leakage and improves overall encryption strength and attack resistance.
[0076] Specifically, during the encryption assembly process, the first public key is first used to encrypt the JSON format message structure consisting of the message header and the 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 structure is encrypted using the second public key to form an encrypted request header, which contains the key index information for decrypting the request body. By placing the key index for decrypting the request body in the encrypted request header, the decryption information is separated from the data content. At the same time, different encryption methods are used to encrypt the request body and the request header respectively, forming a dual protection mechanism. This encryption method with cross-key placement not only enhances the security of the data transmission process and prevents the key information from being directly exposed, but also ensures that the recipient can decrypt in sequence according to the correct key sequence, thereby improving the system's security level and the reliability of data processing.
[0077] In addition, since inter-system communication does not rely on third-party middleware, the data transmission path is controllable and only occurs between trusted nodes, avoiding the trust risks brought by external services and further enhancing the security boundary of the system.
[0078] The message header includes: message type, sender's node name and target receiver's field content; the request structure includes: receiving address, timestamp, receiver's system code and first key index.
[0079] Forward the target message to the target node service through the forwarder; In this embodiment, data synchronization uses direct calls rather than asynchronous messaging. When new business data is generated in the system backend, the service layer of the current node service immediately triggers the synchronization process, encapsulating the content to be processed as a target message and sending it to the target node service, achieving real-time push of incremental data.
[0080] Specifically, the logic processing module determines whether the content to be processed meets the forwarding conditions and, if so, determines the recipient information. The encryption assembly module encrypts the message, and the forwarder sends the target message to the recipient node via an HTTP request. The recipient node receives the message through a receiver, decrypts it, and adapts it to complete data delivery.
[0081] This real-time synchronization mechanism avoids the data lag problem caused by message backlog or network delay in traditional asynchronous middleware, ensuring that key business information (such as approval data) can be delivered to relevant units in a timely manner, thus ensuring the timeliness of business processing.
[0082] The parameter configuration table also includes: a mapping relationship table; The mapping relationship table is used to record the data table corresponding to each message type; The logic processing module is further configured to preset 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 includes all fields of the corresponding data table and their corresponding data type information.
[0083] The node service further includes an adaptation layer, which is used to: Parse the decrypted JSON format message body and message header; By parsing the message type in the message header, determine the data table corresponding to the type in the mapping relationship table, and obtain the data structure model corresponding to the data table as the target model; Convert the parsed data into different data types and perform field mapping, and then fill the converted data into the target model based on the field mapping results. The data type conversion means converting the data of the parsed message body into a data type and format that conforms to the data table defined in the system database corresponding to the current node service; The field mapping means mapping the fields in the parsed message body to the fields in the corresponding data table in the system database corresponding to the current node service.
[0084] 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.
[0085] To address the differences in data models, field definitions, and data types among heterogeneous databases used by different systems, this paper implements an adaptation layer to uniformly handle data format conversion. This mechanism automatically adapts to heterogeneous data structures, effectively resolving the challenge of data synchronization across systems and database types, reducing the risk of errors during data conversion and improving data consistency and system compatibility.
[0086] Specifically, the present invention effectively solves the technical difficulties faced by data synchronization between heterogeneous databases, such as data model differences, field inconsistencies, and type conversion difficulties, by introducing a mapping relationship table and presetting a corresponding data structure model for each data table. After receiving the decrypted JSON format message, the adaptation layer first searches for the corresponding data table in the mapping relationship table according to the message type and obtains the preset data structure model for 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 results of the field mapping, and finally completes the data writing through the database driver. This mechanism realizes the 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 presetting of the data structure model and the automatic mapping processing of the adaptation layer, the system's dependence on a specific database platform is reduced, the flexibility and scalability of data synchronization are improved, and the requirements for efficient, secure, and flexible data synchronization in a multi-system environment are met.
[0087] It should be noted that in order to build an efficient and reliable central node service, this embodiment uses Spring Boot as the basic framework and introduces the BeetlSQL lightweight ORM framework to handle database operations. The following details the specific steps for building a node service:
[0088] 1. In Linux environment, use the yum package manager to install the Java Development Kit (JDK).
[0089] 2. Edit the system environment variable configuration file / etc / profile, set JAVA_HOME and update the PATH variable.
[0090] 3. Initialize the parameter configuration table in the system database:
[0091] 3.1. Supplement the node meta-information table with the current node's system code, corresponding organization ID, and whether it is a central node.
[0092] 3.2. Initialize key configuration: Initialize the various encryption methods corresponding to the current node and their corresponding key indexes, public key and private key in the password configuration table, and synchronize these data to the password configuration table of the central node.
[0093] 3.3. Configure forwarding rules: Configure the relevant information of various messages in the message push rule configuration table.
[0094] 4. Run the node service.
[0095] 4.1. Unzip the pre-packaged node service package to the specified directory on the server. For example, assume the unzip directory is / opt / node-service.
[0096] 4.2. Enter the unzipped directory and execute the startup script in the bin subdirectory.
[0097] After executing the above startup script, the node service will start according to the settings in the configuration file and begin to listen for data requests from other node services.
[0098] The present invention deploys node services on each system, performs decryption operations on received messages through the decryption module in the node service, and uses the node meta-information table and the content to be processed to identify whether the forwarding conditions are met through the logic processing module. This intelligent forwarding condition judgment mechanism avoids unnecessary data transmission and optimizes the use of network resources; and when the forwarding conditions are met, the recipient 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, the present invention flexibly adjusts the recipient 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, the present 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.
[0099] An embodiment of the present invention further provides an electronic device, comprising: 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, wherein the computer program, when executed by the at least one processor, causes the electronic device to perform the method of an embodiment of the present invention.
[0100] An embodiment of the present invention further provides a non-transitory machine-readable medium storing a computer program, wherein the computer program, when executed by a processor of a computer, is used to cause the computer to perform the method of the embodiment of the present invention.
[0101] An embodiment of the present invention further provides a computer program product, including a computer program, wherein when the computer program is executed by a processor of a computer, it is used to enable the computer to perform the method of the embodiment of the present invention.
[0102] refer to Figure 4, a block diagram of an electronic device that can serve as a server or client of an embodiment of the present invention will now be described, which is an example of a hardware device that can be applied to various aspects of the present invention. Electronic devices are 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. Electronic devices can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.
[0103] like Figure 4 As shown, the electronic device includes a computing unit 401, which can perform various appropriate actions and processes according to 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. RAM 403 can also store various programs and data required for the operation of the electronic device. The computing unit 401, ROM 402, and RAM 403 are connected to each other via a bus 404. An input / output (I / O) interface 405 is also connected to the bus 404.
[0104] Multiple components within the electronic device are connected to the I / O interface 405, including an input unit 406, an output unit 407, a storage unit 408, and a communication unit 409. The input unit 406 can be any type of device capable of inputting information into the electronic device. The input unit 406 can receive input numeric or character information and generate key signal inputs related to user settings and / or function control of the electronic device. The output unit 407 can be any type of device capable of presenting information and can include, but is not limited to, a display, a speaker, a video / audio output terminal, a vibrator, and / or a printer. The storage unit 408 can include, but is not limited to, a magnetic disk or an optical disk. The communication unit 409 allows the electronic device to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks, and can include, but is not limited to, a modem, a network card, an infrared communication device, a wireless communication transceiver, and / or a chipset, such as a Bluetooth device, a WiFi device, a WiMax device, a cellular communication device, and / or the like.
[0105] Computing unit 401 can be any general-purpose and / or specialized processing component with processing and computing capabilities. Some examples of computing unit 401 include, but are not limited to, a CPU, a graphics processing unit (GPU), various specialized artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Computing unit 401 performs the methods and processes described above. For example, in some embodiments, method embodiments of the present invention may be implemented as a computer program tangibly embodied 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 onto the electronic device via ROM 402 and / or communication unit 409. In some embodiments, computing unit 401 may be configured to perform the above-described methods by any other suitable means (e.g., via firmware).
[0106] The computer programs for implementing the methods of the 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 device, so that when the computer programs are executed by the processor or controller, the functions / operations specified in the flowcharts and / or block diagrams are implemented. The computer programs may be executed entirely on the machine, partially on the machine, as a stand-alone software package, partially on the machine and partially on a remote machine, or entirely on a remote machine or server.
[0107] In the context of embodiments of the present invention, a machine-readable medium may 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 may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable signal medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of machine-readable storage media may include an electrical connection based on one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), optical fibers, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0108] 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 position relationship, movement status, etc. between the various components under a certain specific posture (as shown in the accompanying drawings). If the specific posture changes, the directional indication will also change accordingly.
[0109] In addition, in the present invention, descriptions such as "first," "second," and "one" are for descriptive purposes only and should not be understood to indicate or imply their relative importance or implicitly specify the number of the technical features indicated. Therefore, a feature specified as "first" or "second" may explicitly or implicitly include at least one of such features. In the description of the present invention, "plurality" means at least two, such as two, three, etc., unless otherwise specifically defined.
[0110] In the present invention, unless otherwise specified or limited, the terms "connection" and "fixation" should be understood in a broad sense. For example, "fixation" can mean fixed connection, detachable connection, or integration; mechanical connection or electrical connection; direct connection or indirect connection through an intermediate medium; internal communication between two elements or interaction between two elements, unless otherwise specified. Those skilled in the art will be able to understand the specific meanings of the above terms in the present invention based on specific circumstances.
[0111] In addition, the technical solutions between the various embodiments of the present invention can be combined with each other, but it must be based on the fact that ordinary technicians in this field can implement it. When the combination of technical solutions is mutually contradictory or cannot be implemented, it should be deemed that such a combination of technical solutions does not exist and is not within the scope of protection required by the present invention.
Claims
1. A data synchronization method based on node service, applied to multi-system platform; characterized in that: The multi-system platform includes: a master system and one or more slave systems; each system is deployed with a node service, wherein the node service deployed on the master system is a master node, and the node service deployed on the slave system is a slave node; the node service includes: 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 meta-information table, a node service and system association table, a message push rule configuration table, a message receiving address configuration table, and a password configuration table; the data transceiver layer includes a receiver and a forwarder; the service layer includes a decryption module, a logic processing module, and an encryption assembly module; the data synchronization method includes: Receive messages from other node services and business data from the corresponding system background through the receiver; Decryption module uses the cipher 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 the corresponding node meta-information table and the content to be processed to identify whether the content meets the forwarding conditions. If so, the association configuration table and / or the message receiving address configuration table are used to determine the recipient information based on the content to be processed, and the encrypted message is constructed based on the recipient information and the content to be processed; the association 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 encrypted message to obtain the target message; the target message is forwarded to the target node service through the forwarder; The content to be processed is business data from the system background or decrypted message data.
2. A data synchronization method based on node service according to claim 1, characterized in that: The node meta information 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 of 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 corresponding to each message type, and the corresponding forwarding rules; The fields of the message receiving address configuration table include: the node name of the receiver, the receiving address, the node type and the system code of the system to which it belongs; The fields of the codebook configuration table include: encryption mode 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. A data synchronization method based on node service 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; Second forwarding rule: Send the message to all node services under the corresponding receiver node type except the sender.
4. A data synchronization method based on node service according to claim 3, characterized in that: The logic processing module uses the corresponding node meta-information table and the content to be processed to identify whether the content meets the forwarding conditions, specifically: When the content to be processed is business data from the system background, based on the preset correspondence between the message type and the forwarding object, the message type corresponding to 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 node meta-information table identifies that the current node serves as the master node and the content to be processed is decrypted message data, it is determined whether the message meets the forwarding condition based on the content in the message data.
5. A data synchronization method based on node service according to claim 4, characterized in that: When the content to be processed is business data from the system background, based on the preset correspondence between the message type and the forwarding object, the message type corresponding to the business data is used to determine whether the business data meets the forwarding conditions, specifically: The forwarding object corresponding to the business data is obtained by using the preset correspondence between the message type and the forwarding object through the message type of the business data; 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. A data synchronization method based on node service according to claim 5, characterized in that: The determining of the recipient information based on the content to be processed using the association configuration table and / or the message receiving address configuration table is specifically: When the current node service is a slave node and the content to be processed is business data from the system background, based on the preset correspondence between the message type and the target recipient, the field content of the business data corresponding to the target recipient is set; the field content is empty or the target node name, that is, the node name of the target node service; Determine the recipient information based on the target recipient's field content and the row information corresponding to the master node in the message receiving address configuration table; When the current node serves as the master node and the content to be processed is business data from the system background, the recipient information is determined by associating the configuration table with the message receiving address configuration table; When the current node serves as 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 through the message receiving address configuration table based on the field content; If so, the receiver information is determined by associating the configuration table with the message receiving address configuration table.
7. A data synchronization method based on node service according to claim 6, characterized in that: The receiver information is determined by associating the configuration table with the message receiving address configuration table, specifically: Obtain the recipient's node type and corresponding forwarding rules from the message push rule configuration table based on the message type corresponding to the content to be processed; Obtain the node names included in the node service and system association table based on the obtained node type and forwarding rule; Obtain the corresponding receiver information in the message receiving address configuration table through the obtained node name; Each acquired node name has unique corresponding receiver information.
8. A data synchronization method based on node service according to claim 7, characterized in that: The recipient information includes: the field contents of the receiving address and the target recipient; the encryption methods in the password configuration table include at least two.
9. A data synchronization method based on node service according to claim 8, characterized in that: When the current node serves as the master node and the content to be processed is decrypted message data, if the field content of the target recipient is not empty, the receiving address in the recipient information is the receiving address corresponding to the target recipient.
10. A data synchronization method based on node service according to claim 8, characterized in that: The method of encrypting and assembling the encrypted message using the codebook configuration table to obtain the target message is as follows: Obtaining the first public key and the first key index corresponding to the key, the second public key and the second key index corresponding to the key through the codebook configuration table; Construct the message header and message body based on the content to be processed and the recipient information, and encapsulate the message header and message body in JSON format to obtain the message structure; Encrypt the message structure in the JSON format using the first public key; Store the encrypted message structure into the HTTP request body to obtain the encrypted request body; Obtain a request structure by assembling the recipient information and the first key index; Encrypt the request structure using the second public key to obtain a request ciphertext; Assemble the request ciphertext, request ID, and second key index into an encrypted request header; Assemble the encrypted request body and the encrypted request header into the target message; The target message corresponds to the receiver information one by one.
11. A data synchronization method based on node service according to claim 10, characterized in that: The message header includes: message type, sender's node name and target receiver's field content; the request structure includes: receiving address, timestamp, receiver's system code and first key index.
12. A data synchronization method based on node service according to claim 10, characterized in that: The first public key and the first key index corresponding to the key, the second public key and the second key index corresponding to the key are obtained through the codebook configuration table; specifically: Two encryption methods are randomly obtained through the code book configuration table, and one of them is set as the first encryption method and the other is set 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.
13. A data synchronization method based on node service according to claim 12, characterized in that: The method randomly obtains two encryption modes through the codebook configuration table, and sets one of them as the first encryption mode and the other as the second encryption mode; specifically: Randomly sort the data rows in the codebook 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.
14. A data synchronization method based on node service according to claim 11, characterized in that: When the node meta-information table identifies that the current node service is the main node and the content to be processed is decrypted message data, it is determined whether the message meets the forwarding conditions based on the content in the message data. Specifically, it is determined whether the field content of the target recipient in the decrypted message data is the node name of the current node service. If so, it means that the forwarding conditions are not met, and the local business processing logic is triggered; if not, it is determined that the message meets the forwarding conditions.
15. The data synchronization method based on node service according to claim 11, characterized in that: The decryption module uses the cipher book configuration table of the corresponding node service to perform a decryption operation on the message received by the receiver from other node services, specifically: Obtaining a second key index from the encryption request header of the message; Obtain the corresponding private key from the password configuration table of the current node service through the second key index, and decrypt the request ciphertext in the encrypted request header through the private key to obtain the first key index; The first key index is used to obtain the corresponding private key in the password configuration table of the current node service, and the encrypted request body of the message is decrypted using the private key to obtain the message body and message header in JSON format.
16. A data synchronization method based on node service according to claim 2, characterized in that: The parameter configuration table also includes: a mapping relationship table; The mapping relationship table is used to record the data table corresponding to each message type; The logic processing module is further configured to preset 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 includes all fields of the corresponding data table and their corresponding data type information.
17. A data synchronization method based on node service according to claim 16, characterized in that: The node service further includes an adaptation layer, which is used to: Parse the decrypted message body and message header; By parsing the message type in the message header, determine the data table corresponding to the type in the mapping relationship table, and obtain the data structure model corresponding to the data table as the target model; Convert the parsed data into different data types and perform field mapping, and then fill the converted data 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.
18. A data synchronization method based on node service according to claim 17, characterized in that: The data type conversion means converting the data of the parsed message body into a data type and format that conforms to the data table defined in the system database corresponding to the current node service; The field mapping means mapping the fields in the parsed message body to the fields in the corresponding data table in the system database corresponding to the current node service.
19. An electronic device comprising: A processor and a memory storing a program, wherein the program comprises instructions which, when executed by the processor, cause the processor to perform the method according to any one of claims 1 to 18.
20. A non-transitory machine-readable medium storing computer instructions, characterized in that The computer instructions are used to cause the computer to execute the method according to any one of claims 1 to 18.
Citation Information
Patent Citations
Automatic synchronization achieving method for business data between heterogeneous systems
CN105787057A
Wireless private network real-time communication service encryption method and wireless private network real-time communication service encryption system
CN108390847A
Communication method, device and equipment based on option list
CN118612310A
Adaptation method in use for syncretizing Ethernet and SHD or synchronous optical network
CN1728720A
Method and apparatus for delivering digital media using packetized encryption data
US20030018917A1
Cited By
Data synchronization method based on node service and related equipment
CN121151417A
A node service-based data synchronization method and related device
CN121151417B