A method, storage medium and device for data synchronization configuration in different environments

By introducing the file management functions of data synchronization switches and nas servers in the business system, combined with the recognition capabilities of the p6spy component, the automatic synchronization of data protocols in different environments is achieved, which solves the problem of repeated configurations by testers in different environments, reduces labor time costs and improves configuration efficiency.

CN116095148BActive Publication Date: 2025-05-16SUNING CONSUMER FINANCE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310074504.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-02-07
Publication Date
2025-05-16
Estimated Expiration
2043-02-07

AI Technical Summary

Technical Problem

In Internet business development, testers need to repeatedly configure data protocols in different environments, which makes it time-consuming and labor-intensive and easy to make mistakes, increasing labor-time costs.

Method used

By introducing a data synchronization switch in the business system, when it is turned on, the Nas server is used to search for the data protocol directory addresses stored in the database in different environments, and the change operation is identified through the p6spy component to complete the synchronization configuration of the data protocol in different environments.

Benefits of technology

Automatic synchronization of data protocols in different environments is realized, which avoids duplicate configuration, reduces labor time costs, and improves configuration accuracy and efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116095148B_ABST
    Figure CN116095148B_ABST
Patent Text Reader

Abstract

A method, storage medium and device for data synchronization configuration in different environments, including S1: a protocol configuration administrator enters a business system and performs a data protocol change operation in a grayscale environment; S2: when the protocol configuration administrator triggers a data protocol change operation, the configuration system determines whether the current data synchronization switch is turned on, that is, determines whether the protocol configuration administrator needs to synchronize the change operation in step S1 to the test environment; S3: according to whether the data synchronization switch is turned on or not, the business system selectively searches the database for the data protocol directory address to be changed in different environments through a nas server, and replaces the fields in the directory address with the change operation of the protocol configuration administrator, thereby completing the update configuration of the data protocol change operation in different environments. The above scheme ensures the consistency of data protocols in different environmental scenarios, while avoiding duplication of work and reducing manpower and time costs.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data protocol configuration, and in particular to a method, storage medium and device for data synchronization configuration under different environments. Background Art

[0002] There are many environments in the process of Internet business development and use, including pro production environment, which is an environment for external users, also known as formal environment, which can be accessed by connecting to the Internet, sit system integration test environment, where developers can test whether the process is working, pre grayscale environment, in the early stage of business version release, before the official version is released, external users can access it, but the server configuration is relatively low, and the others are the same as production, of course, in addition to these, there are other environments. In the context of the rapid development of the Internet, the stability and efficiency of user access services are the key considerations of developers, so it is necessary to test them in a test environment, and the protocol configuration needs to be performed in the test environment before the test. However, after the tester completes the signature position, protocol title, protocol content, and upload of the contract PDF template in a certain set of environment configuration protocol scenarios, when switching to the integrated test environment, the tester has to repeat the above work and reconfigure the data protocol, which is time-consuming and labor-intensive, and is prone to mismatching. Therefore, based on this situation, the present application proposes a method, storage medium and device for data synchronization configuration in different environments. Summary of the invention

[0003] In view of the deficiencies in the prior art, the present invention provides a method, storage medium and device for data synchronization configuration in different environments to meet the requirements of personnel configuration according to the protocol: after the data synchronization switch is turned on, they can be synchronized with each other in different environments to ensure the consistency of test protocol scenario data while avoiding duplication of work and reducing manpower and time costs.

[0004] To achieve the above object, the present invention adopts the following technical solutions:

[0005] A method for data synchronization configuration in different environments includes the following steps:

[0006] S1: The protocol configuration administrator enters the business system and starts to change the data protocol in a grayscale environment, where the grayscale environment is also called a pre environment.

[0007] S2: When the protocol configuration administrator triggers a change operation to the data protocol, the configuration system determines whether the current data synchronization switch is turned on, that is, whether the protocol configuration administrator needs to synchronize the change operation in step S1 to the test environment; wherein the test environment is also called the sit environment;

[0008] S3: Depending on whether the data synchronization switch is turned on or not, the business system selectively searches the nas server for the data protocol directory address to be changed in the database storage under different environments, and replaces the fields in the directory address with the change operations of the protocol configuration administrator, thereby completing the update configuration of the data protocol change operations under different environments.

[0009] To optimize the above technical solutions, the specific measures taken also include:

[0010] Furthermore, when the data synchronization switch is in the on state, the specific contents of the update configuration for completing the data protocol change operation in different environments in step 3 are as follows:

