Data export method, data export device, electronic equipment and storage medium

By generating a configuration interface and converting it into data operation instructions, and utilizing service nodes to acquire and store multi-table data results, the cumbersome problem of exporting multi-table data in existing technologies is solved, achieving fast and efficient data export.

CN115203307BActive Publication Date: 2026-01-02CHINA PING AN LIFE INSURANCE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210860252.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-21
Publication Date
2026-01-02
Estimated Expiration
2042-07-21

AI Technical Summary

Technical Problem

The existing technology for exporting data from multiple tables in a database is cumbersome, requiring personnel to repeatedly enter query commands, resulting in low efficiency.

Method used

The system generates a configuration interface to obtain query content and converts it into data operation instructions. It then uses service nodes to retrieve the target query results from a preset database and stores the results as the target storage object. Subsequently, it responds to export instructions to export data from node resources.

Benefits of technology

It eliminates the need to repeatedly enter query commands, enabling fast and efficient export of data from multiple tables, thus improving operational convenience and efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115203307B_ABST
    Figure CN115203307B_ABST
Patent Text Reader

Abstract

The embodiment of the application provides a data export method, a data export device, an electronic equipment and a storage medium, and belongs to the technical field of big data. The method is applied to a first terminal connected with a first service node, and comprises the following steps: obtaining a query instruction for a to-be-queried object, and generating a configuration interface according to the query instruction. Data query content from the configuration interface is obtained, and the data query content is converted into a data operation instruction. According to the data operation instruction, a target query result is obtained from a preset database through the first service node, a target storage object corresponding to the to-be-queried object is generated according to the target query result, and the target storage object is added to a first node resource corresponding to the first service node. An export instruction for the to-be-queried object is obtained, and the target storage object is exported from the first node resource according to the export instruction, so that the efficiency of exporting multi-table data can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of big data, and particularly relates to a data export method, a data export device, an electronic device and a storage medium. BACKGROUND

[0002] Nowadays, big data has great commercial value and can help enterprises understand and position customers, optimize business processes, etc. In daily work, it is usually necessary to export pre-processed data from a database to provide it to business parties for checking. In practice, if the data to be queried involves multiple tables, relevant personnel need to repeatedly input query commands for different tables, which is relatively cumbersome. Therefore, how to improve the efficiency of exporting multi-table data has become a technical problem to be solved. SUMMARY

[0003] The main purpose of the embodiments of the present application is to provide a data export method, a data export device, an electronic device and a storage medium, which aims to improve the efficiency of exporting multi-table data.

[0004] To achieve the above-mentioned purpose, a first aspect of the embodiments of the present application provides a data export method applied to a first terminal, wherein the first terminal is connected with a first service node, and the method comprises the following steps:

[0005] obtaining a query instruction for a to-be-queried object;

[0006] generating a configuration interface according to the query instruction;

[0007] obtaining data query content from the configuration interface;

[0008] converting the data query content into a data operation instruction;

[0009] obtaining a target query result from a preset database through the first service node according to the data operation instruction;

[0010] generating a target storage object corresponding to the to-be-queried object according to the target query result through the first service node, and adding the target storage object into a first node resource corresponding to the first service node;

[0011] obtaining an export instruction for the to-be-queried object;

[0012] exporting the target storage object from the first node resource according to the export instruction.

[0013] In some optional embodiments, the data operation instruction comprises a database connection instruction, a query operation instruction and a data processing instruction, and the step of obtaining a target query result from a preset database through the first service node according to the data operation instruction comprises:

[0014] connect with the preset database according to the database connection instruction; obtain an initial query result from the preset database according to the query operation instruction through the first service node; and convert the initial query result into a target query result satisfying a preset storage structure according to the data processing instruction through the first service node.

[0015] In some optional embodiments, the obtaining of the target query result from the preset database according to the data operation instruction through the first service node comprises:

[0016] identifying a data operation element according to the data operation instruction; obtaining a first node resource corresponding to the first service node and querying the data operation element in the first node resource; if a first operation element in the data operation element is queried from the first node resource, obtaining a first operation instruction corresponding to the first operation element from the data operation instruction and obtaining a first query result in the first node resource according to the first operation instruction; and if a second operation element in the data operation element is not queried from the first node resource, obtaining a second operation instruction corresponding to the second operation element from the data operation instruction and obtaining a second query result from the preset database according to the second operation instruction through the first service node.

[0017] In some optional embodiments, the obtaining of the second operation instruction corresponding to the second operation element from the data operation instruction if the second operation element in the data operation element is not queried from the first node resource comprises:

[0018] if the second operation element in the data operation element is not queried from the first node resource, obtaining a node cluster corresponding to the first service node, the node cluster comprising the first service node and at least one second service node; generating a first synchronization instruction according to the second operation element and sending the first synchronization instruction to the second service node through the first service node, the first synchronization instruction being used to instruct the second service node to obtain a third query result corresponding to the second operation element from a second node resource of the second service node; receiving the third query result returned by the second service node through the first service node and updating the first node resource by using the third query result to obtain a new first node resource; and if the second operation element is not queried from the new first node resource, obtaining the second operation instruction corresponding to the second operation element from the data operation instruction.

