Elasticsearch client version compatibility implementation method for complex network environment

Through the Elasticsearch client version compatibility implementation method for complex network environments, the technical problems of integration between old Spring versions and modern Elasticsearch versions are solved, cross-version compatibility and simplified operation logic are achieved, and development and maintenance costs are reduced. .

CN118642748BActive Publication Date: 2025-01-21JIANGSU FINSTONE TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410737839.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-07
Publication Date
2025-01-21
Estimated Expiration
2044-06-07

AI Technical Summary

Technical Problem

There are significant technical difficulties in integrating between older Spring versions (such as Spring 3.2.10) and modern Elasticsearch versions (such as 6.x, 7.x, 8.x), including difficulty in implementing automatic configuration processes and modern Incompatibility of Elasticsearch client with legacy libraries and toolchains.

Method used

Provides Elasticsearch client version compatible implementation methods for complex network environments, including pre-building initial assembly conditions, serializing to generate serialized assembly conditions, generating query requests based on serialized assembly conditions, responding to query requests and generating feedback results, and deserializing The returned results are processed to generate object information.

Benefits of technology

Through this method, the Elasticsearch client framework is independent of the Spring version and can run in JDK 1.8 and above systems, which significantly improves the compatibility between the old Spring architecture and modern Elasticsearch versions, simplifies the Elasticsearch operation logic, and reduces the development time and maintenance costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118642748B_ABST
    Figure CN118642748B_ABST
Patent Text Reader

Abstract

The present invention relates to the technical field of big data processing. The present invention discloses an Elasticsearch client version compatibility implementation method for a complex network environment. The method comprises pre-building an initial assembly condition, serializing the initial assembly condition to generate a serialized assembly condition, generating a query request based on the serialized assembly condition, responding to the query request and generating a feedback result, deserializing the feedback result to generate a deserialized return result, and processing the deserialized return result to generate object information. The Elasticsearch client framework in the present invention is independent of a Spring version, provides a clear and consistent API interface, simplifies the Elasticsearch operation logic, and enables developers to quickly get started without having to deeply understand the complex internal details of Elasticsearch.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of big data processing, and more specifically, to an implementation method for Elasticsearch client version compatibility in a complex network environment. Background Art

[0002] With the continuous development and upgrading of enterprise information systems, the Spring framework, as a mainstream enterprise-level application development platform, has undergone multiple rounds of updates during the development and iteration process. At the same time, Elasticsearch, as a highly scalable full-text search engine, has also undergone multiple major version iterations, introducing many functional updates, API changes, and client library reconstructions. This phenomenon has caused enterprises to encounter significant technical difficulties when maintaining or upgrading legacy systems, especially when integrating old Spring versions (such as Spring 3.2.10) with modern Elasticsearch versions (such as 6.x, 7.x, 8.x). The Spring framework is an open source Java platform for simplifying enterprise-level application development. It provides a comprehensive set of infrastructure support designed to help developers quickly build robust and maintainable Java applications;

[0003] The specific questions are as follows:

[0004] As part of the Spring Data ecosystem, Spring Data Elasticsearch was launched after Spring Data Kay (corresponding to Spring Framework 4.x), so it does not directly support earlier versions such as Spring 3.2.10. Modern Spring Data Elasticsearch requires the core library support of Spring Framework 4.x and above, and old Spring versions cannot meet this requirement. Spring Data is a subproject of the Spring framework that aims to simplify data access and operations. Spring Data Kay is one of the versions of Spring Data. Spring Data Elasticsearch is a submodule of the Spring Data project that is specifically used to integrate and interact with Elasticsearch.

[0005] Modern Elasticsearch client integrations often use the auto-configuration feature provided by Spring Boot, which relies on the features of Spring Framework 4.x and above. However, these advanced features are not available in the old Spring 3.2.10 environment, making the auto-configuration process difficult to implement. SpringBoot is an open source project based on the Spring framework that aims to simplify the development of Spring applications.

[0006] Modern Elasticsearch clients (such as the Elasticsearch Java High Level REST Client) are based on a newer API design and may be incompatible with libraries and tool chains used in the Spring 3.2.10 era, increasing the complexity and risk of direct integration.

[0007] In view of this, the present invention proposes an Elasticsearch client version compatibility implementation method for complex network environments to solve the above problems. Summary of the invention

[0008] In order to overcome the above-mentioned defects of the prior art, the present invention provides an implementation method for Elasticsearch client version compatibility in a complex network environment.

