Data synchronization method, system and device supporting commercial secret algorithm conversion and medium
By introducing an adapter resource pool mechanism and a plug-in adapter design, the security risks and inefficiencies caused by inconsistent cryptographic algorithms in cross-system data synchronization are solved, realizing secure transmission and efficient synchronization of encrypted data, which is suitable for high-frequency and high-usage scenarios of public credit information.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-03
- Publication Date
- 2026-03-13
AI Technical Summary
During cross-system data synchronization, inconsistencies in cryptographic algorithms necessitate the transmission of sensitive data in plaintext, posing security risks and inefficiencies.
By introducing an adapter resource pool mechanism, the decryption algorithm of the data provider and the encryption algorithm of the data acquirer are decoupled, supporting multiple field-level processing strategies, such as decrypt-re-encryption, encryption only, and skip processing. The adapter with plug-in design is dynamically registered and hot-updated, so that the encrypted data is available but not visible.
It safeguards data sovereignty and privacy, enhances the system's versatility and adaptability, reduces system coupling, improves the efficiency and reliability of large-scale data synchronization, and reduces the cost of building separate encryption and decryption conversion libraries.
Smart Images

Figure CN121664495A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of information technology and data security technology, specifically to a data synchronization method, system, device, and medium that supports commercial cryptographic algorithm conversion. Background Technology
[0002] With the deepening of the national public credit information system, a four-tiered credit information platform has been established at the national, provincial, municipal, and county levels. Each platform is primarily responsible for aggregating and processing public credit data within its jurisdiction and pushing data to higher-level nodes. Under the current integrated public credit information collection model, nodes at all levels generally use a front-end database for data synchronization. Specifically, lower-level nodes store the collected public credit data in plaintext in the front-end database, and then higher-level nodes retrieve the data using data synchronization tools (such as DM data exchange tools, KETTLE, etc.). Similarly, when nodes at all levels obtain data from data providers at the same level, they mostly use this method of plaintext exchange with a front-end database.
[0003] However, as credit information collection standards become increasingly refined, the synchronized data will inevitably include more sensitive information involving enterprises and individuals (such as ID card numbers, information on senior executives, and financial reports). If this data is stored and transmitted directly in plaintext in the front-end database, it poses a significant data breach security risk. At the same time, the requirement for critical networks and information systems to complete application security assessments using commercial cryptography places higher compliance demands on data security.
[0004] In the actual process of public credit data synchronization, due to the large number of data source entities, different entities may use different types of commercial cryptographic algorithms or have encryption and decryption services provided by different service providers, resulting in inconsistent data encryption standards. This presents significant pain points for data acquirers and providers when sharing encrypted data using a pre-repository: to complete data synchronization, the current common approach is to first decrypt the data into plaintext and store it in a shared repository or pre-repository, and then, after synchronization, the data acquirer re-encrypts and stores it in the repository. This approach is not only cumbersome, but more importantly, it results in sensitive data existing in plaintext form at multiple stages, greatly increasing the risk of data exposure, and also incurring high costs due to the need to build and maintain separate encryption and decryption conversion systems. Summary of the Invention
[0005] In view of this, it is necessary to provide a data synchronization method, system, device and medium that supports commercial cryptographic algorithm conversion, so as to solve the technical problem in the prior art that sensitive data must be transmitted in plaintext due to inconsistent cryptographic algorithms during cross-system data synchronization, which leads to security risks and low efficiency.
[0006] To address the aforementioned technical problems, in a first aspect, the present invention provides a data synchronization method supporting commercial cryptographic algorithm conversion, comprising: Obtain a list of source data tables and a list of target data tables; the list of source data tables includes source data tables that have been configured to store public credit information to be reported, and the list of source data tables includes target data tables that have been configured to store the encrypted public credit information; Obtain an adapter resource pool, which includes multiple adapters configured with at least one of a decryption algorithm and an encryption algorithm, wherein the decryption algorithm is provided by the data provider and the encryption algorithm is provided by the data acquirer; Create a data synchronization task, the data synchronization task including a field to be synchronized marked with at least one of decryption requirements and encryption requirements; The data synchronization task is executed and the encrypted data is written to the target data table. Specifically, the data synchronization task includes: reading target data from the source data table according to the field to be synchronized; calling a specified decryption adapter to decrypt the target data corresponding to the field to be synchronized with the decryption requirement to obtain intermediate plaintext data; and calling a specified encryption adapter to encrypt the data to be encrypted to obtain the encrypted data. The data to be encrypted includes the intermediate plaintext data, or the target data with the decryption requirement but with the decryption operation skipped.
[0007] In one possible implementation, obtaining the source data table list and the target data table list includes: Obtain parameter configuration information and data table configuration information. The parameter configuration information includes the database names, network addresses, port numbers, and login credentials of the source and target databases. Establish a connection channel between the source database and the target database based on the database name, the network address, the port number, and the login credentials; The data table configuration operation is performed based on the data table configuration information to obtain the source data table list and the target data table list.
[0008] In one possible implementation, obtaining the adapter resource pool includes: If the algorithm type and key are known, the decryption algorithm and the encryption algorithm are set through the configuration operation obtained through the graphical configuration interface, and the configured adapter is obtained by obtaining the key through the graphical configuration interface. The adapter resource pool is obtained based on the configured adapter. If the algorithm type and key are unknown, the graphical configuration interface sequentially obtains the application programming interface call name, call form and its commercial cryptographic algorithm file, key and the logic code corresponding to the third-party commercial cryptographic algorithm to obtain the configured adapter, and obtains the adapter resource pool based on the configured adapter.
[0009] In one possible implementation, the invocation form includes HTTP API packages and JAR packages; If the calling form is the JAR package, upload the JAR package file containing the third-party commercial cryptographic algorithm provided by the third-party algorithm organization; If the call format is the HTTP API, obtain the HTTP address, submission mode, and header, and upload them; the submission mode includes POST submission mode and GET submission mode, and fill in the required header according to the third-party encryption and decryption requirements; the commercial encryption algorithm file provided by the third-party algorithm organization is a JAR package file.
[0010] In one possible implementation, the decryption algorithm and the encryption algorithm include any one of the national commercial cryptography standard algorithm and the third-party commercial cryptography algorithm, wherein the national commercial cryptography standard algorithm includes at least one of the SM2 algorithm, SM3 algorithm or SM4 algorithm.
[0011] In one possible implementation, the creation of the data synchronization task includes: Select the chosen source data table from the list of source data tables, and determine the fields to be synchronized; The decryption adapters are selected from those already configured with the decryption algorithm, and a decryption requirement is set for the field to be synchronized. Based on the target data table list, select the target data table, filter out the encryption adapters from the adapters that have been configured with the encryption algorithm, and set the encryption requirement flag for the field to be synchronized; Configure the incremental data recognition mode to complete the creation of the data synchronization task.
[0012] In one possible implementation, the incremental data identification mode includes an MD5 full-text comparison synchronization mode or an incremental data synchronization mode based on the primary key and the last modification timestamp.
[0013] Secondly, the present invention also provides a data synchronization system supporting commercial cryptographic algorithm conversion, comprising: A data source management device is used to obtain a list of source data tables and a list of target data tables; the list of source data tables includes source data tables that have been configured to store public credit information to be reported, and the list of source data tables includes target data tables that have been configured to store encrypted public credit information; An encryption / decryption adapter is used to obtain an adapter resource pool, the adapter resource pool including multiple adapters configured with at least one of a decryption algorithm and an encryption algorithm, the decryption algorithm being provided by a data provider and the encryption algorithm being provided by a data acquirer; A synchronization configuration device is used to create a data synchronization task, execute the data synchronization task, and write encrypted data into the target data table. The data synchronization task includes a field to be synchronized that is marked with at least one of decryption and encryption requirements. Executing the data synchronization task specifically includes: reading target data from the source data table according to the field to be synchronized; calling a specified decryption adapter to decrypt the target data corresponding to the field to be synchronized with the decryption requirement to obtain intermediate plaintext data; and calling a specified encryption adapter to encrypt the data to be encrypted to obtain the encrypted data. The data to be encrypted includes the intermediate plaintext data, or the target data with the decryption requirement but skipping the decryption operation.
[0014] Thirdly, the present invention also provides an electronic device, including a memory and a processor, wherein, The memory is used to store programs; The processor, coupled to the memory, is used to execute the program stored in the memory to implement the steps in the data synchronization method supporting commercial cryptographic algorithm conversion as described in any of the above implementations.
[0015] Fourthly, the present invention also provides a computer-readable storage medium for storing a computer-readable program or instructions, which, when executed by a processor, can implement the steps of the data synchronization method supporting commercial cryptographic algorithm conversion described in any of the above implementations.
[0016] The beneficial effects of this invention are as follows: The data synchronization method supporting commercial cryptographic algorithm conversion provided by the embodiments of this invention firstly decouples the decryption algorithm of the data provider from the encryption algorithm of the data acquirer by introducing an adapter resource pool mechanism. This allows different entities to achieve "usable but invisible" encrypted data without exposing the core algorithm, ensuring data sovereignty and privacy security. Furthermore, the embodiments of this invention support multiple field-level processing strategies such as "decrypt-re-encryption," "encryption only," and "skip processing," adapting to complex data synchronization scenarios, such as data format conversion, compliance re-encryption, and multi-tenant isolation requirements, improving the system's versatility and adaptability. Furthermore, the adapter adopts a plug-in design, supporting dynamic registration and hot updates. Adding encryption or decryption algorithms does not require modification of the core synchronization logic, reducing system coupling and facilitating third-party algorithm integration and version iteration. Furthermore, through field-level marking and intelligent scheduling, the performance overhead of full-table decryption is avoided, effectively improving the efficiency and reliability of large-scale data synchronization, suitable for high-frequency, high-usage public credit information reporting scenarios. This application can encrypt sensitive data (such as public credit information) stored in the target database throughout the entire process, reducing the cost of building a separate encryption / decryption conversion library for encryption. Attached Figure Description
[0017] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0018] Figure 1 This is a schematic flowchart of an embodiment of the data synchronization method supporting commercial cryptographic algorithm conversion provided by the present invention; Figure 2 For the present invention Figure 1 A schematic diagram of an embodiment of S100; Figure 3 For the present invention Figure 1 A schematic diagram of an embodiment of S300; Figure 4 This is a schematic diagram of the structure of an embodiment of the data synchronization system supporting commercial cryptographic algorithm conversion provided by the present invention; Figure 5 A schematic diagram illustrating the relationship between the encryption / decryption adapter and the synchronization configuration device provided by this invention; Figure 6 A schematic diagram illustrating the relationship between the synchronization configuration device and the synchronization strategy configuration unit provided by the present invention; Figure 7 A schematic diagram illustrating the relationship between the execution unit and various devices provided by the present invention; Figure 8 A flowchart illustrating a single execution provided by the present invention; Figure 9 A schematic diagram of the structure of an embodiment of the electronic device provided by the present invention. Detailed Implementation
[0019] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of the present invention.
[0020] In the description of the embodiments of the present invention, unless otherwise stated, "multiple" means two or more. "And / or" describes the relationship between related objects, indicating that there can be three relationships. For example, A and / or B can represent three situations: A exists alone, A and B exist simultaneously, and B exists alone.
[0021] The terms "first," "second," etc., used in the embodiments of this invention 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. Therefore, a technical feature defined with "first" or "second" may explicitly or implicitly include at least one of that feature.
[0022] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of the invention. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.
[0023] This invention provides a data synchronization method, system, device, and medium that supports commercial cryptographic algorithm conversion, which are described below.
[0024] Figure 1 This is a schematic flowchart of an embodiment of the data synchronization method supporting commercial cryptographic algorithm conversion provided by the present invention, as shown below. Figure 1 As shown, data synchronization methods that support commercial cryptographic algorithm conversion include: S100. Obtain a list of source data tables and a list of target data tables; the list of source data tables includes source data tables that have been configured to store public credit information to be reported, and the list of source data tables includes target data tables that have been configured to store the encrypted public credit information.
[0025] It should be noted that: such as Figure 4 As shown, the system is divided into four parts according to its hierarchical structure: encryption / decryption adaptation device, synchronization configuration device, data synchronization strategy device, and data source management device. The data source management device reads the configured source data table list and target data table list from a preset data catalog service or metadata management platform. The source data table stores public credit information to be reported, which may have been encrypted by the data provider; the target data table receives the encrypted public credit information for subsequent use by the data acquirer. Each data table contains field-level metadata, including field name, data type, encryption identifier, and decryption requirement flag. The public credit information includes information on categories such as administrative licenses, administrative penalties, administrative supervision and inspection, and administrative rewards for enterprises or individuals.
[0026] S200. Obtain an adapter resource pool, the adapter resource pool including multiple adapters configured with at least one of a decryption algorithm and an encryption algorithm, the decryption algorithm being provided by the data provider and the encryption algorithm being provided by the data acquirer.
[0027] It should be noted that the encryption / decryption adapter loads a pre-built adapter resource pool. This resource pool registers multiple adapter instances, each encapsulating a specific decryption or encryption algorithm. The decryption algorithm is provided by the data provider and used to restore its encrypted data content; the encryption algorithm is provided by the data acquirer and used to re-encrypt plaintext or intermediate data during data synchronization, ensuring data confidentiality during transmission and storage. The adapter adopts a plug-in architecture, supporting hot-swapping and dynamic loading, facilitating expansion and maintenance.
[0028] S300. Create a data synchronization task, wherein the data synchronization task includes a field to be synchronized that is marked with at least one of decryption requirements and encryption requirements.
[0029] It should be noted that the synchronization configuration device creates data synchronization tasks based on business needs. Task configuration includes the mapping relationship between the source and target data tables, field-level synchronization rules, and whether each field is marked as requiring decryption or encryption. For example, if a field is already encrypted in the source data table, it is marked as "requires decryption"; if the target data table requires the field to be stored encrypted using a specific algorithm, it is marked as "requires encryption." The system supports flexible combinations of decryption and encryption requirements, enabling "decryption-re-encryption" or "encryption only" processing paths.
[0030] S400. Execute the data synchronization task and write the encrypted data into the target data table; the execution of the data synchronization task specifically includes: reading target data from the source data table according to the field to be synchronized, calling the specified decryption adapter to decrypt the target data corresponding to the field to be synchronized with the decryption requirement to obtain intermediate plaintext data, and calling the specified encryption adapter to encrypt the data to be encrypted to obtain the encrypted data; the data to be encrypted includes the intermediate plaintext data, or the target data with the decryption requirement but skipping the decryption operation.
[0031] It should be noted that the synchronization configuration device determines whether the field to be synchronized has the aforementioned decryption requirement. If so, it uses a data synchronization tool (such as DM Data Sharing and Exchange Tool, KETTLE, or other third-party synchronization products) to call the corresponding decryption adapter to decrypt the target data according to the decryption algorithm. If not, it skips the decryption operation and calls the corresponding encryption adapter to encrypt the decrypted data or the target data that skipped the decryption operation according to the encryption algorithm. Specifically, based on the field mapping relationship, the target data is read from the source data table. For fields to be synchronized marked with "decryption requirement," the corresponding decryption adapter (implemented by the data provider's algorithm) is called to decrypt the encrypted data to generate intermediate plaintext data. If the field to be synchronized is also marked with "encryption requirement," the encryption adapter provided by the data acquirer is called to encrypt the intermediate plaintext data (or the original data that skipped the decryption step) to obtain encrypted data. The processed encrypted data is then written into the corresponding field of the target data table.
[0032] In summary, the data synchronization method supporting commercial cryptographic algorithm conversion provided by this invention firstly decouples the decryption algorithm of the data provider from the encryption algorithm of the data acquirer by introducing an adapter resource pool mechanism. This allows different entities to achieve "usable but invisible" encrypted data without exposing the core algorithm, ensuring data sovereignty and privacy security. Furthermore, this invention supports multiple field-level processing strategies such as "decrypt-re-encryption," "encryption only," and "skip processing," adapting to complex data synchronization scenarios, such as data format conversion, compliance re-encryption, and multi-tenant isolation requirements, improving the system's versatility and adaptability. Furthermore, the adapter adopts a plug-in design, supporting dynamic registration and hot updates. Adding encryption or decryption algorithms does not require modification of the core synchronization logic, reducing system coupling and facilitating third-party algorithm integration and version iteration. Furthermore, through field-level marking and intelligent scheduling, the performance overhead of full-table decryption is avoided, effectively improving the efficiency and reliability of large-scale data synchronization, suitable for high-frequency, high-usage public credit information reporting scenarios. This application can encrypt sensitive data (such as public credit information) stored in the target database throughout the entire process, reducing the cost of building a separate encryption / decryption conversion library for encryption.
[0033] In some embodiments of the present invention, such as Figure 2 As shown, step S100 includes: S110. Obtain parameter configuration information and data table configuration information. The parameter configuration information includes the database names, network addresses, port numbers, and login credentials of the source database and the target database.
[0034] It should be noted that the data source management device is used to connect to multi-source heterogeneous databases. By configuring the IP address, database type, username, and password of the required database, it achieves unified management and maintenance of the required data sources and data tables, including database units and data table units. The database unit is used to configure the parameters of the database storing shared and encrypted credit information. Specifically, before the data synchronization task is executed, the database connection is established and the data table list is configured to ensure that subsequent encryption conversion and synchronization operations can be performed accurately and efficiently. The device receives user-input parameter configuration information through a configuration interface or API interface. This parameter configuration information includes, but is not limited to: the source and target database names, network addresses (IP addresses or domain names), port numbers, database types (such as MySQL, Oracle, DM, etc.), login credentials (username, password, key file, etc.), and URL paths. The data table unit configures the public credit information data table used to store encrypted data to be reported, as well as the data table planned to store encrypted data. This primarily refers to the physical table names. The system reads the data table configuration information, including the table names, field names, field types, primary key definitions, encryption identifiers, synchronization flags, and other metadata of the source and target data tables. This configuration information can be stored in a local configuration file, a registry center, or a configuration center (such as Nacos or Apollo), supporting dynamic updates and version management.
[0035] S120. Establish a connection channel between the source database and the target database based on the database name, the network address, the port number, and the login credentials.
[0036] It should be noted that: based on JDBC, ODBC, or the native database driver, the above parameter configuration information is used to establish long-lived connections or connection pools with the source and target databases respectively. During the connection establishment process, the system can perform the following operations: verify network connectivity and port reachability; verify the validity of login credentials and support encrypted password transmission (such as SSL / TLS encrypted channels); identify the database type and version, and automatically match the corresponding driver and dialect; initialize connection pool parameters (such as maximum number of connections, idle timeout, retry policy) to ensure connection stability under high concurrency scenarios; and register the successfully established connection channel to the connection management module for reuse in subsequent data read and write operations.
[0037] S130. Perform data table configuration operations according to the data table configuration information to obtain the source data table list and the target data table list.
[0038] It should be noted that after a successful connection is established, the system further parses the data table configuration information and performs the following configuration operations: It scans the specified source data table in the source database, extracts its physical structure (field names, data types, constraints), and compares it with the data table configuration information, detecting issues such as missing fields or type mismatches, and issuing alarms or automatically correcting them. It checks whether a corresponding target data table exists in the target database. If not, it automatically generates a table creation SQL statement based on the source data table structure and creates the target data table using encrypted field identifiers (automatic addition of encrypted or extended fields is supported). It constructs a source data table list and a target data table list, including table names, field mapping relationships, primary key fields, encryption / decryption flags, synchronization priority, and whether incremental synchronization is supported. The generated source data table list and target data table list are cached in memory or persisted to the metadata database for subsequent synchronization task scheduling and field-level encryption / decryption processing.
[0039] Preferably, the system supports a visual configuration interface, allowing users to configure the mapping between tables and fields by dragging and dropping or selecting options, and preview the generated list content in real time. The system also supports batch import of configurations (such as Excel templates), improving the efficiency of configuring large-scale table structures.
[0040] In this embodiment, by unifying configuration parameters and automatically establishing connection channels, the inefficient operation of manually connecting to databases one by one is avoided, reducing the configuration error rate and improving system deployment efficiency. This is especially suitable for multi-level, multi-source heterogeneous database environments (such as national, provincial, municipal, and county-level credit platforms). Furthermore, the source and target data table structures are automatically parsed and verified, identifying inconsistencies in fields and missing tables in advance, ensuring data structure matching during synchronization tasks and preventing synchronization failures or data loss due to structural errors. Furthermore, the configuration information and connection channels support dynamic updates. When database addresses change or table structures evolve, adjustments can be made quickly without restarting the service, enhancing system maintainability and scalability, and adapting to the continuously refined development trend of credit data standards. Furthermore, by generating a clearly structured list of source / target data tables, fields requiring encryption, decryption, or conversion are clearly marked, providing accurate metadata for subsequent calls to encryption / decryption adapters and field-level processing, ensuring the implementation of the "no plaintext without decryption" security policy. Furthermore, the entire configuration process is highly automated, supporting batch operations and visual interaction, significantly reducing the involvement of DBAs or developers, lowering labor costs, and improving the operability and sustainability of the public credit data sharing system.
[0041] In some embodiments of the present invention, obtaining the adapter resource pool includes: If the algorithm type and key are known, the decryption algorithm and the encryption algorithm are set through the configuration operation obtained through the graphical configuration interface, and the configured adapter is obtained by obtaining the key through the graphical configuration interface. The adapter resource pool is obtained based on the configured adapter.
[0042] It should be noted that the encryption / decryption adaptation device consists of three parts: an encryption adaptation unit, a decryption adaptation unit, and a standard commercial cryptographic unit. If the encryption adaptation unit is used to encrypt data, the corresponding decryption adaptation unit must be adapted simultaneously. If only the decryption adaptation unit is used to decrypt encrypted data, only the decryption adaptation unit needs to be adapted. If the encryption / decryption algorithm name and corresponding encryption factor are known, the built-in standard commercial cryptographic unit can be used directly for encryption and decryption. The encryption / decryption adaptation device is used to manage the adaptation of various commercial cryptographic algorithms, providing third-party commercial cryptographic algorithm management and supporting multiple formats such as HTTPAPI and JAR packages. Users can choose the built-in algorithm or directly use a third-party algorithm based on their integration needs.
[0043] If the type of national cryptographic algorithm and the corresponding encryption / decryption factor (i.e., key) corresponding to the data to be encrypted / decrypted are clearly known, the system provides a graphical configuration interface (web or client). Users can select the known algorithm type through drop-down boxes or selectors, such as national commercial cryptographic algorithms (e.g., SM2, SM3, or SM4 algorithms in the examples below). Users can directly select the national commercial cryptographic standard algorithm built into the system and add the provided encryption / decryption factor for peer encryption / decryption. That is, the user inputs the corresponding key information, including encryption key, decryption key, vector (IV), and other parameters. The system verifies the validity of the key (e.g., length, format, character set). After the user confirms the configuration, the system automatically generates the corresponding adapter instance, encapsulates the selected algorithm and key, registers it to the adapter resource pool, assigns a unique identifier to the adapter (e.g., UUID or algorithm name + key digest), and marks its type as "standard commercial cryptography" or "built-in algorithm". After configuration, the adapter can be directly referenced by synchronization tasks for field-level decryption or encryption processing. Among them, the built-in SM2, SM3, and SM4 algorithms are compiled based on the publicly available national algorithm standards and can be directly built into the decryption adapter.
[0044] If the algorithm type and key are unknown, the graphical configuration interface sequentially obtains the application programming interface call name, call form and its commercial cryptographic algorithm file, key and the logic code corresponding to the third-party commercial cryptographic algorithm to obtain the configured adapter, and obtains the adapter resource pool based on the configured adapter.
[0045] It should be noted that if the encryption / decryption algorithm type of the data provider (or recipient) is unclear, this encryption / decryption adapter can be used for debugging and adaptation. If using the encryption / decryption adapter, the user selects the "Third-Party Algorithm Adaptation" mode in the graphical configuration interface. The user is then guided to fill in the API call name provided by the third-party encryption / decryption provider (automatically generated by the system to uniquely identify the adapter), the call format (user selects the interface type), the commercial encryption algorithm file (including the JAR package or HTTPAPI package in the examples below), the key, and the logic code. The logic code can be obtained online using an online JAVA editor. After selecting the call format and uploading the commercial encryption algorithm file, the peer-to-peer encryption / decryption factor provided by the third party must be entered.
[0046] Of course, after debugging, the system saves and selects the corresponding encrypted (or plaintext) data, and tests it in the test environment. This involves the system performing security checks on the uploaded JAR package or API interface (such as virus scanning, static code analysis, and interface reachability testing). After successful verification, the system encapsulates the third-party algorithm into a standardized adapter, registers it in the adapter resource pool, and allows the adapter to be called in the test environment for encryption and decryption verification. Once confirmed to be correct, the adapter is then enabled for use in the formal synchronization task.
[0047] The relationship between the encryption / decryption adapter and the synchronization configuration device is as follows: Figure 5 As shown, a single synchronization configuration device can select at most one encryption execution unit, one decryption execution unit, and one standard commercial cryptographic algorithm unit at the same time.
[0048] In this embodiment, a graphical interface guides users through algorithm configuration, eliminating the need for writing complex code or manually deploying services. This significantly reduces the difficulty for non-professionals to use commercial cryptographic algorithms, making it suitable for scenarios with high security requirements but limited technical capabilities, such as government and finance. Furthermore, both national standard SM series algorithms and proprietary algorithms provided by third-party organizations can be integrated into the system in a unified manner, resolving compatibility issues caused by algorithm inconsistencies in multi-source heterogeneous data synchronization and improving the system's versatility and adaptability. Moreover, adding or updating algorithms does not require a system restart; adapters can be dynamically registered to the resource pool and take effect immediately, supporting online debugging and canary releases, thus improving system maintainability and business continuity.
[0049] In some embodiments of the present invention, the calling format includes HTTP API packages and JAR packages; If the calling format is the JAR package, upload the JAR package file provided by the third-party algorithm organization, which includes the third-party commercial cryptographic algorithm.
[0050] It should be noted that the graphical configuration interface provides methods for uploading commercial cryptographic algorithm files and configuring interface parameters based on different calling methods provided by third-party algorithm providers, ensuring that the system can correctly load and call the third-party encryption and decryption logic. If the user selects "JAR package" as the calling method in the graphical configuration interface, the system displays a file upload area, supporting drag-and-drop or click selection of local JAR package files. The user uploads a JAR package file containing the implementation class of the commercial cryptographic algorithm provided by the third-party algorithm provider. The system can perform the following verifications and processing on the uploaded JAR package: integrity verification, security scanning, interface specification checks, and class loading tests. After successful verification, the system stores the JAR package in a controlled directory and generates corresponding adapter configuration items, registering them in the adapter resource pool. The user can specify metadata such as key, algorithm name, and version number for the adapter to complete the configuration. Integrity verification includes verifying whether the JAR package is corrupted and contains valid .class files. Security scanning includes calling a virus scanning engine or static code analysis tools to detect whether it contains malicious code or illegal calls. Interface specification checks include checking whether the system-agreed encryption and decryption interfaces (such as Decryptor and Encryptor interfaces) are implemented. Class loading tests include attempting to load the main class from a JAR file in an isolated sandbox to confirm that no runtime exceptions occur.
[0051] If the call format is the HTTP API, obtain the HTTP address, submission mode, and header, and upload them; the submission mode includes POST submission mode and GET submission mode, and fill in the required header according to the third-party encryption and decryption requirements; the commercial encryption algorithm file provided by the third-party algorithm organization is a JAR package file.
[0052] It should be noted that: In the graphical configuration interface, when the user selects "HTTP API" as the calling method, the following configuration items are displayed for the user to fill in: HTTP address, submission mode (the user selects POST or GET as the request method), and header (fill in the required HTTP request headers according to the third party's requirements). The HTTP address is the URL of the encryption / decryption service interface provided by the third party. When the user clicks the "Test Connection" button, the system sends a simulated request to the API (test vectors or mock data can be used) to verify the interface's reachability and response format. The system performs format validation on the returned result to confirm whether it contains the expected plaintext or ciphertext fields. After the test passes, the system encapsulates the API configuration as a remote call adapter and registers it in the adapter resource pool. This allows the system to dynamically call the interface via an HTTP client to complete real-time encryption / decryption processing during subsequent synchronization tasks.
[0053] In this embodiment, regardless of whether the third-party algorithm is deployed as a local JAR package or provided as a remote API service, it can be integrated through a unified configuration interface. This solves the problem of significant differences in algorithm forms and inconsistent interfaces among different institutions, enhancing the system's openness and adaptability. Furthermore, users do not need to write integration code or manually deploy services; they only need to upload files or fill in interface information to complete algorithm integration, greatly reducing the workload of technical personnel. This is suitable for scenarios such as government and finance that require rapid integration with multiple algorithms. Furthermore, all integrated algorithms (whether JAR or API) are registered in a unified adapter resource pool, supporting retrieval and invocation by name, version, and type. This facilitates on-demand loading for subsequent synchronization tasks, achieving centralized and service-oriented management of algorithm resources. Furthermore, the system provides real-time JAR loading and API call testing functions, allowing users to identify and correct problems during the configuration phase. This prevents data errors or task interruptions due to algorithm call failures during formal synchronization tasks, improving system availability.
[0054] In some embodiments of the present invention, the decryption algorithm and the encryption algorithm include any one of the national commercial cryptography standard algorithm and the third-party commercial cryptography algorithm, wherein the national commercial cryptography standard algorithm includes at least one of the SM2 algorithm, SM3 algorithm or SM4 algorithm.
[0055] Application Scenario Example: In the construction of a public credit information platform, a provincial market supervision bureau, as the data provider, stores enterprise registration information encrypted using the SM4 algorithm; the National Development and Reform Commission, as the data recipient, requires the received data to be encrypted using the national cryptographic algorithm SM9. After adopting this solution, the system can automatically call the SM4 decryption adapter to restore the plaintext, and then call the SM9 encryption adapter to generate the target ciphertext, completing secure and compliant data reporting without manual intervention, ensuring algorithm confidentiality and data security.
[0056] In some embodiments of the present invention, such as Figure 3 As shown, step S300 includes: S310. Select a source data table from the list of source data tables and determine the fields to be synchronized.
[0057] It should be noted that: In the data loading unit, selecting the corresponding table to be synchronized includes choosing the data table unit to be configured from the data source and viewing the corresponding data table unit's table structure information. This involves loading the source data table list, displaying all configured source data tables and their field information. Users select the source data table to be synchronized through the graphical configuration interface and read the field structure information of that selected source data table. Users check the fields to be synchronized in the field list and record these fields as fields to be synchronized. The selected fields to be synchronized are validated to ensure that the field types are compatible with the target data table. Preferably, the system supports field filtering, allowing users to quickly filter fields by field name, field type, and other conditions, improving configuration efficiency.
[0058] S320. Select the decryption adapter from the adapters that have been configured with the decryption algorithm, and set a decryption requirement flag for the field to be synchronized.
[0059] It should be noted that: when selecting the fields to be shared in the data table unit, the system must specify the public credit field information to be shared, such as field name, size, and type. The system retrieves the previously configured encryption / decryption adapter parameters from the data cache, selects the corresponding decryption adapter based on its unique name, and specifies the field name to be decrypted. In other words, based on the encryption status of the fields to be synchronized, the system automatically identifies the fields that need decryption, filters adapters with configured decryption algorithms from the adapter resource pool, and displays the adapter list. When the user selects the corresponding decryption adapter, the system sets a decryption requirement flag for the fields to be synchronized, records the unique identifier of the decryption adapter and the corresponding field, ensuring correct invocation during synchronization task execution. Preferably, the system supports automatic recommendation of decryption adapters, automatically matching adapters based on the encryption algorithm type of the fields, reducing the user's configuration workload.
[0060] S330. Determine the selected target data table based on the target data table list, filter out the encryption adapters from the adapters that have been configured with the encryption algorithm, and set the encryption requirement flag for the field to be synchronized.
[0061] It should be noted that: In the data storage unit, select the corresponding data table unit (hereinafter referred to as the target data table unit) address for storing the encrypted public credit data in the data source management. The configuration device checks whether the corresponding table exists in the target data table unit. If it does not exist, it prompts and creates a new table. If it exists, it displays that it already exists, modifies the alias of the target data table unit, and automatically creates a table according to the table structure information of the data table unit to store the encrypted public credit data, and selects the corresponding encryption adapter. Check the fields in the target library that need to be encrypted. That is, load the target data table list, display all configured target data tables and their field information. The user selects the target data table corresponding to the source data table, and the system reads the field structure information of the table. According to the encryption requirements of the target data table, the system automatically identifies the fields that need to be encrypted, filters the adapters with configured encryption algorithms from the adapter resource pool, and displays the adapter list. The user selects the corresponding encryption adapter, and the system sets the encryption requirement mark for the fields to be synchronized, records the unique identifier and corresponding field of the encryption adapter, and ensures that it can be called correctly when the synchronization task is executed. Preferably, the system supports field-level encryption strategy configuration, and users can select different encryption algorithms for different fields to meet complex business needs.
[0062] S340. Configure incremental data recognition mode to complete the creation of the data synchronization task.
[0063] It should be noted that the synchronization configuration device completes the synchronization configuration of the corresponding table. Specifically, in the synchronization management unit, the corresponding incremental data recognition mode is selected, a suitable incremental data recognition mode is chosen, and relevant parameters are configured (such as MD5 field name, primary key field name, last modification time field name, etc.). Based on the user-configured incremental data recognition mode, the incremental recognition logic of the synchronization task is generated. The configuration information of the synchronization task (including source data table, target data table, fields to be synchronized, decryption adapter, encryption adapter, incremental recognition mode, etc.) is saved to the task configuration file or database, completing the creation of the data synchronization task. Preferably, the system supports dynamic switching of the incremental data recognition mode, allowing users to adjust the recognition mode at any time according to business needs without recreating the task. After the data synchronization task is created, in the single execution unit, after clicking "single run," the synchronization program executes the data synchronization task based on the selected source database, target database, and corresponding synchronization fields and encryption / decryption annotations. The specific process involves accessing the source database's source data table based on the source database configuration by calling the JDBC file provided by the corresponding database. The system locates the table structure of the corresponding source data table and the corresponding fields marked as to be synchronized, and writes them into the cache unit. It then iterates through the fields to be shared in the data table unit to retrieve the corresponding record information. If a field type in the retrieved data is marked as a decryption field, the relevant field content is pushed to the decryption processing unit for decryption. After decryption, the record is written to the target cache unit, which then calls the corresponding target data table unit to write the data.
[0064] In this embodiment, field-level decryption and encryption requirements are dynamically set through a graphical interface. Users can select different encryption and decryption algorithms for different fields according to specific business needs, meeting the security requirements of complex data synchronization scenarios and improving the system's flexibility and adaptability. Furthermore, the system automatically identifies fields requiring decryption and encryption and provides adapter filtering and recommendation functions, reducing user configuration workload and improving the efficiency of data synchronization task creation, especially suitable for large-scale data table synchronization scenarios. Furthermore, the encryption and decryption requirements of fields are clearly defined during the synchronization task creation stage, and the unique identifier of the adapter is recorded to ensure that the corresponding encryption and decryption algorithms are correctly called during synchronization task execution, avoiding data security issues caused by configuration errors. Furthermore, after configuring the incremental data recognition mode, the system only synchronizes incremental data, reducing unnecessary data transmission, improving synchronization performance and efficiency, and reducing system resource consumption, especially suitable for high-frequency synchronization tasks. It supports dynamic filtering and configuration of adapters, as well as dynamic switching of incremental data recognition modes, facilitating subsequent algorithm updates, adapter expansion, and changes in business requirements, improving the system's maintainability and scalability.
[0065] In some embodiments of the present invention, the incremental data identification mode includes an MD5 full-text comparison synchronization mode or an incremental data synchronization mode based on the primary key and the last modification timestamp.
[0066] It should be noted that the incremental data recognition mode currently supports two modes: MD5 full-text comparison synchronization mode and incremental data synchronization mode based on primary key and last modification timestamp.
[0067] If the MD5 synchronization mode is selected, the device generates an MD5 hash for all fields each time it runs. This MD5 hash is then compared with the primary key and MD5 hash stored in the existing MD5 table to determine if it is incremental data. Finally, data marked as incremental data is written to the target data table cell. If the user selects the MD5 full-text comparison synchronization mode in the graphical configuration interface, the system prompts the user to specify or automatically generate a field for storing MD5 values (e.g., md5_checksum). This field will store the MD5 value of each record. The system adds or confirms the existence of this MD5 field in both the source and target data tables. Before the synchronization task is executed, the system performs MD5 hash calculations on all field values of each record in the source data table to generate an MD5 value, which is then stored in the specified MD5 field. The system reads the MD5 value of the corresponding record from the target data table. The system compares the MD5 value in the source data table with the MD5 value in the target data table. If the MD5 values are inconsistent, the system marks the record as incremental data and performs a synchronization operation. The system synchronizes the record marked as incremental data to the target data table and updates the MD5 value in the target data table.
[0068] If the primary key + last modified time option is selected, the last modified time of the standard to be synchronized must be marked. The last modified time of the last synchronized record is used as the criterion; records with a last modified time greater than this time are treated as incremental data, and finally, these marked incremental data are written to the target data table cell. Specifically, if the user selects the incremental data synchronization mode based on primary key and last modified timestamp in the graphical configuration interface, the system prompts the user to specify a primary key field (e.g., id) and a last modified timestamp field (e.g., last_modified_time). The system verifies the existence of these fields in both the source and target data tables. The system reads the last modified timestamp of the last synchronized record from the target data table. The system uses this timestamp as the base time. The system filters records in the source data table whose last modified timestamp is greater than the base time; these records are marked as incremental data. The system synchronizes the records marked as incremental data to the target data table and updates the last modified timestamp field in the target data table.
[0069] In this embodiment, the MD5 full-text comparison synchronization mode is used. By comparing MD5 values, the system can accurately identify which records have changed and synchronize only those records, avoiding unnecessary data transmission and improving synchronization efficiency. Furthermore, MD5 comparison ensures data integrity and consistency; even minor data changes can be detected, ensuring the accuracy of synchronized data. Further, if an incremental data synchronization mode based on primary key and last modified timestamp is used to filter incremental data, the system can quickly locate the records that need to be synchronized, reducing the data scanning scope and further improving synchronization efficiency. Moreover, the combination of primary key and timestamp can accurately locate the latest state of a record, avoiding synchronization errors caused by inaccurate timestamps. Furthermore, both incremental data identification modes avoid synchronizing the entire table, reducing data transmission volume and storage space usage, and lowering system resource consumption. This is particularly suitable for synchronizing large-scale data tables. Users can choose different incremental data identification modes according to specific business needs, providing flexible configuration options to meet synchronization requirements in different scenarios. Furthermore, through a graphical configuration interface, users can easily configure and manage incremental data identification modes, reducing the possibility of configuration errors and improving system maintainability.
[0070] In some embodiments of the present invention, the data synchronization strategy device is used to formulate time synchronization strategies as needed. The data synchronization strategy device includes a synchronization strategy configuration unit, a scheduling unit, an execution unit, an execution log unit, and a data verification unit. The synchronization strategy configuration unit configures the synchronization cycle, providing daily, weekly, and monthly configurations. Specifically, the scheduling unit selects the synchronization configuration device to be executed, the synchronization strategy configuration unit configures the corresponding synchronization strategy, the execution unit periodically executes the scheduling unit according to the synchronization cycle to complete the synchronization of relevant data, and the execution status is written to the execution log unit for query by relevant personnel. Furthermore, the execution log unit can be used to view the synchronization execution status of a single batch of data, and the data verification unit can be used to view the details of the batch of data. If encrypted or decrypted data is involved, the corresponding encryption / decryption execution unit will be automatically invoked to complete the encryption / decryption work.
[0071] For example, the relationship between the synchronization configuration device and the synchronization strategy configuration unit is as follows: Figure 6 As shown, the execution unit in the synchronization configuration device (or synchronization strategy configuration unit) is the core element, such as... Figure 7 The diagram illustrates the relationship between the execution unit and each device, such as... Figure 4 and Figure 7As shown, the execution unit completes the data encryption or decryption task by finding the corresponding encryption execution unit (decryption execution unit) based on the module name in the encryption / decryption configuration device. It finds the specific storage data table configuration information from the data source management device through the database unit configuration and data table unit configuration. The synchronization configuration device completes the configuration of data loading, data synchronization, and data storage processes, and specifies the field names to be called for encryption / decryption based on the data table information. The synchronization strategy specifies the execution cycle, such as once a day, once a week, etc. Based on the above basic relational logic diagram, as follows... Figure 8 The following is a breakdown of the main stages of a single execution: ① Configure the corresponding database connection information and find the corresponding database; at the same time, configure the table name to be connected.
[0072] ② Complete the basic configuration of the encryption / decryption adapter and complete the adaptation with third-party encryption / decryption national cryptographic standards.
[0073] ③ Configure the corresponding data table name to be retrieved in the specified data loading unit.
[0074] ④ Identify the corresponding decryption module and specify the fields that need to be decrypted.
[0075] ⑤ Specify the table name corresponding to the data storage unit.
[0076] ⑥ Identify the corresponding encryption module and specify the fields that need to be encrypted.
[0077] ⑦ Complete the configuration of the synchronization management unit.
[0078] ⑧ After triggering, the configuration information formed in steps 1-7 is provided to the single execution call unit.
[0079] ⑨ The single execution unit reads data from the specified data table in a loop according to the configuration information formed in 1-7, and calls the corresponding decryption execution unit according to the configuration to complete the decryption of the relevant fields; it calls the encryption execution unit according to the storage unit configuration to complete the encryption of the data, and finally writes the data into the target data table.
[0080] In the above steps, if multiple tables are involved, each table should be configured once (steps ③-⑦). This invention solves the problem that when various departments share public credit data using a front-end database, inconsistent commercial cryptographic algorithms necessitate storing the data in plaintext in a shared cache. This improves data storage security while reducing costs. During data synchronization, this invention utilizes encryption, decryption, and standard commercial cryptographic modules. It directly uses the decryption rules provided by the data source unit to decrypt relevant data during synchronization and simultaneously uses the encryption requirements of the data acquisition unit to complete encryption activities. All actions are completed directly within the device, without generating intermediate plaintext data or relying on a third-party database to store corresponding temporary plaintext data. Data verification units can directly view and verify the encrypted and decrypted data online, improving the security and availability of sensitive data.
[0081] To better implement the data synchronization method supporting commercial cryptographic algorithm conversion in the embodiments of the present invention, based on the data synchronization method supporting commercial cryptographic algorithm conversion, correspondingly, such as Figure 4 As shown, this embodiment of the invention also provides a data synchronization system that supports commercial cryptographic algorithm conversion. The data synchronization system 400 that supports commercial cryptographic algorithm conversion includes: A data source management device is used to obtain a list of source data tables and a list of target data tables; the list of source data tables includes source data tables that have been configured to store public credit information to be reported, and the list of source data tables includes target data tables that have been configured to store encrypted public credit information; An encryption / decryption adapter is used to obtain an adapter resource pool, the adapter resource pool including multiple adapters configured with at least one of a decryption algorithm and an encryption algorithm, the decryption algorithm being provided by a data provider and the encryption algorithm being provided by a data acquirer; A synchronization configuration device is used to create a data synchronization task, execute the data synchronization task, and write encrypted data into the target data table. The data synchronization task includes a field to be synchronized that is marked with at least one of decryption and encryption requirements. Executing the data synchronization task specifically includes: reading target data from the source data table according to the field to be synchronized; calling a specified decryption adapter to decrypt the target data corresponding to the field to be synchronized with the decryption requirement to obtain intermediate plaintext data; and calling a specified encryption adapter to encrypt the data to be encrypted to obtain the encrypted data. The data to be encrypted includes the intermediate plaintext data, or the target data with the decryption requirement but skipping the decryption operation.
[0082] The data synchronization system 400 supporting commercial cryptographic algorithm conversion provided in the above embodiments can implement the technical solutions described in the above embodiments of the data synchronization method supporting commercial cryptographic algorithm conversion. The specific implementation principles of each module or unit can be found in the corresponding content in the above embodiments of the data synchronization method supporting commercial cryptographic algorithm conversion, which will not be repeated here.
[0083] like Figure 9 As shown, the present invention also provides an electronic device 900. The electronic device 900 includes a processor 901, a memory 902, and a display 903. Figure 9 Only some components of the electronic device 900 are shown, but it should be understood that it is not required to implement all of the components shown, and more or fewer components may be implemented instead.
[0084] In some embodiments, processor 901 may be a central processing unit (CPU), microprocessor, or other data processing chip, used to run program code stored in memory 902 or process data, such as the data synchronization method supporting commercial cryptographic algorithm conversion in this invention.
[0085] In some embodiments, processor 901 may be a single server or a group of servers. The server group may be centralized or distributed. In some embodiments, processor 901 may be local or remote. In some embodiments, processor 901 may be implemented on a cloud platform. In one embodiment, the cloud platform may include a private cloud, public cloud, hybrid cloud, community cloud, distributed cloud, intranet, multi-cloud, etc., or any combination thereof.
[0086] In some embodiments, memory 902 may be an internal storage unit of electronic device 900, such as a hard disk or memory of electronic device 900. In other embodiments, memory 902 may also be an external storage device of electronic device 900, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc. equipped on electronic device 900.
[0087] Furthermore, the memory 902 may include both internal storage units of the electronic device 900 and external storage devices. The memory 902 is used to store application software and various types of data installed on the electronic device 900.
[0088] In some embodiments, display 903 may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, or an OLED (Organic Light-Emitting Diode) touchscreen. Display 903 is used to display information from electronic device 900 and to display a visual user interface. Components 901-903 of electronic device 900 communicate with each other via a system bus.
[0089] In one embodiment, when the processor 901 executes a data synchronization program in the memory 902 that supports commercial cryptography algorithm conversion, the following steps can be implemented: Obtain a list of source data tables and a list of target data tables; the list of source data tables includes source data tables that have been configured to store public credit information to be reported, and the list of source data tables includes target data tables that have been configured to store the encrypted public credit information; Obtain an adapter resource pool, which includes multiple adapters configured with at least one of a decryption algorithm and an encryption algorithm, wherein the decryption algorithm is provided by the data provider and the encryption algorithm is provided by the data acquirer; Create a data synchronization task, the data synchronization task including a field to be synchronized marked with at least one of decryption requirements and encryption requirements; The data synchronization task is executed and the encrypted data is written to the target data table. Specifically, the data synchronization task includes: reading target data from the source data table according to the field to be synchronized; calling a specified decryption adapter to decrypt the target data corresponding to the field to be synchronized with the decryption requirement to obtain intermediate plaintext data; and calling a specified encryption adapter to encrypt the data to be encrypted to obtain the encrypted data. The data to be encrypted includes the intermediate plaintext data, or the target data with the decryption requirement but with the decryption operation skipped.
[0090] It should be understood that when the processor 901 executes the data synchronization method program supporting commercial cryptographic algorithm conversion in the memory 902, in addition to the functions mentioned above, it can also implement other functions, as can be found in the description of the corresponding method embodiments above.
[0091] Furthermore, this embodiment of the invention does not specifically limit the type of electronic device 900 mentioned. Electronic device 900 can be a mobile phone, tablet computer, personal digital assistant (PDA), wearable device, laptop computer, or other portable electronic device. Exemplary embodiments of portable electronic devices include, but are not limited to, portable electronic devices running iOS, Android, Microsoft, or other operating systems. The aforementioned portable electronic device can also be other portable electronic devices, such as a laptop computer with a touch-sensitive surface (e.g., a touch panel). It should also be understood that in some other embodiments of the invention, electronic device 900 may not be a portable electronic device, but rather a desktop computer with a touch-sensitive surface (e.g., a touch panel).
[0092] Accordingly, embodiments of this application also provide a computer-readable storage medium for storing computer-readable programs or instructions. When the programs or instructions are executed by a processor, they can implement the steps or functions of the data synchronization methods supporting commercial cryptographic algorithm conversion provided in the above-described method embodiments.
[0093] Those skilled in the art will understand that all or part of the processes of the methods described in the above embodiments can be implemented by a computer program instructing related hardware (such as a processor, controller, etc.), and the computer program can be stored in a computer-readable storage medium. The computer-readable storage medium may be a disk, optical disk, read-only memory, or random access memory, etc.
[0094] The data synchronization method, system, device, and medium supporting commercial cryptographic algorithm conversion provided by the present invention have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.
Claims
1. A data synchronization method supporting commercial cryptographic algorithm conversion, characterized in that, include: Obtain the list of source data tables and the list of target data tables; The source data table list includes source data tables that have been configured to store public credit information to be reported, and target data tables that have been configured to store encrypted public credit information. Obtain an adapter resource pool, which includes multiple adapters configured with at least one of a decryption algorithm and an encryption algorithm, wherein the decryption algorithm is provided by the data provider and the encryption algorithm is provided by the data acquirer; Create a data synchronization task, the data synchronization task including a field to be synchronized marked with at least one of decryption requirements and encryption requirements; Execute the data synchronization task and write the encrypted data into the target data table; The data synchronization task specifically includes: reading target data from the source data table according to the field to be synchronized; calling a specified decryption adapter to decrypt the target data corresponding to the field to be synchronized with the decryption requirement to obtain intermediate plaintext data; and calling a specified encryption adapter to encrypt the data to be encrypted to obtain the encrypted data. The data to be encrypted includes the intermediate plaintext data, or the target data with the decryption requirement but skipping the decryption operation.
2. The data synchronization method supporting commercial cryptographic algorithm conversion according to claim 1, characterized in that, The process of obtaining the source data table list and the target data table list includes: Obtain parameter configuration information and data table configuration information. The parameter configuration information includes the database names, network addresses, port numbers, and login credentials of the source and target databases. Establish a connection channel between the source database and the target database based on the database name, the network address, the port number, and the login credentials; The data table configuration operation is performed based on the data table configuration information to obtain the source data table list and the target data table list.
3. The data synchronization method supporting commercial cryptographic algorithm conversion according to claim 1, characterized in that, The acquisition of the adapter resource pool includes: If the algorithm type and key are known, the decryption algorithm and the encryption algorithm are set through the configuration operation obtained through the graphical configuration interface, and the configured adapter is obtained by obtaining the key through the graphical configuration interface. The adapter resource pool is obtained based on the configured adapter. If the algorithm type and key are unknown, the graphical configuration interface sequentially obtains the application programming interface call name, call form and its commercial cryptographic algorithm file, key and the logic code corresponding to the third-party commercial cryptographic algorithm to obtain the configured adapter, and obtains the adapter resource pool based on the configured adapter.
4. The data synchronization method supporting commercial cryptographic algorithm conversion according to claim 3, characterized in that, The invocation methods include HTTP API packages and JAR packages; If the calling form is the JAR package, upload the JAR package file containing the third-party commercial cryptographic algorithm provided by the third-party algorithm organization; If the call format is the HTTP API, obtain the HTTP address, submission mode, and header, and upload them; the submission mode includes POST submission mode and GET submission mode, and fill in the required header according to the third-party encryption and decryption requirements; the commercial encryption algorithm file provided by the third-party algorithm organization is a JAR package file.
5. The data synchronization method supporting commercial cryptographic algorithm conversion according to claim 1, characterized in that, The decryption algorithm and the encryption algorithm include any one of the national commercial cryptography standard algorithm and the third-party commercial cryptography algorithm, wherein the national commercial cryptography standard algorithm includes at least one of the SM2 algorithm, SM3 algorithm or SM4 algorithm.
6. The data synchronization method supporting commercial cryptographic algorithm conversion according to claim 1, characterized in that, The creation of the data synchronization task includes: Select the chosen source data table from the list of source data tables, and determine the fields to be synchronized; The decryption adapters are selected from those already configured with the decryption algorithm, and a decryption requirement is set for the field to be synchronized. Based on the target data table list, select the target data table, filter out the encryption adapters from the adapters that have been configured with the encryption algorithm, and set the encryption requirement flag for the field to be synchronized; Configure the incremental data recognition mode to complete the creation of the data synchronization task.
7. The data synchronization method supporting commercial cryptographic algorithm conversion according to claim 6, characterized in that, The incremental data identification modes include MD5 full-text comparison synchronization mode or incremental data synchronization mode based on primary key and last modification timestamp.
8. A data synchronization system supporting commercial cryptographic algorithm conversion, characterized in that, include: A data source management device for acquiring a list of source data tables and a list of target data tables; The source data table list includes source data tables that have been configured to store public credit information to be reported, and target data tables that have been configured to store encrypted public credit information. An encryption / decryption adapter is used to obtain an adapter resource pool, the adapter resource pool including multiple adapters configured with at least one of a decryption algorithm and an encryption algorithm, the decryption algorithm being provided by a data provider and the encryption algorithm being provided by a data acquirer; A synchronization configuration device is used to create a data synchronization task, execute the data synchronization task, and write encrypted data into the target data table; the data synchronization task includes a field to be synchronized marked with at least one of decryption requirements and encryption requirements. The data synchronization task specifically includes: reading target data from the source data table according to the field to be synchronized; calling a specified decryption adapter to decrypt the target data corresponding to the field to be synchronized with the decryption requirement to obtain intermediate plaintext data; and calling a specified encryption adapter to encrypt the data to be encrypted to obtain the encrypted data. The data to be encrypted includes the intermediate plaintext data, or the target data with the decryption requirement but skipping the decryption operation.
9. An electronic device, characterized in that, Including memory and processor, among which, The memory is used to store programs; The processor, coupled to the memory, is used to execute the program stored in the memory to implement the steps in the data synchronization method supporting commercial cryptographic algorithm conversion as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, Used to store computer-readable programs or instructions, which, when executed by a processor, can implement the steps in the data synchronization method supporting commercial cryptographic algorithm conversion as described in any one of claims 1 to 7.