Data processing method and device and electronic equipment

By obtaining the maximum timestamp of the ES cluster and constructing a query statement, it solves the problem of users needing to write complex query statements and manually filter data, achieves efficient and accurate data query, and reduces technical thresholds and resource consumption.

CN118733900APending Publication Date: 2024-10-01BEIYIN FINANCIAL TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202410814313.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-21
Publication Date
2024-10-01

AI Technical Summary

Technical Problem

In the existing technology, the strategy of regularly synchronizing all data to the search server requires users to write complex query statements, which requires a high technical threshold, and the query results need to be manually filtered, which can easily lead to inaccuracies due to human factors.

Method used

By obtaining the maximum timestamp of the ES cluster, a query statement for querying the latest data is constructed, thereby avoiding querying the entire data set, improving query efficiency, and using Python to parse the configuration file to automatically construct a query statement, reducing the user's technical ability requirements.

Benefits of technology

Significantly reduces data transmission and processing time, ensures real-time data, reduces human errors, improves query accuracy and efficiency, and optimizes resource usage.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118733900A_ABST
    Figure CN118733900A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of data processing, in particular to a data processing method and device and electronic equipment. In the method, in response to a request instruction, a first query statement for querying a maximum timestamp is constructed based on configuration information and query conditions required for interaction with an ES cluster in the request instruction. And obtaining the maximum timestamp from the ES cluster by using the first query statement, and constructing a second query statement for querying the latest data by using the maximum timestamp. And obtaining a data set from the ES cluster by using the second ES query statement. According to the scheme, the maximum timestamp is firstly obtained, and then the latest data is queried based on the timestamp, so that the whole data set is prevented from being queried, and the query efficiency is improved. Meanwhile, due to the fact that the ES cluster provides abundant APIs and tools, the development process can be simplified. And the process of constructing and executing the ES cluster query statement is easier to implement and maintain.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and in particular to a data processing method, device and electronic device. Background Art

[0002] Currently, the business system adopts a strategy of regularly synchronizing all data to the search server (Elasticsearch, ES) cluster, that is, a full update is performed every N minutes. For those who need to obtain the latest data, they usually use a method to write a query statement in descending time order to retrieve the data in the ES cluster. However, this traditional query method has two major problems: first, it requires the query personnel to have certain programming and query development capabilities, which has a high technical threshold for many users; second, after the query results are returned, the user also needs to manually filter the latest data, which is not only time-consuming and labor-intensive, but also easy to cause inaccurate screening results due to human factors. Summary of the invention

[0003] The embodiments of the present application provide a data processing method, device and electronic device for simplifying the development process and improving query efficiency in data processing.

[0004] In a first aspect, an embodiment of the present application provides a data processing method, in which, in response to a request instruction, a first query statement for querying the maximum timestamp is constructed based on the configuration information required for interacting with the ES cluster in the request instruction and the query conditions; the first query statement is used to obtain the maximum timestamp from the ES cluster, and the maximum timestamp is used to construct a second query statement for querying the latest data; and the second ES query statement is used to obtain a data set from the ES cluster.

[0005] In the above method, by first obtaining the maximum timestamp and then querying the latest data based on this timestamp, querying the entire data set is avoided, thereby improving query efficiency. Especially when processing a large amount of data, since the latest data is queried based on the maximum timestamp, it can ensure that the acquired data is the latest, meet the real-time requirements, and significantly reduce the time for data transmission and processing. At the same time, the query statement can be flexibly adjusted according to different request instructions and query conditions to meet different data requirements. Reduce unnecessary data transmission and processing, reduce the consumption of server and network resources, and thus optimize resource usage. At the same time, since the ES cluster provides a wealth of APIs and tools, the development process can be further simplified. The process of constructing and executing ES cluster query statements is relatively simple and intuitive, easy to implement and maintain.