[0009] To achieve the above object, the present invention provides the following technical solutions:

[0010] The implementation method of Elasticsearch client version compatibility for complex network environments includes:

[0011] Pre-building an initial assembly condition, where the initial assembly condition includes at least one of an assembly query condition or an assembly update condition;

[0012] Serialize the initial assembly conditions to generate serialized assembly conditions;

[0013] Generate query requests based on serialized assembly conditions, respond to query requests and generate feedback results;

[0014] Deserialize the feedback result to generate a deserialized return result;

[0015] Process the deserialization return result to generate object information.

[0016] Further, the method of pre-building the initial assembly conditions includes:

[0017] Use the pre-packaged client API to build the DSL object structure in Java coding, using the DSL object structure as the initial assembly condition.

[0018] Furthermore, the method of serializing the initial assembly conditions to generate serialized assembly conditions includes:

[0019] Generates serialized assembly conditions by converting the initial assembly conditions from Java object format to string format.

[0020] Furthermore, the method for generating a query request based on the serialization assembly condition includes:

[0021] The serialized assembly condition is used as the request body in the query request to construct the query request, and the query request at least includes a URL, a request header and a request body.

[0022] Further, the method of responding to the query request and generating feedback results includes:

[0023] Send a query request to Elasticsearch, Elasticsearch responds to the query request and extracts feedback results from logDoesData. The feedback results include the total number of records corresponding to the query request, the result list, and the maximum score.

[0024] Furthermore, the method of deserializing the feedback result to generate a deserialized return result includes:

[0025] Convert the feedback result from string format to Java object format to generate the deserialized return result.

[0026] Furthermore, the method further comprises:

[0027] Acquire a first time tag of an initial assembly condition and a second time tag of the object information, and generate a processing rate coefficient based on the first time tag and the second time tag;

[0028] Obtain the sentence length of the initial assembly condition, input the sentence length and the processing rate coefficient into the pre-built state discrimination model, and obtain the corresponding state type, which includes a normal state and an abnormal state;

[0029] According to the status type, the real-time status of the Elasticsearch client is monitored.

[0030] Further, the method for generating a processing rate coefficient based on the first time tag and the second time tag includes:

[0031] The absolute value of the difference between the second time stamp and the first time stamp is calculated, and the reciprocal of the absolute value of the difference is used as the processing rate coefficient.

[0032] Furthermore, the pre-construction method of the state discrimination model includes:

[0033] Obtain h groups of training data, where h is a positive integer greater than 1, and the training data includes historical sentence length, historical processing rate coefficient, and historical state type. Take the historical sentence length, historical processing rate coefficient, and historical state type as a sample set, divide the sample set into a training set and a test set, build a classifier, take the historical sentence length and historical processing rate coefficient in the training set as input data, take the historical state type in the training set as output data, train the classifier to obtain an initial classifier, test the initial classifier using the test set, and output the initial classifier that is greater than a preset accuracy threshold as a state discrimination model.

[0034] A computer-readable storage medium stores a computer program, which, when executed, implements the above-mentioned Elasticsearch client version compatibility implementation method for a complex network environment.

[0035] Compared with the prior art, the present invention has the following beneficial effects:

[0036] The Elasticsearch client framework in the present invention is independent of the Spring version and can run in systems with JDK 1.8 and above. Users do not need to pay attention to or be restricted by a specific Spring version, which greatly improves the compatibility between the old Spring architecture and the modern Elasticsearch version.

[0037] By providing a clear and consistent API interface, the operation logic of Elasticsearch is simplified, allowing developers to quickly get started without having to deeply understand the complex internal details of Elasticsearch;

[0038] Deeply encapsulate the underlying technical details and hide the tedious data conversion and network communication processes, making the task of integrating Elasticsearch more intuitive and concise, significantly reducing development and maintenance costs. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] Figure 1 It is a flowchart of the method for implementing the compatibility of Elasticsearch client versions in a complex network environment in the present invention;

[0040] Figure 2 A schematic diagram of a computer-readable storage medium in the present invention. DETAILED DESCRIPTION

[0041] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0042] Example 1

[0043] See also Figure 1 As shown, this embodiment discloses a method for implementing Elasticsearch client version compatibility in a complex network environment, including:

[0044] S10: Pre-constructing initial assembly conditions, where the initial assembly conditions at least include one of an assembly query condition or an assembly update condition.

