Data source directory update synchronization method and device, storage medium and program product

Generate and send data source directory update information to the server through the terminal device, solving the problem of high update cost of data source directory of the distributed SQL query engine, and achieving efficient updates without service stagnation.

CN120336337APending Publication Date: 2025-07-18CHINA UNITED NETWORK COMM GRP CO LTD +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510330105.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-19
Publication Date
2025-07-18

AI Technical Summary

Technical Problem

In the prior art, the data source directory update of the distributed SQL query engine requires the data query service to be stopped, resulting in high configuration update costs.

Method used

The data source directory update information is generated through the terminal device and sent to the server through the REST interface for updates to ensure that the data source directory of the terminal device and the server is consistent, and the coordinator is synchronized to multiple work nodes.

Benefits of technology

The data source directory configuration update of the distributed SQL query engine is implemented without stopping services, which reduces the update cost and improves the update efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120336337A_ABST
    Figure CN120336337A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a data source directory update synchronization method and device, a storage medium and a program product, which are applied to a terminal device, after an original data source directory is obtained and stored in a database, data source directory update information is generated in response to an update operation on a data source, and then the update synchronization of the data source directory is realized on the basis of the data source directory update information. Updating an original data source directory in the database to obtain a first updated data source directory; the terminal device sends the data source directory update information to the server by calling the REST interface, so that the server updates the original data source directory according to the data source directory update information to generate a second updated data source directory; the data source in the first updating data source catalog is consistent with the data source in the second updating data source catalog, that is, synchronous updating of the data source catalog is completed; the problem that the data source directory configuration updating cost of the distributed SQL query engine is high is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of big data technology, and in particular, to a method, device, storage medium, and program product for updating and synchronizing a data source directory. Background Art

[0002] With the continuous expansion and accumulation of internal and external data sources within an enterprise, data presents significant characteristics such as large scale, diversity, and uneven quality. Based on the development of database technology and big data technology, distributed SQL query engines provide new ideas for processing massive data.

[0003] In the prior art, a distributed SQL query engine is deployed in a server. To process massive data through the distributed SQL query engine, a corresponding data source directory file is configured for the distributed SQL query engine. Then, a user accesses the server through a terminal device to use the data query service.

[0004] However, based on the solution provided by the prior art, when the data source directory file needs to be updated, the data query service needs to be stopped, and then the data source directory file is updated. After that, the updated data source directory file is reconfigured for the distributed SQL query engine, and the data query service is restarted to provide the data query service to users again. The solution of the prior art results in a high cost for updating the data source directory configuration of the distributed SQL query engine. Summary of the Invention

[0005] Embodiments of this application provide a method, device, storage medium, and program product for updating and synchronizing a data source directory to solve the problem of high cost for updating the data source directory configuration of a distributed SQL query engine.

[0006] In a first aspect, an embodiment of this application provides a method for updating and synchronizing a data source directory, which is applied to a terminal device and includes: obtaining an original data source directory; storing the original data source directory in a database of the terminal device; generating data source directory update information in response to an update operation on a data source corresponding to the original data source directory; updating the original data source directory in the database according to the data source directory update information to obtain a first updated data source directory; and calling a Representational State Transfer (REST) interface to send the data source directory update information to a server so that the server updates the original data source directory according to the data source directory update information to generate a second updated data source directory, where the data sources in the first updated data source directory are the same as the data sources in the second updated data source directory.

[0007] In a possible implementation, before invoking the Representational State Transfer (REST) interface of the presentation layer to send the data source directory update information to the server so that the server updates the original data source directory according to the data source directory update information to generate a second updated data source directory, the method further includes: according to the first updated data source directory and the original data source directory, invoking a pre-REST interface to determine the update type of the update operation; according to the update type, determining the Representational State Transfer (REST) interface invoked by the terminal device, and generating corresponding interface call information.

[0008] In a possible implementation, the update type includes a new data source type, a deleted data source type, and a modified data source type; determining the Representational State Transfer (REST) interface of the presentation layer invoked by the terminal device according to the update type, and generating corresponding interface call information includes: if the update type is the new data source type, determining that the REST interface of the presentation layer invoked by the terminal device is a first type of REST interface, and generating first interface call information; correspondingly, invoking the REST interface of the presentation layer to send the data source directory update information to the server, so that the server updates the original data source directory according to the data source directory update information to generate a second updated data source directory, includes: according to the first interface call information, invoking the first type of REST interface to send the data source directory update information to the server, so that the server adds a data source to the original data source directory according to the data source directory update information to obtain the second updated data source directory; if the update type is the deleted data source type, determining that the REST interface of the presentation layer invoked by the terminal device is a second type of REST interface, and generating second interface call information; correspondingly, invoking the REST interface of the presentation layer to send the data source directory update information to the server, so that the server updates the original data source directory according to the data source directory update information to generate a second updated data source directory, includes: according to the second interface call information, invoking the second type of REST interface to send the data source directory update information to the server, so that the server deletes a data source from the original data source directory according to the data source directory update information to obtain the second updated data source directory; if the update type is the modified data source type, determining that the REST interface of the presentation layer invoked by the terminal device is a third type of REST interface, and generating third interface call information; correspondingly, invoking the REST interface of the presentation layer to send the data source directory update information to the server, so that the server updates the original data source directory according to the data source directory update information to generate a second updated data source directory, includes: according to the third interface call information, invoking the third type of REST interface to send the data source directory update information to the server, so that the server modifies a data source in the original data source directory according to the data source directory update information to obtain the second updated data source directory.