[0006] Optionally, the configuration information includes a URL, a user name, a password, and an index name. The first query statement for querying the maximum timestamp is constructed based on the configuration information required for interacting with the ES cluster in the request instruction and the query condition, specifically including:

[0007] Use the URL, username, and password to construct the connection string or authentication information required to establish a connection with the ES cluster;

[0008] Construct a first query statement according to the index name and the query condition.

[0009] In the above method, after receiving the query request, the server uses the configuration information to prepare for interaction with the ES cluster. The server can generate a connection string or authentication information based on the URL, username, and password. The connection string or authentication information is used in subsequent HTTP requests to ensure that the server has the right to access the ES cluster.

[0010] Optionally, the above method further includes:

[0011] Use Python to parse the configuration file to obtain historical configuration information. The configuration file is used to store the historical configuration information required to interact with the ES cluster;

[0012] A first query statement is constructed based on the historical configuration information and the query condition.

[0013] In the above method, by using Python to parse the configuration file to obtain historical configuration information, and constructing the first query statement based on the historical configuration information and query conditions, the user can modify the connection information of the ES cluster without modifying the code. When the URL, username, password or index name of the ES cluster changes, you only need to update the configuration file without redeploying or modifying the code. At the same time, using Python to parse the configuration file to obtain historical configuration information can automatically construct the query statements required to interact with the ES cluster. This reduces the requirements for the user's technical capabilities, so that the user does not need to write complex query statements, but only needs to provide query conditions, thereby improving the user experience. It avoids errors and unnecessary delays caused by manual entry of configuration information, and improves the efficiency and accuracy of queries.

[0014] Optionally, the first query statement is used to obtain the maximum timestamp from ES, and the maximum timestamp is used to construct a second query statement for querying the latest data, specifically including:

[0015] Use the connection string or authentication information to establish a connection with the ES cluster;

[0016] Send the first query statement to the ES cluster and obtain the maximum timestamp from the ES cluster;

[0017] Construct the second query statement using the maximum timestamp.

[0018] In the above method, by sending the first query statement to obtain the maximum timestamp, the server can accurately determine the range of data added since the last synchronization or query. The second query statement constructed using this maximum timestamp will only retrieve the newly added or updated data, rather than the full amount of data, thereby reducing the amount of data transmission and improving query efficiency. At the same time, by using the maximum timestamp as the query condition, it can be ensured that only data within the specified time range is retrieved, avoiding inaccuracies that may occur during manual screening. Reduce the risk of data errors or omissions due to human errors.

[0019] Optionally, the above method further includes:

[0020] According to preset rules, the data set is converted into a preset data format for display.

[0021] In the above method, by converting the data set into a preset data format for display according to preset rules, it is convenient for users to observe the data set intuitively and facilitate subsequent data analysis.

[0022] Optionally, the data set is converted into a preset data format for display according to preset rules, specifically including:

[0023] Iterate over the query data set, extracting the fields and values ​​for each document in the data set.

[0024] Convert fields and values ​​into a two-dimensional table for display, where each row represents a document and each column represents a field.

[0025] In the above method, by converting the data set into a two-dimensional table format for display, the user can quickly browse and understand the information contained in the data set.

[0026] In a second aspect, an embodiment of the present application provides a data processing device, the device comprising:

[0027] A processing module, configured to respond to a request instruction and construct a first query statement for querying a maximum timestamp based on configuration information required for interacting with the ES cluster in the request instruction and a query condition;

[0028] The transceiver module is used to obtain the maximum timestamp from the ES cluster using the first query statement, and construct a second query statement for querying the latest data using the maximum timestamp;

[0029] The transceiver module is also used to obtain a data set from the ES cluster using a second ES query statement.

[0030] In a third aspect, an embodiment of the present application provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the computer program is executed by the processor, the processor implements any one of the data processing methods in the first aspect.

[0031] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the data processing method of any one of the first aspects is implemented.