[0019] In some optional embodiments, after the configuration interface is generated according to the query instruction, the method further includes:

[0020] obtaining a node cluster corresponding to the first service node, the node cluster including the first service node and at least one second service node; generating a second synchronization instruction according to the object to be queried, and sending the second synchronization instruction to the second service node through the first service node, the second synchronization instruction being used to instruct the second service node to obtain a reference storage object, the reference storage object being a storage object corresponding to the object to be queried in a second node resource of the second service node; receiving the reference storage object returned by the second service node through the first service node; and displaying the reference storage object in the configuration interface.

[0021] In some optional embodiments, after the target storage object is added to the first node resource corresponding to the first service node, the method further includes:

[0022] obtaining an update event of the preset database through the first service node; determining a changed data element from the update event, and determining target data corresponding to the changed data element from the first node resource; deleting the target data from the first node resource; or determining new data corresponding to the changed data element from the update event, and updating the target data by using the new data.

[0023] In some optional embodiments, the converting the data query content into a data operation instruction includes:

[0024] obtaining a preset delimiter, the delimiter being used to divide query content corresponding to different query tables; obtaining at least one target query table and target query content corresponding to the target query table from the data query content according to the delimiter; and converting the target query content into a data operation instruction.

[0025] To achieve the above object, a second aspect of the embodiment of the present application provides a data export device, which is applied to a first terminal, the first terminal being connected with a first service node, and the data export device includes:

[0026] an obtaining module, configured to obtain a query instruction for an object to be queried;

[0027] a generating module, configured to generate a configuration interface according to the query instruction;

[0028] the obtaining module is further configured to obtain data query content from the configuration interface;

[0029] The conversion module is configured to convert the data query content into a data operation instruction.

[0030] The query module is configured to acquire, by the first service node, a target query result from a preset database according to the data operation instruction, and generate, by the first service node, a target storage object corresponding to the to-be-queried object according to the target query result, and add the target storage object into a first node resource corresponding to the first service node.

[0031] The acquisition module is further configured to acquire an export instruction for the to-be-queried object.

[0032] The export module is configured to export, according to the export instruction, the target storage object from the first node resource.

[0033] To achieve the above object, a third aspect of the embodiment of the present application provides an electronic device, which comprises a memory, a processor, a program stored in the memory and executable on the processor, and a data bus for realizing connection communication between the processor and the memory, and the program is executed by the processor to realize the data export method in the first aspect.

[0034] To achieve the above object, a fourth aspect of the embodiment of the present application provides a storage medium, which is a computer readable storage medium, for computer readable storage, and the storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to realize the data export method in the first aspect.

[0035] In the data export method, the data export device, the electronic device and the storage medium provided by the present application, the first terminal generates a configuration interface in response to a query instruction for a to-be-queried object, and acquires data query content from the configuration interface, which can be converted into a data operation instruction to instruct the first service node to acquire a target query result from a preset database. Based on this, the first service node constructs a target storage object of the to-be-queried object according to the target query result, and adds the target storage object into a first node resource corresponding to the first service node, so that in the case that the to-be-queried object involves multi-table data, relevant personnel do not need to repeatedly input data query commands, the first terminal only needs to respond to an export instruction for the to-be-queried object to export the target storage object from the first node resource, thereby realizing rapid and efficient data repeated export, and the operation is convenient, and the efficiency of exporting multi-table data is further improved. BRIEF DESCRIPTION OF DRAWINGS

[0036] Figure 1 is an architecture schematic diagram of a data export system to which the embodiment of the present application is applied;

[0037] Figure 2 is a flowchart of a data export method provided by an embodiment of the present application;

[0038] Figure 3 is Figure 2 is a specific flowchart of step S205 in the method of

[0039] Figure 4 is a specific flowchart of the method of obtaining a target query result from a preset database through a first service node in an embodiment of the present application;

[0040] Figure 5 is Figure 3 is a specific flowchart of step S304 in the method of

[0041] Figure 6 is a structural schematic diagram of a data export device provided by an embodiment of the present application;

[0042] Figure 7 is a hardware structural schematic diagram of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION

[0043] In order to make the objectives, technical solutions and advantages of the present application clearer, the present application is further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application, and are not intended to limit the present application.

[0044] It should be noted that although the functional modules are divided in the device schematic diagram, and the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in a manner different from the module division in the device or the order in the flowchart. The terms "first", "second", etc. in the specification and claims and the above-described drawings are used to distinguish similar objects, and do not necessarily describe a specific order or sequence.

[0045] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which the present application belongs. The terms used herein are only for the purpose of describing the embodiments of the present application, and are not intended to limit the present application.

[0046] First, the terms involved in the present application are analyzed:

[0047] Artificial intelligence (AI): is a new technology science of studying, developing theories, methods, technologies and application systems for simulating, extending and expanding human intelligence; artificial intelligence is a branch of computer science, artificial intelligence attempts to understand the essence of intelligence, and produce a new intelligent machine that can react in a similar way to human intelligence, including robots, language recognition, image recognition, natural language processing and expert systems. Artificial intelligence can simulate the information process of human consciousness and thinking. Artificial intelligence is also the theory, method, technology and application system of using digital computer or digital computer controlled machine to simulate, extend and expand human intelligence, perceive environment, acquire knowledge and use knowledge to obtain optimal results.

