Data processing method, data processing device, electronic device and storage medium

Through the combination mode of document-based database and graph database, the target database is dynamically selected for querying, which solves the problem that relational databases are difficult to meet real-time queries under large-scale data, and realizes efficient data query.

CN114201508BActive Publication Date: 2025-09-02CCB FINTECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111527761.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-14
Publication Date
2025-09-02
Estimated Expiration
2041-12-14

AI Technical Summary

Technical Problem

In the case of large data instances, CMDB built on relational databases is difficult to meet the requirements of real-time data query, especially when the configuration item data volume reaches one million to ten million, the query efficiency is low and it is difficult to meet the needs of real-time data query.

Method used

Using a combination mode of document-type database and graph database, by obtaining the respective interface response time, dynamically selecting the target database for querying, generating target query statements, and realizing data query.

Benefits of technology

It improves data query efficiency and can meet the needs of real-time data query in large-scale configuration of relational data storage and query scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114201508B_ABST
    Figure CN114201508B_ABST
Patent Text Reader

Abstract

The present disclosure provides a data processing method, comprising: in response to a data query request, obtaining the current interface response time of a document-based database and the current interface response time of a graph database recorded in a gateway; determining a target database based on the difference between the current interface response time of the document-based database and the current interface response time of the graph database; generating a target query statement based on the target database and query conditions carried in the data query request; and executing the target query statement to retrieve target data from the target database. Furthermore, the present disclosure provides a data processing device, an electronic device, and a readable storage medium.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of database technology, and more particularly, to a data processing method, a data processing device, an electronic device, a readable storage medium, and a computer program product. Background Art

[0002] With the widespread application of new technologies such as virtualization and cloud computing, the scale of IT infrastructure and application systems within enterprise data centers has grown exponentially. To facilitate the management and maintenance of IT resources, a unified configuration management database (CMDB) is usually built to improve operation and maintenance efficiency and support efficient operation of data centers.

[0003] In the process of implementing the concept of the present disclosure, the inventors discovered that there are at least the following problems in the related art: when the magnitude of data instances is large, the CMDB built based on the relational database is difficult to meet the requirements of real-time data query. Summary of the Invention

[0004] In view of this, the present disclosure provides a data processing method, a data processing device, an electronic device, a readable storage medium, and a computer program product.

[0005] One aspect of the present disclosure provides a data processing method, including: in response to a data query request, obtaining the current interface response time of a document-type database and the current interface response time of a graph database recorded in a gateway; determining a target database based on the current interface response time of the above-mentioned document-type database and the current interface response time of the above-mentioned graph database; generating a target query statement based on the above-mentioned target database and the query conditions carried in the above-mentioned data query request; and executing the above-mentioned target query statement to query and obtain target data from the above-mentioned target database.

[0006] According to an embodiment of the present disclosure, the above method also includes: in response to triggering a scheduled task, obtaining the first configuration item instance recorded in the above gateway; querying the above first configuration item instance in the above document-type database to obtain the first interface response time; querying the above first configuration item instance in the above graphic database to obtain the second interface response time; and recording the above first interface response time and the above second interface response time in the above gateway to replace the current interface response time of the above document-type database with the above first interface response time, and to replace the current interface response time of the above graphic database with the above second interface response time.

[0007] According to an embodiment of the present disclosure, the above method also includes: in the event that data changes occur in the above document-type database or the above graphic database, determining a second configuration item instance from multiple configuration item instances in the above document-type database or the above graphic database; and recording the above second configuration item instance in the above gateway to replace the above first configuration item instance with the above second configuration item instance.

[0008] According to an embodiment of the present disclosure, the above method also includes: obtaining business data generated by the client device; performing data conversion on the above business data to obtain a third configuration item instance; determining the data change type of the above third configuration item instance based on the existing configuration item instances in the above document-type database; and storing the above third configuration item instance in the above document-type database based on the above data change type.

[0009] According to an embodiment of the present disclosure, the above method also includes: when storing the above third configuration item instance in the above document-type database, querying the relationship instance associated with the above third configuration item instance in the above document-type database; generating message data based on the above third configuration item instance and the above relationship instance; and sending the above message data to a message queue.

[0010] According to an embodiment of the present disclosure, the above method also includes: monitoring the above message queue to obtain message data; when obtaining the target message data from the above message queue, parsing the above target message data to obtain the target configuration item instance and the target relationship instance associated with the above target configuration item instance; converting the above target configuration item instance and the above target relationship instance into graph data; and writing the above graph data into the above graph database based on the data change type of the above target configuration item instance.

[0011] According to an embodiment of the present disclosure, the above-mentioned graph data includes nodes and edges; wherein, the above-mentioned conversion of the above-mentioned target configuration item instance and the above-mentioned target relationship instance into graph data includes: converting the above-mentioned target configuration item instance into a first target node; and converting each of the above-mentioned target relationship instances into a first target edge of the above-mentioned target node.