[0032] In a fifth aspect, an embodiment of the present application further provides a computer program product, including a computer program, which is executed by a processor to implement a data processing method as described in any one of the first aspects above.

[0033] The technical effects brought about by any one of the implementation methods in the second to fifth aspects can refer to the technical effects brought about by the corresponding implementation method in the first aspect, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] Figure 1 A schematic diagram of an application scenario of data processing provided in an embodiment of the present application;

[0035] Figure 2 A flow chart of a data processing method provided in an embodiment of the present application;

[0036] Figure 3 A schematic diagram illustrating the rules for filling in each field provided in an embodiment of the present application;

[0037] Figure 4 An exemplary flow chart of data processing provided in an embodiment of the present application;

[0038] Figure 5 A schematic diagram of a data processing device provided in an embodiment of the present application;

[0039] Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0040] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present application.

[0041] The application scenarios described in the embodiments of the present application are intended 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. It is known to those skilled in the art that with the emergence of new application scenarios, the technical solutions provided by the embodiments of the present application are also applicable to similar technical problems. In the description of the present application, unless otherwise specified, the meaning of "multiple" is two or more.

[0042] Currently, the business system adopts a strategy of regularly synchronizing all data to the search server (Elasticsearch, ES) cluster, that is, a full update is performed every N minutes. For those who need to obtain the latest data, they usually use a method to write a query statement in descending time order to retrieve the data in the ES cluster. However, this traditional query method has two major problems: first, it requires the query personnel to have certain programming and query development capabilities, which has a high technical threshold for many users; second, after the query results are returned, the user also needs to manually filter the latest data, which is not only time-consuming and labor-intensive, but also easy to cause inaccurate screening results due to human factors.

[0043] In order to solve the above problems, an embodiment of the present application provides a data processing method. In this method, in response to a request instruction, a first query statement for querying the maximum timestamp is constructed based on the configuration information required for interacting with the ES cluster in the request instruction and the query condition. The first query statement is used to obtain the maximum timestamp from the ES cluster, and the maximum timestamp is used to construct a second query statement for querying the latest data. Among them, the second query statement includes a filtering condition for the timestamp field, which is used to filter data with a timestamp greater than or equal to the maximum timestamp. Use the second ES query statement to obtain a data set from the ES cluster.

[0044] In this way, by first obtaining the maximum timestamp and then querying the latest data based on this timestamp, querying the entire data set is avoided, thereby improving query efficiency. Especially when processing a large amount of data, since the latest data is queried based on the maximum timestamp, it can ensure that the acquired data is the latest, meet the real-time requirements, and significantly reduce the time for data transmission and processing. At the same time, the query statement can be flexibly adjusted according to different request instructions and query conditions to meet different data requirements. Reduce unnecessary data transmission and processing, reduce the consumption of server and network resources, and thus optimize resource usage. At the same time, since the ES cluster provides a wealth of APIs and tools, the development process can be further simplified. The process of constructing and executing ES cluster query statements is relatively simple and intuitive, easy to implement and maintain.

[0045] A schematic diagram of an application scenario of an optional data processing method in an embodiment of the present application. Figure 1As shown, it includes a server 100 and a terminal 101. The server 100 and the terminal 101 can be communicatively connected through a network to implement the data processing method of the present application.

[0046] The user can use the server 100 to interact with the terminal 101 through the network, such as receiving or sending messages, etc. Various client applications can be installed on the terminal 101, such as program writing applications, web browser applications, search applications, etc.

[0047] It is understandable that in the embodiment of the present application, the server 100 can be implemented as an independent server or a server cluster composed of multiple servers. The terminal 101 can be various electronic devices with a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, desktop computers, etc.

[0048] The server 100 can be used to respond to the request instruction and construct a first query statement for querying the maximum timestamp based on the configuration information required for interacting with the ES cluster in the request instruction and the query condition. The first query statement is used to obtain the maximum timestamp from the ES cluster, and the maximum timestamp is used to construct a second query statement for querying the latest data. The second ES query statement is used to obtain a data set from the ES cluster.