[0048] Natural language processing (NLP): NLP uses computers to process, understand and use human language (such as Chinese, English, etc.), NLP is a branch of artificial intelligence and is a cross discipline of computer science and linguistics, also known as computational linguistics. Natural language processing includes syntax analysis, semantic analysis, discourse understanding, etc. Natural language processing is commonly used in machine translation, handwritten and printed character recognition, speech recognition and text-to-speech conversion, information intent recognition, information extraction and filtering, text classification and clustering, public opinion analysis and opinion mining, etc. It involves data mining, machine learning, knowledge acquisition, knowledge engineering, artificial intelligence research related to language processing, and language computing related linguistic research.

[0049] Information extraction: Information extraction is a text processing technology that extracts specified types of entities, relationships, events and other factual information from natural language text and forms structured data output. Information extraction is a technology that extracts specific information from text data. Text data is composed of specific units, such as sentences, paragraphs, and chapters. Text information is composed of small specific units, such as words, phrases, sentences, paragraphs, or combinations of these specific units. Extracting noun phrases, names, and places from text data is text information extraction. Of course, the information extracted by text information extraction technology can be various types of information.

[0050] Therefore, the embodiments of the present application provide a data export method, a data export device, an electronic device and a storage medium, which aims to improve the efficiency of exporting multi-table data.

[0051] The data export method, data export device, electronic device and storage medium provided by the embodiments of the present application are specifically explained by the following embodiments. First, the data export method in the embodiments of the present application is described.

[0052] The embodiments of the present application can acquire and process related data based on artificial intelligence technology. The artificial intelligence is a theory, method, technology and application system for simulating, extending and expanding human intelligence by using a digital computer or a machine controlled by a digital computer, perceiving an environment, acquiring knowledge and using the knowledge to obtain optimal results.

[0053] The artificial intelligence basic technology generally includes technologies such as sensors, special artificial intelligence chips, cloud computing, distributed storage, big data processing technology, operation / interaction system, mechatronics, etc. The artificial intelligence software technology mainly includes computer vision technology, robot technology, biometric technology, speech processing technology, natural language processing technology, and machine learning / deep learning, etc.

[0054] The data export method provided by the embodiments of the present application relates to the technical field of big data. The data export method provided by the embodiments of the present application can be applied to a data export system, which includes at least two terminals, at least two service nodes and at least one database. It can be understood that the data export method of the embodiments of the present application is specifically applied to each terminal, and can also be software running in the terminal, and the terminal can establish a connection with any service node. The database is used to store data. The service node is used to communicate and interact with the terminal, and establish a connection with the database to perform data query operations on the database. In some embodiments, the terminal can be a smartphone, a tablet computer, a notebook computer or a desktop computer, etc.; all service nodes can constitute a node cluster or a distributed system, and the service nodes can also be configured as cloud servers providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDNs, and big data and artificial intelligence platforms; the database can use Mysql, Hive, Sqlserver, redis and kafka, etc.; the software can be an application that implements the data export method, etc.; all of which are not specifically limited.

[0055] Please refer to Figure 1 , Figure 1 is a schematic diagram of the architecture of a data export system to which the embodiments of the present application are applied. As Figure 1 shown, the data export system includes a first terminal 10, a second terminal 11, a first service node 20, a second service node 21 and a database 30, the first terminal 10 is connected with the first service node 20, the second terminal 11 is connected with the second service node 21, and the first service node 20 and the second service node 21 can be connected with the database 30 respectively. Figure 1 It is only an example and does not constitute a specific limitation on the number and type of terminals, service nodes and databases. For the convenience of understanding, the following will be described by taking the first terminal 10 as an example.

[0056] The application is operable in a variety of generic or specific computer system environments or configurations. For example: personal computer, server computer, handheld or portable device, tablet device, multiprocessor systems, microprocessor-based systems, set top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, including any of the above system or device in a distributed computing environment, etc. The application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. The application can also be practiced in a distributed computing environment, where tasks are performed by remote processing devices that are connected through a communication network. In a distributed computing environment, program modules can be located in both local and remote computer storage media, including storage devices.

[0057] It should be noted that in each specific embodiment of the present application, when it is necessary to process relevant data related to the identity or characteristics of the user according to user information, user behavior data, user history data and user location information, etc., the user's permission or consent will be obtained first, and the collection, use and processing of these data will comply with relevant laws, regulations and standards. In addition, when the embodiments of the present application need to obtain sensitive personal information of the user, the separate permission or separate consent of the user will be obtained through a pop-up window or by jumping to a confirmation page, and after obtaining the separate permission or separate consent of the user, the necessary user-related data for enabling the embodiments of the present application to normally operate will be obtained.

[0058] Please refer to Figure 2 , Figure 2 is a flowchart of the data export method provided by the embodiments of the present application. As Figure 2 shown, Figure 2 The method in step S201 can include but is not limited to steps S201 to S208.