[0012] According to an embodiment of the present disclosure, the above-mentioned graph data is written into the above-mentioned graph database based on the data change type of the above-mentioned target configuration item instance, including: when the data change type of the above-mentioned target configuration item instance is a new configuration item, the above-mentioned first target node and the above-mentioned first target edge are added to the above-mentioned graph database; and when the data change type of the above-mentioned target configuration item instance is a modified configuration item, the second target node and the second target edge are determined from the above-mentioned graph database based on the above-mentioned target configuration item instance, and the above-mentioned first target node and the above-mentioned first target edge are used to replace the above-mentioned second target node and the above-mentioned second target edge respectively.

[0013] Another aspect of the present disclosure provides a data processing device, including: a first acquisition module, used to obtain the current interface response time of the document database and the current interface response time of the graphic database recorded in the gateway in response to a data query request; a first determination module, used to determine the target database based on the current interface response time of the above-mentioned document database and the current interface response time of the above-mentioned graphic database; a first generation module, used to generate a target query statement based on the above-mentioned target database and the query conditions carried in the above-mentioned data query request; and a first processing module, used to execute the above-mentioned target query statement to query and obtain target data from the above-mentioned target database.

[0014] Another aspect of the present disclosure provides an electronic device, comprising: one or more processors; and a memory for storing one or more instructions, wherein when the one or more instructions are executed by the one or more processors, the one or more processors implement the method described above.

[0015] Another aspect of the present disclosure provides a computer-readable storage medium storing computer-executable instructions, which are used to implement the method described above when executed.

[0016] Another aspect of the present disclosure provides a computer program product comprising computer executable instructions, which are used to implement the method described above when the instructions are executed.

[0017] According to embodiments of the present disclosure, when performing a data query, a database is selected based on the interface response time, and a query statement is assembled based on the query conditions in the data query request to implement the data query. By using document-based and graph-based databases to build a CMDB and automatically selecting the database for actual query, this approach at least partially overcomes the technical problem in related art where CMDBs built on relational databases struggle to meet the requirements of real-time data queries when the number of data instances is large, thereby effectively improving data query efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] The above and other objects, features and advantages of the present disclosure will become more apparent through the following description of the embodiments of the present disclosure with reference to the accompanying drawings, in which:

[0019] Figure 1 An exemplary system architecture to which the data processing method according to an embodiment of the present disclosure can be applied is schematically shown.

[0020] Figure 2 The flowchart of the data processing method according to the embodiment of the present disclosure is schematically shown.

[0021] Figure 3 The flowchart of the method for updating the current interface response time according to an embodiment of the present disclosure is schematically shown.

[0022] Figure 4 A schematic diagram of a data storage structure according to an embodiment of the present disclosure is schematically shown.

[0023] Figure 5 The block diagram schematically shows a data processing device according to an embodiment of the present disclosure.

[0024] Figure 6 A block diagram schematically shows an electronic device suitable for implementing a data processing method according to an embodiment of the present disclosure. DETAILED DESCRIPTION

[0025] Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are merely exemplary and are not intended to limit the scope of the present disclosure. In the detailed description below, for ease of explanation, many specific details are set forth to provide a comprehensive understanding of the embodiments of the present disclosure. However, it is apparent that one or more embodiments may also be implemented without these specific details. In addition, in the following description, descriptions of well-known structures and technologies are omitted to avoid unnecessary confusion of the concepts of the present disclosure.

[0026] The terms used herein are only for describing specific embodiments and are not intended to limit the present disclosure. The terms "comprise," "include," etc. used herein indicate the presence of the features, steps, operations, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, or components.

[0027] All terms used herein (including technical and scientific terms) have the meanings commonly understood by those skilled in the art unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of this specification and should not be interpreted in an idealized or overly rigid manner.

[0028] When expressions such as “at least one of A, B, and C, etc.” are used, they should generally be interpreted in accordance with the meaning commonly understood by those skilled in the art (e.g., “a system having at least one of A, B, and C” should include but is not limited to systems having A alone, B alone, C alone, A and B, A and C, B and C, and / or A, B, and C, etc.). When expressions such as “at least one of A, B, or C, etc.” are used, they should generally be interpreted in accordance with the meaning commonly understood by those skilled in the art (e.g., “a system having at least one of A, B, or C” should include but is not limited to systems having A alone, B alone, C alone, A and B, A and C, B and C, and / or A, B, and C, etc.).

[0029] CMDB is a shared data management service platform that provides shared services such as data addition, deletion, and modification, permission configuration, data visualization, and notification reminders for various peripheral systems and users, and serves as an information aggregation and information interaction platform for the operation and maintenance platform.