[0049] It is understandable that either the terminal or the server can be used to execute the data processing method of the present application. The following is an example of the data processing method of the present application being executed by the server.

[0050] like Figure 1 As shown, a flowchart of a data processing method provided in an embodiment of the present application may specifically include the following steps.

[0051] Step S201: In response to a request instruction, a first query statement for querying a maximum timestamp is constructed based on configuration information required for interacting with an ES cluster in the request instruction and a query condition.

[0052] In an optional embodiment, the configuration information may include a uniform resource locator (URL), a user name, a password, and an index name. The server may use the URL, the user name, and the password to construct a connection string or authentication information required to establish a connection with the ES cluster. The first query statement is constructed according to the index name and the query condition.

[0053] After receiving the query request, the server uses the configuration information to prepare for interaction with the ES cluster. The server can generate a connection string or authentication information based on the URL, username, and password. The connection string or authentication information is used in subsequent HTTP requests to ensure that the server has access to the ES cluster.

[0054] After establishing a connection with the ES cluster, the server constructs a query statement based on the query conditions. The above query statement will be sent to the ES cluster to retrieve data that meets the conditions.

[0055] Optionally, the server may also use Python to parse a configuration file to obtain historical configuration information, where the configuration file is used to store historical configuration information required to interact with the ES cluster; and construct a first query statement based on the historical configuration information and the query condition.

[0056] In this way, by using Python to parse the configuration file to obtain historical configuration information, and constructing the first query statement based on the historical configuration information and query conditions, users can modify the connection information of the ES cluster without modifying the code. When the URL, username, password, or index name of the ES cluster changes, you only need to update the configuration file without redeploying or modifying the code. At the same time, using Python to parse the configuration file to obtain historical configuration information can automatically construct the query statements required to interact with the ES cluster. This reduces the requirements for user technical capabilities, so that users do not need to write complex query statements, but only need to provide query conditions, thereby improving the user experience. It avoids errors and unnecessary delays caused by manually entering configuration information, and improves the efficiency and accuracy of queries.

[0057] For example, Figure 3 As shown, the present application provides a schematic diagram of the filling rules of each field. Among them, the meaning of the field url is the request address. The filling rule is that if there are multiple nodes in the ES cluster, the addresses of each node are separated by commas. For example, the url can be http: / / 192.168.1.1:9200, http: / / 192.168.1.2:9200. The meaning of the field user is the user name. The filling rule is that the user needs to have a query condition. For example, user can be elastic. The meaning of the field password is password. There is no filling rule. For example, password can be elastic. The meaning of the field index_name is the index name. There is no filling rule. For example, password can be rpc-log. The meaning of the field condition is the query condition. The filling rule is that if there is an "and" relationship between multiple conditions, use "and" to connect, and if it is an "or" relationship, use "or" to connect. For example, condition can be password can be type=system and drive=ios-test.

[0058] The ES configuration file rules can be as follows:

[0059] [Elastic]

[0060] url=http: / / 192.168.1.1:9200,http: / / 192.168.1.2:9200

[0061] user=elastic

[0062] password=elastic

[0063] index_name=rpc-log

[0064] condition="type=system and drive=ios-test"

[0065] Step S202: Use the first query statement to obtain the maximum timestamp from the ES cluster, and use the maximum timestamp to construct a second query statement for querying the latest data.

[0066] In an optional embodiment, the server can use a connection string or authentication information to establish a connection with the ES cluster, send the first query statement to the ES cluster, and obtain the maximum timestamp from the ES cluster, and construct the second query statement using the maximum timestamp.

[0067] The second query statement will include a filter condition for the timestamp field, which is used to filter out data with a timestamp greater than or equal to the maximum timestamp, and retrieve new or updated data from the ES cluster since the last query.