[0059] Step S201: Obtain a query instruction for a to-be-queried object.

[0060] In the embodiments of the present application, the to-be-queried object can be any to-be-queried data object, such as an entity description, a thing, an event, a role, an organization unit, a location, and a structure, and the like, and no specific limitation is made thereto. It can be understood that the embodiments of the present application are applicable to the case of performing associated data export in units of to-be-queried objects. In some embodiments, the first terminal can acquire a query instruction input by a user through voice, or can also acquire a query instruction generated when the user inputs a query text or a picture in a query interface generated on the first terminal. Correspondingly, the first terminal can determine the to-be-queried object according to the query instruction, such as converting the above-mentioned voice input query instruction into a natural language text, and extracting a query keyword from the natural language text, so as to determine the query keyword as the to-be-queried object. For another example, the above-mentioned query text is determined as the to-be-queried object.

[0061] Step S202: generating a configuration interface according to the query instruction.

[0062] In the embodiments of the present application, the first terminal can use front-end technologies such as HTML and javascript to define an interface and dynamically interact with the configuration, so as to generate a visual configuration interface. The configuration interface at least includes an input area for information input and an operation control, and the operation control at least includes a query control for triggering a data query step and an export control for triggering a data export step, and no specific limitation is made thereto.

[0063] Step S203: acquiring data query content from the configuration interface.

[0064] In one implementation manner, the user can directly input the data query content through the above-mentioned input area, and the data query content can be code data written based on a data query language, and the data query language can include a structured query language (SQL) and the like. In another implementation manner, the first terminal can also generate a data import template in the input area, the data import template includes a code framework written according to the data query language and a field input area corresponding to a to-be-filled field, the field input information is acquired through the field input area, and the data query content can be generated based on the code template and the field input information, wherein the code framework is used to specify a syntax structure, and the type of the to-be-filled field includes but is not limited to a database type, a database name, a data table name, a parameter value, a query condition, a command type (such as basic query, multi-condition query, fuzzy query, grouping query, connection query, and subquery, and the like), and an operator (such as an arithmetic operator, a relation operator, an assignment operator, and a logic operator, and the like).

[0065] Step S204: converting the data query content into a data operation instruction.

[0066] In this embodiment, specifically, data query content can be converted into data manipulation instructions according to a preset data manipulation language. The data manipulation language (DML) is used to implement basic database operations, such as querying, inserting, deleting, and modifying table data. The data manipulation language and the aforementioned data query language can be different programming languages; for example, the data query language could be SQL, while the data manipulation language could be Python.

[0067] In some embodiments, based on the syntactic features of the data manipulation language, class modules can be pre-constructed through an application programming interface (API) for connecting to the database. Each class module includes at least one function for executing data query instructions; these functions can be understood as program segments that implement the data query functionality. In step S204, the first terminal calls the aforementioned class module and uses the data query content as input parameters to generate data manipulation instructions.

[0068] Step S205: Obtain the target query result from the preset database through the first service node according to the data operation instructions.

[0069] Specifically, in step S205, the first terminal sends a data operation instruction to the first service node. The first service node can then determine the preset database by executing the data operation instruction and perform a query operation on the preset database to obtain the target query result.

[0070] Step S206: Through the first service node, generate the target storage object corresponding to the object to be queried based on the target query result, and add the target storage object to the first node resource corresponding to the first service node.

[0071] In this embodiment, the target storage object is a storage object created by the first service node for the object to be queried, used to store the historical query results obtained by the first service node for the object to be queried. The storage object can be a list or a dictionary, etc., without specific limitations. The first service node can store the obtained query results through the first node resources and periodically update and maintain the first node resources. For example, when the first service node adds the target storage object to the first node resources, it sets a timeout period for the object to be queried. If the target storage object is not exported or updated within the timeout period, it is deleted from the first node resources, thus achieving dynamic resource management.

[0072] Step S207: Obtain the export instruction for the object to be queried.

[0073] In step S207, the first terminal can generate the export instruction for the to-be-queried object upon detecting a confirmation operation (such as clicking the export control, etc.) on the export control in the configuration interface, or through other instruction triggering manners such as voice input, etc., and no specific limitation is made herein.

[0074] In step S208, the target storage object is exported from the first node resource according to the export instruction.

[0075] The steps S201 to S208 shown in the embodiments of the present application do not require the relevant personnel to repeatedly input the data query command in the case of the to-be-queried object involving multi-table data, and the operation is convenient. Based on this, the first service node constructs the target storage object of the to-be-queried object according to the target query result and adds the target storage object to the first node resource corresponding to the first service node, so that the first terminal can only export the target storage object from the first node resource in response to the export instruction for the to-be-queried object, thereby realizing rapid and efficient data re-export and further improving the efficiency of exporting multi-table data.

[0076] In step S204 of some embodiments, step S204 includes but is not limited to the following steps: obtaining a preset delimiter, the delimiter being used to divide the query content corresponding to different query tables. According to the delimiter, at least one target query table and the target query content corresponding to the target query table are obtained from the data query content, so as to convert the target query content into a data operation instruction. As can be seen, the user can input the target query content while configuring different query conditions of multiple data tables, and the first terminal can flexibly identify the query conditions of different data tables to convert them into data operation instructions, thereby supporting simultaneous query of multi-table data.

