CN116401319B - Data synchronization method and device, electronic equipment and computer readable storage medium - Google Patents

Data synchronization method and device, electronic equipment and computer readable storage medium Download PDF

Info

Publication number
CN116401319B
CN116401319B CN202310679482.7A CN202310679482A CN116401319B CN 116401319 B CN116401319 B CN 116401319B CN 202310679482 A CN202310679482 A CN 202310679482A CN 116401319 B CN116401319 B CN 116401319B
Authority
CN
China
Prior art keywords
data
synchronized
sub
target
resource configuration
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.)
Active
Application number
CN202310679482.7A
Other languages
Chinese (zh)
Other versions
CN116401319A (en
Inventor
杨喆
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
CCB Finetech Co Ltd
Original Assignee
CCB Finetech Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by CCB Finetech Co Ltd filed Critical CCB Finetech Co Ltd
Priority to CN202310679482.7A priority Critical patent/CN116401319B/en
Publication of CN116401319A publication Critical patent/CN116401319A/en
Application granted granted Critical
Publication of CN116401319B publication Critical patent/CN116401319B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution
    • G06F16/24564Applying rules; Deductive queries
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/28Databases characterised by their database models, e.g. relational or object models
    • G06F16/284Relational databases
    • G06F16/288Entity relationship models

Abstract

The invention provides a data synchronization method and device, electronic equipment and a computer readable storage medium, which can be applied to the technical field of computers, the technical field of data processing and the technical field of finance and technology. The data synchronization method comprises the following steps: responding to the received data synchronization request, and analyzing and processing a target configuration file in a target configuration management database indicated by the data synchronization request to obtain a target resource configuration data structure corresponding to the target configuration file; acquiring sub-data to be synchronized corresponding to each of the at least one target resource configuration sub-data structure from a source configuration management database according to the at least one target resource configuration sub-data structure; determining a to-be-synchronized resource allocation sub-data structure corresponding to each of the at least one to-be-synchronized sub-data according to the at least one to-be-synchronized sub-data; and synchronizing the to-be-synchronized resource configuration sub-data structures corresponding to the at least one to-be-synchronized sub-data respectively to the target configuration management database.

Description

Data synchronization method and device, electronic equipment and computer readable storage medium
Technical Field
The present invention relates to the field of computer technology, data processing technology, and financial technology, and more particularly, to a data synchronization method and apparatus, an electronic device, and a computer readable storage medium.
Background
With the development of computer technology, a configuration management database (Configuration Management Database, CMDB) has developed.
The configuration management database can be applied to maintenance and management of software and hardware resources and associated relation data of enterprises, and can support reconciliation, maintenance, mapping and visual display of data of multi-source data.
In the process of implementing the inventive concept, the inventor finds that at least the following problems exist in the related art: because the configuration management database cannot monitor the data synchronization process in real time, it is difficult to ensure the accuracy of the data in the configuration management database, and further it is difficult to effectively manage the data synchronization situation.
Disclosure of Invention
In view of this, the present invention provides a data synchronization method and apparatus, an electronic device, a computer-readable storage medium, and a computer program product.
According to an aspect of the present invention, there is provided a data synchronization method including: responding to a received data synchronization request, analyzing a target configuration file in a target configuration management database indicated by the data synchronization request to obtain a target resource configuration data structure corresponding to the target configuration file, wherein the target resource configuration data structure comprises at least one target resource configuration sub-data structure; acquiring sub-data to be synchronized corresponding to each of the at least one target resource configuration sub-data structure from a source configuration management database according to the at least one target resource configuration sub-data structure; determining a to-be-synchronized resource allocation sub-data structure corresponding to each of the at least one to-be-synchronized sub-data according to the at least one to-be-synchronized sub-data; and synchronizing the resource configuration sub-data structures to be synchronized corresponding to the at least one sub-data to be synchronized respectively to the target configuration management database.
According to an embodiment of the present invention, the data synchronization request includes a source configuration management database identifier, and the target resource configuration sub-data structure includes a target resource configuration name.
According to an embodiment of the present invention, the obtaining, from the source configuration management database, sub-data to be synchronized corresponding to each of the at least one target resource configuration sub-data structure according to the at least one target resource configuration sub-data structure includes: determining the source configuration management database according to the source configuration management database identifier; determining address information corresponding to the target resource allocation name in the source allocation management database according to the target resource allocation name for each target resource allocation sub-data structure in the at least one target resource allocation sub-data structure; and acquiring sub-data to be synchronized corresponding to the target resource allocation name based on the address information by utilizing a data interface.
According to an embodiment of the present invention, the obtaining sub-data to be synchronized corresponding to the target resource allocation name based on the address information by using the data interface includes: and responding to the detection that the timing task is triggered, and acquiring sub-data to be synchronized corresponding to the target resource configuration name based on the address information by utilizing the data interface.
According to an embodiment of the present invention, the determining, according to the at least one to-be-synchronized sub-data, a to-be-synchronized resource allocation sub-data structure corresponding to each of the at least one to-be-synchronized sub-data includes: for each sub-data to be synchronized in the at least one sub-data to be synchronized, determining a data type corresponding to the sub-data to be synchronized according to the sub-data to be synchronized; determining a preset rule corresponding to the sub-data to be synchronized according to the data type, wherein the preset rule comprises a preset check rule and a preset mapping rule; according to the preset verification rule, carrying out data verification on the sub-data to be synchronized to obtain a data verification result; and under the condition that the data verification result representation verification passes, carrying out data mapping processing on the sub-data to be synchronized according to the preset mapping rule to obtain the sub-data structure of the resource allocation to be synchronized corresponding to the sub-data to be synchronized.
According to an embodiment of the present invention, when the data verification result indicates that verification passes, performing data mapping processing on the sub-data to be synchronized according to the preset mapping rule to obtain the sub-data structure of the resource configuration to be synchronized corresponding to the sub-data to be synchronized includes: under the condition that the data type is determined to be the first data type, determining a resource configuration name to be synchronized and a resource configuration value to be synchronized corresponding to the resource configuration name to be synchronized according to the sub-data to be synchronized; and determining the sub-data structure of the resource allocation to be synchronized corresponding to the sub-data to be synchronized according to the resource allocation name to be synchronized and the resource allocation value to be synchronized corresponding to the resource allocation name to be synchronized.
According to an embodiment of the present invention, the method further includes: under the condition that the data type is determined to be the second data type, carrying out identifier detection on the sub-data to be synchronized according to a preset identifier to obtain a front field and a rear field corresponding to the preset identifier; determining a preamble field corresponding to the predetermined identifier as the resource allocation name to be synchronized; and determining a postfield corresponding to the predetermined identifier as the resource configuration value to be synchronized.
According to an embodiment of the present invention, the target configuration file includes target data identifiers corresponding to the at least one target resource configuration sub-data structures, and the at least one to-be-synchronized resource configuration sub-data structures correspond to the to-be-synchronized data identifiers.
According to an embodiment of the present invention, synchronizing the to-be-synchronized resource configuration sub-data structures corresponding to each of the at least one to-be-synchronized sub-data to the target configuration management database includes: for each to-be-synchronized resource configuration sub-data structure in the at least one to-be-synchronized resource configuration sub-data structure, matching the to-be-synchronized data identifier corresponding to the to-be-synchronized resource configuration sub-data structure according to the target data identifier corresponding to each of the at least one target resource configuration sub-data structure to obtain a data identifier matching result; updating a target resource configuration value corresponding to the target data identifier according to a resource configuration value to be synchronized corresponding to the data identifier to be synchronized under the condition that the data identifier matching result represents that the target data identifier matched with the data identifier to be synchronized exists in the at least one target data identifier; and under the condition that the data identifier matching result represents that the at least one target data identifier does not have the target data identifier matched with the data identifier to be synchronized, creating a new target resource configuration sub-data structure according to the resource configuration name to be synchronized and the resource configuration value to be synchronized, which correspond to the data identifier to be synchronized.
According to an embodiment of the present invention, the data synchronization request includes a target configuration management database identifier and a target profile identifier.
According to an embodiment of the present invention, in response to receiving a data synchronization request, analyzing a target configuration file in a target configuration management database indicated by the data synchronization request to obtain a target resource configuration data structure corresponding to the target configuration file includes: in response to receiving the data synchronization request, determining the target configuration management database according to the target configuration management database identifier; determining the target configuration file according to the target configuration file identifier; acquiring the target configuration file from the target configuration management database; and analyzing the target configuration file to obtain the at least one target resource configuration sub-data structure.
According to another aspect of the present invention, there is provided a data synchronization apparatus including: the analysis processing module is used for responding to the received data synchronization request, analyzing and processing the target configuration file in the target configuration management database indicated by the data synchronization request to obtain a target resource configuration data structure corresponding to the target configuration file, wherein the target resource configuration data structure comprises at least one target resource configuration sub-data structure; the acquisition module is used for acquiring sub-data to be synchronized corresponding to each of the at least one target resource configuration sub-data structure from the source configuration management database according to the at least one target resource configuration sub-data structure; the determining module is used for determining the to-be-synchronized resource allocation sub-data structures corresponding to the at least one to-be-synchronized sub-data respectively according to the at least one to-be-synchronized sub-data; and the synchronization module is used for synchronizing the to-be-synchronized resource configuration sub-data structures corresponding to the at least one to-be-synchronized sub-data respectively to the target configuration management database.
According to another aspect of the present invention, there is provided an electronic apparatus including: one or more processors; and a memory for storing one or more instructions that, when executed by the one or more processors, cause the one or more processors to implement a method as described herein.
According to another aspect of the present invention, there is provided a computer readable storage medium having stored thereon executable instructions which when executed by a processor cause the processor to implement a method according to the present invention.
According to another aspect of the invention, there is provided a computer program product comprising computer executable instructions which, when executed, are adapted to carry out the method according to the invention.
According to the embodiment of the invention, the sub-data to be synchronized is obtained from the source configuration management database according to the target resource configuration sub-data structure, and the target resource configuration data structure is obtained by analyzing and processing the target configuration file in the target configuration management database indicated by the data synchronization request, so that the correspondence between the sub-data to be synchronized and the target resource configuration sub-data structure can be realized. On the basis, the technical problem that the configuration management database in the related art cannot monitor the data synchronization process in real time is at least partially solved, the data synchronization management can be effectively carried out, and the accuracy of the data in the configuration management database is further improved.
Drawings
The above and other objects, features and advantages of the present invention will become more apparent from the following description of embodiments of the present invention with reference to the accompanying drawings.
Fig. 1 schematically shows a system architecture to which a data synchronization method may be applied according to an embodiment of the invention.
Fig. 2 schematically shows a flow chart of a data synchronization method according to an embodiment of the invention.
Fig. 3 schematically illustrates an example schematic diagram of a process of parsing a target configuration file in a target configuration management database indicated by a data synchronization request in response to receiving the data synchronization request to obtain a target resource configuration data structure corresponding to the target configuration file according to an embodiment of the present invention.
Fig. 4 schematically illustrates an example schematic diagram of a process of acquiring sub-data to be synchronized corresponding to each of at least one target resource configuration sub-data structure from a source configuration management database according to at least one target resource configuration sub-data structure according to an embodiment of the present invention.
Fig. 5A schematically illustrates an example schematic diagram of a process for determining a to-be-synchronized resource allocation sub-data structure corresponding to at least one to-be-synchronized sub-data, respectively, according to at least one to-be-synchronized sub-data according to an embodiment of the present invention.
Fig. 5B schematically illustrates an example schematic diagram of a process for determining a to-be-synchronized resource allocation sub-data structure corresponding to each of at least one to-be-synchronized sub-data according to another embodiment of the present invention.
Fig. 6 schematically shows an example schematic of a data synchronization process according to an embodiment of the invention.
Fig. 7 schematically shows a block diagram of a data synchronization device according to an embodiment of the invention.
Fig. 8 schematically shows a block diagram of an electronic device adapted to implement a data synchronization method according to an embodiment of the invention.
Detailed Description
Hereinafter, embodiments of the present invention will be described with reference to the accompanying drawings. It should be understood that the description is only illustrative and is not intended to limit the scope of the invention. In the following detailed description, for purposes of explanation, numerous specific details are set forth in order to provide a thorough understanding of the embodiments of the invention. It may be evident, however, that one or more embodiments may be practiced without these specific details. In addition, in the following description, descriptions of well-known structures and techniques are omitted so as not to unnecessarily obscure the present invention.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. The terms "comprises," "comprising," and/or the like, as used herein, specify the presence of stated features, steps, operations, and/or components, but do not preclude the presence or addition of one or more other features, steps, operations, or components.
All terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art unless otherwise defined. It should be noted that the terms used herein should be construed to have meanings consistent with the context of the present specification and should not be construed in an idealized or overly formal manner.
Where expressions like at least one of "A, B and C, etc. are used, the expressions should generally be interpreted in accordance with the meaning as commonly understood by those skilled in the art (e.g.," a system having at least one of A, B and C "shall include, but not be limited to, a system having a alone, B alone, C alone, a and B together, a and C together, B and C together, and/or A, B, C together, etc.).
In the technical scheme of the invention, the acquisition, storage, application and the like of the related personal information of the user accord with the regulations of related laws and regulations, necessary security measures are taken, and the public order harmony is not violated.
In the technical scheme of the invention, the authorization or the consent of the user is obtained before the personal information of the user is obtained or acquired.
The configuration management database may refer to a repository for centrally storing and managing all entity elements in an internet technology (Internet Technology, IT) environment. The entity element may be referred to as a configuration item (Configuration Item, CI). The configuration management database may be used to manage configuration data. The management of the configuration data may include at least one of: acquisition, integration, recording, maintenance, inspection, and updating.
In the configuration management database, each object may be described by an attribute, and various types of association relations may exist between objects. The configuration items, attributes, and associations may be used together to describe an enterprise internet architecture.
In order to at least partially solve the technical problems in the related art, the invention provides a data synchronization method and device, an electronic device and a computer readable storage medium, which can be applied to the technical fields of computers, data processing and financial science and technology. The data synchronization method comprises the following steps: in response to receiving the data synchronization request, analyzing a target configuration file in a target configuration management database indicated by the data synchronization request to obtain a target resource configuration data structure corresponding to the target configuration file, wherein the target resource configuration data structure comprises at least one target resource configuration sub-data structure; acquiring sub-data to be synchronized corresponding to each of the at least one target resource configuration sub-data structure from a source configuration management database according to the at least one target resource configuration sub-data structure; determining a to-be-synchronized resource allocation sub-data structure corresponding to each of the at least one to-be-synchronized sub-data according to the at least one to-be-synchronized sub-data; and synchronizing the to-be-synchronized resource configuration sub-data structures corresponding to the at least one to-be-synchronized sub-data respectively to the target configuration management database.
It should be noted that the data synchronization method and apparatus provided by the embodiments of the present invention may be used in the fields of computer technology, data processing technology, and financial technology, for example, in the field of internet technology. The data synchronization method and the data synchronization device provided by the embodiment of the invention can be also applied to any field except the technical field of computers, the technical field of data processing and the technical field of finance, for example, the technical field of database management. The application fields of the data synchronization method and the data synchronization device provided by the embodiment of the invention are not limited.
Fig. 1 schematically shows a system architecture to which a data synchronization method may be applied according to an embodiment of the invention. It should be noted that fig. 1 is only an example of a system architecture to which the embodiments of the present invention may be applied to help those skilled in the art understand the technical content of the present invention, and does not mean that the embodiments of the present invention may not be used in other devices, systems, environments, or scenarios.
As shown in fig. 1, a system architecture 100 according to this embodiment may include a first terminal device 101, a second terminal device 102, a third terminal device 103, a network 104, and a server 105. The network 104 is a medium used to provide a communication link between the first terminal device 101, the second terminal device 102, the third terminal device 103, and the server 105. The network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others.
The user may interact with the server 105 through the network 104 using at least one of the first terminal device 101, the second terminal device 102, the third terminal device 103, to receive or send messages, etc. Various communication client applications, such as a shopping class application, a web browser application, a search class application, an instant messaging tool, a mailbox client, social platform software, etc. (by way of example only) may be installed on the first terminal device 101, the second terminal device 102, and the third terminal device 103.
The first terminal device 101, the second terminal device 102, the third terminal device 103 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smartphones, tablets, laptop and desktop computers, and the like.
The server 105 may be a server providing various services, such as a background management server (by way of example only) providing support for websites browsed by the user using the first terminal device 101, the second terminal device 102, and the third terminal device 103. The background management server may analyze and process the received data such as the user request, and feed back the processing result (e.g., the web page, information, or data obtained or generated according to the user request) to the terminal device.
It should be noted that the data synchronization method provided by the embodiment of the present invention may be generally performed by the server 105. Accordingly, the data synchronization device provided in the embodiment of the present invention may be generally disposed in the server 105. The data synchronization method provided by the embodiment of the present invention may also be performed by a server or a server cluster that is different from the server 105 and is capable of communicating with the first terminal device 101, the second terminal device 102, the third terminal device 103 and/or the server 105. Accordingly, the data synchronization apparatus provided by the embodiment of the present invention may also be provided in a server or a server cluster, which is different from the server 105 and is capable of communicating with the first terminal device 101, the second terminal device 102, the third terminal device 103 and/or the server 105.
Alternatively, the data synchronization method provided by the embodiment of the present invention may be performed by the first terminal device 101, the second terminal device 102, or the third terminal device 103, or may be performed by another terminal device different from the first terminal device 101, the second terminal device 102, or the third terminal device 103. Accordingly, the data synchronization apparatus provided by the embodiment of the present invention may also be provided in the first terminal device 101, the second terminal device 102, or the third terminal device 103, or in other terminal devices different from the first terminal device 101, the second terminal device 102, or the third terminal device 103.
It should be understood that the number of first, second or third terminal devices, networks and servers in fig. 1 is merely illustrative. There may be any number of first, second or third terminal devices, networks and servers, as desired for implementation.
It should be noted that the sequence numbers of the respective operations in the following methods are merely representative of the operations for the purpose of description, and should not be construed as representing the order of execution of the respective operations. The method need not be performed in the exact order shown unless explicitly stated.
Fig. 2 schematically shows a flow chart of a data synchronization method according to an embodiment of the invention.
As shown in FIG. 2, the data synchronization method 200 includes operations S210-S240.
In operation S210, in response to receiving the data synchronization request, the target configuration file in the target configuration management database indicated by the data synchronization request is parsed to obtain a target resource configuration data structure corresponding to the target configuration file, where the target resource configuration data structure includes at least one target resource configuration sub-data structure.
In operation S220, sub-data to be synchronized corresponding to each of the at least one target resource allocation sub-data structure is acquired from the source allocation management database according to the at least one target resource allocation sub-data structure.
In operation S230, according to the at least one sub-data to be synchronized, a sub-data structure of resource allocation to be synchronized corresponding to each of the at least one sub-data to be synchronized is determined.
In operation S240, the to-be-synchronized resource configuration sub-data structures corresponding to the at least one to-be-synchronized sub-data respectively are synchronized to the target configuration management database.
According to the embodiment of the invention, the code for generating the data synchronization request can be written in the script in advance, and the client can run the script to generate the data synchronization request message in response to the detection of the data synchronization operation initiated by the target object. For example, the target object may enter a target configuration management database identification, a target profile identification, and a source configuration management database identification during initiation of a data synchronization operation. The client can run the script and generate a data synchronization request message according to the target configuration management database identifier, the target configuration file identifier and the source configuration management database identifier. The client can send the data synchronization request message to the server, so that the server can perform synchronization processing on data corresponding to the data synchronization operation according to the data synchronization request message.
According to an embodiment of the invention, a configuration management database may be used to store resources. The resource may assign a configuration item (Configuration Item, CI). The resources may be connected by a relationship (i.e., relationship). The source configuration management database identification may be used to characterize the source configuration management database. The source configuration management database may have stored therein data to be synchronized. The target configuration management database identification may be used to characterize the target configuration management database. The data to be synchronized in the source configuration management database may be synchronized to the target configuration management database. The target profile identification may be used to characterize the target profile.
According to the embodiment of the invention, after receiving the data synchronization request, the target configuration file indicated by the data synchronization request can be acquired. The method for obtaining the target configuration file may be set according to the actual service requirement, which is not limited herein. For example, the target profile may be acquired through real-time acquisition. Alternatively, the target profile may be obtained from a data source. The data source may include at least one of: local databases, cloud databases, and network resources. For example, a data interface may be invoked, with which a target profile is obtained from a data source. Alternatively, the target profile may be received from other terminal devices.
According to the embodiment of the invention, after the target configuration file is obtained, the target configuration file can be analyzed to obtain at least one target resource configuration sub-data structure. For example, the fields in the target configuration file may be stored in a data structure of the memory, where the data structure is the target resource configuration sub-data structure. The target resource configuration sub-data structure may include a target resource configuration name and a target resource configuration value. For example, the target resource configuration name may include at least one of: timerStart, name, ip, port, param, cornExpression, attributeName, mappers, define and rule.
According to embodiments of the present invention, a target resource configuration value corresponding to timerStart may be used to characterize whether to turn on the timing. The target resource configuration value corresponding to the name may be used to characterize the synchronization source name. The target resource configuration value corresponding to ip may be used to characterize the restful request ip address. The target resource configuration value corresponding to a port may be used to characterize the restful request port. The target resource configuration value corresponding to param may be used to characterize other parameters. The target resource configuration value corresponding to the corn expression may be used to characterize the corn expression. The target resource allocation value corresponding to attributeName may be used to characterize the extracted attribute name. The target resource configuration value corresponding to mappers may be used to characterize the mapping set. The target resource configuration value corresponding to defined may be used to characterize the attribute name matching name. The target resource configuration value corresponding to rule may be used to characterize the mapping rule.
According to the embodiment of the invention, after the at least one target resource allocation sub-data structure is obtained, aiming at each target resource allocation sub-data structure in the at least one target resource allocation sub-data structure, sub-data to be synchronized corresponding to the target resource allocation sub-data structure can be obtained from a source allocation management database. For example, a data interface may be invoked to obtain sub-data to be synchronized from a source configuration management database.
According to the embodiment of the invention, after the sub-data to be synchronized corresponding to each of the at least one target resource allocation sub-data structure is obtained, the data type of the sub-data to be synchronized can be determined for each of the at least one sub-data to be synchronized. And determining a preset rule corresponding to the sub-data to be synchronized according to the data type. And analyzing and processing the sub-data to be synchronized according to a preset rule to obtain a sub-data structure of the resource allocation to be synchronized. The resource configuration to be synchronized sub-data structure may include at least one of: configuration item instance, configuration item instance attribute, and configuration item relationship.
According to the embodiment of the invention, after the to-be-synchronized resource configuration sub-data structures corresponding to the at least one to-be-synchronized sub-data respectively are obtained, the to-be-synchronized resource configuration sub-data structures corresponding to the at least one to-be-synchronized sub-data respectively can be synchronized to the target configuration management database so as to complete the data synchronization process. The synchronization operation may include one of: creating and updating.
According to the embodiment of the invention, the sub-data to be synchronized is obtained from the source configuration management database according to the target resource configuration sub-data structure, and the target resource configuration data structure is obtained by analyzing and processing the target configuration file in the target configuration management database indicated by the data synchronization request, so that the correspondence between the sub-data to be synchronized and the target resource configuration sub-data structure can be realized. On the basis, the technical problem that the configuration management database in the related art cannot monitor the data synchronization process in real time is at least partially solved, the data synchronization management can be effectively carried out, and the accuracy of the data in the configuration management database is further improved.
The following describes a data synchronization method 200 according to an embodiment of the present invention with reference to fig. 3 to 6.
According to an embodiment of the present invention, operation S210 may include the following operations.
And in response to receiving the data synchronization request, determining a target configuration management database according to the target configuration management database identification. And determining the target configuration file according to the target configuration file identification. The target configuration file is obtained from the target configuration management database. And analyzing the target configuration file to obtain at least one target resource configuration sub-data structure.
According to an embodiment of the invention, the data synchronization request may include a target configuration management database identification and a target profile identification.
According to an embodiment of the invention, the target configuration file may be in JSON (JavaScript Object Notation, JS object profile) data exchange format. The values of JSON may include numbers, strings, logical values, arrays, objects, and null. At least one target resource configuration sub-data structure can be obtained by performing JSON format analysis processing on the target configuration file.
Fig. 3 schematically illustrates an example schematic diagram of a process of parsing a target configuration file in a target configuration management database indicated by a data synchronization request in response to receiving the data synchronization request to obtain a target resource configuration data structure corresponding to the target configuration file according to an embodiment of the present invention.
As shown in fig. 3, in 300, in response to receiving a data synchronization request 301, a target configuration management database 302 may be determined from a target configuration management database identification 301_1 in the data synchronization request 301. The target profile 303 is determined from the target profile identification 301_2 in the data synchronization request 301.
After determining the target configuration management database 302 and the target configuration file 303, the target configuration file 303 may be obtained from the target configuration management database 302. The target configuration file 303 is parsed to obtain at least one target resource configuration sub-data structure 304.
According to an embodiment of the present invention, operation S220 may include the following operations.
And determining a source configuration management database according to the source configuration management database identification. For each target resource allocation sub-data structure in the at least one target resource allocation sub-data structure, address information corresponding to the target resource allocation name is determined in the source allocation management database according to the target resource allocation name. And acquiring sub-data to be synchronized corresponding to the target resource allocation name based on the address information by utilizing the data interface.
According to an embodiment of the invention, the data synchronization request may include a source configuration management database identification. The target resource configuration sub-data structure may include a target resource configuration name.
According to the embodiment of the invention, the address information corresponding to the target resource allocation name in the source allocation management database can be determined according to the target resource allocation name in the target resource allocation sub-data structure. The address information may be used to characterize the address of the sub-data to be synchronized. The address information may include an internet protocol address (Internet Protocol Address, IP). After the address information is obtained, the data interface can be utilized to obtain sub-data to be synchronized corresponding to the target resource configuration name according to the address information.
According to an embodiment of the present invention, acquiring sub-data to be synchronized corresponding to a target resource allocation name based on address information using a data interface may include the following operations.
And responding to the detection that the timing task is triggered, and acquiring sub-data to be synchronized corresponding to the target resource configuration name by utilizing the data interface based on the address information.
According to embodiments of the present invention, a corn expression may be used to set a timed task to enable timing scheduling. The timed task may include triggering execution of a predetermined action at a predetermined time. The timing tasks may be associated with a target resource configuration sub-data structure. The predetermined action may include obtaining sub-data to be synchronized corresponding to the target resource configuration name. In this case, the timing task may be used to trigger acquisition of sub-data to be synchronized corresponding to the target resource configuration name at a predetermined time. The predetermined time may include a predetermined time point and a predetermined period of time. The predetermined time may be set according to actual service requirements, which is not limited herein.
For example, in the case where the predetermined time is a predetermined time point, the predetermined time may be set to 12:00, in this case, in response to the current system time reaching 12:00, triggering timing tasks. Alternatively, in the case where the predetermined time is a predetermined period of time, the predetermined time may be set to 12 hours, in which case the timing task is triggered in response to the current system time interval reaching 12 hours.
According to the embodiment of the invention, the address information is determined in the source configuration management database according to the target resource configuration name, and the sub-data to be synchronized corresponding to the target resource configuration name is acquired based on the address information by utilizing the data interface, so that the instantaneity of the sub-data to be synchronized is improved, and the efficiency and accuracy of data synchronization are further improved.
Fig. 4 schematically illustrates an example schematic diagram of a process of acquiring sub-data to be synchronized corresponding to each of at least one target resource configuration sub-data structure from a source configuration management database according to at least one target resource configuration sub-data structure according to an embodiment of the present invention.
As shown in fig. 4, in 400, a source configuration management database 402 may be determined from a source configuration management database identification 401. For each target resource configuration sub-data structure 403 of the at least one target resource configuration sub-data structure, address information 404 corresponding to the target resource configuration name 403_1 may be determined in the source configuration management database 402 according to the target resource configuration name 403_1 comprised by the target resource configuration sub-data structure 403. After the address information 404 is obtained, sub-data 405 to be synchronized corresponding to the target resource configuration name 403_1 may be obtained based on the address information 404 using the data interface.
According to an embodiment of the present invention, operation S230 may include the following operations.
For each sub-data to be synchronized in at least one sub-data to be synchronized, determining the data type corresponding to the sub-data to be synchronized according to the sub-data to be synchronized. And determining a preset rule corresponding to the sub-data to be synchronized according to the data type, wherein the preset rule comprises a preset check rule and a preset mapping rule. And carrying out data verification on the synchronous sub-data according to a preset verification rule to obtain a data verification result. And under the condition that the data verification result representation verification passes, carrying out data mapping processing on the sub-data to be synchronized according to a preset mapping rule to obtain a sub-data structure of the resource configuration to be synchronized, which corresponds to the sub-data to be synchronized.
According to an embodiment of the invention, the sub-data to be synchronized may be structured data in the form of key-value pairs. After the sub-data to be synchronized is obtained, a data type corresponding to the sub-data to be synchronized may be determined according to a value corresponding to the sub-data to be synchronized. The data types may include numbers, strings, logical values, arrays, objects, and null. After the data type is obtained, the field in the sub-data to be synchronized can be positioned according to the value corresponding to the attributeName in the sub-data to be synchronized, and a corresponding preset rule is found according to the field.
According to an embodiment of the present invention, the preset rules may include preset check rules and preset mapping rules. The preset check rule can be used for performing data check on the sub-data to be synchronized. The preset mapping rule can be used for carrying out data mapping processing on the sub-data to be synchronized.
According to an embodiment of the present invention, the preset mapping rule may include at least one of: string context rules (e.g., concat, concat _ws), ordering rules (e.g., sort by), string interception rules (e.g., substr, substring), string case conversion rules (e.g., upper, lower), string inversion rules (e.g., reverse).
According to the embodiment of the invention, under the condition that the data verification result represents verification, data mapping processing is performed on the sub-data to be synchronized according to a preset mapping rule, and the obtaining of the sub-data structure of the resource allocation to be synchronized corresponding to the sub-data to be synchronized can comprise the following operations.
And under the condition that the data type is determined to be the first data type, determining a resource configuration name to be synchronized and a resource configuration value to be synchronized corresponding to the resource configuration name to be synchronized according to the sub-data to be synchronized. And determining a sub-data structure of the resource configuration to be synchronized corresponding to the sub-data to be synchronized according to the resource configuration name to be synchronized and the resource configuration value to be synchronized corresponding to the resource configuration name to be synchronized.
According to the embodiment of the invention, the first data type may be set according to actual service requirements, which is not limited herein. For example, the first data type may include at least one of: string, number, boolean and null. In the case that the data type is determined to belong to at least one of a character string, a number, a boolean and a null, the resource configuration name to be synchronized and the resource configuration value to be synchronized corresponding to the resource configuration name to be synchronized may be directly determined according to the sub-data to be synchronized.
Fig. 5A schematically illustrates an example schematic diagram of a process for determining a to-be-synchronized resource allocation sub-data structure corresponding to at least one to-be-synchronized sub-data, respectively, according to at least one to-be-synchronized sub-data according to an embodiment of the present invention.
As shown in fig. 5A, in 500A, a data type 502 corresponding to the sub-data to be synchronized 501 may be determined from the sub-data to be synchronized 501. According to the data type 502, a preset check rule 503 corresponding to the sub data 501 to be synchronized is determined. And according to a preset verification rule 503, performing data verification on the sub-data 501 to be synchronized to obtain a data verification result 504. After the data verification result 504 is obtained, operation S510 may be performed.
In operation S510, the data verification result characterizes verification pass?
If so, in the case that the data type is determined to be the first data type, according to the to-be-synchronized sub-data 501, a to-be-synchronized resource configuration name 505 and a to-be-synchronized resource configuration value 506 corresponding to the to-be-synchronized resource configuration name 505 may be determined. According to the resource configuration name 505 to be synchronized and the resource configuration value 506 to be synchronized corresponding to the resource configuration name 505 to be synchronized, a resource configuration sub-data structure 507 corresponding to the sub-data 501 to be synchronized is determined. If not, the data synchronization flow may be ended.
According to an embodiment of the present invention, the data synchronization method 200 may further include the following operations.
And under the condition that the data type is determined to be the second data type, carrying out identifier detection on the sub-data to be synchronized according to the preset identifier to obtain a preamble field and a postamble field corresponding to the preset identifier. And determining a preamble field corresponding to the predetermined identifier as a resource configuration name to be synchronized. And determining a postfield corresponding to the predetermined identifier as a resource configuration value to be synchronized.
According to the embodiment of the invention, the second data type can be set according to actual service requirements, which is not limited herein. For example, the first data type may include at least one of: objects and arrays. The object may refer to { key1: value1, key2: value2,..} key-value pair structure. The key may be used to characterize an attribute of the object, and the value may be used to characterize a value corresponding to the attribute. The key may be represented using integers and strings. The type of value may be any type. The array may refer to an index structure of [ "java", "javascript", "vb", ].
According to the embodiment of the invention, in the case that the data type is determined to belong to one of the object and the array, identifier detection can be carried out on the sub-data to be synchronized according to the preset identifier, so as to obtain the front field and the rear field corresponding to the preset identifier. The predetermined identifier may be set according to actual service requirements, and is not limited herein. For example, the predetermined identifier may be "". In this case, a field located before the predetermined identifier may be determined as a preamble field, and a field located after the predetermined identifier may be determined as a post-field. For example, in the case where the data type is an object, it may be selected by ". Object value". In the case where the data type is an array, it may be selected by ". An array subscript".
According to the embodiment of the invention, the data verification result is obtained by carrying out data verification on the sub-data to be synchronized according to the preset verification rule, the preset verification rule is determined according to the data type, and the data type corresponds to the sub-data to be synchronized, so that the automatic verification of the sub-data to be synchronized is realized, and the safety of the data is improved. On the basis, the to-be-synchronized resource allocation sub-data structure is obtained by carrying out data mapping processing on to-be-synchronized sub-data according to a preset mapping rule, so that automatic mapping of the to-be-synchronized sub-data is realized, and the efficiency and the accuracy of generating the to-be-synchronized resource allocation sub-data structure are improved.
Fig. 5B schematically illustrates an example schematic diagram of a process for determining a to-be-synchronized resource allocation sub-data structure corresponding to each of at least one to-be-synchronized sub-data according to another embodiment of the present invention.
As shown in fig. 5B, in 500B, a data type 509 corresponding to the sub-data to be synchronized 508 may be determined from the sub-data to be synchronized 508. According to the data type 509, a preset check rule 510 corresponding to the sub-data 508 to be synchronized is determined. According to the preset check rule 510, the sub-data 508 to be synchronized is subjected to data check, and a data check result 511 is obtained. After the data verification result 511 is obtained, operation S520 may be performed.
In operation S520, the data verification result characterizes verification pass?
If so, the identifier detection may be performed on the sub-data 508 to be synchronized according to the predetermined identifier to obtain the preamble field 512 and the postamble field 513 corresponding to the predetermined identifier when the data type is determined to be the second data type. The preamble field 512 corresponding to the predetermined identifier is determined as the resource configuration name 514 to be synchronized. The postfield 513 corresponding to the predetermined identifier is determined as the resource configuration value to be synchronized 515. A to-be-synchronized resource configuration sub-data structure 516 corresponding to the to-be-synchronized sub-data 508 may be determined based on the to-be-synchronized resource configuration name 514 and the to-be-synchronized resource configuration value 515. If not, the data synchronization flow may be ended.
According to an embodiment of the present invention, operation S240 may include the following operations.
And matching the to-be-synchronized data identifiers corresponding to the to-be-synchronized resource configuration sub-data structures according to the target data identifiers corresponding to the at least one target resource configuration sub-data structure respectively aiming at each to-be-synchronized resource configuration sub-data structure in the at least one to-be-synchronized resource configuration sub-data structure, so as to obtain a data identifier matching result. Under the condition that the data identifier matching result represents that at least one target data identifier is matched with the data identifier to be synchronized, updating the target resource configuration value corresponding to the target data identifier according to the resource configuration value to be synchronized corresponding to the data identifier to be synchronized. Under the condition that the data identifier matching result represents that at least one target data identifier does not exist, the target data identifier matched with the data identifier to be synchronized, a new target resource configuration sub-data structure is created according to the resource configuration name to be synchronized and the resource configuration value to be synchronized, which correspond to the data identifier to be synchronized.
According to an embodiment of the present invention, the target configuration file may comprise target data identifications corresponding to each of the at least one target resource configuration sub-data structure. The at least one to-be-synchronized resource allocation sub-data structure may each correspond to an identity of the to-be-synchronized data.
According to an embodiment of the invention, the data identification to be synchronized and the target data identification may comprise an identification number (Identity Document, ID), for example. The identification of the data to be synchronized can be used to ensure the uniqueness of the data to be synchronized. The target data identification may be used to guarantee the uniqueness of the target data.
For example, the data identifier to be synchronized may be "b", the at least one target data identifier may include "a", "b" and "c", and the data identifier to be synchronized "b" may be matched according to the target data identifiers "a", "b" and "c", so as to obtain a data identifier matching result, that is, there is a target data identifier "b" matched with the data identifier to be synchronized "b". In this case, the target resource configuration value corresponding to the target data identification "b" may be updated.
Alternatively, the data identifier to be synchronized may be "d", and the at least one target data identifier may include "a", "b" and "c", and the data identifier to be synchronized "d" may be matched according to the target data identifiers "a", "b" and "c" to obtain a data identifier matching result, that is, there is no target data identifier matched with the data identifier to be synchronized "d" in the target data identifiers. In this case, a new target resource allocation sub-data structure corresponding to the data identification "d" to be synchronized may be created.
Fig. 6 schematically shows an example schematic of a data synchronization process according to an embodiment of the invention.
As shown in fig. 6, in 600, the data synchronization process is illustrated with the target configuration management database 601 including a target configuration file 601_1, a target configuration file 601_2, and a target configuration file 601_3.
For example, the target configuration file 601_2 in the target configuration management database 601 indicated by the data synchronization request may be parsed, to obtain the target resource configuration data structure 603 corresponding to the target configuration file 601_2. The target resource configuration data structure 603 may include a target resource configuration name 603_11, a target resource configuration value 603_12 corresponding to the target resource configuration name 603_11, a target resource configuration name 603_21, and a target resource configuration value 603_22 corresponding to the target resource configuration name 603_21.
Address information corresponding to the target resource configuration name 603_11 may be determined in the source configuration management database 602 according to the target resource configuration name 603_11. With the data interface, sub data 604_1 to be synchronized corresponding to the target resource allocation name 603_11 is acquired based on the address information. Address information corresponding to the target resource configuration name 603_21 may be determined in the source configuration management database 602 according to the target resource configuration name 603_21. With the data interface, sub data 604_2 to be synchronized corresponding to the target resource allocation name 603_21 is acquired based on the address information.
The to-be-synchronized resource configuration sub-data structure 605_1 corresponding to the to-be-synchronized sub-data 604_1 may be determined according to the to-be-synchronized sub-data 604_1. According to the sub-data to be synchronized 604_2, a sub-data structure 605_2 of the resource configuration to be synchronized corresponding to the sub-data to be synchronized 604_2 is determined.
After obtaining the to-be-synchronized resource configuration sub-data structure 605_1 and the to-be-synchronized resource configuration sub-data structure 605_2, the to-be-synchronized resource configuration sub-data structure 605_1 and the to-be-synchronized resource configuration sub-data structure 605_2 may be synchronized to the target configuration management database 601.
The foregoing is only an exemplary embodiment, but not limited thereto, and other data synchronization methods known in the art may be included, as long as the data synchronization management can be performed more effectively, thereby improving the accuracy of the data in the configuration management database.
Fig. 7 schematically shows a block diagram of a data synchronization device according to an embodiment of the invention.
As shown in fig. 7, the data synchronization apparatus 700 may include an parsing processing module 710, an acquisition module 720, a determination module 730, and a synchronization module 740.
And the parsing module 710 is configured to parse the target configuration file in the target configuration management database indicated by the data synchronization request in response to receiving the data synchronization request, to obtain a target resource configuration data structure corresponding to the target configuration file, where the target resource configuration data structure includes at least one target resource configuration sub-data structure.
And an obtaining module 720, configured to obtain sub-data to be synchronized corresponding to each of the at least one target resource configuration sub-data structure from the source configuration management database according to the at least one target resource configuration sub-data structure.
A determining module 730, configured to determine, according to the at least one sub-data to be synchronized, a sub-data structure of resource configuration to be synchronized corresponding to each of the at least one sub-data to be synchronized.
And the synchronization module 740 is configured to synchronize the to-be-synchronized resource configuration sub-data structures corresponding to the at least one to-be-synchronized sub-data respectively to the target configuration management database.
According to an embodiment of the invention, the data synchronization request includes a source configuration management database identification and the target resource configuration sub-data structure includes a target resource configuration name.
According to an embodiment of the present invention, the acquisition module 720 may include a first determination sub-module, a second determination sub-module, and a first acquisition sub-module.
And the first determining submodule is used for determining the source configuration management database according to the source configuration management database identification.
And the second determining sub-module is used for determining address information corresponding to the target resource allocation names in the source allocation management database according to the target resource allocation names aiming at each target resource allocation sub-data structure in the at least one target resource allocation sub-data structure.
The first acquisition sub-module is used for acquiring sub-data to be synchronized corresponding to the target resource configuration name based on the address information by utilizing the data interface.
According to an embodiment of the invention, the first acquisition sub-module may comprise an acquisition unit.
And the acquisition unit is used for acquiring the sub-data to be synchronized corresponding to the target resource configuration name based on the address information by utilizing the data interface in response to the detection that the timing task is triggered.
According to an embodiment of the present invention, the determining module 730 may include a third determining sub-module, a fourth determining sub-module, a verifying sub-module, and a mapping sub-module.
And the third determining sub-module is used for determining the data type corresponding to the sub-data to be synchronized according to the sub-data to be synchronized aiming at each sub-data to be synchronized in at least one sub-data to be synchronized.
And the fourth determining submodule is used for determining a preset rule corresponding to the sub-data to be synchronized according to the data type, wherein the preset rule comprises a preset check rule and a preset mapping rule.
And the verification sub-module is used for carrying out data verification on the synchronous sub-data according to a preset verification rule to obtain a data verification result.
And the mapping sub-module is used for carrying out data mapping processing on the sub-data to be synchronized according to a preset mapping rule under the condition that the data verification result representation verification passes, so as to obtain a sub-data structure of the resource configuration to be synchronized corresponding to the sub-data to be synchronized.
According to an embodiment of the present invention, the mapping sub-module may comprise a first determination unit and a second determination unit.
And the first determining unit is used for determining a resource configuration name to be synchronized and a resource configuration value to be synchronized corresponding to the resource configuration name to be synchronized according to the sub-data to be synchronized under the condition that the data type is determined to be the first data type.
And the second determining unit is used for determining a to-be-synchronized resource configuration sub-data structure corresponding to the to-be-synchronized sub-data according to the to-be-synchronized resource configuration name and the to-be-synchronized resource configuration value corresponding to the to-be-synchronized resource configuration name.
According to an embodiment of the present invention, the mapping sub-module may further include a detection unit, a third determination unit, and a fourth determination unit.
And the detection unit is used for carrying out identifier detection on the sub-data to be synchronized according to the preset identifier under the condition that the data type is determined to be the second data type, and obtaining a front field and a rear field corresponding to the preset identifier.
And a third determining unit, configured to determine a preamble field corresponding to the predetermined identifier as a resource configuration name to be synchronized.
And a fourth determining unit, configured to determine a post field corresponding to the predetermined identifier as a resource configuration value to be synchronized.
According to an embodiment of the present invention, the target configuration file includes target data identifiers corresponding to at least one target resource configuration sub-data structure, respectively, and at least one resource configuration sub-data structure to be synchronized corresponds to a data identifier to be synchronized, respectively.
According to an embodiment of the invention, the synchronization module 740 may include a match sub-module, an update sub-module, and a create sub-module.
And the matching sub-module is used for matching the to-be-synchronized data identifications corresponding to the to-be-synchronized resource configuration sub-data structures according to the target data identifications corresponding to the at least one target resource configuration sub-data structure respectively aiming at each to-be-synchronized resource configuration sub-data structure in the at least one to-be-synchronized resource configuration sub-data structure to obtain a data identification matching result.
And the updating sub-module is used for updating the target resource configuration value corresponding to the target data identifier according to the resource configuration value to be synchronized corresponding to the data identifier to be synchronized under the condition that the data identifier matching result characterizes at least one target data identifier matched with the data identifier to be synchronized.
The creating sub-module is used for creating a new target resource configuration sub-data structure according to the resource configuration name to be synchronized and the resource configuration value to be synchronized, which correspond to the data identifier to be synchronized, under the condition that the data identifier matching result indicates that at least one target data identifier does not exist the target data identifier matched with the data identifier to be synchronized.
According to an embodiment of the invention, the data synchronization request includes a target configuration management database identification and a target profile identification.
According to an embodiment of the present invention, the parsing processing module 710 may include a fifth determining sub-module, a sixth determining sub-module, a second acquiring sub-module, and a processing sub-module.
And the fifth determining submodule is used for determining a target configuration management database according to the target configuration management database identification in response to receiving the data synchronization request.
And the sixth determining submodule is used for determining the target configuration file according to the target configuration file identification.
And the second acquisition sub-module is used for acquiring the target configuration file from the target configuration management database.
And the processing sub-module is used for analyzing the target configuration file to obtain at least one target resource configuration sub-data structure.
Any number of the modules, sub-modules, units, sub-units, or at least part of the functionality of any number of the sub-units according to embodiments of the invention may be implemented in one module. Any one or more of the modules, sub-modules, units, sub-units according to embodiments of the present invention may be implemented as a split into multiple modules. Any one or more of the modules, sub-modules, units, sub-units according to embodiments of the invention may be implemented at least in part as hardware circuitry, such as a Field Programmable Gate Array (FPGA), programmable Logic Array (PLA), system-on-chip, system-on-substrate, system-on-package, application Specific Integrated Circuit (ASIC), or in hardware or firmware in any other reasonable manner of integrating or packaging circuitry, or in any one of, or in any suitable combination of, software, hardware, and firmware. Alternatively, one or more of the modules, sub-modules, units, sub-units according to embodiments of the invention may be at least partly implemented as computer program modules, which, when run, may perform the respective functions.
For example, any of the parsing processing module 710, the acquisition module 720, the determination module 730, and the synchronization module 740 may be combined in one module/unit/sub-unit or any of the modules/units/sub-units may be split into a plurality of modules/units/sub-units. Alternatively, at least some of the functionality of one or more of these modules/units/sub-units may be combined with at least some of the functionality of other modules/units/sub-units and implemented in one module/unit/sub-unit. At least one of the parsing processing module 710, the acquisition module 720, the determination module 730, and the synchronization module 740 may be implemented at least in part as hardware circuitry, such as a Field Programmable Gate Array (FPGA), a Programmable Logic Array (PLA), a system on a chip, a system on a substrate, a system on a package, an Application Specific Integrated Circuit (ASIC), or as hardware or firmware in any other reasonable way of integrating or packaging circuitry, or as any one of or a suitable combination of any of the three. Alternatively, at least one of the parsing processing module 710, the acquisition module 720, the determination module 730 and the synchronization module 740 may be at least partially implemented as a computer program module, which when executed may perform the corresponding functions.
It should be noted that, in the embodiment of the present invention, the data synchronization device portion corresponds to the data synchronization method portion in the embodiment of the present invention, and the description of the data synchronization device portion specifically refers to the data synchronization method portion, which is not described herein.
Fig. 8 schematically shows a block diagram of an electronic device adapted to implement a data synchronization method according to an embodiment of the invention. The electronic device shown in fig. 8 is only an example and should not be construed as limiting the functionality and scope of use of the embodiments of the invention.
As shown in fig. 8, a computer electronic device 800 according to an embodiment of the present invention includes a processor 801 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 802 or a program loaded from a storage section 809 into a Random Access Memory (RAM) 803. The processor 801 may include, for example, a general purpose microprocessor (e.g., a CPU), an instruction set processor and/or an associated chipset and/or special purpose microprocessor (e.g., an Application Specific Integrated Circuit (ASIC)), or the like. The processor 801 may also include on-board memory for caching purposes. The processor 801 may comprise a single processing unit or multiple processing units for performing the different actions of the method flows according to embodiments of the invention.
In the RAM 803, various programs and data required for the operation of the electronic device 800 are stored. The processor 801, the ROM 802, and the RAM 803 are connected to each other by a bus 804. The processor 801 performs various operations of the method flow according to the embodiment of the present invention by executing programs in the ROM 802 and/or the RAM 803. Note that the program may be stored in one or more memories other than the ROM 802 and the RAM 803. The processor 801 may also perform various operations of the method flow according to embodiments of the present invention by executing programs stored in the one or more memories.
According to an embodiment of the invention, the electronic device 800 may further comprise an input/output (I/O) interface 805, the input/output (I/O) interface 805 also being connected to the bus 804. The electronic device 800 may also include one or more of the following components connected to an input/output (I/O) interface 805: an input portion 806 including a keyboard, mouse, etc.; an output portion 807 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and a speaker; a storage section 808 including a hard disk or the like; and a communication section 809 including a network interface card such as a LAN card, a modem, or the like. The communication section 809 performs communication processing via a network such as the internet. The drive 810 is also connected to an input/output (I/O) interface 805 as needed. A removable medium 811 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 810 as needed so that a computer program read out therefrom is mounted into the storage section 808 as needed.
According to an embodiment of the present invention, the method flow according to an embodiment of the present invention may be implemented as a computer software program. For example, embodiments of the present invention include a computer program product comprising a computer program embodied on a computer readable storage medium, the computer program comprising program code for performing the method shown in the flowcharts. In such an embodiment, the computer program may be downloaded and installed from a network via the communication section 809, and/or installed from the removable media 811. The above-described functions defined in the system of the embodiment of the present invention are performed when the computer program is executed by the processor 801. The systems, devices, apparatus, modules, units, etc. described above may be implemented by computer program modules according to embodiments of the invention.
The present invention also provides a computer-readable storage medium that may be embodied in the apparatus/device/system described in the above embodiments; or may exist alone without being assembled into the apparatus/device/system. The computer-readable storage medium carries one or more programs which, when executed, implement methods in accordance with embodiments of the present invention.
According to an embodiment of the present invention, the computer-readable storage medium may be a nonvolatile computer-readable storage medium. Examples may include, but are not limited to: 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), a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
For example, according to embodiments of the invention, the computer-readable storage medium may include ROM 802 and/or RAM 803 and/or one or more memories other than ROM 802 and RAM 803 described above.
Embodiments of the present invention also include a computer program product comprising a computer program comprising program code means for performing the method provided by the embodiments of the present invention, when the computer program product is run on an electronic device, for causing the electronic device to carry out the data synchronization method provided by the embodiments of the present invention.
The above-described functions defined in the system/apparatus of the embodiment of the present invention are performed when the computer program is executed by the processor 801. The systems, apparatus, modules, units, etc. described above may be implemented by computer program modules according to embodiments of the invention.
In one embodiment, the computer program may be based on a tangible storage medium such as an optical storage device, a magnetic storage device, or the like. In another embodiment, the computer program may also be transmitted, distributed, and downloaded and installed in the form of a signal on a network medium, and/or from a removable medium 811 via a communication portion 809. The computer program may include program code that may be transmitted using any appropriate network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the foregoing.
According to embodiments of the present invention, program code for carrying out computer programs provided by embodiments of the present invention may be written in any combination of one or more programming languages, and in particular, such computer programs may be implemented in high-level procedural and/or object-oriented programming languages, and/or in assembly/machine languages. Programming languages include, but are not limited to, such as Java, c++, python, "C" or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, partly on a remote computing device, or entirely on the remote computing device or server. In the case of remote computing devices, the remote computing device may be connected to the user computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., connected via the Internet using an Internet service provider).
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions. Those skilled in the art will appreciate that the features recited in the various embodiments of the invention and/or in the claims may be combined in various combinations and/or combinations even if such combinations or combinations are not explicitly recited in the invention. In particular, the features recited in the various embodiments of the invention and/or in the claims can be combined in various combinations and/or combinations without departing from the spirit and teachings of the invention. All such combinations and/or combinations fall within the scope of the invention.
The embodiments of the present invention are described above. However, these examples are for illustrative purposes only and are not intended to limit the scope of the present invention. Although the embodiments are described above separately, this does not mean that the measures in the embodiments cannot be used advantageously in combination. The scope of the invention is defined by the appended claims and equivalents thereof. Various alternatives and modifications can be made by those skilled in the art without departing from the scope of the invention, and such alternatives and modifications are intended to fall within the scope of the invention.