[0068] The server uses the connection string or authentication information to communicate with the ES cluster to retrieve data. After the server establishes a connection with the ES cluster, the server sends the first query statement to the ES cluster. The ES cluster returns the maximum timestamp to the server. The maximum timestamp indicates the time point of the latest data in the ES cluster. After obtaining the maximum timestamp, the server uses the maximum timestamp to construct the second query statement.

[0069] In this way, by sending the first query statement to obtain the maximum timestamp, the server can accurately determine the range of data added since the last synchronization or query. The second query statement constructed using this maximum timestamp will only retrieve the newly added or updated data, rather than the full amount of data, thereby reducing the amount of data transmission and improving query efficiency. At the same time, by using the maximum timestamp as the query condition, it can be ensured that only data within the specified time range is retrieved, avoiding inaccuracies that may occur during manual screening. Reduce the risk of data errors or omissions due to human errors.

[0070] Step S203: Use the second ES query statement to obtain a data set from the ES cluster.

[0071] The server can send a second query statement to the ES cluster and obtain the data set returned by the ES cluster, that is, the data that has been added or updated since the last query.

[0072] Optionally, the server converts the data set into a preset data format for display according to preset rules, so that users can intuitively observe the data set and conduct subsequent data analysis.

[0073] For example, a two-dimensional table is an intuitive way to display data, allowing users to quickly browse and understand the information contained in a data set. The server can traverse the query data set and extract the fields and values ​​of each document in the data set. The fields and values ​​are converted into a two-dimensional table for display, where each row represents a document and each column represents a field.

[0074] like Figure 4 As shown, an exemplary flow chart of a data processing method provided in an embodiment of the present application may include the following steps:

[0075] Step S401: In response to the request instruction, use the URL, user name and password to construct a connection string or authentication information required to establish a connection with the ES cluster;

[0076] Step S402: construct a first query statement according to the index name and the query condition;

[0077] Step S403: Use the connection string or authentication information to establish a connection with the ES cluster;

[0078] Step S404: Send the first query statement to the ES cluster, and obtain the maximum timestamp from the ES cluster;

[0079] Step S405: construct a second query statement using the maximum timestamp;

[0080] Step S406: Use the second ES query statement to obtain a data set from the ES cluster;

[0081] Step S407, traverse the query data set, and extract the fields and values ​​of each document in the data set;

[0082] Step S408: Convert the fields and values ​​into a two-dimensional table for display, where each row represents a document and each column represents a field.

[0083] Figure 5 A schematic diagram of the structure of a data processing device provided in an embodiment of the present application. Figure 5 As shown, the device includes: a processing module 501 and a transceiver module 502.

[0084] Processing module 501 is used to respond to the request instruction and construct a first query statement for querying the maximum timestamp based on the configuration information required for interacting with the ES cluster in the request instruction and the query condition;

[0085] The transceiver module 502 is used to obtain the maximum timestamp from the ES cluster using the first query statement, and construct a second query statement for querying the latest data using the maximum timestamp, wherein the second query statement includes a filtering condition of the timestamp field, and is used to filter data whose timestamp is greater than or equal to the maximum timestamp;

[0086] The transceiver module 502 is further configured to use a second ES query statement to obtain a data set from the ES cluster.

[0087] Optionally, the configuration information includes a URL, a user name, a password, and an index name. Based on the configuration information required for interacting with the ES cluster in the request instruction and the query condition, a first query statement for querying the maximum timestamp is constructed. The processing module 501 is specifically used to:

[0088] Use the URL, username, and password to construct the connection string or authentication information required to establish a connection with the ES cluster;

[0089] Construct a first query statement according to the index name and the query condition.

[0090] Optionally, the processing module 501 is further used for:

[0091] Use Python to parse the configuration file to obtain historical configuration information. The configuration file is used to store the historical configuration information required to interact with the ES cluster;