[0045] Methods for pre-building initial assembly conditions include:

[0046] Use the pre-packaged client API to build the DSL object structure in Java coding, using the DSL object structure as the initial assembly condition.

[0047] It should be noted that the client API refers to the interface provided by the service provider for communicating with its services. It defines the methods and protocols that the client can use to interact with the service, send requests and receive responses. The client API is usually provided in the form of a software library, SDK (Software Development Kit) or RESTful API. SDK, that is, Software Development Kit (Software Development Kit), is a collection of development tools, libraries and documents designed to help developers build specific types of software applications or integrate specific technologies or platforms. RESTful API is a design style for creating network services. It is based on the REST (Representational State Transfer) principle. REST is a software architecture style that emphasizes the unified management of resources in the system and the stateless transmission of state.

[0048] The DSL object structure mentioned above refers to a data structure used to represent a DSL statement. DSL is usually used to describe logic or behavior in certain specific fields, such as configuration files, query statements, update statements, rule definitions, etc. In this embodiment, the DSL object structure can be a query statement or an update statement. The query statement here refers to the assembly of query conditions, and the update statement refers to the assembly of update conditions.

[0049] It should be added that, in this embodiment, both the assembly query conditions and the assembly update conditions are presented in the format of Java code. The above-mentioned assembly query conditions and assembly update conditions are processed in the same way in this embodiment. In this embodiment, the assembly query conditions and assembly update conditions can be constructed at the same time, or only one of them can be constructed.

[0050] S20: Serialize the initial assembly conditions to generate serialized assembly conditions.

[0051] The method of serializing the initial assembly condition to generate the serialized assembly condition includes:

[0052] Generates serialized assembly conditions by converting the initial assembly conditions from Java object format to string format.

[0053] It can be understood that the initial assembly conditions in the above are presented in the format of Java code, and this embodiment converts the initial assembly conditions from Java object format to string format because the subsequent Elasticsearch query interface only accepts requests in string format.

[0054] S30: Generate a query request based on the serialized assembly condition, respond to the query request and generate a feedback result.

[0055] Methods for generating query requests based on serialized assembly conditions include:

[0056] The serialized assembly condition is used as the request body in the query request to construct the query request, and the query request at least includes a URL, a request header and a request body.

[0057] It should be noted that a query request includes at least a URL, a request header and a request body. A URL refers to an address used to specify the location of a web page, file, directory or data resource on the Internet. A request header is used to describe various attributes and conditions of the query request, which are included in the request header in the form of key-value pairs.

[0058] The method of responding to the query request and generating feedback results includes:

[0059] Send a query request to Elasticsearch, Elasticsearch responds to the query request and extracts feedback results from logDoesData. The feedback results include the total number of records corresponding to the query request, the result list, and the maximum score.

[0060] It should be noted that the total number of records indicates the total number of records that match the query conditions. When performing paging queries, the total number of records can help you understand the number of records that meet the query conditions, so as to perform paging calculations or display related statistical information. The result list contains the actual query result list, which is a collection of records that meet the query conditions. Each record corresponds to a matching document or data object. The result list is the main output of the query request. It provides specific data that meets the query conditions. The maximum score indicates the maximum score in the query results. In scenarios such as full-text retrieval, Elasticsearch will calculate a relevance score for each document, indicating the degree of match between the document and the query conditions.

[0061] It should be added that logDoesData is a pre-built database, which stores the corresponding total number of records, result list and maximum score, and there is a mapping relationship between the total number of records, result list and maximum score and the query request.

[0062] S40: Deserialize the feedback result to generate a deserialized return result.

[0063] The methods for deserializing the feedback results to generate deserialized return results include:

[0064] Convert the feedback result from string format to Java object format to generate the deserialized return result.

[0065] It is understandable that because the Elasticsearch query interface only accepts requests in string format, the feedback results generated subsequently are also in string format. Therefore, deserialization refers to converting the string format into the corresponding Java object format.

[0066] S50: Process the deserialization return result to generate object information.

[0067] Methods for processing the deserialization return result to generate object information include:

[0068] Detect the error information in the deserialization return result, remove the error information, and generate object information.

[0069] It is understandable that the data in the deserialization return result usually has data format mismatch, lack of necessary attributes, etc. These erroneous data need to be eliminated before subsequent display.