[0077] The delimiter is used to divide the query content corresponding to different query tables by marking the division position, and the delimiter can be a human-set and adjusted identifier such as a semicolon, a colon, or a blank symbol, etc., and no specific limitation is made herein. For example, if the delimiter is a semicolon, and the target query content is “select * from a;select * from b where b.id=‘001’;”, two target query tables, table a and table b, can be obtained from the target query content, and the target query content of table a “select * from a” and the target query content of table b “select * from b where b.id=‘001’” are obtained.

[0078] Please refer to Figure 3 , Figure 3 is Figure 2 a specific flowchart of step S205 in FIG. 8. As Figure 3As shown, in step S205 of some embodiments, step S205 includes but is not limited to the following steps S301-S304.

[0079] Step S301: According to the data operation instruction, identify the data operation element.

[0080] In the embodiments of the present application, the data operation element represents the attribute value corresponding to the preset data attribute in the data operation instruction, and the preset data attribute can include but is not limited to at least one of the following: data table name, column name, row name, primary key, and index.

[0081] Step S302: Obtain the first node resource corresponding to the first service node, and query the data operation element in the first node resource.

[0082] Step S303: If the first operation element in the data operation element is queried from the first node resource, the first operation instruction corresponding to the first operation element is obtained from the data operation instruction, and the first query result is obtained in the first node resource according to the first operation instruction.

[0083] For step S303, in some embodiments, the first terminal can also obtain a hierarchical relationship list, which is used to set the hierarchical relationship between different preset data attributes. For example, assuming that the hierarchical relationship list is [preset data attribute a, preset data attribute b, preset data attribute c], that is, if the preset data attribute is arranged earlier in the hierarchical relationship list, the hierarchical level of the preset data attribute is higher. For example, in actual application, the hierarchical relationship list can be [data table name, (column name, row name), index]. Then, if the first terminal queries the target operation element from the first node resource, and the target operation element is any operation element in the data operation element, the preset data attribute corresponding to the target operation element is determined as the target data attribute, and the attribute hierarchical chain corresponding to the target data attribute is determined from the hierarchical relationship list. At this time, if the target data attribute is the preset data attribute with the highest hierarchical level in the hierarchical relationship list, the attribute hierarchical chain only includes the target data attribute; otherwise, the preset data attribute with a higher hierarchical level than the target data attribute is obtained from the hierarchical relationship list, and the attribute hierarchical chain is determined in combination with the target data attribute. Based on this, the first operation element queried by the first terminal satisfies that the first operation element includes the operation element corresponding to all preset data attributes in the attribute hierarchical chain, thereby ensuring the integrity of data query. Further, by determining the corresponding target query table through the first operation element, the operation instruction corresponding to the target query table can be obtained from the data operation instruction as the first operation instruction.

[0084] Step S304: If the second operation element in the data operation element is not queried from the first node resource, a second operation instruction corresponding to the second operation element is acquired from the data operation instruction, and a second query result is acquired from the preset database according to the second operation instruction through the first service node.

[0085] Similarly, in step S304, the corresponding target query table is determined through the second operation element, and the operation instruction corresponding to the target query table can be acquired from the data operation instruction as the second operation instruction.

[0086] It can be seen that, by steps S301 to S304, the node resource of the service node is preferentially utilized for data query, which can save the time for querying data in a large amount of data in the database, and is beneficial to improving the data query efficiency.

[0087] In some embodiments, the data operation instruction includes a database connection instruction, a query operation instruction, and a data processing instruction. Please refer to Figure 4 , Figure 4 is a specific flowchart of acquiring a target query result from a preset database through a first service node in the embodiments of the present application. As Figure 4 indicated, the target query result is acquired from the preset database through the first service node according to the data operation instruction, including but not limited to the following steps S401 to S404.

[0088] Step S401: A connection is established between the first service node and the preset database according to the database connection instruction.

[0089] The database connection instruction includes but is not limited to the host information, the port information, and the database name of the preset database. In some embodiments, the database connection instruction can also include the import information of a third-party tool library, such as importing PyHive to connect the hive database.

[0090] Step S402: An initial query result is acquired from the preset database through the first service node according to the query operation instruction.

[0091] The query operation instruction is used to instruct the first service node to perform a query operation on the preset database according to the data query content (or the target query content).

[0092] Step S403: The initial query result is converted into a target query result satisfying a preset storage structure according to the data processing instruction through the first service node.

[0093] The data processing instruction includes, but is not limited to, definition information of a preset storage structure and conversion relationship information between a query result and the preset storage structure. For example, the definition information is used to define a row field and a column field of a target storage object, and the conversion relationship information is used to obtain a first field corresponding to a row field point and a second field corresponding to a column field from an initial query result.

[0094] It can be seen that through steps S401 to S403, the database connection, data query and data storage structure are unified.

[0095] Further, in some embodiments, referring to Figure 5 , Figure 5 is Figure 3 a specific flowchart of step S304. As Figure 5 shown, in step S304 of some embodiments, step S304 includes, but is not limited to, the following steps S501 to S504.