[0092] A first query statement is constructed based on the historical configuration information and the query condition.

[0093] Optionally, the first query statement is used to obtain the maximum timestamp from ES, and the maximum timestamp is used to construct a second query statement for querying the latest data. The processing module 501 is specifically used for:

[0094] Use the connection string or authentication information to establish a connection with the ES cluster;

[0095] Send the first query statement to the ES cluster and obtain the maximum timestamp from the ES cluster;

[0096] Construct the second query statement using the maximum timestamp.

[0097] Optionally, the processing module 501 is further used for:

[0098] According to preset rules, the data set is converted into a preset data format for display.

[0099] Optionally, the data set is converted into a preset data format for display according to a preset rule, and the processing module 501 is specifically used for:

[0100] Iterate over the query data set, extracting the fields and values ​​for each document in the data set.

[0101] Convert fields and values ​​into a two-dimensional table for display, where each row represents a document and each column represents a field.

[0102] Based on the same technical concept, an electronic device is also provided in an embodiment of the present application, and the electronic device can realize the functions of the aforementioned data processing device.

[0103] Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.

[0104] At least one processor 601, and a memory 602 connected to the at least one processor 601. The specific connection medium between the processor 601 and the memory 602 is not limited in the embodiment of the present application. Figure 6 In the example, the processor 601 and the memory 602 are connected via a bus 600. Figure 6 The connection between other components is shown by bold lines, and is not intended to be limiting. The bus 600 can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 6 Only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus. Alternatively, the processor 601 can also be called a controller, and there is no limitation on the name.

[0105] In the embodiment of the present application, the memory 602 stores instructions that can be executed by at least one processor 601. The at least one processor 601 can execute a data processing method discussed above by executing the instructions stored in the memory 602. The processor 601 can implement Figure 5 The functions of each module in the device shown.

[0106] Among them, the processor 601 is the control center of the device, and can use various interfaces and lines to connect the various parts of the entire control device. By running or executing instructions stored in the memory 602 and calling the data stored in the memory 602, the various functions of the device and processing data, the device can be monitored as a whole.

[0107] In one possible design, the processor 601 may include one or more processing units, and the processor 601 may integrate an application processor and a modem processor, wherein the application processor mainly processes an operating system, a driver interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the modem processor may not be integrated into the processor 601. In some embodiments, the processor 601 and the memory 602 may be implemented on the same chip, and in some embodiments, they may also be implemented separately on separate chips.

[0108] Processor 601 can be a general-purpose processor, such as a central processing unit (CPU), a digital signal processor, an application-specific integrated circuit, a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component, and can implement or execute the various methods, steps and logic block diagrams disclosed in the embodiments of the present application. A general-purpose processor can be a microprocessor or any conventional processor, etc. The steps of a data processing method disclosed in the embodiments of the present application can be directly embodied as a hardware processor to be executed, or a combination of hardware and software modules in the processor can be executed.

[0109] The memory 602 is a non-volatile computer-readable storage medium that can be used to store non-volatile software programs, non-volatile computer executable programs and modules. The memory 602 may include at least one type of storage medium, such as a flash memory, a hard disk, a multimedia card, a card-type memory, a random access memory (Random Access Memory, RAM), a static random access memory (Static Random Access Memory, SRAM), a programmable read-only memory (Programmable Read Only Memory, PROM), a read-only memory (Read Only Memory, ROM), an electrically erasable programmable read-only memory (Electrically Erasable Programmable Read-Only Memory, EEPROM), a magnetic memory, a disk, an optical disk, etc. The memory 602 is any other medium that can be used to carry or store a desired program code in the form of an instruction or data structure and can be accessed by a computer, but is not limited thereto. The memory 602 in the embodiment of the present application can also be a circuit or any other device that can realize a storage function, for storing program instructions and / or data.