[0009] In a possible implementation, a coordinator and multiple worker nodes are deployed in the server, and the second updated data source directory is stored in the coordinator; after calling the Representational State Transfer (REST) interface to send the data source directory update information to the server so that the server updates the original data source directory according to the data source directory update information to generate the second updated data source directory, the method further includes: causing the coordinator to synchronize the second updated data source directory to the multiple worker nodes by calling the synchronization REST interface, so that the multiple worker nodes update the original data source directory to the second updated data source directory and execute tasks according to the second updated data source directory.

[0010] In a possible implementation, after calling the Representational State Transfer (REST) interface to send the data source directory update information to the server so that the server updates the original data source directory according to the data source directory update information to generate the second updated data source directory, the method further includes: generating a data source query request in response to a query operation for a target data source; wherein, the data source query request includes a first data source identifier corresponding to the target data source; judging whether the first updated data source directory includes the first data source identifier according to the data source query request and the first updated data source directory; if the first data source identifier is not included, generating and displaying an invalid data query message; if the first data source identifier is included, determining corresponding target data source information from the first updated data source directory according to the first data source identifier; generating query connection information according to the target data source information; sending the query connection information to the server so that the server determines a second data source identifier corresponding to the target data source from the second updated data source directory according to the query connection information, so that the server queries the target data of the target data source according to the second data source identifier; receiving the target data sent by the server so that the display unit of the terminal device displays the target data.

[0011] Second aspect, an embodiment of the present application provides a method for updating and synchronizing a data source directory, which is applied to a server and includes: receiving data source directory update information sent by a terminal device calling a Representational State Transfer (REST) interface; the data source directory update information is generated by the terminal device in response to an update operation on a data source corresponding to an original data source directory; the original data source directory is obtained by the terminal device and stored in a database of the terminal device; the terminal device updates the original data source directory in the database according to the data source directory update information to obtain a first updated data source directory; updating the original data source directory according to the data source directory update information to generate a second updated data source directory; wherein, data sources in the first updated data source directory are the same as data sources in the second updated data source directory.

[0012] Third aspect, an embodiment of the present application provides a data source directory update synchronization device, which is applied to a terminal device and includes:

[0013] A receiving module, configured to obtain an original data source directory;

[0014] A processing module, configured to store the original data source directory in a database of the terminal device; generate data source directory update information in response to an update operation on a data source corresponding to the original data source directory; update the original data source directory in the database according to the data source directory update information to obtain a first updated data source directory;

[0015] A sending module, configured to call a Representational State Transfer (REST) interface to send the data source directory update information to a server, so that the server updates the original data source directory according to the data source directory update information to generate a second updated data source directory; wherein, data sources in the first updated data source directory are the same as data sources in the second updated data source directory.

[0016] In a possible implementation manner, before calling the Representational State Transfer (REST) interface to send the data source directory update information to the server, so that the server updates the original data source directory according to the data source directory update information to generate a second updated data source directory, the device is further configured to: determine an update type of the update operation according to the first updated data source directory and the original data source directory by calling a preposed REST interface; determine the Representational State Transfer (REST) interface called by the terminal device according to the update type, and generate corresponding interface call information.

[0017] In a possible implementation manner, the update type includes a new data source type, a delete data source type, and a modify data source type; when the device determines the Representational State Transfer (REST) interface called by the terminal device according to the update type and generates corresponding interface call information, it specifically is used for: if the update type is the new data source type, determining that the REST interface called by the terminal device is a first type of REST interface, and generating first interface call information; correspondingly, when the sending module calls the Representational State Transfer (REST) interface to send the data source directory update information to the server so that the server updates the original data source directory according to the data source directory update information to generate a second updated data source directory, it specifically is used for: according to the first interface call information, calling the first type of REST interface to send the data source directory update information to the server so that the server adds a data source to the original data source directory according to the data source directory update information to obtain the second updated data source directory; if the update type is the delete data source type, determining that the REST interface called by the terminal device is a second type of REST interface, and generating second interface call information; correspondingly, when the sending module calls the Representational State Transfer (REST) interface to send the data source directory update information to the server so that the server updates the original data source directory according to the data source directory update information to generate a second updated data source directory, it specifically is used for: according to the second interface call information, calling the second type of REST interface to send the data source directory update information to the server so that the server deletes a data source from the original data source directory according to the data source directory update information to obtain the second updated data source directory; if the update type is the modify data source type, determining that the REST interface called by the terminal device is a third type of REST interface, and generating third interface call information; correspondingly, when the sending module calls the Representational State Transfer (REST) interface to send the data source directory update information to the server so that the server updates the original data source directory according to the data source directory update information to generate a second updated data source directory, it specifically is used for: according to the third interface call information, calling the third type of REST interface to send the data source directory update information to the server so that the server modifies a data source in the original data source directory according to the data source directory update information to obtain the second updated data source directory.

[0018] In a possible implementation, a coordinator and multiple worker nodes are deployed in the server, and the second updated data source directory is stored in the coordinator; after the REST interface of the Representational State Transfer (REST) is called to send the data source directory update information to the server so that the server updates the original data source directory according to the data source directory update information to generate a second updated data source directory, the apparatus is further configured to: cause the coordinator to synchronize the second updated data source directory to the multiple worker nodes by calling a synchronization REST interface, so that the multiple worker nodes update the original data source directory to the second updated data source directory and execute tasks according to the second updated data source directory.

[0019] In a possible implementation, after the REST interface of the Representational State Transfer (REST) is called to send the data source directory update information to the server so that the server updates the original data source directory according to the data source directory update information to generate a second updated data source directory, the apparatus is further configured to: in response to a query operation for a target data source, generate a data source query request; wherein the data source query request includes a first data source identifier corresponding to the target data source; determine whether the first updated data source directory includes the first data source identifier according to the data source query request and the first updated data source directory; if the first data source identifier is not included, generate and display an invalid data query message; if the first data source identifier is included, determine corresponding target data source information from the first updated data source directory according to the first data source identifier; generate query connection information according to the target data source information; send the query connection information to the server so that the server determines a second data source identifier corresponding to the target data source from the second updated data source directory according to the query connection information, so that the server queries the target data according to the second data source identifier; receive the target data sent by the server so that a display unit of the terminal device displays the target data.