[0096] Step S501: If the second operation element in the data operation element is not queried from the first node resource, the node cluster corresponding to the first service node is obtained, and the node cluster includes the first service node and at least one second service node.

[0097] Step S502: According to the second operation element, a first synchronization instruction is generated, and the first synchronization instruction is sent to the second service node through the first service node.

[0098] The first synchronization instruction is used to instruct the second service node to obtain a third query result corresponding to the second operation element from the second node resource of the second service node.

[0099] Step S503: The third query result returned by the second service node is received through the first service node, and the third query result is used to update the first node resource to obtain a new first node resource.

[0100] In one case, if the third node resource in the data operation element is queried from the new first node resource, the first terminal obtains a third operation instruction corresponding to the third operation element from the data operation instruction, and obtains a third query result in the new first node resource according to the third operation instruction. It can be understood that the above-mentioned obtaining of the third operation instruction and the third operation instruction can refer to the description of step S303, and will not be repeated. In another case, the first terminal executes the following step S504.

[0101] Step S504: If the second operation element is not queried from the new first node resource, the second operation instruction corresponding to the second operation element is obtained from the data operation instruction.

[0102] It can be seen that through steps S501 to S504, the data synchronization of the distributed nodes is realized, which is beneficial to further save the time of querying data in a large amount of data in the database.

[0103] After step S202 of some embodiments, at least the following steps can be further included: obtaining a node cluster corresponding to the first service node, the node cluster including the first service node and at least one second service node. According to the object to be queried, a second synchronization instruction is generated, and the second synchronization instruction is sent to the second service node through the first service node, the second synchronization instruction being used to instruct the second service node to obtain a reference storage object, the reference storage object being a storage object corresponding to the object to be queried in the second node resource of the second service node. Through the first service node, the reference storage object returned by the second service node is received, so as to display the reference storage object in the configuration interface.

[0104] For example, if the user inputs the query keyword "product P" through the first terminal, in step S501, the first service node sends the second synchronization instruction for "product P" to the second service node in the node cluster, and then the second service node obtains the temporary table of "product P" from the second node resource and returns the temporary table to the first terminal through the first service node. The first terminal displays the temporary table in the configuration interface for the user to refer, so that the user can adaptively adjust the input query content according to the historical query situation of the object to be queried.

[0105] After step S206 of some embodiments, at least the following steps can be included: obtaining an update event of the preset database through the first service node, determining a changed data element from the update event, and obtaining target data corresponding to the changed data element from the first node resource, wherein the changed data element represents an attribute value that is updated in the preset database. In one implementation, the target data can be directly deleted from the first node resource, so as to timely clean up useless historical data. In another implementation, new data corresponding to the changed data element can also be determined from the update event, so as to update the target data with the new data, thereby realizing timely data update.

[0106] Please refer to Figure 6 The embodiment of the present application also provides a data export device, which is applied to a first terminal and can realize the above-mentioned data export method. The data export device includes an obtaining module 601, a generating module 602, a converting module 603, a querying module 604, and an exporting module 605, wherein:

[0107] The obtaining module 601 is used to obtain a query instruction for an object to be queried.

[0108] The generating module 602 is used to generate a configuration interface according to the query instruction.

[0109] The acquisition module 601 is further configured to acquire data query content from the configuration interface;

[0110] The conversion module 603 is configured to convert the data query content into a data operation instruction;

[0111] The query module 604 is configured to acquire, by the first service node, a target query result from a preset database according to the data operation instruction, and generate, by the first service node, a target storage object corresponding to the to-be-queried object according to the target query result, and add the target storage object into a first node resource corresponding to the first service node.

[0112] The acquisition module 601 is further configured to acquire an export instruction for the to-be-queried object.

[0113] The export module 605 is configured to export, according to the export instruction, the target storage object from the first node resource.

[0114] It can be understood that the specific implementation of the data export apparatus is basically the same as the specific implementation of the data export method, and thus will not be described herein.

[0115] The embodiments of the present application further provide an electronic device, which comprises a memory, a processor, a program stored in the memory and executable on the processor, and a data bus for realizing connection and communication between the processor and the memory, and the program is executed by the processor to realize the data export method. The electronic device can be any intelligent terminal, such as a tablet computer or a vehicle-mounted computer.

[0116] Please refer to Figure 7 , Figure 7 The hardware structure of the electronic device of another embodiment is illustrated, which comprises:

[0117] The processor 701 can be implemented in a general central processing unit (CPU), a microprocessor, an application specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute related programs to realize the technical solutions provided by the embodiments of the present application.

[0118] The memory 702 can be implemented in the form of read only memory (ROM), static storage device, dynamic storage device or random access memory (RAM). The memory 702 can store operating systems and other application programs. When the technical solutions provided by the embodiments of the present application are implemented by software or firmware, the related program codes are stored in the memory 702 and are called and executed by the processor 701 to perform the data export method of the embodiments of the present application.

[0119] The input / output interface 703 is used to realize information input and output.