[0030] In related technologies, CMDB implementations use relational databases like MySQL and Oracle as underlying data storage, establishing relationships between various IT resources through relational tables. To manage hundreds of models and a vast number of data model instances, abstraction is required during database table design, employing a "dynamic table" approach to table structure design.

[0031] While MySQL's "dynamic table" design can accommodate the dynamic adjustments of IT resource models, significant performance issues arise when configuration item data is excessively large—for example, when the number of configuration item instances reaches millions to tens of millions. Multi-layered relational queries are inefficient, making it difficult to meet real-time data query requirements. For example, in scenarios such as analyzing the relationships between transaction chains between infrastructure and its applications based on real-time alert information and performing intelligent multi-layered event analysis, CMDB queries based on MySQL require significant query time.

[0032] In view of this, the embodiments of the present disclosure construct a combined mode data storage method based on an open source document database and a graph database to support the storage and query of large-scale configuration relationship data. Specifically, the embodiments of the present disclosure provide a data processing method, a data processing device, an electronic device, a readable storage medium and a computer program product. The method includes obtaining the current interface response time of the document database and the current interface response time of the graph database recorded in the gateway in response to a data query request; determining the target database based on the current interface response time of the document database and the current interface response time of the graph database; generating a target query statement based on the query conditions carried in the target database and the data query request; and executing the target query statement to query and obtain target data from the target database.

[0033] In the technical solution disclosed herein, the acquisition, storage and application of user personal information involved comply with the provisions of relevant laws and regulations, take necessary confidentiality measures, and do not violate public order and good morals.

[0034] In the technical solution disclosed herein, the user's authorization or consent is obtained before obtaining or collecting the user's personal information.

[0035] Figure 1 The following schematically illustrates an exemplary system architecture to which the data processing method according to an embodiment of the present disclosure can be applied. Figure 1 The examples shown are merely examples of system architectures to which the embodiments of the present disclosure may be applied, to help those skilled in the art understand the technical content of the present disclosure, but do not mean that the embodiments of the present disclosure may not be used in other devices, systems, environments or scenarios.

[0036] like Figure 1 As shown, the system architecture 100 according to this embodiment may include terminal devices 101 , 102 , 103 , a network 104 and a server 105 .

[0037] The terminal devices 101 , 102 , and 103 may be various electronic devices having a display screen and supporting data communication, including but not limited to smart phones, tablet computers, laptop computers, and desktop computers.

[0038] Client applications may be installed on the terminal devices 101 , 102 , and 103 , such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, and / or social platform software.

[0039] The network 104 is used to provide a medium for communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired and / or wireless communication links, etc.

[0040] The server 105 may be a server that provides various services.

[0041] For example, a search application may be installed on the terminal device 101, and the user may input the data to be searched in the search application. The data may be sent to the server 105 via the network 104. The server 105 may search for the data in the database it contains and return the searched data to the terminal device 101.

[0042] It should be noted that the data processing method provided in the embodiments of the present disclosure can generally be executed by the server 105. Accordingly, the data processing device provided in the embodiments of the present disclosure can generally be set in the server 105. The data processing method provided in the embodiments of the present disclosure can also be executed by a server or server cluster that is different from the server 105 and can communicate with the terminal devices 101, 102, 103 and / or the server 105. Accordingly, the data processing device provided in the embodiments of the present disclosure can also be set in a server or server cluster that is different from the server 105 and can communicate with the terminal devices 101, 102, 103 and / or the server 105. Alternatively, the data processing method provided in the embodiments of the present disclosure can also be executed by the terminal devices 101, 102, or 103, or by other terminal devices different from the terminal devices 101, 102, or 103. Accordingly, the data processing device provided in the embodiments of the present disclosure can also be set in the terminal devices 101, 102, or 103, or in other terminal devices different from the terminal devices 101, 102, or 103.

[0043] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is merely illustrative. Any number of terminal devices, networks and servers may be provided as required.

[0044] Figure 2 The flowchart of the data processing method according to the embodiment of the present disclosure is schematically shown.

[0045] like Figure 2 As shown, the method includes operations S201 to S204.

[0046] In operation S201 , in response to a data query request, the current interface response time of the document database and the current interface response time of the graph database recorded in the gateway are acquired.

[0047] In operation S202 , a target database is determined based on the current interface response time of the document database and the current interface response time of the graphic database.

[0048] In operation S203, a target query statement is generated based on the target database and the query conditions carried in the data query request.

[0049] In operation S204 , the target query statement is executed to obtain target data from the target database.

[0050] According to an embodiment of the present disclosure, the gateway may be a data entry point for a CMDB system, and may be used to implement information interaction between an external system and a document database or a graphic database.

[0051] According to an embodiment of the present disclosure, the type of document database is not limited, and may be, for example, MongoDB, Apache CouchDB, etc.

[0052] According to an embodiment of the present disclosure, the type of graph database is not limited, and may be, for example, neo4j, HugeGraph, etc.