[0020] Fourthly, an embodiment of the present application provides a data source directory update and synchronization apparatus, which is applied to a server and includes:

[0021] A second receiving module, configured to receive the data source directory update information sent by the terminal device when calling the REST interface of the Representational State Transfer (REST); the data source directory update information is generated by the terminal device in response to an update operation for a data source corresponding to the original data source directory; the original data source directory is obtained and stored in a database of the terminal device by the terminal device; the terminal device updates the original data source directory in the database according to the data source directory update information to obtain a first updated data source directory;

[0022] A second processing module, configured to update the original data source directory according to the data source directory update information to generate a second updated data source directory; wherein, the data sources in the first updated data source directory are the same as the data sources in the second updated data source directory.

[0023] In a fifth aspect, an embodiment of the present application provides an electronic device, including: a memory, a processor;

[0024] The memory stores computer-executable instructions;

[0025] The processor executes the computer-executable instructions stored in the memory, so that the processor executes the above first aspect and / or various possible implementation manners of the first aspect.

[0026] In a sixth aspect, an embodiment of the present application provides a server, including: a memory, a processor;

[0027] The memory stores computer-executable instructions;

[0028] The processor executes the computer-executable instructions stored in the memory, so that the processor executes the possible implementation manner of the above second aspect.

[0029] In a seventh aspect, an embodiment of the present application provides a computer-readable storage medium, in which computer-executable instructions are stored, and when the computer-executable instructions are executed by a processor, they are used to implement the above first aspect and / or various possible implementation manners of the first aspect, and are also used to implement the possible implementation manner of the above second aspect.

[0030] In an eighth aspect, an embodiment of the present application provides a computer program product, including a computer program, and when the computer program is executed by a processor, it implements the above first aspect and / or various possible implementation manners of the first aspect, and is also used to implement the possible implementation manner of the above second aspect.

[0031] The data source directory update and synchronization method, device, storage medium and program product provided by the embodiments of the present application are applied to a terminal device. After obtaining the original data source directory and storing it in a database, in response to a user's update operation on the data source, corresponding data source directory update information can be generated. Then, based on the data source directory update information, the original data source directory in the database can be updated to obtain a first updated data source directory. At the same time, the terminal device sends the data source directory update information to the server by calling a REST interface, so that the server updates the original data source directory according to the data source directory update information to generate a second updated data source directory. Furthermore, it is realized that the data sources in the first updated data source directory are consistent with the data sources in the second updated data source directory, that is, the synchronous update of the data source directory is completed. Since the distributed SQL query engine provided by the embodiments of the present application is deployed with a REST interface, the problem of high cost for configuring and updating the data source directory of the distributed SQL query engine caused by the existing technical solutions is solved by calling the REST interface to update the original data source directory. Brief Description of the Drawings

[0032] The drawings here are incorporated into the specification and form a part of this specification, showing embodiments consistent with the present application, and are used together with the specification to explain the principles of the present application.

[0033] Figure 1 It is a schematic diagram of the scenario of the data source directory update and synchronization method provided by the present application;

[0034] Figure 2 It is a flowchart of the data source directory update and synchronization method provided by an embodiment of the present application;

[0035] Figure 3 It is a flowchart of the data source directory update and synchronization method provided by another embodiment of the present application;

[0036] Figure 4 It is a schematic diagram of the structure of the data source directory update and synchronization device provided by an embodiment of the present application;

[0037] Figure 5 It is a schematic diagram of the structure of the electronic device provided by the present application.

[0038] Through the above drawings, the clear embodiments of the present application have been shown, and there will be more detailed descriptions later. These drawings and text descriptions are not intended to limit the scope of the concept of the present application in any way, but to explain the concept of the present application to those skilled in the art by referring to specific embodiments. Detailed Embodiments

[0039] Exemplary embodiments will be described in detail herein, and examples thereof are shown in the accompanying drawings. When the following description refers to the accompanying drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. On the contrary, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.

[0040] In the technical solution of the present application, the collection, storage, use, processing, transmission, provision, and disclosure of user personal information and data involved all comply with the provisions of relevant laws and regulations and do not violate public order and good customs.

[0041] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in the present application are all information and data authorized by the user or fully authorized by all parties. Moreover, the collection, use, and processing of relevant data need to comply with the relevant laws, regulations, and standards of the relevant region, and a corresponding operation entry is provided for the user to choose to authorize or refuse.

[0042] With the continuous expansion and accumulation of internal and external data sources within enterprises, data exhibits significant characteristics such as large scale, diversity, and uneven quality. Based on the development of database technology and big data technology, distributed SQL query engines provide new ideas for processing massive data. In the prior art, distributed SQL query engines are deployed in servers. To process massive data through distributed SQL query engines, corresponding data source directory files are configured for the distributed SQL query engines. Then, users access the server through terminal devices to use the data query service. However, based on the solution provided by the prior art, when the data source directory file needs to be updated, the data query service needs to be stopped, and then the data source directory file is updated. After that, the updated data source directory file is reconfigured for the distributed SQL query engine, and the data query service is restarted to provide the data query service for users again. Therefore, the solution of the prior art leads to the problem of high cost for updating the data source directory configuration of the distributed SQL query engine.

[0043] The application scenarios of the embodiments of the present application will be explained below:

[0044] The technical solution of the present application and how the technical solution of the present application solves the above technical problems will be described in detail below with specific embodiments. These several specific embodiments below can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below with reference to the accompanying drawings.