[0070] The Elasticsearch client framework in this embodiment is independent of the Spring version and can run in systems with JDK 1.8 and above. Users do not need to pay attention to or be restricted by a specific Spring version, which greatly improves the compatibility between the old Spring architecture and the modern Elasticsearch version.

[0071] By providing a clear and consistent API interface, the operation logic of Elasticsearch is simplified, allowing developers to quickly get started without having to deeply understand the complex internal details of Elasticsearch.

[0072] Deeply encapsulate the underlying technical details and hide the tedious data conversion and network communication processes, making the task of integrating Elasticsearch more intuitive and concise, significantly reducing development and maintenance costs.

[0073] Example 2

[0074] S60: Acquire a first time tag of the initial assembly condition and a second time tag of the object information, and generate a processing rate coefficient based on the first time tag and the second time tag.

[0075] It should be noted that the first time tag can be the moment corresponding to the completion of the initial assembly condition construction, which is recorded by the timer in the system, and the second time tag can be the moment corresponding to the generation of the object information, which is also recorded by the timer in the system.

[0076] The method for generating a processing rate coefficient based on a first time tag and a second time tag includes:

[0077] The absolute value of the difference between the second time stamp and the first time stamp is calculated, and the reciprocal of the absolute value of the difference is used as the processing rate coefficient.

[0078] It should be added that the processing rate coefficient represents the speed of processing the initial assembly conditions. In this embodiment, the larger the processing rate coefficient is, the faster the processing speed of the initial assembly conditions is.

[0079] S70; obtain the sentence length of the initial assembly condition, input the sentence length and the processing rate coefficient into the pre-built state discrimination model, obtain the corresponding state type, the state type includes a normal state and an abnormal state, and monitor the real-time state of the Elasticsearch client according to the state type.

[0080] Methods for obtaining the statement length of the initial assembly condition include:

[0081] Get the string length of the serialized assembly condition corresponding to the initial assembly condition, and use the string length as the statement length of the initial assembly condition.

[0082] It can be understood that the statement length represents the complexity of the initial assembly conditions. The greater the complexity of the corresponding initial assembly conditions, the slower the processing of the initial assembly conditions. Continuing from the above, the initial assembly conditions are in Java object format, and the corresponding serialized assembly conditions are in string format. The length of the Java statement is difficult to obtain directly, but it is relatively simple to obtain the length of the string accordingly. The length of the string can be directly obtained by calling the length() function.

[0083] The construction method of the state discrimination model includes:

[0084] Obtain h groups of training data, where h is a positive integer greater than 1, and the training data includes historical sentence length, historical processing rate coefficient, and historical state type. The historical sentence length, historical processing rate coefficient, and historical state type are used as sample sets, and the sample sets are divided into training sets and test sets. A classifier is constructed, and the historical sentence length and historical processing rate coefficient in the training set are used as input data, and the historical state type in the training set is used as output data. The classifier is trained to obtain an initial classifier, and the initial classifier is tested using the test set. The initial classifier having an accuracy greater than a preset threshold is output as a state discrimination model, and the classifier is preferably a naive Bayes model or a support vector machine model.

[0085] In this embodiment, the first time tag of the initial assembly condition and the second time tag of the object information are first obtained, and a processing rate coefficient is generated based on the first time tag and the second time tag. The sentence length of the initial assembly condition is obtained, and the sentence length and the processing rate coefficient are input into a pre-built state discrimination model to obtain the corresponding state type, so that the Elasticsearch client can be monitored in real time.

[0086] Example 3

[0087] Based on Example 1, this embodiment provides an Elasticsearch client version compatibility implementation system for complex network environments. The system is implemented based on the Elasticsearch client version compatibility implementation method for complex network environments, including:

[0088] Client module: used to pre-build initial assembly conditions, which include at least one of assembly query conditions or assembly update conditions.

[0089] Methods for pre-building initial assembly conditions include:

[0090] Use the pre-packaged client API to build the DSL object structure in Java coding, using the DSL object structure as the initial assembly condition.

[0091] It should be noted that the client API refers to the interface provided by the service provider for communicating with its services. It defines the methods and protocols that the client can use to interact with the service, send requests and receive responses. The client API is usually provided in the form of a software library, SDK (Software Development Kit) or RESTful API.

[0092] The DSL object structure mentioned above refers to a data structure used to represent a DSL statement. DSL is usually used to describe logic or behavior in certain specific fields, such as configuration files, query statements, update statements, rule definitions, etc. In this embodiment, the DSL object structure can be a query statement or an update statement. The query statement here refers to the assembly of query conditions, and the update statement refers to the assembly of update conditions.