Claims (11)

1. A method of data synchronization, comprising:
in response to receiving a data synchronization request, analyzing a target configuration file in a target configuration management database indicated by the data synchronization request to obtain a target resource configuration data structure corresponding to the target configuration file, wherein the data synchronization request comprises a source configuration management database identifier, a target configuration management database identifier and a target configuration file identifier, the target resource configuration data structure comprises at least one target resource configuration sub-data structure, and the target resource configuration sub-data structure comprises a target resource configuration name;
Acquiring sub-data to be synchronized corresponding to each of the at least one target resource configuration name from a source configuration management database according to each target resource configuration name of the at least one target resource configuration sub-data structure;
determining a to-be-synchronized resource allocation sub-data structure corresponding to at least one to-be-synchronized sub-data respectively according to the at least one to-be-synchronized sub-data passing through the data verification; and
and synchronizing the resource configuration sub-data structures to be synchronized, which correspond to the at least one sub-data to be synchronized respectively, to the target configuration management database.
2. The method of claim 1, wherein the step of determining the position of the substrate comprises,
the obtaining, from a source configuration management database, sub-data to be synchronized corresponding to each of the at least one target resource configuration name according to each target resource configuration name of the at least one target resource configuration sub-data structure includes:
determining the source configuration management database according to the source configuration management database identifier;
for each of the at least one target-resource-allocation sub-data structure,
determining address information corresponding to the target resource allocation name in the source allocation management database according to the target resource allocation name; and
And acquiring sub-data to be synchronized corresponding to the target resource allocation name based on the address information by utilizing a data interface.
3. The method of claim 2, wherein the obtaining, with the data interface, sub-data to be synchronized corresponding to the target resource allocation name based on the address information comprises:
and responding to the detection that the timing task is triggered, and acquiring sub-data to be synchronized corresponding to the target resource configuration name based on the address information by utilizing the data interface.
4. A method according to any one of claims 1 to 3, wherein said determining, from at least one sub-data to be synchronized that passes the data check, a sub-data structure of a resource configuration to be synchronized that corresponds to each of the at least one sub-data to be synchronized comprises:
for each of the at least one sub-data to be synchronized,
determining a data type corresponding to the sub-data to be synchronized according to the sub-data to be synchronized;
determining a preset rule corresponding to the sub-data to be synchronized according to the data type, wherein the preset rule comprises a preset check rule and a preset mapping rule;
According to the preset verification rule, carrying out data verification on the sub-data to be synchronized to obtain a data verification result; and
and under the condition that the data verification result representation verification passes, carrying out data mapping processing on the sub-data to be synchronized according to the preset mapping rule to obtain the sub-data structure of the resource allocation to be synchronized corresponding to the sub-data to be synchronized.
5. The method of claim 4, wherein, in the case that the data verification result indicates that the verification passes, the performing data mapping processing on the sub-data to be synchronized according to the preset mapping rule, to obtain the sub-data structure of the resource configuration to be synchronized corresponding to the sub-data to be synchronized includes:
under the condition that the data type is determined to be the first data type, determining a resource configuration name to be synchronized and a resource configuration value to be synchronized corresponding to the resource configuration name to be synchronized according to the sub-data to be synchronized; and
and determining the sub-data structure of the resource configuration to be synchronized corresponding to the sub-data to be synchronized according to the resource configuration name to be synchronized and the resource configuration value to be synchronized corresponding to the resource configuration name to be synchronized.
6. The method as recited in claim 5, further comprising:
under the condition that the data type is determined to be the second data type, carrying out identifier detection on the sub-data to be synchronized according to a preset identifier to obtain a front field and a rear field corresponding to the preset identifier;
determining a preamble field corresponding to the predetermined identifier as the resource configuration name to be synchronized; and
and determining a postfield corresponding to the preset identifier as the resource configuration value to be synchronized.
7. A method according to any one of claims 1 to 3, wherein the target profile comprises target data identities corresponding to each of the at least one target resource configuration sub-data structures, each of the at least one resource configuration sub-data structures corresponding to a data identity to be synchronized;
the synchronizing the to-be-synchronized resource configuration sub-data structures respectively corresponding to the at least one to-be-synchronized sub-data to the target configuration management database includes:
for each of the at least one to-be-synchronized resource configuration sub-data structure,
matching the data identifiers to be synchronized corresponding to the resource configuration sub-data structures to be synchronized according to the target data identifiers corresponding to the at least one target resource configuration sub-data structure respectively, so as to obtain a data identifier matching result;
Updating a target resource configuration value corresponding to the target data identifier according to a resource configuration value to be synchronized corresponding to the data identifier to be synchronized under the condition that the data identifier matching result represents that the target data identifier matched with the data identifier to be synchronized exists in the at least one target data identifier; and
and under the condition that the data identifier matching result represents that the at least one target data identifier does not have the target data identifier matched with the data identifier to be synchronized, creating a new target resource configuration sub-data structure according to the resource configuration name to be synchronized and the resource configuration value to be synchronized, which correspond to the data identifier to be synchronized.
8. A method according to any one of claim 1 to 3, wherein,
the responding to the received data synchronization request, analyzing the target configuration file in the target configuration management database indicated by the data synchronization request, and obtaining a target resource configuration data structure corresponding to the target configuration file comprises the following steps:
in response to receiving the data synchronization request, determining the target configuration management database according to the target configuration management database identifier;
Determining the target configuration file according to the target configuration file identifier;
acquiring the target configuration file from the target configuration management database; and
and analyzing the target configuration file to obtain the at least one target resource configuration sub-data structure.
9. A data synchronization device, comprising:
the system comprises an analysis processing module, a target resource configuration processing module and a data synchronization module, wherein the analysis processing module is used for responding to a received data synchronization request, analyzing and processing a target configuration file in a target configuration management database indicated by the data synchronization request to obtain a target resource configuration data structure corresponding to the target configuration file, the data synchronization request comprises a source configuration management database identifier, a target configuration management database identifier and a target configuration file identifier, the target resource configuration data structure comprises at least one target resource configuration sub-data structure, and the target resource configuration sub-data structure comprises a target resource configuration name;
the acquisition module is used for acquiring sub-data to be synchronized corresponding to each of the at least one target resource configuration name from a source configuration management database according to each target resource configuration name of the at least one target resource configuration sub-data structure;
The determining module is used for determining a to-be-synchronized resource configuration sub-data structure corresponding to at least one to-be-synchronized sub-data according to the at least one to-be-synchronized sub-data passing through the data verification; and
and the synchronization module is used for synchronizing the to-be-synchronized resource configuration sub-data structures corresponding to the at least one to-be-synchronized sub-data respectively to the target configuration management database.
10. An electronic device, comprising:
one or more processors;
a memory for storing one or more instructions,
wherein the one or more instructions, when executed by the one or more processors, cause the one or more processors to implement the method of any of claims 1 to 8.
11. A computer readable storage medium having stored thereon executable instructions which when executed by a processor cause the processor to implement the method of any of claims 1 to 8.
CN202310679482.7A 2023-06-09 2023-06-09 Data synchronization method and device, electronic equipment and computer readable storage medium Active CN116401319B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310679482.7A CN116401319B (en) 2023-06-09 2023-06-09 Data synchronization method and device, electronic equipment and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310679482.7A CN116401319B (en) 2023-06-09 2023-06-09 Data synchronization method and device, electronic equipment and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN116401319A CN116401319A (en) 2023-07-07
CN116401319B true CN116401319B (en) 2023-09-12