[0045] Figure 1 This is a schematic diagram of the scenario for the data source directory update synchronization method provided by this application. As Figure 1 shown, the specific application scenario of this application is a scenario where a terminal device synchronizes and updates a data source to a server, thereby realizing the synchronization and update of the data source directory. The execution subject of the method provided by the embodiments of this application can be an electronic control unit, an electronic device, or a terminal device. Taking the terminal device as the execution subject for illustration, a distributed SQL query engine is deployed in the server. After the terminal device obtains the original data source directory and stores it in the database, in response to the user's update operation on the data source, the corresponding data source directory update information can be generated. Then, based on the data source directory update information, the original data source directory in the database can be updated to obtain the first updated data source directory. At the same time, the data source directory update information is sent to the server, and then the server calls the Representational State Transfer interface (hereinafter referred to as the REST interface) to update the original data source directory according to the data source directory update information to generate the second updated data source directory. Among them, the data sources in the first updated data source directory are the same as those in the second updated data source directory, that is, the synchronization and update of the data source directory are completed.

[0046] Figure 2 This is a flowchart of the data source directory update synchronization method provided by an embodiment of this application. As Figure 2 shown, the execution subject of the data source directory update synchronization method provided by this embodiment can be an electronic control unit, an electronic device, or a terminal device. Exemplarily, this embodiment takes the terminal device as the execution subject of the method of this embodiment for illustration. The data source directory update synchronization method provided by this embodiment includes the following steps:

[0047] Step S101, obtain the original data source directory.

[0048] Step S102, store the original data source directory in the database of the terminal device.

[0049] Exemplarily, a distributed SQL query engine is deployed in the server. The original data source directory stored in the server is used to provide a query basis for the distributed SQL query engine. That is, in response to the data source query request sent by the terminal device, the server calls the distributed SQL query engine to perform data query according to the data sources in the original data source directory, and then sends the data query result to the terminal device.

[0050] Exemplarily, the terminal device obtains the original data source directory and stores the original data source directory in the database of the terminal device, realizing that the terminal device and the server have the same original data source directory.

[0051] Step S103: Generate data source directory update information in response to an update operation on the data source corresponding to the original data source directory.

[0052] Step S104: Update the original data source directory in the database according to the data source directory update information to obtain a first updated data source directory.

[0053] Exemplarily, the terminal device generates data source directory update information in response to a user's update operation on the data source corresponding to the original data source directory, such as modifying, deleting, or adding a data source in the original data source directory. Further, the terminal device updates the original data source directory in the database according to the data source directory update information, and then a first updated data source directory can be obtained.

[0054] Step S105: Invoke the Representational State Transfer (REST) interface to send the data source directory update information to the server, so that the server updates the original data source directory according to the data source directory update information to generate a second updated data source directory; wherein, the data sources in the first updated data source directory are the same as those in the second updated data source directory.

[0055] Exemplarily, for the distributed SQL query engine deployed in the server, the method provided in the embodiments of the present application further compiles and develops the distributed SQL query engine on the basis of the distributed SQL query engine in the existing technical solution, so that the distributed SQL query engine provided in the embodiments of the present application is deployed with a REST interface.

[0056] Exemplarily, after the terminal device generates the data source directory update information, the terminal device sends the data source directory update information to the server by invoking the REST interface, and then the server updates the original data source directory according to the data source directory update information to generate a second updated data source directory, thereby realizing that the data sources in the first updated data source directory are the same as those in the second updated data source directory, that is, the synchronous update of the data source directory is completed.

[0057] The method provided in this embodiment is applied to a terminal device. After obtaining the original data source directory and storing it in a database, in response to a user's update operation on the data source, the corresponding data source directory update information can be generated. Then, based on the data source directory update information, the original data source directory in the database can be updated to obtain the first updated data source directory. At the same time, the terminal device sends the data source directory update information to the server by calling the REST interface, so that the server updates the original data source directory according to the data source directory update information to generate the second updated data source directory. Thus, it is realized that the data sources in the first updated data source directory are consistent with the data sources in the second updated data source directory, that is, the synchronous update of the data source directory is completed. Since the distributed SQL query engine provided in the embodiment of the present application is deployed with a REST interface, the problem of high cost for configuring and updating the data source directory of the distributed SQL query engine caused by the solution of the prior art is solved by calling the REST interface to update the original data source directory.

[0058] Further, a coordinator and multiple worker nodes are deployed in the server, that is, a coordinator and multiple worker nodes are deployed in the distributed SQL query engine, and the second updated data source directory is stored in the coordinator. Then, after calling the Representational State Transfer (REST) interface to send the data source directory update information to the server so that the server updates the original data source directory according to the data source directory update information to generate the second updated data source directory, the method provided in the embodiment of the present application further includes: enabling the coordinator to synchronize the second updated data source directory to multiple worker nodes by calling the synchronization REST interface, so that the multiple worker nodes update the original data source directory to the second updated data source directory and execute tasks according to the second updated data source directory.

[0059] Specifically, the coordinator is used to receive and process the data query request sent by the terminal device and send the data query result to the terminal device. Further, processing the data query request sent by the terminal device includes generating a data query instruction according to the data query request and sending the data query instruction to the worker node, so that the worker node executes the data query instruction to obtain the data query result and receives the data query result sent by the worker node. Among them, the operation of both the coordinator and the worker node depends on the data source directory with consistent data sources. Then, after the terminal device enables the server to update the original data source directory to generate the second updated data source directory, the synchronization configuration of the second updated data source directory is immediately completed in the coordinator. Then, the coordinator synchronizes the second updated data source directory to multiple worker nodes by calling the synchronization REST interface, so that the multiple worker nodes update the original data source directory to the second updated data source directory and execute tasks according to the second updated data source directory.

