CN113535857A - Data synchronization method and device - Google Patents
Data synchronization method and device Download PDFInfo
- Publication number
- CN113535857A CN113535857A CN202110893529.0A CN202110893529A CN113535857A CN 113535857 A CN113535857 A CN 113535857A CN 202110893529 A CN202110893529 A CN 202110893529A CN 113535857 A CN113535857 A CN 113535857A
- Authority
- CN
- China
- Prior art keywords
- data
- key
- submitted
- synchronized
- field
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Withdrawn
Links
- 238000000034 method Methods 0.000 title claims abstract description 65
- 230000001360 synchronised effect Effects 0.000 claims abstract description 111
- 238000012545 processing Methods 0.000 claims abstract description 38
- 238000006243 chemical reaction Methods 0.000 claims abstract description 15
- 230000006870 function Effects 0.000 claims description 75
- 238000013507 mapping Methods 0.000 claims description 28
- 238000004458 analytical method Methods 0.000 claims description 17
- 238000004590 computer program Methods 0.000 claims description 16
- 238000007405 data analysis Methods 0.000 claims description 15
- 238000012360 testing method Methods 0.000 claims description 11
- 238000005516 engineering process Methods 0.000 abstract description 4
- 244000035744 Hura crepitans Species 0.000 description 27
- 238000010586 diagram Methods 0.000 description 15
- 230000008569 process Effects 0.000 description 15
- 238000011161 development Methods 0.000 description 9
- 230000018109 developmental process Effects 0.000 description 9
- 238000004891 communication Methods 0.000 description 8
- 238000012986 modification Methods 0.000 description 5
- 230000004048 modification Effects 0.000 description 5
- 230000003287 optical effect Effects 0.000 description 3
- 238000004364 calculation method Methods 0.000 description 2
- 230000003993 interaction Effects 0.000 description 2
- 238000003491 array Methods 0.000 description 1
- 238000013473 artificial intelligence Methods 0.000 description 1
- 238000004422 calculation algorithm Methods 0.000 description 1
- 230000001413 cellular effect Effects 0.000 description 1
- 238000010276 construction Methods 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 238000012217 deletion Methods 0.000 description 1
- 230000037430 deletion Effects 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 239000000284 extract Substances 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 238000010801 machine learning Methods 0.000 description 1
- 230000007246 mechanism Effects 0.000 description 1
- 239000013307 optical fiber Substances 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 230000001953 sensory effect Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 230000033772 system development Effects 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/27—Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/25—Integrating or interfacing systems involving database management systems
- G06F16/258—Data format conversion from or to a database
Landscapes
- Engineering & Computer Science (AREA)
- Databases & Information Systems (AREA)
- Theoretical Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Computing Systems (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The disclosure provides a data synchronization method and device, and relates to technologies of Internet of vehicles and Internet of things in data processing. The specific implementation scheme is as follows: a data synchronization request is obtained, wherein the data synchronization request comprises a first keyword. And calling a data viewing interface of the first data system according to the first keyword, and determining at least one piece of data to be synchronized corresponding to the first keyword in the first data system. And performing data format conversion processing on at least one to-be-synchronized data according to the data newly-added interface of the second data system to obtain the to-be-submitted data corresponding to each to-be-synchronized data. And synchronizing the data to be submitted to the second data system through a data adding interface of the second data system. The data to be submitted is synchronized to the second data system by multiplexing the data viewing interface of the first data system and the data adding interface of the second data system, so that the data synchronization can be quickly and accurately realized.
Description
Technical Field
The disclosure relates to technologies of internet of vehicles and internet of things in data processing, and in particular, to a data synchronization method and device.
Background
Software systems typically include a number of different environments, such as development environments, sandbox environments, online environments, etc., each with a background system for configuring the necessary parameters.
At present, after the sandbox test of the software passes, the parameters which are required to be configured are usually stable, so that the parameters in the sandbox environment can be directly applied to the online environment, and then the parameters in the sandbox environment can be synchronized to the online environment.
In the related art, when parameters in the sandbox environment are synchronized into the online environment, a manual copy and paste mode is generally adopted.
Disclosure of Invention
The disclosure provides a data synchronization method and device.
According to a first aspect of the present disclosure, there is provided a data synchronization method, including:
acquiring a data synchronization request, wherein the data synchronization request comprises a first keyword, and the data synchronization request is used for requesting to synchronize data corresponding to the first keyword in a first data system to a second data system;
calling a data viewing interface of a first data system according to a first keyword, and determining at least one piece of data to be synchronized corresponding to the first keyword in the first data system;
performing format conversion processing on the at least one to-be-synchronized data according to a data newly-added interface of the second data system to obtain to-be-submitted data corresponding to each to-be-synchronized data;
and synchronizing the data to be submitted to the second data system through a data adding interface of the second data system.
According to a second aspect of the present disclosure, there is provided a data synchronization apparatus including:
the data synchronization method comprises the steps that an obtaining module is used for obtaining a data synchronization request, wherein the data synchronization request comprises a first keyword, and the data synchronization request is used for requesting to synchronize data corresponding to the first keyword in a first data system to a second data system;
the device comprises a determining module, a synchronization module and a synchronization module, wherein the determining module is used for calling a data viewing interface of a first data system according to a first keyword and determining at least one piece of data to be synchronized corresponding to the first keyword in the first data system;
the processing module is used for performing format conversion processing on the at least one to-be-synchronized data according to the data newly-added interface of the second data system to obtain to-be-submitted data corresponding to each to-be-synchronized data;
and the synchronization module is used for synchronizing the data to be submitted to the second data system through a data adding interface of the second data system.
According to a third aspect of the present disclosure, there is provided an electronic device comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of the first aspect.
According to a fourth aspect of the present disclosure, there is provided a non-transitory computer readable storage medium having stored thereon computer instructions for causing the computer to perform the method of the first aspect.
According to a fifth aspect of the present disclosure, there is provided a computer program product comprising: a computer program, stored in a readable storage medium, from which at least one processor of an electronic device can read the computer program, execution of the computer program by the at least one processor causing the electronic device to perform the method of the first aspect.
The technology according to the present disclosure solves the problem of improving the efficiency of data synchronization.
It should be understood that the statements in this section do not necessarily identify key or critical features of the embodiments of the present disclosure, nor do they limit the scope of the present disclosure. Other features of the present disclosure will become apparent from the following description.
Drawings
The drawings are included to provide a better understanding of the present solution and are not to be construed as limiting the present disclosure. Wherein:
FIG. 1 is a system diagram of a software system provided by an embodiment of the present disclosure;
fig. 2 is a flowchart of a data synchronization method provided by an embodiment of the present disclosure;
fig. 3 is a second flowchart of a data synchronization method provided in the embodiment of the present disclosure;
FIG. 4 is a schematic diagram illustrating an implementation of determining a first key-value pair according to an embodiment of the present disclosure;
fig. 5 is a schematic diagram illustrating an implementation of determining data to be submitted according to an embodiment of the present disclosure;
fig. 6 is a schematic diagram illustrating an implementation of determining data to be submitted for a plurality of data to be synchronized according to an embodiment of the present disclosure;
fig. 7 is a schematic diagram of an implementation process of data synchronization provided by an embodiment of the present disclosure;
FIG. 8 is a schematic structural diagram of a data synchronization apparatus according to an embodiment of the disclosure;
fig. 9 is a block diagram of an electronic device for implementing a data synchronization method of an embodiment of the present disclosure.
Detailed Description
Exemplary embodiments of the present disclosure are described below with reference to the accompanying drawings, in which various details of the embodiments of the disclosure are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present disclosure. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
In order to better understand the technical solution of the present disclosure, the related art related to the present disclosure is further described in detail below.
Software systems are typically divided into multiple different environments, such as development environments, sandbox environments, online environments, etc., where the different environments may correspond to different development phases of the software system.
It is worth mentioning that sandbox (sandbox) is a computer terminology, and is a security mechanism in the field of computer security, which provides an isolated environment for running programs. Often, the process is used as a source of uncertainty, damage, or failure to determine the intent of the process. Sandboxes generally tightly control the resources that programs therein can access, e.g., sandboxes may provide disk and memory space that is reclaimed from time to time. In sandboxes, network access, access to real systems, reading of input devices are typically prohibited or severely limited. From this perspective, sandboxes are one type of virtualization. All changes in the sandbox do not cause any loss to the operating system. Typically, this technique is widely used by computer technicians to test potentially virulent programs or other malicious code.
Whether the development environment, the sandbox environment or the online environment is adopted, each environment generally has a background system, and the background system is used for configuring certain necessary parameters for the corresponding environment so as to ensure that the code can run normally.
For example, the configured parameters may be introduced in combination with a specific scenario, for example, if a launching platform actively recommending digital cards to users currently exists, for a software system of the launching platform, each backend system in the launching platform needs to configure the parameters to the corresponding environment, where the configured parameters may include, for example, titles of the digital cards, templates of the digital cards, fields of the digital cards, and the like, and only if the parameters are configured, the digital cards may be correspondingly pushed to the users.
In an actual implementation process, the parameters specifically configured by the background system may depend on the functions implemented by the current software system, and the specific implementation manner of the parameters configured by the background system is not particularly limited in this embodiment.
The configuration functions of the parameters generally include addition, deletion, search, and modification, and each corresponding background system may include a data adding interface, a data viewing interface, a data deleting interface, and a data modifying interface, which may be understood by referring to fig. 1, for example, where fig. 1 is a system schematic diagram of a software system provided in the embodiment of the present disclosure.
As shown in fig. 1, the current software system may include a development environment, a sandbox environment, and an online environment, where each environment has a background system for configuring necessary parameters for the corresponding environment, and specifically, a data adding interface may be included on each background system for adding parameters for the corresponding environment, a data viewing interface may be included on each background system for viewing parameters of the corresponding environment, and a data deleting interface may be included on each background system for deleting parameters for the corresponding environment, and a data modification conclusion may be included on each background system for modifying parameters of the corresponding environment.
Based on the above description, the following description is provided for a general software system development process, which is to develop a software system in a development environment, for example, a data adding interface of a background system of the development environment may be called, and manually configured parameters are added to the development environment.
After the software system is developed in the development environment, the software system may be tested in the sandbox environment, for example, a data adding interface of a background system of the sandbox environment may be called, and the same manually configured parameters may be added in the sandbox environment.
After the test in the sandbox environment passes, the software system can be formally run in the online environment, for example, the same manually configured parameters can be newly added in the online environment through a data adding interface of a background system of the online environment.
It can be determined that new configuration parameters need to be added no matter what environment of the software system. Meanwhile, after the sandbox test of the software system passes, the parameters which are generally required to be configured are already stable, and can be directly applied to the online environment.
At present, in the prior art, when the configuration parameters of the sandbox environment and the online environment are synchronized, the configuration parameters of the sandbox environment are synchronized to the online environment by a manual copying and pasting mode, so as to ensure the consistency of the configuration parameters of the online environment and the sandbox environment.
Aiming at the problems in the prior art, the technical concept is as follows: the data needing to be synchronized is acquired from the data viewing interface of the sandbox environment according to the keywords, the data format of the data needing to be synchronized is analyzed and constructed into the data format corresponding to the data viewing interface of the online environment, so that the data needing to be synchronized is synchronized to the online environment through the data adding interface of the online environment, the data synchronization of the sandbox environment and the online environment can be quickly and effectively realized based on the multiplexing of the data viewing interface and the data adding interface, and the data synchronization operation efficiency is improved.
Based on the above description, the data synchronization method provided by the present disclosure is described in detail below with reference to specific embodiments, and it should be noted that the execution main body of each embodiment in the present disclosure may be, for example, a device with a data processing function, such as a server, a processor, a microprocessor, a terminal device running a software system, and the like.
First, description is made with reference to fig. 2, and fig. 2 is a flowchart of a data synchronization method provided in an embodiment of the present disclosure.
As shown in fig. 2, the method includes:
s201, a data synchronization request is obtained, wherein the data synchronization request comprises a first keyword, and the data synchronization request is used for requesting to synchronize data corresponding to the first keyword in a first data system to a second data system.
In this embodiment, for example, a data synchronization request may be first obtained, where the data synchronization request is used to request synchronization of data between the first data system and the second data system, and thus a plurality of data may be included in the first data system.
In a possible implementation manner, the first data system may be, for example, a data system corresponding to a test environment, and includes related configuration data corresponding to the test environment, where the test environment may be, for example, the sandbox environment described above. And the second data system may be, for example, a data system corresponding to an operating environment, including relevant configuration data corresponding to the operating environment, where the operating environment may be, for example, the above-described online environment.
In an actual implementation process, specific data content of data included in the first data system and the second data system may be selected according to actual requirements, which is not limited in this embodiment and may depend on specific functions of the software system, for example.
In a possible implementation manner, the data synchronization request includes a first keyword, where the first keyword may be, for example, an Identifier (ID) of the data to be synchronized, a name of the data to be synchronized, and the like, and in an actual implementation process, a specific implementation manner of the first keyword may be selected and set according to an actual requirement, as long as the first keyword can implement an indication of the data to be synchronized.
S202, calling a data viewing interface of the first data system according to the first keyword, and determining at least one piece of data to be synchronized corresponding to the first keyword in the first data system.
The data synchronization request in this embodiment is used to request that data corresponding to a first keyword in a first data system is synchronized to a second data system, so that at least one piece of data to be synchronized corresponding to the first keyword may be determined in the first data system according to the first keyword.
Based on the above description, it can be determined that each environment corresponds to a data viewing interface, a data adding interface, a data deleting interface, and a data modifying interface, and is used to configure parameters corresponding to the environment, and if data in the first data system needs to be synchronized to the second data system at present, corresponding data can be obtained through a data viewing result of the first data system.
In a possible implementation manner, for example, a data viewing interface of the first data system may be called according to the first keyword, so as to determine at least one to-be-synchronized data corresponding to the first keyword in the first data system.
It can be understood here, for example, in connection with a specific example, that, assuming that the function of the current software system is the function of actively recommending digital cards to the user as described above, one of the digital cards may be, for example, a piece of synchronization data, where each digital card corresponds to a respective identifier or name, the first keyword may be, for example, an identifier of the digital card that needs to be synchronized, or the first keyword may be, for example, a name of the digital card that needs to be synchronized, and so on.
Then, for example, according to the identification, name, etc. of the digital cards to be synchronized, the corresponding at least one digital card can be determined from the first data system, and one of the digital cards can be used as a piece of data to be synchronized.
The above is an exemplary introduction performed in combination with the digital card, in an actual implementation process, a specific implementation manner of the data to be synchronized may be selected according to an actual requirement, and all data that needs to be synchronized from the first data system to the second data system may be used as the data to be synchronized in this embodiment, which is not limited in this embodiment.
S203, according to the data adding interface of the second data system, data format conversion processing is carried out on at least one data to be synchronized, and data to be submitted corresponding to each data to be synchronized are obtained.
After the data to be synchronized is determined, the data may be synchronized to the second data system through the data adding interface of the second data system, and it can be understood that, in the data synchronization process, it is required to ensure that the data format of the data to be synchronized meets the data format requirement of the data adding interface of the second data system.
And S204, synchronizing the data to be submitted to the second data system through a data adding interface of the second data system.
After the data to be submitted is obtained by performing data analysis on the data to be synchronized, the data format of the data to be submitted is in accordance with the data format of the data adding interface of the second data system, so that the data to be submitted can be synchronized to the second data system through the data adding interface of the second data system.
The data synchronization method provided by the embodiment of the disclosure comprises the following steps: and acquiring a data synchronization request, wherein the data synchronization request comprises a first keyword, and the data synchronization request is used for requesting to synchronize data corresponding to the first keyword in the first data system to the second data system. And calling a data viewing interface of the first data system according to the first keyword, and determining at least one piece of data to be synchronized corresponding to the first keyword in the first data system. And performing data format conversion processing on at least one to-be-synchronized data according to the data newly-added interface of the second data system to obtain the to-be-submitted data corresponding to each to-be-synchronized data. And synchronizing the data to be submitted to the second data system through a data adding interface of the second data system. The data to be synchronized is acquired from the first data system by multiplexing the data viewing interface of the first data system, the format conversion processing is carried out on the data to be synchronized to obtain the data to be submitted, then the data adding interface of the second data system is multiplexed, and the data to be submitted is synchronized to the second data system, so that the data synchronization can be quickly and accurately realized based on the existing system structure.
On the basis of the foregoing embodiment, the following describes in further detail the data synchronization method provided by the present disclosure with reference to fig. 3 to 7, fig. 3 is a second flowchart of the data synchronization method provided by the embodiment of the present disclosure, fig. 4 is an implementation schematic diagram for determining a first key value pair provided by the embodiment of the present disclosure, fig. 5 is an implementation schematic diagram for determining data to be submitted provided by the embodiment of the present disclosure, fig. 6 is an implementation schematic diagram for determining data to be submitted for a plurality of data to be synchronized provided by the embodiment of the present disclosure, and fig. 7 is an execution process schematic diagram of data synchronization provided by the embodiment of the present disclosure.
As shown in fig. 3, the method includes:
s301, a data synchronization request is obtained, wherein the data synchronization request comprises a first keyword, and the data synchronization request is used for requesting to synchronize data corresponding to the first keyword in a first data system to a second data system.
The implementation manner of S301 is similar to that of S201, and is not described herein again.
S302, calling a data viewing interface of the first data system according to the first keyword, and determining at least one piece of data to be synchronized corresponding to the first keyword in the first data system.
The implementation manner of S302 is similar to that of S202, and is not described here again.
S303, acquiring at least one request field corresponding to the data addition interface.
In this embodiment, the data adding interface of the second data system corresponds to at least one request field, and in a possible implementation manner, for example, the request field corresponding to the data adding interface may be specified in an interface document of the data adding interface, so that the at least one request field corresponding to the data adding interface may be obtained according to the interface document.
For example, the request field may be understood in combination with a specific example, for example, the request field may include a Name (Name), an Age (Age), and a key (number of request fields), and in a possible implementation, each request field may further correspond to a respective data type, for example, the Name is a string type, the Age is an int (integer) type, and the key is fixed to a value of 3, which indicates that the request field corresponding to the current data adding interface includes three request fields, i.e., the Name, the Age, and the key.
In an optional implementation manner, the interface document may further include, for example, a request method, where the request method may be "post form-data," and it indicates that the request method of the data addition interface is of a post form-data type, and three parameters need to be transmitted, that is, parameters corresponding to the three request fields.
S304, obtaining the analysis function corresponding to each request field.
In this embodiment, each request field may correspond to an analysis function, so that in this embodiment, an analysis function corresponding to a request field may be obtained.
In a possible implementation manner, the parsing function corresponding to each request field may be stored in the first storage unit, for example, and then the parsing function corresponding to the request field may be obtained from the first storage unit; in another possible implementation manner, for example, an analysis function corresponding to the request field may be automatically generated through a first script, where the first script is a script for automatically generating the analysis function corresponding to the request field, and a specific implementation manner of obtaining the analysis function corresponding to the request field in this embodiment is not particularly limited.
S305, generating a mapping table according to at least one request field and the analysis function corresponding to each request field, wherein the mapping table comprises a plurality of first key value pairs, the keys of the first key value pairs are the request fields, and the values of the first key value pairs are the analysis functions corresponding to the request fields.
In this embodiment, after determining each field and the parsing function corresponding to each request field, a mapping table may be generated, where the mapping table is used to process the data format of the data to be synchronized into the data format corresponding to the data adding interface.
In a possible implementation manner, the mapping table in this embodiment may include a plurality of first key-value pairs, where a key-value pair (key-value) is a data format, and the key-value pair may include a key and a value, and the key-value pair represents a correspondence between the key and the value, for example, there is currently one key-value pair of's ' ═ 1', where s is the key, 1 is the value, and s is represented by 1.
The implementation of the current determination of the mapping table may, for example, determine a corresponding key-value pair for each request field, thereby obtaining a plurality of first key-value pairs to determine the mapping table. For example, the following may use any request field as an example to describe the implementation of determining the first key-value pair, and the implementation of the remaining request fields is similar.
In a possible implementation manner, the request field may be determined as a key in the first key value pair, and an analysis function corresponding to the request field may be determined as a value in the first key value pair, after the key and the value are determined, the first key value pair corresponding to the request field may be obtained, and the same operation is performed on each request field, so that the first key value pair corresponding to each request field may be determined, and a mapping table including a plurality of first key value pairs may be obtained.
In one possible implementation manner, for example, the above-described request field including Name (Name), Age (Age), and key (number of request fields) may be used as an example, and an implementation manner of determining the first key-value pair is described with reference to fig. 4.
As shown in fig. 4, the request field includes Name, Age, and key. For the request field Name (Name) therein, it may be determined as a key in the first key value pair, and an analytic function corresponding to the Name (Name) is determined as a value in the first key value pair, so that the first key value pair 41 shown in fig. 4 may be obtained, in one possible implementation, the analytic function corresponding to the Name (Name) may be func () { return a.name }, for example, and the meaning of the analytic function is a value corresponding to a parameter Name in the returned data a, then the first key value pair 41 may be expressed as 'Name' ═ func ({ return a.name }, for example.
And, for the request field Age therein, it may be determined as a key in the first key value pair, and an analytic function corresponding to Age may be determined as a value in the first key value pair, so that the first key value pair 42 shown in fig. 4 may be obtained, in one possible implementation, the analytic function corresponding to Age may be, for example, func () { return a.age }, meaning that the value corresponding to the parameter Age in the returned data a, then the first key value pair 42 may be, for example, expressed as 'Age' ═ func ({ return a.age }.
And, for the request field key (request field number) therein, it may be determined as a key in the first key value pair, and an analytic function corresponding to the key (request field number) is determined as a value in the first key value pair, so that the first key value pair 43 shown in fig. 4 may be obtained, in one possible implementation, the analytic function corresponding to the key (request field number) may be func ({ return 3}, for example, the meaning of the analytic function is to return a fixed value 3 corresponding to the key, and then the first key value pair 43 may be expressed as 'key' ═ func ({ return 3}, for example.
Based on the implementation manner described above, the first key-value pairs corresponding to the respective request fields may be correspondingly determined, and the mapping table in this embodiment includes at least one first key-value pair, so that after the first key-value pairs corresponding to the respective request fields are determined, the mapping table may be correspondingly determined, for example, the mapping table in this embodiment may be represented as: { ' Name ═ func () { return a.name }, ' Age ═ func () { return a.age }, and ' key ═ func () { return 3} }.
In the above description, a possible implementation manner of the parsing function corresponding to the request field is introduced, and it can be understood that the parsing function in this embodiment is a function for parsing the field content corresponding to the request field from the data to be synchronized, for example, if the current request field is "name", the parsing function corresponding to the request field of "name" is used for parsing the field content corresponding to the request field of "name" from the data to be synchronized.
It is to be understood that the key in the first key value pair in this embodiment is a required field specified by the request parameter, and the value in the first key value pair is a method, i.e. a parsing function in this embodiment, where the parsing function is used to parse the value of the required field specified by the current request parameter from the data to be synchronized. Based on this, the specific implementation manner of the parsing function may be selected according to actual requirements as long as it can parse the corresponding field content from the data to be synchronized, and the specific implementation manner of the parsing function is not particularly limited in this embodiment.
S306, aiming at any one first key value pair, determining a key in the first key value pair as a submission field in the data to be submitted; and performing data analysis on at least one data to be synchronized according to an analysis function in the first key value pair, and determining field content corresponding to the submitted field.
In this embodiment, after the mapping table is determined, data analysis may be performed on the data to be synchronized according to the mapping table, so that data to be submitted corresponding to each data to be synchronized is obtained.
Based on the above description, it may be determined that the mapping table in this embodiment includes at least one first key-value pair, where each of the first key-value pairs may correspond to one submission field in the data to be submitted, and an implementation manner of determining the data to be submitted is described below by taking any one of the first key-value pairs as an example, where the implementation manners of the first key-value pairs are similar, and are not described herein again.
In this embodiment, for example, the data to be submitted may include at least one submission field and submission contents corresponding to each submission field, and if the data to be submitted corresponding to each data to be synchronized is to be determined, the submission fields and the submission contents corresponding to the submission fields need to be determined.
Based on the above description, it may be determined that the first key-value pair includes a key and a value, and in a possible implementation, the key in the first key-value pair may be determined as one commit field in the data to be committed.
Specifically, in this embodiment, the key in the first key value pair is a request field indicated by the format indication information, where the request field is a field specified by the data add-on interface of the second data system, and therefore, the key in the first key value pair is currently determined as a commit field, and actually, the request field in the format indication information is directly determined as a commit field, so as to ensure that the commit field is a field required by the data add-on interface of the second data system.
For example, as can be understood in conjunction with fig. 5, as shown in fig. 5, the current mapping table includes three first key-value pairs, namely, a first key-value pair 51, a first key-value pair 52 and a first key-value pair 53, a key in each first key-value pair may be respectively used as one submission field in the data to be submitted, as shown in fig. 5, a key Name (Name) in the first key-value pair 51 may be determined as one submission field, a key Age (Age) in the first key-value pair 52 may be determined as another submission field, and a key (number of request fields) in the first key-value pair 53 may be determined as another submission field, so that 3 submission fields in the data to be submitted as shown in fig. 5 may be obtained.
And the data to be submitted in this embodiment includes submitted fields and field contents, and after each submitted field is determined, the field contents corresponding to each submitted field need to be further determined, where a value in the first key value pair is an analytic function, where the analytic function is used to determine the field contents corresponding to the submitted field, so that data analysis may be performed on at least one data to be synchronized according to the analytic function in the first key value pair, thereby determining the field contents corresponding to the submitted field.
In this embodiment, the data to be synchronized includes at least one second key-value pair, which also includes a key and a value, for example, as can be understood in conjunction with fig. 5, assuming that the data a to be synchronized currently exists, where the data a to be synchronized includes a second key-value pair 54 and a second key-value pair 55, the key of the second key-value pair 54 is a name (name) with a value of "zhangsan", and the key of the second key-value pair 55 is an age (age) with a value of "18", and the data to be synchronized may be expressed as a { ' name ' > zhangsan ' with an ' age ' >18}, for example.
In a possible implementation manner, a target second key-value pair may be determined in each second key-value pair of the data to be synchronized, where there is a correspondence between a key of the target second key-value pair and a key of the first key-value pair.
Assuming that the field content is currently determined for the first key-value pair 51, where the key of the first key-value pair 51 is a Name, a target second key-value pair may be determined in a second key-value pair of the current data to be synchronized, which includes a second key-value pair ' Name ' ═ zhang ' and a second key-value pair ' Name ' ═ zhang ', where there is a correspondence between the key of the target second key-value pair in this embodiment and the key of the first key-value pair currently being processed, for example, the target second key-value pair is ' Name ' ═ zhang ', where there is a correspondence between the key of the target second key-value pair and the key of the first key-value pair currently being processed, and in this embodiment, the correspondence between the key of the first key-value pair and the key of the second key-value pair may be stored in a preset storage unit, for example, the correspondence may be obtained from the preset storage unit, thereby determining the target second key-value pair.
Similarly, assuming that field contents are currently being determined for a first key-value pair 52, where the key of the first key-value pair 52 is Age, the current target second key-value pair may be determined to be 'Age' > 18.
After the target second key value pair is determined, values in the target second key value pair may be obtained according to an analytic function.
Assuming that the above example is continued, the current first key-value pair 51 may be represented as, for example, ' Name ' > func () { return a.name }, and then the parsing function corresponding to the request field Name (Name) may be, for example, func () { return a.name }, and the current target second key-value pair is ' Name ' zhang ', and then the value of the target second key-value pair, that is, "zhang" may be extracted from the target second key-value pair ' Name ' zhang ' according to the parsing function ' func () { return a.name } "and, referring to fig. 5, the parsing function in the first key-value pair 51 may parse the data" zhang "from the second key-value pair 54.
Similarly, assuming that the current first key-value pair 52 may be denoted as 'Age' > func () { return a.e }, for example, the analytic function corresponding to the request field Age may be denoted as func () { return a.e }, and the current target second key-value pair is 'Age' >18, the value of the target second key-value pair, that is, "18", may be extracted from the target second key-value pair 'Age' >18 according to the analytic function "func () { return a.e }" and, referring to fig. 5, the analytic function in the first key-value pair 52 may obtain data "18" from the second key-value pair 55.
After determining the value in the target second key value pair, the value in the target second key value pair may be determined as the field content corresponding to the commit field, for example, "zhang san" determined above is determined for the commit field "Name", and then, referring to fig. 5, "zhang san" may be determined as the field content corresponding to the commit field "Name". And for example, "18" determined above is determined for the commit field "Age", then with reference to fig. 5, "18" may be determined as the field content corresponding to the commit field "Age".
And the value of the request field in this embodiment may also be configured to be a preset value, and then the field content corresponding to the submit field may also be determined according to the preset value indicated by the parsing function, and if the first key-value pair 53 may be represented as, for example, 'key' ═ func () { return 3}, then the parsing function indicating that the request field key (the number of request fields) corresponds to, for example, func () { return 3}, then the preset value indicated by the parsing function may be obtained as 3, and referring to fig. 5, the preset value "3" may be determined as the field content corresponding to the submit field "key". Thus, the multiple commit fields and corresponding field contents shown in FIG. 5 are available.
S307, associating each submitted field and the field content corresponding to each submitted field respectively to obtain the data to be submitted.
Based on the above-described process, at least one submission field and the respective field contents of the submission fields can be determined. And then, associating each submitted field with the field content corresponding to each submitted field respectively to obtain the data to be submitted. As shown in fig. 5, the submission field "Name" and the field content "zhang san" may be associated, the submission field "Age" and the field content "18" may be associated, and the submission field "key" and the field content "3" may be associated, so as to obtain the data to be submitted shown in fig. 5.
Based on the above description of fig. 5, it can be determined that the original data to be synchronized is a { 'name' > 'zhang' and 'age' >18}, the data to be submitted after data parsing is { 'Name' ='zhang', 'Age' >18, 'key' >3}, it can be seen that, the capital and small letters of the fields are changed, so that the data formats required by the data adding interface of the second data system are the capital names and Ages, therefore, if the data are directly synchronized according to the data to be synchronized, because the format does not meet the requirement of the data adding interface of the second data system, the data synchronization can not be directly realized, therefore, data synchronization can be realized only by analyzing data to obtain data to be submitted which meets the format requirement of the data adding interface of the second data system.
In this embodiment, for example, a plurality of data to be synchronized may be determined according to the first keyword, where for each data to be synchronized, data parsing may be performed to obtain data to be submitted corresponding to the data to be synchronized, each data to be synchronized may include at least one second key value pair, and each data to be submitted may include at least one submission field and field content corresponding to each submission field.
For example, it can be understood by referring to fig. 6, as shown in fig. 6, assuming that data a to be synchronized, data b to be synchronized, and data c to be synchronized are currently determined, referring to fig. 6, each data to be synchronized may include a plurality of second key value pairs, and then, for each data to be synchronized, data analysis may be performed respectively, so as to obtain data to be submitted corresponding to each data to be synchronized.
As shown in fig. 6, data analysis is performed on data to be synchronized a to obtain corresponding data to be submitted 1, data analysis is performed on data to be synchronized b to obtain corresponding data to be submitted 2, and data analysis is performed on data to be synchronized c to obtain corresponding data to be submitted 3, where it can be determined by referring to fig. 6 that each data to be submitted includes at least one submitted field and field content corresponding to each field.
And S308, generating a submission request according to the data to be submitted, wherein the submission request comprises the data to be submitted.
After determining the data to be submitted, a submission request may be generated according to the data to be submitted, where the submission request in this embodiment includes the data to be submitted, and the submission request may be used to request to call a data adding interface of the second data system, for example, to add the data to be submitted to the second data system.
S309, acquiring a request address of the data adding interface.
In a possible implementation manner, for example, the interface document of the data addition interface may include the request address, and for example, the request address may be obtained from the interface document of the data addition interface.
The request address may be, for example, a Uniform Resource Locator (URL) of the request, for example, http:// test.com/user/create, and in an actual implementation process, a specific implementation of the request address may be selected according to an actual requirement, which is not limited in this embodiment.
And S310, sending a submission request to the data adding interface according to the request address.
After the request address is determined, a submission request including the data to be submitted can be sent according to the data addition interface, so that the submitted data can be synchronized to the second data system.
For example, the implementation process of this embodiment can be understood with reference to fig. 7, as shown in fig. 7, the sandbox environment corresponds to the first data system, the online environment corresponds to the second data system, and the first data system and the second data system both correspondingly include a data adding interface, a data viewing interface, a data deleting interface, and a data modifying interface.
Assuming that part of the data in the first data system is to be synchronized into the second data system currently, for example, a data viewing interface of the first data system may be called according to the first keyword, so as to determine at least one piece of data to be synchronized corresponding to the first keyword in the first data system.
And then format conversion can be respectively carried out on the data to be synchronized, so as to obtain the data to be submitted corresponding to the data to be synchronized, wherein the data format of the data to be submitted is in accordance with the data format corresponding to the data adding interface of the second data system, then the adding data interface of the second data system can be called, and the data to be submitted is synchronized to the second data system, so that the data corresponding to the first keyword in the first data system is effectively synchronized to the second data system.
The data synchronization method provided by the embodiment of the disclosure determines a mapping table for data parsing of data to be synchronized according to a request field included in format indication information of a data adding interface of a second data system, and then directly determines the request field in the mapping table as a submission field of the data to be submitted, so as to effectively ensure that the data to be submitted obtained after the data parsing of the data to be synchronized is in accordance with format requirements of the data adding interface of the second data system, and when determining field contents corresponding to each submission field in the data to be submitted, specifically, according to an analysis function corresponding to each request field, extracts the field contents corresponding to the request field from the data to be synchronized, so as to effectively ensure that the data contents of the data to be submitted are in accordance with the data contents of the data to be synchronized, therefore, the data synchronization method provided by this embodiment can quickly and effectively implement data synchronization between the first data system and the second data system on the basis of the existing architecture by multiplexing the data viewing interface and the data adding interface and by constructing the mapping table, so as to effectively improve the efficiency of data synchronization.
Fig. 8 is a schematic structural diagram of a data synchronization apparatus according to an embodiment of the disclosure. As shown in fig. 8, the data synchronization apparatus 800 of the present embodiment may include: an acquisition module 801, a determination module 802, a processing module 803, and a synchronization module 804.
An obtaining module 801, configured to obtain a data synchronization request, where the data synchronization request includes a first keyword, and the data synchronization request is used to request to synchronize data corresponding to the first keyword in a first data system to a second data system;
a determining module 802, configured to invoke a data viewing interface of a first data system according to a first keyword, and determine at least one to-be-synchronized data corresponding to the first keyword in the first data system;
a processing module 803, configured to perform format conversion processing on the at least one to-be-synchronized data according to the data addition interface of the second data system, so as to obtain to-be-submitted data corresponding to each to-be-synchronized data;
a synchronizing module 804, configured to synchronize the data to be submitted to the second data system through a data addition interface of the second data system.
In a possible implementation manner, the processing module 803 is specifically configured to:
acquiring at least one request field corresponding to the data addition interface;
acquiring an analytic function corresponding to each request field;
and performing data format conversion processing on the at least one data to be synchronized according to the at least one request field and the analysis function corresponding to each request field to obtain the data to be submitted corresponding to each data to be synchronized.
In a possible implementation manner, the processing module 803 is specifically configured to:
generating a mapping table according to the at least one request field and the analytic function corresponding to each request field, wherein the mapping table comprises a plurality of first key-value pairs, the key of each first key-value pair is the request field, and the value of each first key-value pair is the analytic function corresponding to the request field;
and performing data analysis on the at least one data to be synchronized according to the mapping table to obtain the data to be submitted corresponding to each data to be synchronized.
In a possible implementation manner, the data to be submitted includes at least one submission field and submission contents corresponding to each submission field; the data to be synchronized comprises at least one second key-value pair;
the processing module 803 is specifically configured to:
for any one first key value pair, determining a key in the first key value pair as a submission field in the data to be submitted; and the number of the first and second groups,
performing data analysis on the at least one data to be synchronized according to an analysis function in the first key value pair, and determining field content corresponding to the submitted field;
and respectively associating the submitted fields with the field contents corresponding to the submitted fields to obtain the data to be submitted.
In a possible implementation manner, the processing module 803 is specifically configured to:
determining a target second key value pair in each second key value pair of the data to be synchronized, wherein a corresponding relation exists between a key of the target second key value pair and a key of the first key value pair;
obtaining a value in the target second key value pair according to the analytic function;
and determining the value in the target second key value pair as the field content corresponding to the submitted field.
In a possible implementation manner, the processing module 803 is further configured to:
and determining a preset numerical value indicated by the analytic function in the first key value pair as the field content corresponding to the submitted field.
In a possible implementation manner, the synchronization module 804 is specifically configured to:
generating a submission request according to the data to be submitted, wherein the submission request comprises the data to be submitted;
acquiring a request address of the data adding interface;
and sending the submission request to the data newly-added interface according to the request address.
In a possible implementation manner, the first data system is a data system corresponding to a test environment, and the second data system is a data system corresponding to an operating environment.
The disclosure provides a data synchronization method and device, which are applied to the Internet of things technology in data processing to achieve the purpose of improving the efficiency of data synchronization.
The present disclosure also provides an electronic device and a readable storage medium according to an embodiment of the present disclosure.
According to an embodiment of the present disclosure, the present disclosure also provides a computer program product comprising: a computer program, stored in a readable storage medium, from which at least one processor of the electronic device can read the computer program, the at least one processor executing the computer program causing the electronic device to perform the solution provided by any of the embodiments described above.
FIG. 8 illustrates a schematic block diagram of an example electronic device 900 that can be used to implement embodiments of the present disclosure. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be examples only, and are not meant to limit implementations of the disclosure described and/or claimed herein.
As shown in fig. 9, the electronic apparatus 900 includes a computing unit 901, which can perform various appropriate actions and processes in accordance with a computer program stored in a Read Only Memory (ROM)902 or a computer program loaded from a storage unit 908 into a Random Access Memory (RAM) 903. In the RAM 903, various programs and data required for the operation of the device 900 can also be stored. The calculation unit 901, ROM 902, and RAM 903 are connected to each other via a bus 904. An input/output (I/O) interface 905 is also connected to bus 904.
A number of components in the device 900 are connected to the I/O interface 905, including: an input unit 906 such as a keyboard, a mouse, and the like; an output unit 907 such as various types of displays, speakers, and the like; a storage unit 908 such as a magnetic disk, optical disk, or the like; and a communication unit 909 such as a network card, a modem, a wireless communication transceiver, and the like. The communication unit 909 allows the device 900 to exchange information/data with other devices through a computer network such as the internet and/or various telecommunication networks.
The computing unit 901 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of the computing unit 901 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various dedicated Artificial Intelligence (AI) computing chips, various computing units running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, and so forth. The calculation unit 901 performs the respective methods and processes described above, such as the data synchronization method. For example, in some embodiments, the data synchronization method may be implemented as a computer software program tangibly embodied in a machine-readable medium, such as storage unit 908. In some embodiments, part or all of the computer program may be loaded and/or installed onto device 900 via ROM 902 and/or communications unit 909. When the computer program is loaded into the RAM 903 and executed by the computing unit 901, one or more steps of the data synchronization method described above may be performed. Alternatively, in other embodiments, the computing unit 901 may be configured to perform the data synchronization method by any other suitable means (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuitry, Field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), system on a chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
Program code for implementing the methods of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the program codes, when executed by the processor or controller, cause the functions/operations specified in the flowchart and/or block diagram to be performed. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), Wide Area Networks (WANs), and the Internet.
The computer system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The Server can be a cloud Server, also called a cloud computing Server or a cloud host, and is a host product in a cloud computing service system, so as to solve the defects of high management difficulty and weak service expansibility in the traditional physical host and VPS service ("Virtual Private Server", or simply "VPS"). The server may also be a server of a distributed system, or a server incorporating a blockchain.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present application may be executed in parallel, sequentially, or in different orders, and are not limited herein as long as the desired results of the technical solutions disclosed in the present disclosure can be achieved.
The above detailed description should not be construed as limiting the scope of the disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made in accordance with design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present disclosure should be included in the scope of protection of the present disclosure.
Claims (19)
1. A method of data synchronization, comprising:
acquiring a data synchronization request, wherein the data synchronization request comprises a first keyword, and the data synchronization request is used for requesting to synchronize data corresponding to the first keyword in a first data system to a second data system;
calling a data viewing interface of a first data system according to a first keyword, and determining at least one piece of data to be synchronized corresponding to the first keyword in the first data system;
performing format conversion processing on the at least one to-be-synchronized data according to a data newly-added interface of the second data system to obtain to-be-submitted data corresponding to each to-be-synchronized data;
and synchronizing the data to be submitted to the second data system through a data adding interface of the second data system.
2. The method of claim 1, wherein the performing, according to the data addition interface of the second data system, data format conversion processing on the at least one to-be-synchronized data to obtain to-be-submitted data corresponding to each to-be-synchronized data includes:
acquiring at least one request field corresponding to the data addition interface;
acquiring an analytic function corresponding to each request field;
and performing data format conversion processing on the at least one data to be synchronized according to the at least one request field and the analysis function corresponding to each request field to obtain the data to be submitted corresponding to each data to be synchronized.
3. The method according to claim 2, wherein the performing, according to the at least one request field and the parsing function corresponding to each request field, data format conversion processing on the at least one data to be synchronized to obtain data to be submitted corresponding to each data to be synchronized comprises:
generating a mapping table according to the at least one request field and the analytic function corresponding to each request field, wherein the mapping table comprises a plurality of first key-value pairs, the key of each first key-value pair is the request field, and the value of each first key-value pair is the analytic function corresponding to the request field;
and performing data analysis on the at least one data to be synchronized according to the mapping table to obtain the data to be submitted corresponding to each data to be synchronized.
4. The method according to claim 3, wherein the data to be submitted comprises at least one submission field and submission contents corresponding to each submission field; the data to be synchronized comprises at least one second key-value pair;
performing data analysis on the at least one data to be synchronized according to the mapping table to obtain data to be submitted corresponding to each data to be synchronized, including:
for any one first key value pair, determining a key in the first key value pair as a submission field in the data to be submitted; and the number of the first and second groups,
performing data analysis on the at least one data to be synchronized according to an analysis function in the first key value pair, and determining field content corresponding to the submitted field;
and respectively associating the submitted fields with the field contents corresponding to the submitted fields to obtain the data to be submitted.
5. The method of claim 4, wherein the performing data parsing on the at least one data to be synchronized according to a parsing function in the first key value pair to determine field contents corresponding to the submitted fields comprises:
determining a target second key value pair in each second key value pair of the data to be synchronized, wherein a corresponding relation exists between a key of the target second key value pair and a key of the first key value pair;
obtaining a value in the target second key value pair according to the analytic function;
and determining the value in the target second key value pair as the field content corresponding to the submitted field.
6. The method of claim 4, further comprising:
and determining a preset numerical value indicated by the analytic function in the first key value pair as the field content corresponding to the submitted field.
7. The method of claim 3, wherein the synchronizing the data to be submitted to the second data system through a data addition interface of the second data system comprises:
generating a submission request according to the data to be submitted, wherein the submission request comprises the data to be submitted;
acquiring a request address of the data adding interface;
and sending the submission request to the data newly-added interface according to the request address.
8. The method of any one of claims 1-7, wherein the first data system is a data system corresponding to a test environment and the second data system is a data system corresponding to a runtime environment.
9. A data synchronization apparatus, comprising:
the data synchronization method comprises the steps that an obtaining module is used for obtaining a data synchronization request, wherein the data synchronization request comprises a first keyword, and the data synchronization request is used for requesting to synchronize data corresponding to the first keyword in a first data system to a second data system;
the device comprises a determining module, a synchronization module and a synchronization module, wherein the determining module is used for calling a data viewing interface of a first data system according to a first keyword and determining at least one piece of data to be synchronized corresponding to the first keyword in the first data system;
the processing module is used for performing format conversion processing on the at least one to-be-synchronized data according to the data newly-added interface of the second data system to obtain to-be-submitted data corresponding to each to-be-synchronized data;
and the synchronization module is used for synchronizing the data to be submitted to the second data system through a data adding interface of the second data system.
10. The apparatus of claim 9, wherein the processing module is specifically configured to:
acquiring at least one request field corresponding to the data addition interface;
acquiring an analytic function corresponding to each request field;
and performing data format conversion processing on the at least one data to be synchronized according to the at least one request field and the analysis function corresponding to each request field to obtain the data to be submitted corresponding to each data to be synchronized.
11. The apparatus of claim 10, wherein the processing module is specifically configured to:
generating a mapping table according to the at least one request field and the analytic function corresponding to each request field, wherein the mapping table comprises a plurality of first key-value pairs, the key of each first key-value pair is the request field, and the value of each first key-value pair is the analytic function corresponding to the request field;
and performing data analysis on the at least one data to be synchronized according to the mapping table to obtain the data to be submitted corresponding to each data to be synchronized.
12. The apparatus according to claim 11, wherein the data to be submitted includes at least one submission field and submission contents corresponding to each of the submission fields; the data to be synchronized comprises at least one second key-value pair;
the processing module is specifically configured to:
for any one first key value pair, determining a key in the first key value pair as a submission field in the data to be submitted; and the number of the first and second groups,
performing data analysis on the at least one data to be synchronized according to an analysis function in the first key value pair, and determining field content corresponding to the submitted field;
and respectively associating the submitted fields with the field contents corresponding to the submitted fields to obtain the data to be submitted.
13. The apparatus of claim 12, wherein the processing module is specifically configured to:
determining a target second key value pair in each second key value pair of the data to be synchronized, wherein a corresponding relation exists between a key of the target second key value pair and a key of the first key value pair;
obtaining a value in the target second key value pair according to the analytic function;
and determining the value in the target second key value pair as the field content corresponding to the submitted field.
14. The apparatus of claim 12, the processing module further to:
and determining a preset numerical value indicated by the analytic function in the first key value pair as the field content corresponding to the submitted field.
15. The apparatus of claim 11, wherein the synchronization module is specifically configured to:
generating a submission request according to the data to be submitted, wherein the submission request comprises the data to be submitted;
acquiring a request address of the data adding interface;
and sending the submission request to the data newly-added interface according to the request address.
16. The apparatus according to any one of claims 9-15, wherein the first data system is a data system corresponding to a test environment, and the second data system is a data system corresponding to a runtime environment.
17. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-8.
18. A non-transitory computer readable storage medium having stored thereon computer instructions for causing the computer to perform the method of any one of claims 1-8.
19. A computer program product comprising a computer program which, when executed by a processor, implements the method according to any one of claims 1-8.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110893529.0A CN113535857A (en) | 2021-08-04 | 2021-08-04 | Data synchronization method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110893529.0A CN113535857A (en) | 2021-08-04 | 2021-08-04 | Data synchronization method and device |
Publications (1)
Publication Number | Publication Date |
---|---|
CN113535857A true CN113535857A (en) | 2021-10-22 |
Family
ID=78090484
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110893529.0A Withdrawn CN113535857A (en) | 2021-08-04 | 2021-08-04 | Data synchronization method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113535857A (en) |
Citations (14)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104731569A (en) * | 2013-12-23 | 2015-06-24 | 华为技术有限公司 | Data processing method and relevant equipment |
CN108009261A (en) * | 2017-12-12 | 2018-05-08 | 北京奇艺世纪科技有限公司 | A kind of method of data synchronization, device and electronic equipment |
CN108052681A (en) * | 2018-01-12 | 2018-05-18 | 毛彬 | The synchronous method and system of structural data between a kind of relevant database |
CN108228875A (en) * | 2018-01-18 | 2018-06-29 | 北京奇安信科技有限公司 | Daily record analysis method and device based on perfect Hash |
CN108804510A (en) * | 2017-04-26 | 2018-11-13 | 三星电子株式会社 | Key assignments file system |
CN108874950A (en) * | 2018-06-05 | 2018-11-23 | 亚信科技(中国)有限公司 | A kind of distributed data storage method and device based on ER relationship |
CN109684335A (en) * | 2018-12-26 | 2019-04-26 | 百度在线网络技术(北京)有限公司 | Data structure implementation method, device, equipment and storage medium based on key-value pair |
CN111061678A (en) * | 2019-12-10 | 2020-04-24 | 深圳奇迹智慧网络有限公司 | Service data processing method and device, computer equipment and storage medium |
CN111400308A (en) * | 2020-02-21 | 2020-07-10 | 中国平安财产保险股份有限公司 | Processing method of cache data, electronic device and readable storage medium |
CN111611225A (en) * | 2020-05-15 | 2020-09-01 | 腾讯科技(深圳)有限公司 | Data storage management method, query method, device, electronic equipment and medium |
CN111881209A (en) * | 2020-06-29 | 2020-11-03 | 平安国际智慧城市科技股份有限公司 | Data synchronization method and device for heterogeneous database, electronic equipment and medium |
CN111897833A (en) * | 2020-08-12 | 2020-11-06 | 网易(杭州)网络有限公司 | Data processing method and device |
CN112035471A (en) * | 2020-08-28 | 2020-12-04 | 中国平安人寿保险股份有限公司 | Transaction processing method and computer equipment |
CN112416940A (en) * | 2020-11-27 | 2021-02-26 | 深信服科技股份有限公司 | Key value pair storage method and device, terminal equipment and storage medium |
-
2021
- 2021-08-04 CN CN202110893529.0A patent/CN113535857A/en not_active Withdrawn
Patent Citations (14)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104731569A (en) * | 2013-12-23 | 2015-06-24 | 华为技术有限公司 | Data processing method and relevant equipment |
CN108804510A (en) * | 2017-04-26 | 2018-11-13 | 三星电子株式会社 | Key assignments file system |
CN108009261A (en) * | 2017-12-12 | 2018-05-08 | 北京奇艺世纪科技有限公司 | A kind of method of data synchronization, device and electronic equipment |
CN108052681A (en) * | 2018-01-12 | 2018-05-18 | 毛彬 | The synchronous method and system of structural data between a kind of relevant database |
CN108228875A (en) * | 2018-01-18 | 2018-06-29 | 北京奇安信科技有限公司 | Daily record analysis method and device based on perfect Hash |
CN108874950A (en) * | 2018-06-05 | 2018-11-23 | 亚信科技(中国)有限公司 | A kind of distributed data storage method and device based on ER relationship |
CN109684335A (en) * | 2018-12-26 | 2019-04-26 | 百度在线网络技术(北京)有限公司 | Data structure implementation method, device, equipment and storage medium based on key-value pair |
CN111061678A (en) * | 2019-12-10 | 2020-04-24 | 深圳奇迹智慧网络有限公司 | Service data processing method and device, computer equipment and storage medium |
CN111400308A (en) * | 2020-02-21 | 2020-07-10 | 中国平安财产保险股份有限公司 | Processing method of cache data, electronic device and readable storage medium |
CN111611225A (en) * | 2020-05-15 | 2020-09-01 | 腾讯科技(深圳)有限公司 | Data storage management method, query method, device, electronic equipment and medium |
CN111881209A (en) * | 2020-06-29 | 2020-11-03 | 平安国际智慧城市科技股份有限公司 | Data synchronization method and device for heterogeneous database, electronic equipment and medium |
CN111897833A (en) * | 2020-08-12 | 2020-11-06 | 网易(杭州)网络有限公司 | Data processing method and device |
CN112035471A (en) * | 2020-08-28 | 2020-12-04 | 中国平安人寿保险股份有限公司 | Transaction processing method and computer equipment |
CN112416940A (en) * | 2020-11-27 | 2021-02-26 | 深信服科技股份有限公司 | Key value pair storage method and device, terminal equipment and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2021023149A1 (en) | Method and apparatus for dynamically returning message | |
CN110858172A (en) | Automatic test code generation method and device | |
CN112015468B (en) | Interface document processing method and device, electronic equipment and storage medium | |
CN113836314B (en) | Knowledge graph construction method, device, equipment and storage medium | |
WO2023142451A1 (en) | Workflow generation methods and apparatuses, and electronic device | |
CN113220367A (en) | Applet running method and device, electronic equipment and storage medium | |
CN113127357B (en) | Unit test method, apparatus, device, storage medium, and program product | |
CN112989797B (en) | Model training and text expansion methods, devices, equipment and storage medium | |
CN113642295B (en) | Page typesetting method, device and computer program product | |
CN113535857A (en) | Data synchronization method and device | |
CN114218166A (en) | Data processing method and device, electronic equipment and readable storage medium | |
CN118133794B (en) | Table configuration method, apparatus, device and storage medium | |
CN114281981B (en) | News brief report generation method and device and electronic equipment | |
CN113590483B (en) | Use case operation method and device | |
CN113220282B (en) | Development processing method, device and storage medium for applet | |
CN114564133A (en) | Application program display method, device, equipment and medium | |
CN117762462A (en) | Code examination method, device, equipment and storage medium based on large model | |
CN118799021A (en) | Method and device for reusing business commodity components, electronic equipment and storage medium | |
CN116842926A (en) | Template generation method and device, electronic equipment and storage medium | |
CN113377378A (en) | Processing method, device and equipment for small program and storage medium | |
CN115220722A (en) | Method, device, equipment and medium for back-end internationalization | |
CN116225437A (en) | Page generation method and device, electronic equipment and storage medium | |
CN114465811A (en) | Website login determination method and device, electronic equipment and storage medium | |
CN115328497A (en) | File merging method and device, electronic equipment and readable storage medium | |
CN115599823A (en) | Data acquisition method, device, equipment and storage medium in micro-service scene |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
WW01 | Invention patent application withdrawn after publication |
Application publication date: 20211022 |
|
WW01 | Invention patent application withdrawn after publication |