Family

ID=87009095

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310679482.7A Active CN116401319B (en) 2023-06-09 2023-06-09 Data synchronization method and device, electronic equipment and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN116401319B (en)

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2017050176A1 (en) * 2015-09-25 2017-03-30 阿里巴巴集团控股有限公司 Data synchronization method and device
CN108205569A (en) * 2016-12-19 2018-06-26 中国移动通信集团山西有限公司 For updating the method and apparatus of configuration management database
CN109710676A (en) * 2018-12-26 2019-05-03 新华三技术有限公司 Data capture method, device and the electronic equipment of CMDB model
WO2021027363A1 (en) * 2019-08-15 2021-02-18 平安科技(深圳)有限公司 Data synchronization method and apparatus, computer device and storage medium
CN114385759A (en) * 2022-01-13 2022-04-22 平安科技(深圳)有限公司 Configuration file synchronization method and device, computer equipment and storage medium
CN114510529A (en) * 2020-11-16 2022-05-17 顺丰科技有限公司 Data synchronization method and device, computer equipment and storage medium
CN114610798A (en) * 2022-03-25 2022-06-10 医渡云(北京)技术有限公司 Resource allocation management method, system, device, storage medium and electronic equipment
CN114691780A (en) * 2022-04-01 2022-07-01 北京百度网讯科技有限公司 Data synchronization method and device, electronic equipment and storage medium
CN115904527A (en) * 2022-08-31 2023-04-04 建信金融科技有限责任公司 Data processing method, device, equipment and medium
CN116149745A (en) * 2022-07-22 2023-05-23 马上消费金融股份有限公司 Application configuration data management method and device, electronic equipment and storage medium

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8489547B2 (en) * 2009-07-30 2013-07-16 International Business Machines Corporation System and method for transforming configuration data items in a configuration management database
CN102141996A (en) * 2010-01-29 2011-08-03 国际商业机器公司 Data access method and configuration management database system
US10931774B2 (en) * 2019-01-17 2021-02-23 Servicenow, Inc. Discovery and service mapping of application programming interface proxies

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2017050176A1 (en) * 2015-09-25 2017-03-30 阿里巴巴集团控股有限公司 Data synchronization method and device
CN108205569A (en) * 2016-12-19 2018-06-26 中国移动通信集团山西有限公司 For updating the method and apparatus of configuration management database
CN109710676A (en) * 2018-12-26 2019-05-03 新华三技术有限公司 Data capture method, device and the electronic equipment of CMDB model
WO2021027363A1 (en) * 2019-08-15 2021-02-18 平安科技(深圳)有限公司 Data synchronization method and apparatus, computer device and storage medium
CN114510529A (en) * 2020-11-16 2022-05-17 顺丰科技有限公司 Data synchronization method and device, computer equipment and storage medium
CN114385759A (en) * 2022-01-13 2022-04-22 平安科技(深圳)有限公司 Configuration file synchronization method and device, computer equipment and storage medium
CN114610798A (en) * 2022-03-25 2022-06-10 医渡云(北京)技术有限公司 Resource allocation management method, system, device, storage medium and electronic equipment
CN114691780A (en) * 2022-04-01 2022-07-01 北京百度网讯科技有限公司 Data synchronization method and device, electronic equipment and storage medium
CN116149745A (en) * 2022-07-22 2023-05-23 马上消费金融股份有限公司 Application configuration data management method and device, electronic equipment and storage medium
CN115904527A (en) * 2022-08-31 2023-04-04 建信金融科技有限责任公司 Data processing method, device, equipment and medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于图数据库的大规模配置管理数据库关联查询;戴声;王波;;计算机与现代化(01);54-59 *