[0060] Further, after invoking the Representational State Transfer (REST) interface of the presentation layer to send the data source directory update information to the server so that the server updates the original data source directory according to the data source directory update information to generate a second updated data source directory, the method provided by the embodiments of the present application further includes: in response to a query operation for a target data source, generating a data source query request; wherein, the data source query request includes a first data source identifier corresponding to the target data source; judging whether the first updated data source directory includes the first data source identifier according to the data source query request and the first updated data source directory; if the first updated data source directory does not include the first data source identifier, generating and displaying an invalid data query message; if the first updated data source directory includes the first data source identifier, determining corresponding target data source information from the first updated data source directory according to the first data source identifier; generating query connection information according to the target data source information; sending the query connection information to the server so that the server determines a second data source identifier corresponding to the target data source from the second updated data source directory according to the query connection information, so that the server queries the target data of the target data source according to the second data source identifier; receiving the target data sent by the server so that the display unit of the terminal device displays the target data.

[0061] Exemplarily, after completing the synchronous update of the original data source directory, the terminal device immediately responds to the user's query operation for the target data source to generate a data source query request; wherein, the data source query request includes a first data source identifier corresponding to the target data source; furthermore, the terminal device judges whether the first updated data source directory includes the first data source identifier according to the data source query request; if the first updated data source directory does not include the first data source identifier, the terminal device generates and displays an invalid data query message; if the first updated data source directory includes the first data source identifier, the terminal device determines corresponding target data source information from the first updated data source directory according to the first data source identifier; furthermore, the terminal device generates query connection information according to the target data source information, such as a data source cluster identifier and a database identifier; furthermore, the terminal device sends the query connection information to the server so that the server determines a second data source identifier corresponding to the target data source from the second updated data source directory according to the query connection information, so that the server queries the target data of the target data source according to the second data source identifier; furthermore, the terminal device receives the target data sent by the server so that the display unit of the terminal device displays the target data, that is, the data query service provided to the user is completed.

[0062] Figure 3 The flowchart of the data source directory update synchronization method provided by another embodiment of the present application is as Figure 3 shown. The data source directory update synchronization method provided in this embodiment is in Figure 2Based on the data source directory update and synchronization method provided by the illustrated embodiment and further refined, the data source directory update and synchronization method provided by this embodiment is applied to a terminal device and includes the following steps:

[0063] Step S201, obtain the original data source directory.

[0064] Step S202, store the original data source directory in the database of the terminal device.

[0065] Step S203, in response to an update operation on the data source corresponding to the original data source directory, generate data source directory update information.

[0066] Step S204, update the original data source directory in the database according to the data source directory update information to obtain a first updated data source directory.

[0067] Step S205, according to the first updated data source directory and the original data source directory, call the pre - REST interface to determine the update type of the update operation.

[0068] Step S206, according to the update type, determine the Representational State Transfer (REST) interface called by the terminal device and generate corresponding interface call information.

[0069] Exemplarily, after completing the update of the original data source directory in the database to obtain a first updated data source directory, the terminal device calls the pre - REST interface to compare the first updated data source directory with the original data source directory, and then determines the update changes of the first updated data source directory relative to the original data source directory, and further obtains the corresponding update type.

[0070] Further, after obtaining the update type, the terminal device immediately determines the REST interface called by the terminal device according to the update type and generates corresponding interface call information. Specifically, for example, if the update type is the new data source type, it is determined that the Representational State Transfer (REST) interface called by the terminal device is the first - type REST interface and the first interface call information is generated; if the update type is the delete data source type, it is determined that the Representational State Transfer (REST) interface called by the terminal device is the second - type REST interface and the second interface call information is generated; if the update type is the modify data source type, it is determined that the Representational State Transfer (REST) interface called by the terminal device is the third - type REST interface and the third interface call information is generated.

[0071] Furthermore, before determining the Representational State Transfer (REST) interface called by the terminal device according to the update type and generating the corresponding interface call information, the method provided by the embodiments of the present application further includes: obtaining a preset time recording period; recording the update types of the update operations within the preset time recording period to obtain a first operation count for the new data source type, a second operation count for the deleted data source type, and a third operation count for the modified data source type; determining a first deployment quantity of the first type of REST interface according to the first operation count; determining a second deployment quantity of the second type of REST interface according to the second operation count; and determining a third deployment quantity of the third type of REST interface according to the third operation count.

[0072] Exemplarily, the preset time recording period includes a preset time recording period with a daily cycle, a preset time recording period with a weekly cycle, a preset time recording period with a quarterly cycle, a preset time recording period with an annual cycle, and a preset time recording period with a cycle from the start time to the end time of the task. Further, based on the preset time recording period, the terminal device records the update types of the update operations within the preset time recording period to obtain a first operation count for the new data source type, a second operation count for the deleted data source type, and a third operation count for the modified data source type.

[0073] Further, according to the first operation count, the second operation count, and the third operation count, the total operation count is obtained, and the total deployment quantity of the deployed REST interfaces is obtained. Further, the ratio of the first operation count to the total operation count is multiplied by the total deployment quantity of the REST interfaces to obtain the first deployment quantity of the first type of REST interface. Similarly, the ratio of the second operation count to the total operation count is multiplied by the total deployment quantity of the REST interfaces to obtain the second deployment quantity of the second type of REST interface. The ratio of the third operation count to the total operation count is multiplied by the total deployment quantity of the REST interfaces to obtain the third deployment quantity of the third type of REST interface, improving the utilization rate of the REST interfaces and further reducing the problem of high update cost for the data source directory configuration of the distributed SQL query engine.

[0074] Step S207: Call the Representational State Transfer (REST) interface to send the data source directory update information to the server, so that the server updates the original data source directory according to the data source directory update information to generate a second updated data source directory, where the data sources in the first updated data source directory are the same as those in the second updated data source directory.