[0120] The communication interface 704 is used to realize the communication interaction between the device and other devices. The communication can be realized by wired mode (such as USB, network cable, etc.) or wireless mode (such as mobile network, WIFI, Bluetooth, etc.).

[0121] The bus 705 transmits information between various components (such as the processor 701, the memory 702, the input / output interface 703 and the communication interface 704) of the device.

[0122] The processor 701, the memory 702, the input / output interface 703 and the communication interface 704 are connected to each other through the bus 705 to realize the communication connection between the device.

[0123] The embodiments of the present application also provide a storage medium, which is a computer readable storage medium, used for computer readable storage. The storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the above data export method.

[0124] The memory is a non-transitory computer readable storage medium, which can be used to store non-transitory software programs and non-transitory computer executable programs. In addition, the memory can include a high-speed random access memory and can also include a non-transitory memory, such as at least one magnetic disk storage device, a flash memory device or other non-transitory solid-state memory device. In some embodiments, the memory can optionally include a memory remotely arranged relative to the processor, and these remote memories can be connected to the processor through a network. Examples of the above network include but are not limited to the Internet, an intranet, a local area network, a mobile communication network and a combination thereof.

[0125] The embodiments described in the embodiments of the present application are used to more clearly illustrate the technical solutions of the embodiments of the present application, and do not constitute a limitation on the technical solutions provided by the embodiments of the present application. Those skilled in the art can know that, with the evolution of technology and the appearance of new application scenarios, the technical solutions provided by the embodiments of the present application are also applicable to similar technical problems.

[0126] Those skilled in the art can understand that the technical solutions shown in the above embodiments are not limited to the embodiments of the present application, and can include more or fewer steps than the drawings, or combine certain steps, or different steps. Figures 1-7 The technical solutions shown in the above embodiments do not constitute a limitation on the embodiments of the present application, and can include more or fewer steps than the drawings, or combine certain steps, or different steps.

[0127] The device embodiments described above are only schematic, and the units described as separate components can or can not be physically separate, i.e., can be located in one place, or can be distributed on multiple network units. Part or all of the modules can be selected according to actual needs to achieve the purpose of the embodiments.

[0128] Those skilled in the art can understand that all or some of the steps in the above disclosed method, the functional modules / units in the system and the device can be implemented as software, firmware, hardware and their appropriate combinations.

[0129] The terms "first", "second", "third", "fourth" and the like (if any) in the specification of the present application and the above drawings are used to distinguish similar objects, and do not necessarily indicate a specific order or sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device including a series of steps or units does not necessarily limit to those steps or units clearly listed, but can include other steps or units not clearly listed or inherent to these processes, methods, products or devices.

[0130] It should be understood that in the present application, "at least one" means one or more, and "multiple" means two or more. "And / or" is used to describe the association between the associated objects, which means that there can be three relationships, for example, "A and / or B" can mean that there are three cases: only A, only B, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally represents an "or" relationship between the associated objects. "At least one of the following" or similar expressions means any combination of these items, including single item or any combination of multiple items. For example, at least one of a, b or c, can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.

[0131] In several embodiments provided in the present application, it should be understood that the disclosed apparatus and method can be implemented by other manners. For example, the apparatus embodiments described above are merely illustrative, for example, the division of the above units is merely a logical function division, and actual implementation can have another division manner, for example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the units or components shown or discussed can be indirect coupling or communication connection through some interfaces, apparatuses or units, and can be electrical, mechanical or other forms.

[0132] The units described above as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, i.e., they can be located in one place or distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the embodiment.

[0133] In addition, the functional units in each embodiment of the present application can be integrated in one processing unit, or each unit can be physically present separately, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of a software functional unit.

[0134] If the integrated unit is realized in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer readable storage medium. Based on this understanding, the technical solutions of the present application essentially or the part of the prior art that contributes to the technical solutions or all or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium, including a plurality of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method of each embodiment of the present application. The foregoing storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), magnetic disk or optical disk, and various program storage media.

[0135] The preferred embodiments of the embodiments of the present application are described above with reference to the accompanying drawings, but this does not limit the scope of the embodiments of the present application. Any modifications, equivalent replacements and improvements made by those skilled in the art without departing from the scope and essence of the embodiments of the present application shall be within the scope of the embodiments of the present application.

Claims

1. A data export method, characterized by, The application is applied to a first terminal connected with a first service node, and the method comprises: obtaining a query instruction for a to-be-queried object; generating a configuration interface according to the query instruction; obtaining data query content from the configuration interface; converting the data query content into a data operation instruction; obtaining a target query result from a preset database through the first service node according to the data operation instruction; generating a target storage object corresponding to the to-be-queried object through the first service node according to the target query result, and adding the target storage object into a first node resource corresponding to the first service node; obtaining an export instruction for the to-be-queried object; exporting the target storage object from the first node resource according to the export instruction; wherein, the obtaining of the target query result from the preset database through the first service node according to the data operation instruction comprises: identifying a data operation element according to the data operation instruction; obtaining a first node resource corresponding to the first service node and querying the data operation element in the first node resource; after the generation of the configuration interface according to the query instruction, the method further comprises: obtaining a node cluster corresponding to the first service node, the node cluster comprising the first service node and at least one second service node; generating a second synchronization instruction according to the to-be-queried object, and sending the second synchronization instruction to the second service node through the first service node, the second synchronization instruction being used to instruct the second service node to obtain a reference storage object, the reference storage object being a storage object corresponding to the to-be-queried object in a second node resource of the second service node.