[0011] When the data synchronization switch is in the on state, the business system uploads the data protocol to be changed in step S1 to the nas server in the pre environment for search and comparison, and finds out the directory address of the data protocol to be changed corresponding to the database storage in the pre environment, and then the nas server forms the encrypted string information pre_picstoken with the path of the directory address in the environment and returns it to the business system; similarly, the business system uploads the data protocol to be changed in step S1 to the nas server in the sit environment for search and comparison, and finds out the directory address of the data protocol to be changed corresponding to the database storage in the sit environment, and then the nas server forms the encrypted string information sit_picstoken with the path of the directory address in the environment and returns it to the business system;

[0012] The business system decrypts the encrypted string information to obtain the directory address of the data protocol in different environment databases; at the same time, the business system identifies the change operation of the protocol configuration administrator in step S1 through the built-in p6spy component, and replaces the data protocol information of the change operation with the field in the directory address under the decrypted path to form two sets of scripts in different environments, namely, the script sql_pre in the pre environment and the script sql_sit in the sit environment;

[0013] The business system establishes connections with the database in the pre environment and the database in the sit environment respectively, and executes the sql_sit script and sql_pre script accordingly to complete the data protocol synchronization configuration in the pre environment and the sit environment.

[0014] Furthermore, when the data synchronization switch is in the off state, the specific contents of the update configuration for completing the data protocol change operation in different environments in step 3 are:

[0015] When the data synchronization switch is in the off state, it means that the change operation in step S1 does not need to be synchronized to the test environment, and only the data protocol of the database in the pre environment is updated. The specific contents include: the business system uploads the data protocol to be changed in step S1 to the nas server in the pre environment for search and comparison, and finds out the directory address of the data protocol to be changed corresponding to the database storage in the pre environment, and then the nas server forms the encrypted string information pre_picstoken with the path of the directory address in the environment and returns it to the business system;

[0016] The business system decrypts the encrypted string information to obtain the directory address of the data protocol in the pre environment database; at the same time, the business system identifies the change operation of the protocol configuration administrator in step S1 through the built-in p6spy component, and replaces the data protocol information of the change operation with the field in the directory address under the decrypted path to form the script sql_pre in the pre environment;

[0017] The business system establishes a connection with the database in the pre environment and executes the sql_pre script to complete the update of the data protocol in the pre environment.

[0018] Furthermore, the protocol configuration administrator's change operations on the data protocol include adding, modifying and deleting.

[0019] A computer-readable storage medium stores a computer program, wherein the computer program enables a computer to execute any of the data synchronization configuration methods described above.

[0020] An electronic device comprises: a memory, a processor and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the data synchronization configuration method as described in any one of the above items is implemented.

[0021] The beneficial effect of the present invention is that, in the context of traditional data protocol configuration, if the tester configures the protocol information in a certain environment, when conducting a test, the same protocol configuration needs to be performed again in the test environment. The present application cleverly utilizes the file management function of the NAS server. When the data protocol configuration is performed in a certain environment, the directory address of the corresponding data protocol in the database of the different environments is searched through the NAS server, and then the p6spy component is used to identify the content of the change operation and replace the corresponding directory. The change operation can be synchronized to the database in the different environments. The operation is simple and convenient, which solves the problem of multiple configurations of protocols in different environments and reduces the testing time of the tester. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] Figure 1-Figure 2 It is a flow chart of the overall technical solution of the present invention. DETAILED DESCRIPTION

[0023] Now combine with Figure 1-Figure 2 The present invention is described in further detail.

[0024] A method for data synchronization configuration in different environments includes the following steps:

[0025] S1: The protocol configuration administrator enters the business system and starts to change the data protocol in a grayscale environment, where the grayscale environment is also called a pre environment.

[0026] S2: When the protocol configuration administrator triggers a change operation to the data protocol, the configuration system determines whether the current data synchronization switch is turned on, that is, whether the protocol configuration administrator needs to synchronize the change operation in step S1 to the test environment; wherein the test environment is also called the sit environment;

[0027] S3: Depending on whether the data synchronization switch is turned on or not, the business system selectively searches the nas server for the data protocol directory address to be changed in the database storage under different environments, and replaces the fields in the directory address with the change operations of the protocol configuration administrator, thereby completing the update configuration of the data protocol change operations under different environments.

[0028] Among them, when the data synchronization switch is in the on state, the specific contents of the update configuration for completing the data protocol change operation in different environments in step 3 are:

[0029] When the data synchronization switch is in the on state, the business system uploads the data protocol to be changed in step S1 to the nas server in the pre environment for search and comparison, and finds out the directory address of the data protocol to be changed corresponding to the database storage in the pre environment, and then the nas server forms the encrypted string information pre_picstoken with the path of the directory address in the environment and returns it to the business system; similarly, the business system uploads the data protocol to be changed in step S1 to the nas server in the sit environment for search and comparison, and finds out the directory address of the data protocol to be changed corresponding to the database storage in the sit environment, and then the nas server forms the encrypted string information sit_picstoken with the path of the directory address in the environment and returns it to the business system;

[0030] The business system decrypts the encrypted string information to obtain the directory address of the data protocol in different environment databases; at the same time, the business system identifies the change operation of the protocol configuration administrator in step S1 through the built-in p6spy component, and replaces the data protocol information of the change operation with the field in the directory address under the decrypted path to form two sets of scripts in different environments, namely, the script sql_pre in the pre environment and the script sql_sit in the sit environment;

[0031] The business system establishes connections with the database in the pre environment and the database in the sit environment respectively, and executes the sql_sit script and sql_pre script accordingly to complete the data protocol synchronization configuration in the pre environment and the sit environment.

[0032] Among them, when the data synchronization switch is in the off state, the specific contents of the update configuration for completing the data protocol change operation in different environments in step 3 are:

[0033] When the data synchronization switch is in the off state, it means that the change operation in step S1 does not need to be synchronized to the test environment, and only the data protocol of the database in the pre environment is updated. The specific contents include: the business system uploads the data protocol to be changed in step S1 to the nas server in the pre environment for search and comparison, and finds out the directory address of the data protocol to be changed corresponding to the database storage in the pre environment, and then the nas server forms the encrypted string information pre_picstoken with the path of the directory address in the environment and returns it to the business system;

[0034] The business system decrypts the encrypted string information to obtain the directory address of the data protocol in the pre environment database; at the same time, the business system identifies the change operation of the protocol configuration administrator in step S1 through the built-in p6spy component, and replaces the data protocol information of the change operation with the field in the directory address under the decrypted path to form the script sql_pre in the pre environment;

[0035] The business system establishes a connection with the database in the pre environment and executes the sql_pre script to complete the update of the data protocol in the pre environment.

[0036] The protocol configuration administrator's change operations on the data protocol include adding, modifying and deleting.

[0037] A computer-readable storage medium stores a computer program, wherein the computer program enables a computer to execute any of the above-mentioned data synchronization configuration methods.

[0038] An electronic device comprises: a memory, a processor and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the data synchronization configuration method as described in any one of the above items is implemented.

[0039] refer to Figure 2 , the following is a brief description of the specific working scenarios:

[0040] Step 1: When the protocol configuration administrator (such as operating in the pre environment) triggers the background management system to add, modify, or delete a protocol, click Modify and Submit;

[0041] Step 2: Determine whether the data synchronization switch (the flag indicating whether it is synchronized) is turned on (sit: database IP address; pre: database IP address);