[0075] Exemplarily, based on the REST interface called by the terminal device determined in step S206 and the corresponding interface call information generated, the terminal device calls the corresponding Representational State Transfer (REST) interface according to the interface call information, and sends the data source directory update information to the server, so that the server updates the original data source directory according to the data source directory update information to generate a second updated data source directory.

[0076] Specifically, for example, if the Representational State Transfer (REST) interface is a first type of REST interface, then according to the first interface call information, the first type of REST interface is called, and the data source directory update information is sent to the server, so that the server adds a data source to the original data source directory according to the data source directory update information to obtain a second updated data source directory; if the Representational State Transfer (REST) interface is a second type of REST interface, then according to the second interface call information, the second type of REST interface is called, and the data source directory update information is sent to the server, so that the server deletes a data source from the original data source directory according to the data source directory update information to obtain a second updated data source directory; if the Representational State Transfer (REST) interface is a third type of REST interface, then according to the third interface call information, the third type of REST interface is called, and the data source directory update information is sent to the server, so that the server modifies a data source in the original data source directory according to the data source directory update information to obtain a second updated data source directory.

[0077] In this embodiment, the implementation manners of steps S201 - S204 are the same as those of steps S101 - S104 in the embodiment Figure 2 shown in this application, and will not be elaborated herein one by one.

[0078] A data source directory update and synchronization method provided by another embodiment of this application, which is applied to a server, includes the following steps:

[0079] Step S301, receiving the data source directory update information sent by the terminal device calling the Representational State Transfer (REST) interface; the data source directory update information is generated by the terminal device in response to an update operation on the data source corresponding to the original data source directory; the original data source directory is obtained by the terminal device and stored in the database of the terminal device; the terminal device updates the original data source directory in the database according to the data source directory update information to obtain a first updated data source directory.

[0080] Step S302, updating the original data source directory according to the data source directory update information to generate a second updated data source directory; wherein, the data sources in the first updated data source directory are the same as those in the second updated data source directory.

[0081] Exemplarily, a distributed SQL query engine is deployed in the server. For the distributed SQL query engine deployed in the server, on the basis of the distributed SQL query engine in the prior art solution, the distributed SQL query engine is further compiled and developed, so that the distributed SQL query engine provided in the embodiment of the present application is deployed with a REST interface.

[0082] Exemplarily, the data sources in the first updated data source directory are the same as those in the second updated data source directory, where the first updated data source directory is obtained by the terminal device updating the original data source directory in the database based on the data source directory update information.

[0083] Figure 4 It is a schematic structural diagram of a data source directory update and synchronization device provided by an embodiment of the present application. As Figure 4 shown, the data source directory update and synchronization device 3 provided in this embodiment is applied to a terminal device and includes:

[0084] A receiving module 31, configured to obtain an original data source directory;

[0085] A processing module 32, configured to store the original data source directory in the database of the terminal device; in response to an update operation on the data source corresponding to the original data source directory, generate data source directory update information; and update the original data source directory in the database according to the data source directory update information to obtain a first updated data source directory;

[0086] A sending module 33, configured to call a Representational State Transfer (REST) interface to send the data source directory update information to the server, so that the server updates the original data source directory according to the data source directory update information to generate a second updated data source directory; wherein, the data sources in the first updated data source directory are the same as those in the second updated data source directory.

[0087] In a possible implementation manner, before calling the Representational State Transfer (REST) interface to send the data source directory update information to the server, so that the server updates the original data source directory according to the data source directory update information to generate a second updated data source directory, the data source directory update and synchronization device 3 is further configured to: determine the update type of the update operation according to the first updated data source directory and the original data source directory by calling a pre - REST interface; determine the Representational State Transfer (REST) interface called by the terminal device according to the update type, and generate corresponding interface call information.

[0088] In a possible implementation, the update types include adding a data source type, deleting a data source type, and modifying a data source type; when the data source directory update synchronization device 3 determines the Representational State Transfer (REST) interface of the presentation layer called by the terminal device and generates corresponding interface call information according to the update type, it specifically is used as follows: If the update type is adding a data source type, it determines that the REST interface of the presentation layer called by the terminal device is the first type of REST interface, and generates the first interface call information; correspondingly, when the sending module 33 calls the REST interface of the presentation layer to send the data source directory update information to the server so that the server updates the original data source directory according to the data source directory update information to generate the second updated data source directory, it specifically is used as follows: According to the first interface call information, it calls the first type of REST interface to send the data source directory update information to the server so that the server adds a data source to the original data source directory according to the data source directory update information to obtain the second updated data source directory; If the update type is deleting a data source type, it determines that the REST interface of the presentation layer called by the terminal device is the second type of REST interface, and generates the second interface call information; correspondingly, when the sending module 33 calls the REST interface of the presentation layer to send the data source directory update information to the server so that the server updates the original data source directory according to the data source directory update information to generate the second updated data source directory, it specifically is used as follows: According to the second interface call information, it calls the second type of REST interface to send the data source directory update information to the server so that the server deletes a data source from the original data source directory according to the data source directory update information to obtain the second updated data source directory; If the update type is modifying a data source type, it determines that the REST interface of the presentation layer called by the terminal device is the third type of REST interface, and generates the third interface call information; correspondingly, when the sending module 33 calls the REST interface of the presentation layer to send the data source directory update information to the server so that the server updates the original data source directory according to the data source directory update information to generate the second updated data source directory, it specifically is used as follows: According to the third interface call information, it calls the third type of REST interface to send the data source directory update information to the server so that the server modifies a data source in the original data source directory according to the data source directory update information to obtain the second updated data source directory.