2. The method of claim 1, wherein, The data operation instruction comprises a database connection instruction, a query operation instruction and a data processing instruction, and the obtaining of the target query result from the preset database through the first service node according to the data operation instruction comprises: establishing a connection with a preset database through the first service node according to the database connection instruction; obtaining an initial query result from the preset database through the first service node according to the query operation instruction; converting the initial query result into a target query result satisfying a preset storage structure through the first service node according to the data processing instruction.

3. The method of claim 1, wherein, The obtaining of the target query result from the preset database through the first service node according to the data operation instruction further comprises: if a first operation element in the data operation element is queried from the first node resource, obtaining a first operation instruction corresponding to the first operation element from the data operation instruction, and obtaining a first query result in the first node resource according to the first operation instruction; if a second operation element in the data operation element is not queried from the first node resource, obtaining a second operation instruction corresponding to the second operation element from the data operation instruction, and obtaining a second query result from a preset database through the first service node according to the second operation instruction.

4. The method of claim 3, wherein, If the second operation element in the data operation elements is not queried from the first node resource, a second operation instruction corresponding to the second operation element is acquired from the data operation instruction, and the second operation instruction includes: If the second operation element in the data operation elements is not queried from the first node resource, a node cluster corresponding to the first service node is acquired, and the node cluster includes the first service node and at least one second service node; According to the second operation element, a first synchronization instruction is generated, and the first synchronization instruction is sent to the second service node through the first service node, and the first synchronization instruction is used to instruct the second service node to acquire a third query result corresponding to the second operation element from a second node resource of the second service node; The third query result returned by the second service node is received through the first service node, and the third query result is used to update the first node resource to obtain a new first node resource; If the second operation element is not queried from the new first node resource, a second operation instruction corresponding to the second operation element is acquired from the data operation instruction.

5. The method of claim 1, wherein, After the configuration interface is generated according to the query instruction, the method further includes: The reference storage object returned by the second service node is received through the first service node; The reference storage object is displayed in the configuration interface.

6. The method according to any one of claims 1 to 5, characterized in that, After the target storage object is added into the first node resource corresponding to the first service node, the method further includes: An update event of the preset database is acquired through the first service node; A changed data element is determined from the update event, and a target data corresponding to the changed data element is determined from the first node resource; The target data is deleted from the first node resource; Or, new data corresponding to the changed data element is determined from the update event, and the target data is updated by using the new data.

7. The method according to any one of claims 1 to 5, characterized in that, The data query content is converted into a data operation instruction, including: A preset delimiter is acquired, and the delimiter is used to divide query contents corresponding to different query tables; According to the delimiter, at least one target query table and target query content corresponding to the target query table are acquired from the data query content; The target query content is converted into a data operation instruction.

8. A data export apparatus characterized by comprising: The data export device is applied to a first terminal, the first terminal is connected with a first service node, and the data export device includes: An acquisition module is configured to acquire a query instruction for a to-be-queried object; A generation module is configured to generate a configuration interface according to the query instruction; The acquisition module is further configured to acquire data query content from the configuration interface; A conversion module is configured to convert the data query content into a data operation instruction; The query module is configured to acquire a target query result from a preset database according to the data operation instruction through the first service node, and generate a target storage object corresponding to the to-be-queried object according to the target query result through the first service node, and add the target storage object into a first node resource corresponding to the first service node; The acquisition module is further configured to acquire an export instruction for the to-be-queried object; The export module is configured to export the target storage object from the first node resource according to the export instruction; The query module is configured to acquire a target query result from a preset database according to the data operation instruction through the first service node, and generate a target storage object corresponding to the to-be-queried object according to the target query result through the first service node, and add the target storage object into a first node resource corresponding to the first service node; According to the data operation instruction, a data operation element is identified; The first node resource corresponding to the first service node is acquired, and the data operation element is queried in the first node resource; The data export device is further configured to: Acquire a node cluster corresponding to the first service node, the node cluster including the first service node and at least one second service node; According to the to-be-queried object, a second synchronization instruction is generated, and the second synchronization instruction is sent to the second service node through the first service node, the second synchronization instruction being used to instruct the second service node to acquire a reference storage object, the reference storage object being a storage object corresponding to the to-be-queried object in a second node resource of the second service node.

9. An electronic device, comprising: The electronic device includes a memory, a processor, a program stored on the memory and executable on the processor, and a data bus for realizing connection communication between the processor and the memory, and the program is executed by the processor to realize the steps of the data export method in any one of claims 1 to 7.

10. A storage medium, the storage medium being a computer-readable storage medium for computer-readable storage, characterized in that, The storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to realize the steps of the data export method in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Data exporting method and apparatus

    CN106708854A

  • Multi-database data processing method and device, computer equipment and storage medium

    CN109947789A