[0093] It should be added that, in this embodiment, both the assembly query conditions and the assembly update conditions are presented in the format of Java code. The above-mentioned assembly query conditions and assembly update conditions are processed in the same way in this embodiment. In this embodiment, the assembly query conditions and assembly update conditions can be constructed at the same time, or only one of them can be constructed.

[0094] Serialization module: used to serialize the initial assembly conditions to generate serialized assembly conditions.

[0095] The method of serializing the initial assembly condition to generate the serialized assembly condition includes:

[0096] Generates serialized assembly conditions by converting the initial assembly conditions from Java object format to string format.

[0097] It can be understood that the initial assembly conditions in the above are presented in the format of Java code, and this embodiment converts the initial assembly conditions from Java object format to string format because the subsequent Elasticsearch query interface only accepts requests in string format.

[0098] Feedback module: used to generate query requests based on serialized assembly conditions, respond to query requests and generate feedback results.

[0099] Methods for generating query requests based on serialized assembly conditions include:

[0100] The serialized assembly conditions are used as the request body in the query request to construct the query request. The query request at least includes a URL, a request header, and a request body.

[0101] It should be noted that a query request includes at least a URL, a request header and a request body. A URL refers to an address used to specify the location of a web page, file, directory or data resource on the Internet. A request header is used to describe various attributes and conditions of the query request, which are included in the request header in the form of key-value pairs.

[0102] The method of responding to the query request and generating feedback results includes:

[0103] Send a query request to Elasticsearch, Elasticsearch responds to the query request and extracts feedback results from logDoesData. The feedback results include the total number of records, the result list, and the maximum score.

[0104] It should be noted that the total number of records indicates the total number of records that match the query conditions. When performing paging queries, the total number of records can help you understand the number of records that meet the query conditions, so as to perform paging calculations or display related statistical information. The result list contains the actual query result list, which is a collection of records that meet the query conditions. Each record corresponds to a matching document or data object. The result list is the main output of the query request. It provides specific data that meets the query conditions. The maximum score indicates the maximum score in the query results. In scenarios such as full-text retrieval, Elasticsearch will calculate a relevance score for each document, indicating the degree of match between the document and the query conditions.

[0105] It should be added that logDoesData is a pre-built database, which stores the corresponding total number of records, result list and maximum score, and there is a mapping relationship between the total number of records, result list and maximum score and the query request.

[0106] Deserialization module: used to deserialize the feedback results to generate deserialized return results.

[0107] The methods for deserializing the feedback results to generate deserialized return results include:

[0108] Convert the feedback result from string format to Java object format to generate the deserialized return result.

[0109] It is understandable that because the Elasticsearch query interface only accepts requests in string format, the feedback results generated subsequently are also in string format. Therefore, deserialization refers to converting the string format into the corresponding Java object format.

[0110] Processing module: used to process the deserialization return results to generate object information.

[0111] Methods for processing the deserialization return result to generate object information include:

[0112] Detect the error information in the deserialization return result, remove the error information, and generate object information.

[0113] It is understandable that the data in the deserialization return result usually has data format mismatch, lack of necessary attributes, etc. These erroneous data need to be eliminated before subsequent display.

[0114] The Elasticsearch client framework in this embodiment is independent of the Spring version and can run in systems with JDK 1.8 and above. Users do not need to pay attention to or be restricted by a specific Spring version, which greatly improves the compatibility between the old Spring architecture and the modern Elasticsearch version.

[0115] By providing a clear and consistent API interface, the operation logic of Elasticsearch is simplified, allowing developers to quickly get started without having to deeply understand the complex internal details of Elasticsearch.

[0116] Deeply encapsulate the underlying technical details and hide the tedious data conversion and network communication processes, making the task of integrating Elasticsearch more intuitive and concise, significantly reducing development and maintenance costs.

[0117] Example 4

[0118] See also Figure 2 As shown, this embodiment discloses a computer-readable storage medium, on which a computer program is stored. When the computer program is executed, the above-mentioned Elasticsearch client version compatibility implementation method for a complex network environment is implemented.

[0119] The above formulas are all dimensionless and numerical calculations. The formula is a formula for the most recent real situation obtained by collecting a large amount of data and performing software simulation. The preset parameters, weights and thresholds in the formula are set by technicians in this field according to actual conditions.