[0089] In a possible implementation, a coordinator and multiple worker nodes are deployed in the server, and the second updated data source directory is stored in the coordinator; after calling the Representational State Transfer (REST) interface to send the data source directory update information to the server so that the server updates the original data source directory according to the data source directory update information to generate the second updated data source directory, the data source directory update synchronization device 3 is further configured to: cause the coordinator to synchronize the second updated data source directory to the multiple worker nodes by calling the synchronization REST interface, so that the multiple worker nodes update the original data source directory to the second updated data source directory and execute tasks according to the second updated data source directory.

[0090] In a possible implementation, after calling the Representational State Transfer (REST) interface to send the data source directory update information to the server so that the server updates the original data source directory according to the data source directory update information to generate the second updated data source directory, the data source directory update synchronization device 3 is further configured to: in response to a query operation for a target data source, generate a data source query request; wherein, the data source query request includes a first data source identifier corresponding to the target data source; determine whether the first updated data source directory includes the first data source identifier according to the data source query request and the first updated data source directory; if the first updated data source directory does not include the first data source identifier, generate and display an invalid data query message; if the first updated data source directory includes the first data source identifier, determine corresponding target data source information from the first updated data source directory according to the first data source identifier; generate query connection information according to the target data source information; send the query connection information to the server so that the server determines a second data source identifier corresponding to the target data source from the second updated data source directory according to the query connection information, so that the server queries the target data according to the second data source identifier; receive the target data sent by the server so that the display unit of the terminal device displays the target data.

[0091] Among them, the receiving module 31, the processing module 32, and the sending module 33 are connected in sequence. The data source directory update synchronization device 3 provided in this embodiment can execute the technical solutions of the method embodiments as Figures 2 - 3 shown in any one of them. The implementation principles and technical effects are similar and will not be elaborated here.

[0092] An embodiment of the present application provides a data source directory update and synchronization device, which is applied to a server and includes: a second receiving module, configured to receive data source directory update information sent by a terminal device when calling a Representational State Transfer (REST) interface; the data source directory update information is generated by the terminal device in response to an update operation on the data source corresponding to the original data source directory; the original data source directory is obtained by the terminal device and stored in the database of the terminal device; the terminal device updates the original data source directory in the database according to the data source directory update information to obtain a first updated data source directory.

[0093] A second processing module, configured to update the original data source directory according to the data source directory update information to generate a second updated data source directory; wherein, the data sources in the first updated data source directory are the same as those in the second updated data source directory.

[0094] Figure 5 It is a schematic structural diagram of an electronic device provided by the present application. As Figure 5 shown, the electronic device 50 provided in this embodiment includes: at least one processor 501 and a memory 502. Optionally, the device 50 further includes a communication component 503. Among them, the processor 501, the memory 502, and the communication component 503 are connected through a bus 504.

[0095] In a specific implementation process, at least one processor 501 executes computer-executable instructions stored in the memory 502, so that at least one processor 501 executes the above-mentioned method.

[0096] For the specific implementation process of the processor 501, reference can be made to the above method embodiment, and its implementation principle and technical effects are similar, so they will not be elaborated here in this embodiment.

[0097] In the above embodiment, it should be understood that the processor may be a Central Processing Unit (CPU), or may also be other general-purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. The steps of the method disclosed in combination with the invention can be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules in the processor.

[0098] The memory may include a Random Access Memory (RAM), and may also be used for non-volatile memory (NVM), such as at least one disk memory.

[0099] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the buses in the drawings of this application are not limited to only one bus or one type of bus.

[0100] This application also provides a computer program product, including a computer program which, when executed by a processor, implements the above method.

[0101] This application also provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the above method.

[0102] The above-mentioned readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as a Static Random Access Memory (SRAM), an Electrically Erasable Programmable Read-Only Memory (EEPROM), an Erasable Programmable Read-Only Memory (EPROM), a Programmable Read-Only Memory (PROM), a Read-Only Memory (ROM), a magnetic memory, a flash memory, a disk or an optical disc. The readable storage medium can be any available medium accessible by a general-purpose or special-purpose computer.

[0103] An exemplary readable storage medium is coupled to the processor, enabling the processor to read information from and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can be located in an Application Specific Integrated Circuit (ASIC). Of course, the processor and the readable storage medium can also exist as discrete components in a device.

[0104] The division of units is merely a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the couplings or direct couplings or communication connections shown or discussed among each other can be indirect couplings or communication connections through some interfaces, devices or units, and can be in electrical, mechanical or other forms.

[0105] The units described as separate components may or may not be physically separated. The components shown as units may or may not be physical units, that is, they can be located in one place, or can be distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0106] In addition, in each embodiment of the present invention, the functional units can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit.

[0107] If the function is implemented 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 such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or a part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several 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 methods in each embodiment of the present invention. And the aforementioned storage medium includes: USB flash drives, mobile hard disks, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), magnetic disks or optical disks and other various media that can store program codes.

[0108] Those of ordinary skill in the art can understand that all or part of the steps of implementing the above method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When this program is executed, it executes the steps including the above method embodiments; and the aforementioned storage medium includes: ROM, RAM, magnetic disks or optical disks and other various media that can store program codes.

[0109] Finally, it should be noted that those skilled in the art will readily conceive of other embodiments of the present invention after considering the specification and practicing the invention disclosed herein. The present invention is intended to cover any variations, uses, or adaptations of the present invention, which follow the general principles of the present invention and include well-known common general knowledge or conventional technical means in the technical field not disclosed in the present invention. It is not limited to the exact structures described above and shown in the drawings, and various modifications and changes can be made without departing from its scope. The scope of the present invention is only limited by the appended claims.

Claims