[0053] According to an embodiment of the present disclosure, the current interface response time may be the time required to query all relationship instances of a target configuration item instance in a document database or a graph database.

[0054] According to an embodiment of the present disclosure, the database corresponding to the smaller of the two interface response times can be selected as the target database. When querying, the interface of the target database can be directly called to perform data query, avoiding the situation where the user needs to specify the back-end database, thereby improving query efficiency.

[0055] According to an embodiment of the present disclosure, the query condition may include, for example, querying the attributes of a configuration item instance, querying all relationship instances associated with the configuration item instance, and the like.

[0056] According to an embodiment of the present disclosure, the target data may correspond to the query condition, for example, may be configuration item instance data, relationship instance data, etc.

[0057] According to an embodiment of the present disclosure, the target query statement can be generated based on specific query conditions and the grammatical specifications of the target database. The tool used to generate the target query statement can be determined according to the specific application scenario and is not limited here.

[0058] According to embodiments of the present disclosure, when performing a data query, a database is selected based on the interface response time, and a query statement is assembled based on the query conditions in the data query request to implement the data query. By using document-based and graph-based databases to build a CMDB and automatically selecting the database for actual query, this approach at least partially overcomes the technical problem in related art where CMDBs built on relational databases struggle to meet the requirements of real-time data queries when the number of data instances is large, thereby effectively improving data query efficiency.

[0059] Reference below Figures 3 and 4 , combined with specific embodiments Figure 2 The method shown is further explained.

[0060] Figure 3 The flowchart of the method for updating the current interface response time according to an embodiment of the present disclosure is schematically shown.

[0061] like Figure 3 As shown, the method includes operations S301 to S305.

[0062] It should be noted that, unless it is explicitly stated that there is a sequence of execution between different operations shown in the flowchart in the embodiments of the present disclosure, or there is a sequence of execution between different operations in technical implementation, otherwise, the execution order between multiple operations may not be prioritized, and multiple operations may also be executed simultaneously.

[0063] In operation S301, it is determined whether a scheduled task is triggered. If it is determined that the scheduled task is triggered, operation S302 is performed; if it is determined that the scheduled task is not triggered, operation S301 is continued to monitor the triggering status of the scheduled task.

[0064] In operation S302, a first configuration item instance is obtained.

[0065] In operation S303, a first configuration item instance is queried in a document-type database to obtain a first interface response time.

[0066] In operation S304, the first configuration item instance is queried in the graph database to obtain the second interface response time.

[0067] In operation S305 , the first interface response time and the second interface response time are recorded in the gateway as current interface response time.

[0068] According to an embodiment of the present disclosure, the timed task may be a pre-set task for regularly updating the current interface response time.

[0069] According to an embodiment of the present disclosure, the first configuration item instance may be pre-stored in the gateway.

[0070] According to an embodiment of the present disclosure, the first configuration item instance may be a configuration item instance having the most associated relationship instances in a document database and a graph database.

[0071] In some embodiments, due to reasons such as thread delay, the configuration item instances contained in the document database and the graph database may not be synchronized. Therefore, the configuration item instances with the most associated relationship instances in the document database and the graph database may be different.

[0072] According to an embodiment of the present disclosure, a first configuration item instance can be re-determined when data changes occur in a document-based database or a graph database. Specifically, when data changes occur in a document-based database or a graph database, a second configuration item instance is determined from multiple configuration item instances in the document-based database or the graph database; the second configuration item instance is then recorded in the gateway, so that the second configuration item instance replaces the first configuration item instance.

[0073] According to an embodiment of the present disclosure, the current interface response time originally recorded in the gateway may be replaced by the new first interface response time and the new second interface response time obtained by calculation.

[0074] Figure 4 A schematic diagram of a data storage structure according to an embodiment of the present disclosure is schematically shown.

[0075] like Figure 4 As shown, the data storage structure may be composed of a document database 401 and a graphic database 402 .

[0076] According to an embodiment of the present disclosure, the business data generated by the client device 403 can be stored in the document database 401; thereafter, the business data stored in the document database 401 can be synchronized to the graph database 402 through the message middleware 404 and the data conversion service 405; both the document database 401 and the graph database 402 can provide data query services for configuration item instances and relationship instances, and the data query interfaces of the document database 401 and the graph database 402 are uniformly registered in the gateway 406 to facilitate users to query data through the gateway 406.

[0077] According to an embodiment of the present disclosure, the specific operations of storing the business data generated by the client device 403 into the document-type database 401 may include: obtaining the business data generated by the client device 403; performing data conversion on the business data to obtain a third configuration item instance; determining the data change type of the third configuration item instance based on the existing configuration item instances in the document-type database 401; and storing the third configuration item instance in the document-type database 401 based on the data change type.

[0078] According to an embodiment of the present disclosure, the client device 403 may be any type of electronic device, including but not limited to a computer, a mobile phone, a server, etc.