[0120] The above embodiments can be implemented in whole or in part by software, hardware, firmware or any other combination. When implemented by software, the above embodiments can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer programs are loaded or executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website site, computer, server or data center to another website site, computer, server or data center through a wired network or a wireless network. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that contains one or more available media sets. The available medium can be a magnetic medium (for example, a floppy disk, a hard disk, a tape), an optical medium (for example, a DVD) or a semiconductor medium. The semiconductor medium can be a solid-state hard disk.

[0121] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed in the present invention can be implemented in electronic hardware or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0122] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0123] In the several embodiments provided by the present invention, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of the units is only one, and there may be other division methods in actual implementation, such as 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 mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

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

[0125] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0126] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.

[0127] Finally: The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.

Claims

1. An implementation method for Elasticsearch client version compatibility in a complex network environment, characterized in that: include: Pre-building an initial assembly condition, where the initial assembly condition includes at least one of an assembly query condition or an assembly update condition; Serialize the initial assembly conditions to generate serialized assembly conditions; Generate query requests based on serialized assembly conditions, respond to query requests and generate feedback results; Deserialize the feedback result to generate a deserialized return result; Process the deserialization return result to generate object information; The method further comprises: Obtaining a first time tag of the initial assembly condition and a second time tag of the object information, and generating a processing rate coefficient based on the first time tag and the second time tag, wherein the first time tag is the time corresponding to when the initial assembly condition is constructed, and the second time tag is the time corresponding to when the object information is generated; Obtain the sentence length of the initial assembly condition, input the sentence length and the processing rate coefficient into the pre-built state discrimination model, and obtain the corresponding state type, which includes a normal state and an abnormal state; According to the status type, monitor the real-time status of the Elasticsearch client; The method for generating a processing rate coefficient based on a first time tag and a second time tag comprises: Calculate the absolute value of the difference between the second time label and the first time label, and use the reciprocal of the absolute value of the difference as a processing rate coefficient; Methods for obtaining the statement length of the initial assembly condition include: Get the string length of the serialized assembly condition corresponding to the initial assembly condition, and use the string length as the statement length of the initial assembly condition.

2. According to the method for implementing Elasticsearch client version compatibility in a complex network environment according to claim 1, it is characterized in that: The method for pre-building initial assembly conditions comprises: Use the pre-packaged client API to build the DSL object structure in Java coding, using the DSL object structure as the initial assembly condition.

3. The method for implementing Elasticsearch client version compatibility in a complex network environment according to claim 2, characterized in that: The method of serializing the initial assembly conditions to generate serialized assembly conditions comprises: Generates serialized assembly conditions by converting the initial assembly conditions from Java object format to string format.

4. According to claim 1, the method for implementing Elasticsearch client version compatibility in a complex network environment is characterized in that: The method for generating a query request based on a serialized assembly condition includes: The serialized assembly condition is used as the request body in the query request to construct the query request, and the query request at least includes a URL, a request header and a request body.

5. The method for implementing Elasticsearch client version compatibility in a complex network environment according to claim 4, characterized in that: The method for responding to a query request and generating a feedback result includes: Send a query request to Elasticsearch, Elasticsearch responds to the query request and extracts feedback results from logDoesData. The feedback results include the total number of records corresponding to the query request, the result list, and the maximum score.

6. The method for implementing Elasticsearch client version compatibility in a complex network environment according to claim 1, characterized in that: The method for deserializing the feedback result to generate a deserialized return result includes: Convert the feedback result from string format to Java object format to generate the deserialized return result.

7. The method for implementing Elasticsearch client version compatibility in a complex network environment according to claim 6, characterized in that: The pre-construction method of the state discrimination model includes: Obtain h groups of training data, where h is a positive integer greater than 1, and the training data includes historical sentence length, historical processing rate coefficient, and historical state type. Take the historical sentence length, historical processing rate coefficient, and historical state type as a sample set, divide the sample set into a training set and a test set, build a classifier, take the historical sentence length and historical processing rate coefficient in the training set as input data, take the historical state type in the training set as output data, train the classifier to obtain an initial classifier, test the initial classifier using the test set, and output the initial classifier that is greater than a preset accuracy threshold as a state discrimination model.

8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed, the method for implementing Elasticsearch client version compatibility for a complex network environment as described in any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Query method and system based on big data medical general retrieval index construction

    CN115563127A

  • Message format dynamic conversion method based on enterprise service bus

    CN117573926A