1. A method for updating and synchronizing a data source directory, characterized in that Applied to a terminal device, the method includes: Obtain the original data source directory; Store the original data source directory in the database of the terminal device; In response to an update operation on the data source corresponding to the original data source directory, generate data source directory update information; According to the data source directory update information, update the original data source directory in the database to obtain a first updated data source directory; Call the Representational State Transfer (REST) interface to send the data source directory update information to the server, so that the server updates the original data source directory according to the data source directory update information to generate a second updated data source directory; wherein, the data sources in the first updated data source directory are the same as the data sources in the second updated data source directory.

2. The method according to claim 1, wherein Before the step of calling the Representational State Transfer (REST) interface to send the data source directory update information to the server, so that the server updates the original data source directory according to the data source directory update information to generate a second updated data source directory, the method further includes: According to the first updated data source directory and the original data source directory, call a pre-REST interface to determine the update type of the update operation; According to the update type, determine the Representational State Transfer (REST) interface called by the terminal device, and generate corresponding interface call information.

3. The method according to claim 2, wherein The update type includes a new data source type, a deleted data source type, and a modified data source type; The step of determining the Representational State Transfer (REST) interface called by the terminal device according to the update type and generating corresponding interface call information includes: If the update type is the new data source type, determine that the Representational State Transfer (REST) interface called by the terminal device is a first type of REST interface, and generate first interface call information; Correspondingly, the step of calling the Representational State Transfer (REST) interface to send the data source directory update information to the server, so that the server updates the original data source directory according to the data source directory update information to generate a second updated data source directory includes: According to the first interface call information, call the first type of REST interface to send the data source directory update information to the server, so that the server adds a new data source to the original data source directory according to the data source directory update information to obtain the second updated data source directory; If the update type is the deleted data source type, determine that the Representational State Transfer (REST) interface called by the terminal device is a second type of REST interface, and generate second interface call information; Correspondingly, the step of calling the Representational State Transfer (REST) interface to send the data source directory update information to the server, so that the server updates the original data source directory according to the data source directory update information to generate a second updated data source directory includes: According to the second interface call information, call the second type of REST interface, and send the data source directory update information to the server, so that the server deletes the data source from the original data source directory according to the data source directory update information, and obtains the second updated data source directory; If the update type is to modify the data source type, determine that the Representational State Transfer (REST) interface called by the terminal device is the third type of REST interface, and generate third interface call information; Correspondingly, the step of calling the Representational State Transfer (REST) interface and sending the data source directory update information to the server, so that the server updates the original data source directory according to the data source directory update information and generates a second updated data source directory includes: According to the third interface call information, call the third type of REST interface, and send the data source directory update information to the server, so that the server modifies the data source from the original data source directory according to the data source directory update information, and obtains the second updated data source directory.

4. The method according to claim 1, wherein A coordinator and multiple worker nodes are deployed in the server, and the second updated data source directory is stored in the coordinator; After the step of calling the Representational State Transfer (REST) interface and sending the data source directory update information to the server, so that the server updates the original data source directory according to the data source directory update information and generates a second updated data source directory, the method further includes: Cause the coordinator to synchronize the second updated data source directory to the multiple worker nodes by calling a synchronization REST interface, so that the multiple worker nodes update the original data source directory to the second updated data source directory and execute tasks according to the second updated data source directory.

5. The method according to claim 1, wherein After the step of calling the Representational State Transfer (REST) interface and sending the data source directory update information to the server, so that the server updates the original data source directory according to the data source directory update information and generates a second updated data source directory, the method further includes: In response to a query operation for a target data source, generate a data source query request; wherein, the data source query request includes a first data source identifier corresponding to the target data source; According to the data source query request and the first updated data source directory, determine whether the first updated data source directory includes the first data source identifier; If the first data source identifier is not included, generate and display an invalid data query message; If the first data source identifier is included, determine corresponding target data source information from the first updated data source directory according to the first data source identifier; Generate query connection information according to the target data source information; Send the query connection information to the server, so that the server determines a second data source identifier corresponding to the target data source from the second updated data source directory according to the query connection information, so that the server queries the target data of the target data source according to the second data source identifier. Receive the target data sent by the server, so that the display unit of the terminal device displays the target data.

6. A method for updating and synchronizing a data source directory, characterized in that, Applied to a server, the method includes: Receiving data source directory update information sent by a terminal device calling a Representational State Transfer (REST) interface; the data source directory update information is generated by the terminal device in response to an update operation on a data source corresponding to an original data source directory; the original data source directory is obtained and stored in the database of the terminal device by the terminal device; the terminal device updates the original data source directory in the database according to the data source directory update information to obtain a first updated data source directory; Updating the original data source directory according to the data source directory update information to generate a second updated data source directory; wherein, the data sources in the first updated data source directory are the same as the data sources in the second updated data source directory.

7. A data source directory update synchronization device, characterized in that, Applied to a terminal device, it includes: A receiving module, configured to obtain an original data source directory; A processing module, configured to store the original data source directory in the database of the terminal device; in response to an update operation on a data source corresponding to the original data source directory, generate data source directory update information; update the original data source directory in the database according to the data source directory update information to obtain a first updated data source directory; A sending module, configured to call a Representational State Transfer (REST) interface to send the data source directory update information to the server, so that the server updates the original data source directory according to the data source directory update information to generate a second updated data source directory; wherein, the data sources in the first updated data source directory are the same as the data sources in the second updated data source directory.

8. An electronic device, characterized in that, It includes: A processor, and a memory communicatively connected to the processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the method according to any one of claims 1 to 5, or the method according to claim 6.

9. A computer-readable storage medium, characterized in that, Computer-executable instructions are stored in the computer-readable storage medium, and when the computer-executable instructions are executed by a processor, they are used to implement the method according to any one of claims 1 to 5, and the method according to claim 6.

10. A computer program product, characterized in that, It includes a computer program, and when the computer program is executed by a processor, it implements the method according to any one of claims 1 to 5, and the method according to claim 6.