[0042] Step 3: Turn on the switch (turning on means that the protocol-related configuration information needs to be synchronized to multiple environments), upload the PDF protocol file according to the protocol administrator, upload the nas server addresses of different environments (sit and pre environments), and return the encrypted string sit_picstoken of the corresponding environment path (the picstoken of the sit environment is decrypted into ciphertext, which corresponds to the directory nas / sit / 2022 / 08 / 20 / HH24 / XXX.PDF); pre_picstoken (the picstoken of the pre environment is decrypted into ciphertext, which corresponds to the directory nas / pre / 202 2 / 08 / 20 / HH24 / XXX.PDF), the p6spy component (the SQL component that analyzes the administrator's operations and can parse the SQL statements of addition, deletion, modification and query) will analyze the execution actions of the SQL (such as addition, deletion and modification) according to the administrator's operations, replace the corresponding environment path field (the environment field refers to the picstoken value in different environments) to form two sets of environment sql_sit and sql_pre scripts, respectively establish sit data connection and pre database connection, execute sql_sit and sql_pre, and complete the data synchronization configuration of multiple environments;

[0043] Step 4: Turn off the switch, upload the PDF agreement file according to the agreement administrator, upload only the pre-environment nas server address, return the pre-environment path pre_picstoken, execute the script, and implement the maintenance function of the agreement.

[0044] It should be noted that the terms such as "upper", "lower", "left", "right", "front", "back", etc. cited in the invention are only for the convenience of description and are not used to limit the scope of implementation of the present invention. Changes or adjustments to their relative relationships should be regarded as the scope of implementation of the present invention without substantially changing the technical content.

[0045] The above are only preferred embodiments of the present invention, and the protection scope of the present invention is not limited to the above embodiments. All technical solutions under the concept of the present invention belong to the protection scope of the present invention. It should be pointed out that for ordinary technicians in this technical field, some improvements and modifications without departing from the principle of the present invention should be regarded as the protection scope of the present invention.

Claims

1. A method for data synchronization configuration in different environments, characterized in that: The following steps are involved: S1: The protocol configuration administrator enters the business system and starts to change the data protocol in a grayscale environment, where the grayscale environment is also called a pre environment. S2: When the protocol configuration administrator triggers a change operation to the data protocol, the configuration system determines whether the current data synchronization switch is turned on, that is, whether the protocol configuration administrator needs to synchronize the change operation in step S1 to the test environment; wherein the test environment is also called the sit environment; S3: Depending on whether the data synchronization switch is turned on or not, the business system selectively searches the data protocol directory address to be changed in the database stored in different environments through the nas server, and replaces the fields in the directory address with the change operation of the protocol configuration administrator. The business system identifies the change operation of the protocol configuration administrator in step S1 through the built-in p6spy component, and replaces the fields in the directory address under the decrypted path with the data protocol information of the change operation, thereby completing the update configuration of the data protocol change operation in different environments.

2. The method for data synchronization configuration under different environments according to claim 1, characterized in that: When the data synchronization switch is in the on state, the specific contents of the update configuration for completing the data protocol change operation under different environments in step S3 are: When the data synchronization switch is in the on state, the business system uploads the data protocol to be changed in step S1 to the nas server in the pre environment for search and comparison, and finds out the directory address of the data protocol to be changed corresponding to the database storage in the pre environment, and then the nas server forms the encrypted string information pre_picstoken with the path of the directory address in the environment and returns it to the business system; similarly, the business system uploads the data protocol to be changed in step S1 to the nas server in the sit environment for search and comparison, and finds out the directory address of the data protocol to be changed corresponding to the database storage in the sit environment, and then the nas server forms the encrypted string information sit_picstoken with the path of the directory address in the environment and returns it to the business system; The business system decrypts the encrypted string information to obtain the directory address of the data protocol in different environment databases; at the same time, the business system identifies the change operation of the protocol configuration administrator in step S1 through the built-in p6spy component, and replaces the data protocol information of the change operation with the field in the directory address under the decrypted path to form two sets of scripts in different environments, namely, the script sql_pre in the pre environment and the script sql_sit in the sit environment; The business system establishes connections with the database in the pre environment and the database in the sit environment respectively, and executes the sql_sit script and sql_pre script accordingly to complete the data protocol synchronization configuration in the pre environment and the sit environment.

3. The method for data synchronization configuration under different environments according to claim 2, characterized in that: When the data synchronization switch is in the off state, the specific contents of the update configuration for completing the data protocol change operation under different environments in step S3 are: When the data synchronization switch is in the off state, it means that the change operation in step S1 does not need to be synchronized to the test environment, and only the data protocol of the database in the pre environment is updated. The specific contents include: the business system uploads the data protocol to be changed in step S1 to the nas server in the pre environment for search and comparison, and finds out the directory address of the data protocol to be changed corresponding to the database storage in the pre environment, and then the nas server forms the encrypted string information pre_picstoken with the path of the directory address in the environment and returns it to the business system; The business system decrypts the encrypted string information to obtain the directory address of the data protocol in the pre environment database; at the same time, the business system identifies the change operation of the protocol configuration administrator in step S1 through the built-in p6spy component, and replaces the data protocol information of the change operation with the field in the directory address under the decrypted path to form the script sql_pre in the pre environment; The business system establishes a connection with the database in the pre environment and executes the sql_pre script to complete the update of the data protocol in the pre environment.

4. The method for data synchronization configuration under different environments according to claim 3, characterized in that: The protocol configuration administrator's change operations on the data protocol include adding, modifying and deleting.

5. A computer-readable storage medium storing a computer program, characterized in that: The computer program enables a computer to execute the data synchronization configuration method as described in any one of claims 1 to 4.

6. An electronic device, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the data synchronization configuration method according to any one of claims 1 to 4 is implemented.

Citation Information

Patent Citations

  • Automated methods and systems for developing and deploying projects in parallel

    CN101932999A

  • Method for realizing cross-domain data and file updating synchronization

    CN110532275A