[0079] According to the embodiments of the present disclosure, business data may be data collected by automated equipment, data input by users, or data input from external systems through external system docking, which is not limited here.

[0080] According to an embodiment of the present disclosure, the format of the third configuration item instance is related to the type of the document database 401. For example, when the document database 401 is MongoDB, the business data needs to be converted into the third configuration item instance in BSON format.

[0081] According to an embodiment of the present disclosure, data change types may include addition, modification, deletion, and the like.

[0082] According to an embodiment of the present disclosure, the message middleware 404 may be ActiveMQ, Kafka, etc.

[0083] For example, when the message middleware 404 is a message queue, synchronizing the business data stored in the document database 401 to the graph database 402 may include a process of generating a message and a process of consuming the message.

[0084] Among them, the process of generating a message can specifically include: when the third configuration item instance is stored in the document-type database 401, querying the relationship instance associated with the third configuration item instance in the document-type database 401; generating message data based on the third configuration item instance and the relationship instance; and sending the message data to the message queue.

[0085] The process of consuming messages may specifically include: listening to the message queue to obtain message data; when obtaining target message data from the message queue, parsing the target message data to obtain a target configuration item instance and a target relationship instance associated with the target configuration item instance; converting the target configuration item instance and the target relationship instance into graph data; and writing the graph data into the graph database 402 based on the data change type of the target configuration item instance.

[0086] According to embodiments of the present disclosure, data conversion service 405 can monitor the designated topic of message middleware 404 in real time to obtain data change messages. Subsequently, by leveraging the consistency between relationships between configuration item instances and the graph data structure, target configuration item instances and target relationship instances obtained from consuming message data can be mapped to configuration item relationship representations in the graph database.

[0087] Taking MongoDB as a document database and HugeGraph as a graph database as an example, the graph data in HugeGraph can be divided into nodes and edges. Mapping the target configuration item instances and target relationship instances obtained from consuming message data into the configuration item relationship expression of the graph database can specifically include: converting the target configuration item instance into a first target node; and converting each target relationship instance into a first target edge of the target node.

[0088] According to an embodiment of the present disclosure, writing graph data into a graph database may specifically include: when the data change type of the target configuration item instance is a new configuration item, adding a first target node and a first target edge to the graph database; and when the data change type of the target configuration item instance is a modified configuration item, determining a second target node and a second target edge from the graph database based on the target configuration item instance, and using the first target node and the first target edge to replace the second target node and the second target edge respectively.

[0089] In some embodiments, the processing of message data can be recorded in the Redis cache. When an exception occurs in the processing, compensation operations can be performed through the cached data to provide high availability of the data storage service.

[0090] Figure 5 The block diagram schematically shows a data processing device according to an embodiment of the present disclosure.

[0091] like Figure 5 As shown, the data processing device 500 includes a first acquisition module 510 , a first determination module 520 , a first generation module 530 and a first processing module 540 .

[0092] The first acquisition module 510 is configured to acquire, in response to a data query request, the current interface response time of the document database and the current interface response time of the graphic database recorded in the gateway.

[0093] The first determining module 520 is configured to determine a target database based on the difference between the current interface response time of the document database and the current interface response time of the graphic database.

[0094] The first generating module 530 is configured to generate a target query statement based on the target database and the query conditions carried in the data query request.

[0095] The first processing module 540 is configured to execute a target query statement to obtain target data from a target database.

[0096] According to embodiments of the present disclosure, when performing a data query, a database is selected based on the interface response time, and a query statement is assembled based on the query conditions in the data query request to implement the data query. By using document-based and graph-based databases to build a CMDB and automatically selecting the database for actual query, this approach at least partially overcomes the technical problem in related art where CMDBs built on relational databases struggle to meet the requirements of real-time data queries when the number of data instances is large, thereby effectively improving data query efficiency.

[0097] According to an embodiment of the present disclosure, the data processing device 500 further includes a second acquisition module, a first query module, a second query module, and a first recording module.

[0098] The second acquisition module is configured to acquire the first configuration item instance recorded in the gateway in response to triggering the scheduled task.

[0099] The first query module is used to query the first configuration item instance in the document database to obtain the first interface response time.

[0100] The second query module is used to query the first configuration item instance in the graphic database to obtain the second interface response time.

[0101] The first recording module is used to record the first interface response time and the second interface response time in the gateway, so as to use the first interface response time to replace the current interface response time of the document database, and use the second interface response time to replace the current interface response time of the graphic database.

[0102] According to an embodiment of the present disclosure, the data processing device 500 further includes a second determining module and a second recording module.

[0103] The second determining module is configured to determine a second configuration item instance from a plurality of configuration item instances in the document database or the graph database when data change occurs in the document database or the graph database.