Also Published As

Publication number Publication date
CN116401319A (en) 2023-07-07

Similar Documents

Publication Publication Date Title
US10089384B2 (en) Machine learning-derived universal connector
US11329904B2 (en) Using subject alternative names for aggregate network traffic monitoring
US11533330B2 (en) Determining risk metrics for access requests in network environments using multivariate modeling
US20160019102A1 (en) Application pattern discovery
US9934310B2 (en) Determining repeat website users via browser uniqueness tracking
WO2020244307A1 (en) Vulnerability detection method and apparatus
US10360394B2 (en) System and method for creating, tracking, and maintaining big data use cases
CN109376534B (en) Method and apparatus for detecting applications
CN110895534A (en) Data splicing method, device, medium and electronic equipment
US9300547B2 (en) Modification of cloud application service levels based upon document consumption
CN113535577B (en) Application testing method and device based on knowledge graph, electronic equipment and medium
CN114281803A (en) Data migration method, device, equipment, medium and program product
CN115221033A (en) Interface protocol testing method and device, computer readable medium and electronic equipment
CN116401319B (en) Data synchronization method and device, electronic equipment and computer readable storage medium
US20230145461A1 (en) Receiving and integrating external data into a graphical user interface of an issue tracking system
CN115904527A (en) Data processing method, device, equipment and medium
CN111400623B (en) Method and device for searching information
CN114281704A (en) Website testing method and device, electronic equipment and medium
CN114237821A (en) Self-discovery method and device for Kubernetes container cluster, electronic device and storage medium
CN113392311A (en) Field searching method, field searching device, electronic equipment and storage medium
CN113918525A (en) Data exchange scheduling method, system, electronic device, medium, and program product
CN113535568B (en) Verification method, device, equipment and medium for application deployment version
CN117176576A (en) Network resource changing method, device, equipment and storage medium
CN115952485A (en) Information processing method, device, equipment and storage medium
CN114528592A (en) Service processing method, device, equipment, medium and program product

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
GR01 Patent grant
GR01 Patent grant