[0110] By programming the processor 601, the code corresponding to the data processing method described in the above embodiment can be fixed into the chip, so that the chip can execute the code when running. Figure 2The embodiment shown is a data processing method. How to design and program the processor 601 is a technique known to those skilled in the art and will not be described in detail here.

[0111] It should be noted here that the above-mentioned electronic device provided in the embodiment of the present application can implement all the method steps implemented in the above-mentioned method embodiment, and can achieve the same technical effect. The parts and beneficial effects of this embodiment that are the same as the method embodiment will not be described in detail here.

[0112] An embodiment of the present application further provides a computer-readable storage medium, which stores computer-executable instructions, and the computer-executable instructions are used to enable a computer to execute a data processing method in the above embodiment.

[0113] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.

[0114] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the present application. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 Flow or flows and / or boxes Figure 1 A device that performs the functions specified in a box or multiple boxes.

[0115] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 Flow or flows and / or boxes Figure 1 The functions specified in one or more boxes.

[0116] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 Flow or flows and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0117] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

Claims

1. A data processing method, It is characterized in that The method comprises: In response to the request instruction, construct a first query statement for querying the maximum timestamp based on the configuration information required for interacting with the ES cluster in the request instruction and the query condition; Using the first query statement to obtain the maximum timestamp from the ES cluster, and using the maximum timestamp to construct a second query statement for querying the latest data, the second query statement including a filtering condition for the timestamp field, for filtering data whose timestamp is greater than or equal to the maximum timestamp; Use the second ES query statement to obtain a data set from the ES cluster.

2. The method according to claim 1, It is characterized in that The configuration information includes a URL, a user name, a password, and an index name. The first query statement for querying the maximum timestamp based on the configuration information required for interacting with the ES cluster in the request instruction and the query condition is constructed, specifically including: Use the URL, the user name and the password to construct a connection string or authentication information required to establish a connection with the ES cluster; The first query statement is constructed according to the index name and the query condition.

3. The method according to claim 1, It is characterized in that The method further comprises: Use Python to parse the configuration file to obtain historical configuration information. The configuration file is used to store historical configuration information required for interacting with the ES cluster. The first query statement is constructed based on the historical configuration information and the query condition.

4. The method according to claim 1, It is characterized in that The using the first query statement to obtain the maximum timestamp from the ES, and using the maximum timestamp to construct a second query statement to query the latest data specifically includes: Use the connection string or authentication information to establish a connection with the ES cluster; Send the first query statement to the ES cluster, and obtain the maximum timestamp from the ES cluster; The second query statement is constructed using the maximum timestamp.

5. The method according to claim 1, It is characterized in that The method further comprises: According to preset rules, the data set is converted into a preset data format for display.

6. The method according to claim 5, It is characterized in that The step of converting the data set into a preset data format for display according to a preset rule specifically includes: Traverse and query the data set, and extract the fields and values ​​of each document in the data set; The fields and the values ​​are converted into a two-dimensional table for display, wherein each row represents a document and each column represents a field.

7. A data processing device, It is characterized in that The device comprises: A processing module, configured to respond to a request instruction and construct a first query statement for querying a maximum timestamp based on configuration information required for interacting with the ES cluster in the request instruction and a query condition; A transceiver module, configured to use the first query statement to obtain the maximum timestamp from the ES cluster, and use the maximum timestamp to construct a second query statement for querying the latest data; The transceiver module is further used to obtain a data set from the ES cluster using the second ES query statement.

8. An electronic device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, It is characterized in that When the processor executes the computer program, the method according to any one of claims 1 to 6 is implemented.

9. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a computer program, and the computer program is used to cause the computer to execute the method according to any one of claims 1 to 6.

10. A computer program product, It is characterized in that When the computer program product is called by a computer, the computer executes the method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Time series data acquisition method and device, electronic equipment and storage medium

    CN116756216A

  • Optimization method and device for data multi-table joint retrieval and electronic equipment

    CN116955417A

  • Stale data recognition

    US20230086203A1