[0104] The second recording module is configured to record the second configuration item instance in the gateway to replace the first configuration item instance with the second configuration item instance.

[0105] According to an embodiment of the present disclosure, the data processing device 500 further includes a third acquisition module, a second processing module, a third determination module and a first storage module.

[0106] The third acquisition module is used to acquire the service data generated by the client device.

[0107] The second processing module is used to perform data conversion on the business data to obtain a third configuration item instance.

[0108] The third determining module is configured to determine a data change type of a third configuration item instance based on existing configuration item instances in the document-based database.

[0109] The first storage module is configured to store the third configuration item instance in a document-based database based on the data change type.

[0110] According to an embodiment of the present disclosure, the data processing device 500 further includes a third query module, a second generation module, and a sending module.

[0111] The third query module is configured to query the document-type database for a relationship instance associated with the third configuration item instance when the third configuration item instance is stored in the document-type database.

[0112] The second generating module is configured to generate message data based on the third configuration item instance and the relationship instance.

[0113] The sending module is used to send message data to the message queue.

[0114] According to an embodiment of the present disclosure, the data processing device 500 further includes a monitoring module, a parsing module, a third processing module and a second storage module.

[0115] The monitoring module is used to monitor the message queue to obtain message data.

[0116] The parsing module is used to parse the target message data when obtaining the target message data from the message queue to obtain the target configuration item instance and the target relationship instance associated with the target configuration item instance.

[0117] The third processing module is used to convert the target configuration item instance and the target relationship instance into graph data.

[0118] The second storage module is used to write the graph data into the graph database based on the data change type of the target configuration item instance.

[0119] According to an embodiment of the present disclosure, graph data includes nodes and edges.

[0120] According to an embodiment of the present disclosure, the third processing module includes a first processing unit and a second processing unit.

[0121] The first processing unit is configured to convert the target configuration item instance into a first target node.

[0122] The second processing unit is configured to convert each target relationship instance into a first target edge of the target node.

[0123] According to an embodiment of the present disclosure, the second storage module includes a first storage unit and a second storage unit.

[0124] The first storage unit is configured to add a first target node and a first target edge to a graph database when the data change type of the target configuration item instance is a newly added configuration item.

[0125] The second storage unit is used to determine a second target node and a second target edge from the graph database based on the target configuration item instance when the data change type of the target configuration item instance is to modify the configuration item, and to replace the second target node and the second target edge with the first target node and the first target edge respectively.

[0126] According to the modules, submodules, units, and subunits of the embodiments of the present invention, any multiple or at least part of the functions of any multiple thereof can be implemented in one module. According to the modules, submodules, units, and subunits of the embodiments of the present invention, any one or more thereof can be split into multiple modules for implementation. According to the modules, submodules, units, and subunits of the embodiments of the present invention, any one or more thereof can be at least partially implemented as a hardware circuit, 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 can be implemented by hardware or firmware of any other reasonable way of integrating or packaging the circuit, or implemented in any one of the three implementation modes of software, hardware, and firmware or in an appropriate combination of any of them. Alternatively, according to the modules, submodules, units, and subunits of the embodiments of the present invention, one or more thereof can be at least partially implemented as a computer program module, which can perform the corresponding function when the computer program module is run.

[0127] For example, any multiple of the first acquisition module 510, the first determination module 520, the first generation module 530, and the first processing module 540 can be combined into one module / unit / sub-unit for implementation, or any one of the modules / units / sub-units can be split into multiple modules / units / sub-units. Alternatively, at least part of the functions of one or more of these modules / units / sub-units can be combined with at least part of the functions of other modules / units / sub-units and implemented in one module / unit / sub-unit. According to an embodiment of the present disclosure, at least one of the first acquisition module 510, the first determination module 520, the first generation module 530, and the first processing module 540 can be at least partially implemented as a hardware circuit, 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 can be implemented by hardware or firmware in any other reasonable way of integrating or packaging the circuit, or implemented in any one of the three implementation modes of software, hardware, and firmware, or in an appropriate combination of any of them. Alternatively, at least one of the first acquisition module 510 , the first determination module 520 , the first generation module 530 and the first processing module 540 may be at least partially implemented as a computer program module, which may perform corresponding functions when executed.

[0128] It should be noted that the data processing device part in the embodiment of the present disclosure corresponds to the data processing method part in the embodiment of the present disclosure. The description of the data processing device part specifically refers to the data processing method part and will not be repeated here.

[0129] Figure 6 A block diagram schematically shows an electronic device suitable for implementing a data processing method according to an embodiment of the present disclosure. Figure 6 The electronic device shown is only an example and should not limit the functions and scope of use of the embodiments of the present disclosure.

[0130] like Figure 6 As shown, the computer electronic device 600 according to an embodiment of the present disclosure includes a processor 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage part 608 into a random access memory (RAM) 603. The processor 601 may include, for example, a general-purpose microprocessor (such as a CPU), an instruction set processor and / or a related chipset and / or a special-purpose microprocessor (such as an application-specific integrated circuit (ASIC)), etc. The processor 601 may also include an onboard memory for caching purposes. The processor 601 may include a single processing unit or multiple processing units for executing different actions of the method flow according to an embodiment of the present disclosure.

[0131] Various programs and data required for the operation of the electronic device 600 are stored in the RAM 603. The processor 601, ROM 602, and RAM 603 are connected to each other via a bus 604. The processor 601 executes the various operations of the method flow according to the embodiment of the present disclosure by executing the programs in the ROM 602 and / or RAM 603. It should be noted that the programs may also be stored in one or more memories other than the ROM 602 and RAM 603. The processor 601 may also execute the various operations of the method flow according to the embodiment of the present disclosure by executing the programs stored in the one or more memories.

[0132] According to an embodiment of the present disclosure, the electronic device 600 may further include an input / output (I / O) interface 605, which is also connected to the bus 604. The electronic device 600 may further include one or more of the following components connected to the I / O interface 605: an input portion 606 including a keyboard, a mouse, etc.; an output portion 607 including devices such as a cathode ray tube (CRT), a liquid crystal display (LCD), and a speaker; a storage portion 608 including a hard disk; and a communication portion 609 including a network interface card such as a LAN card or a modem. The communication portion 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to the I / O interface 605 as needed. A removable medium 611, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed in the drive 610 as needed, so that a computer program read therefrom can be installed into the storage portion 608 as needed.

[0133] According to an embodiment of the present disclosure, the method flow according to an embodiment of the present disclosure can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable storage medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 609, and / or installed from the removable medium 611. When the computer program is executed by the processor 601, the above-mentioned functions defined in the system of the embodiment of the present disclosure are executed. According to an embodiment of the present disclosure, the system, equipment, device, module, unit, etc. described above can be implemented by a computer program module.

[0134] The present disclosure also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments, or may exist independently and not be incorporated into the device / apparatus / system. The computer-readable storage medium carries one or more programs, and when executed, implements the method according to the embodiments of the present disclosure.

[0135] According to an embodiment of the present disclosure, a computer-readable storage medium may be a non-volatile computer-readable storage medium. For example, it may include, but is not limited to: a portable computer disk, a hard disk, a random-access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.

[0136] For example, according to an embodiment of the present disclosure, the computer-readable storage medium may include the ROM 602 and / or the RAM 603 described above and / or one or more memories other than the ROM 602 and the RAM 603 .

[0137] An embodiment of the present disclosure also includes a computer program product, which includes a computer program, and the computer program contains program code for executing the method provided by the embodiment of the present disclosure. When the computer program product runs on an electronic device, the program code is used to enable the electronic device to implement the data processing method provided by the embodiment of the present disclosure.

[0138] When the computer program is executed by the processor 601, the above functions defined in the system / device of the embodiment of the present disclosure are performed. According to the embodiment of the present disclosure, the system, device, module, unit, etc. described above can be implemented by a computer program module.

[0139] In one embodiment, the computer program may be stored on a tangible storage medium such as an optical storage device or a magnetic storage device. In another embodiment, the computer program may be transmitted and distributed in the form of a signal on a network medium, downloaded and installed via the communication portion 609, and / or installed from a removable medium 611. The program code contained in the computer program may be transmitted using any appropriate network medium, including but not limited to wireless, wired, or any suitable combination thereof.

[0140] According to an embodiment of the present disclosure, the program code for executing the computer program provided by the embodiment of the present disclosure can be written in any combination of one or more programming languages. Specifically, these computer programs can be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages ​​include, but are not limited to, languages ​​such as Java, C++, python, "C" or similar programming languages. The program code can be executed entirely on the user computing device, partially on the user device, partially on a remote computing device, or entirely on a remote computing device or server. In cases involving a remote computing device, the remote computing device can be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (for example, using an Internet service provider to connect via the Internet).

[0141] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of the systems, methods, and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram may represent a module, program segment, or portion of code, which contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the boxes may occur in an order different from that marked in the accompanying drawings. For example, two boxes shown in succession may actually be executed substantially in parallel, or they may sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, as well as the combination of boxes in the block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or may be implemented using a combination of dedicated hardware and computer instructions. It will be understood by those skilled in the art that the features described in the various embodiments and / or claims of the present disclosure may be combined and / or coupled in various ways, even if such combinations or couplings are not explicitly described in the present disclosure. In particular, without departing from the spirit and teachings of the present disclosure, the features described in the various embodiments and / or claims of the present disclosure may be combined and / or coupled in various ways, and all such combinations and / or couplings fall within the scope of the present disclosure.

[0142] The embodiments of the present disclosure are described above. However, these embodiments are for illustrative purposes only and are not intended to limit the scope of the present disclosure. Although each embodiment has been described separately above, this does not mean that the measures in each embodiment cannot be used in combination to advantage. The scope of the present disclosure is defined by the appended claims and their equivalents. Without departing from the scope of the present disclosure, those skilled in the art may make various substitutions and modifications, which should all fall within the scope of the present disclosure.

Claims

1. A data processing method, comprising: In response to the data query request, obtaining the current interface response time of the document database and the current interface response time of the graph database recorded in the gateway; Determining a target database based on the current interface response time of the document database and the current interface response time of the graphic database; Generate a target query statement based on the target database and the query conditions carried in the data query request; Executing the target query statement to query and obtain target data from the target database; Obtain business data generated by client devices; Performing data conversion on the business data to obtain a third configuration item instance; Determining a data change type of the third configuration item instance based on existing configuration item instances in the document-based database; as well as Based on the data change type, storing the third configuration item instance in the document-based database; When the third configuration item instance is stored in the document-type database, searching the document-type database for a relationship instance associated with the third configuration item instance; generating message data based on the third configuration item instance and the relationship instance; as well as Sending the message data to a message queue; Monitor the message queue to obtain message data; When obtaining target message data from the message queue, parsing the target message data to obtain a target configuration item instance and a target relationship instance associated with the target configuration item instance; Converting the target configuration item instance and the target relationship instance into graph data; as well as The graph data is written into the graph database based on a data change type of the target configuration item instance.

2. The method according to claim 1, further comprising: In response to triggering the scheduled task, obtaining a first configuration item instance recorded in the gateway; Querying the first configuration item instance in the document database to obtain a first interface response time; querying the first configuration item instance in the graphic database to obtain a second interface response time; as well as The first interface response time and the second interface response time are recorded in the gateway, so as to replace the current interface response time of the document database with the first interface response time and replace the current interface response time of the graphic database with the second interface response time.

3. The method according to claim 2, further comprising: In the event that data in the document-type database or the graphic database is changed, determining a second configuration item instance from a plurality of configuration item instances in the document-type database or the graphic database; and The second configuration item instance is recorded in the gateway to replace the first configuration item instance with the second configuration item instance.

4. The method according to claim 1, wherein The graph data includes nodes and edges; The step of converting the target configuration item instance and the target relationship instance into graph data includes: Converting the target configuration item instance into a first target node; and Each of the target relationship instances is converted into a first target edge of the target node.

5. The method according to claim 4, wherein The step of writing the graph data into the graph database based on the data change type of the target configuration item instance includes: When the data change type of the target configuration item instance is a newly added configuration item, adding the first target node and the first target edge to the graph database; and When the data change type of the target configuration item instance is to modify the configuration item, a second target node and a second target edge are determined from the graph database based on the target configuration item instance, and the first target node and the first target edge are used to replace the second target node and the second target edge respectively.

6. A data processing device comprising: A first acquisition module is configured to acquire, in response to a data query request, a current interface response time of a document database and a current interface response time of a graphic database recorded in the gateway; A first determining module is configured to determine a target database based on a difference between a current interface response time of the document database and a current interface response time of the graphic database; A first generating module, configured to generate a target query statement based on the target database and the query condition carried in the data query request; A first processing module is used to execute the target query statement to query and obtain target data from the target database; A third acquisition module is used to obtain business data generated by the client device; A second processing module is used to perform data conversion on the business data to obtain a third configuration item instance; A third determining module is configured to determine a data change type of a third configuration item instance based on existing configuration item instances in the document-based database; A first storage module is configured to store the third configuration item instance in a document-based database based on the data change type; a third query module, configured to query the document-type database for a relationship instance associated with the third configuration item instance when the third configuration item instance is stored in the document-type database; A second generating module, configured to generate message data based on the third configuration item instance and the relationship instance; The sending module is used to send message data to the message queue; The monitoring module is used to monitor the message queue to obtain message data; A parsing module is used to parse the target message data to obtain a target configuration item instance and a target relationship instance associated with the target configuration item instance when the target message data is obtained from the message queue; A third processing module is used to convert the target configuration item instance and the target relationship instance into graph data; The second storage module is used to write the graph data into the graph database based on the data change type of the target configuration item instance.

7. An electronic device comprising: one or more processors; a memory for storing one or more instructions, When the one or more instructions are executed by the one or more processors, the one or more processors are enabled to implement the method according to any one of claims 1 to 5. 8 . A computer-readable storage medium having executable instructions stored thereon, wherein when the executable instructions are executed by a processor, the processor is enabled to implement the method according to claim 1 .

9. A computer program product, comprising computer executable instructions, for implementing the method according to any one of claims 1 to 5 when the computer executable instructions are executed.

Citation Information

Patent Citations

  • Data storage method and apparatus

    CN108108384A

  • Event processing method and system

    CN113434366A