Method and device for setting multi-application communication link applied to service cluster
By querying the cache database and updating the communication link in the service cluster, the problem of interface address update in scenarios such as application migration is solved, and the rapid deployment of multiple applications and the stability of inter-application communication is achieved.
Patent Information
- Application Number
- CN202411786835.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-05
- Publication Date
- 2025-04-15
AI Technical Summary
In the service cluster, when applications are migrated, redeployed or network changes, the data exchange interface addresses between other applications need to be updated simultaneously, resulting in increased workload for operations and maintenance and developers, and it is easy to cause human errors to cause application exceptions.
By querying the configuration file of the cache database, we can determine whether the communication link involved in the data interaction exists and is valid. If it is inconsistent, update the communication link to the latest configuration in the preset file server to ensure the stability of the data interaction.
It realizes rapid and precise deployment of multiple applications, ensures stable communication between applications, and reduces the possibility of data abnormalities, such as data loss or calculation errors.
Smart Images

Figure CN119835157A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of server clusters, and in particular to a method and device for setting a multi-application communication link applied to a server cluster. Background Art
[0002] With the continuous growth of business volume, multiple applications exist in a service cluster at the same time. Data exchange between various business applications needs to be carried out through open interfaces, databases, cache services and other methods to ensure the normal operation and display of data in various business applications. Taking open interfaces as an example, when an application deployed in the same server cluster undergoes migration, redeployment, network switching, domain name change and other scenarios, the interface addresses used for data exchange between other applications also need to be updated synchronously. When large-scale modifications occur, this will increase the workload for operation and maintenance personnel and developers, and human errors are prone to cause application anomalies. In order to enable operation and maintenance personnel and developers to quickly complete application deployment, ensure the rapid and accurate recovery of services and data in the above scenarios, improve work efficiency, and reduce data anomalies that occur in similar work such as application migration in server clusters, such as data loss and calculation errors. How to properly solve the above problems has become a topic that needs to be solved in the industry. Summary of the invention
[0003] The present invention provides a method and device for setting a multi-application communication link applied to a service cluster, which can be used to update the access link of each application, realize fast and accurate deployment of multiple applications, and ensure the technical effect of stable communication between applications.
[0004] According to a first aspect of the present invention, a method for setting a multi-application communication link applied to a service cluster is provided, and the method for setting a multi-application communication link applied to a service cluster includes:
[0005] When any application needs to perform data interaction in the server cluster, it queries the configuration file of the cache database to check whether the communication link involved in the data interaction exists;
[0006] If so, determining whether access according to the communication link is successful;
[0007] If the access fails, determine whether the captured exception is related to the communication link;
[0008] If relevant, determining whether the corresponding communication link in the communication link configuration file in the preset file server is consistent with the communication link involved in the data interaction;
[0009] If they are inconsistent, the communication link involved in the data interaction is changed to a corresponding communication link in the communication link configuration file.
[0010] In one embodiment, it further includes:
[0011] Determining whether a communication link needs to be set for any application, wherein the setting includes any one of deployment and update;
[0012] When the above judgment is true, all communication links involved in the application are updated in the communication link configuration file in the preset file server.
[0013] In one embodiment, it further includes:
[0014] Before application deployment, the preset file server is built and a communication link configuration file is created.
[0015] In one embodiment, it further includes:
[0016] When any application needs to perform data interaction in the server cluster, it queries the configuration file of the cache database to check whether the communication link involved in the data interaction exists;
[0017] If it does not exist, the corresponding communication link in the communication link configuration file in the preset file server is obtained and written into the data cache library, and data interaction is performed.
[0018] In one embodiment, it further includes:
[0019] If they are inconsistent, the communication links involved in data interaction will be updated in the cache database;
[0020] Data interaction is performed again according to the communication link updated in the cache database.
[0021] In one embodiment, it further includes:
[0022] The file format of the communication link configuration file includes any one of JSON, XML, XLSX, CSV, and TXT.
[0023] According to a second aspect of the present invention, there is provided a device for setting a multi-application communication link applied to a service cluster, comprising:
[0024] A query module is used to query the configuration file of the cache database to check whether the communication link involved in the data interaction exists when any application needs to interact with data in the server cluster;
[0025] A first determination module, used to determine whether access according to the communication link is successful, if any;
[0026] The second judgment module is used to judge whether the captured exception is related to the communication link if the access fails;
[0027] A third judgment module, if relevant, judges whether the corresponding communication link in the communication link configuration file in the preset file server is consistent with the communication link involved in the data interaction;
[0028] The changing module changes the communication link involved in the data interaction to a corresponding communication link in the communication link configuration file if there is inconsistency.
[0029] In one embodiment, the query module, the first judgment module, the second judgment module, the third judgment module and the modification module implement any one of the above-mentioned methods for setting a multi-application communication link applied to a service cluster.
[0030] According to a third aspect of the present invention, there is provided an electronic device, the electronic device comprising: a communication interface, a processor, and a memory;
[0031] The memory is used to store program instructions, and when the program instructions are executed by the processor that is communicatively connected to the memory through the communication interface, any of the above-mentioned methods for setting a multi-application communication link applied to a service cluster is implemented.
[0032] According to a fourth aspect of the present invention, a computer-readable storage medium is provided, on which computer program instructions are stored. When the computer program instructions are executed by a computer (for example, a processor in a computer), any of the above-mentioned methods for setting up a multi-application communication link applied to a service cluster is implemented.
[0033] In summary, the present invention provides a method and device for setting up multi-application communication links for a service cluster, the method comprising: when any application needs to perform data interaction in a server cluster, query the configuration file of the cache database to check whether the communication link involved in the data interaction exists; if it exists, determine whether the access is successful according to the communication link; if the access fails, determine whether the captured exception is related to the communication link; if it is related, determine whether the corresponding communication link in the communication link configuration file in the preset file server is consistent with the communication link involved in the data interaction; if not, change the communication link involved in the data interaction to the corresponding communication link in the communication link configuration file. The technical solution of the present application can update the access link of each application, and ultimately achieve the technical effect of rapid and accurate deployment of multiple applications and ensuring stable communication and data between applications.
[0034] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or understood by practicing the present invention. The purpose and other advantages of the present invention can be realized and obtained by the structures particularly pointed out in the written description, claims, and drawings.
[0035] The technical solution of the present invention is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0037] Figure 1 A flowchart of a method for setting a multi-application communication link applied to a service cluster provided by an embodiment of the present invention;
[0038] Figure 2 A schematic diagram of a method for setting a multi-application communication link applied to a service cluster provided by an embodiment of the present invention;
[0039] Figure 3 A schematic diagram of another method for setting a multi-application communication link applied to a service cluster provided by an embodiment of the present invention;
[0040] Figure 4 A structural diagram of a device for setting a multi-application communication link for a service cluster provided by an embodiment of the present invention;
[0041] Figure 5 A structural diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0042] The features and exemplary embodiments of various aspects of the present application will be described in detail below. 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 and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain the present application, rather than to limit the present application. For those skilled in the art, the present application can be implemented without the need for some of these specific details. The following description of the embodiments is only to provide a better understanding of the present application by illustrating the examples of the present application.
[0043] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "include..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0044] like Figure 1 As shown, the present invention provides a method for setting a multi-application communication link applied to a service cluster, and the method for setting a multi-application communication link applied to a service cluster includes:
[0045] In step S11, when any application needs to perform data interaction in the server cluster, it queries the configuration file of the cache database to check whether the communication link involved in the data interaction exists;
[0046] In step S12, if it exists, determining whether the access according to the communication link is successful;
[0047] In step S13, if the access fails, it is determined whether the captured exception is related to the communication link;
[0048] In step S14, if relevant, determining whether the corresponding communication link in the communication link configuration file in the preset file server is consistent with the communication link involved in the data interaction;
[0049] In step S15, if there is inconsistency, the communication link involved in the data interaction is changed to a corresponding communication link in the communication link configuration file.
[0050] In one embodiment, in a server cluster, when multiple applications interact with each other, the configuration, update and maintenance of the communication link is a task with a huge workload and high real-time requirements. The technology in this embodiment enables each application to use the correct communication link during the data interaction process, avoiding data interaction failure or abnormality caused by changes in the communication link.
[0051] When any application needs to interact with data in a server cluster, it needs to communicate with other applications or services. Query the configuration file of the cache database to check whether the communication link involved in the data interaction exists. Query the configuration file in the cache database to check whether the required communication link already exists, so as to improve the query speed, reduce the dependence on the remote configuration file, reduce network delay, and improve the efficiency of data interaction. If it exists, determine whether the access is successful according to the communication link. Use the communication link in the cache database to try to interact with data, determine whether the access is successful, and ensure that the communication link is available. If the access fails, determine whether the captured exception is related to the communication link. Capture the exception information when the access fails, and determine whether the exception is caused by a communication link problem, such as network failure, address error, etc. If relevant, determine whether the corresponding communication link in the communication link configuration file in the preset file server is consistent with the communication link involved in the data interaction. Obtain the latest communication link configuration file from the preset file server. Compare whether the communication link in the cache database is consistent with the communication link in the configuration file. If not, change the communication link involved in the data interaction to the corresponding communication link in the communication link configuration file. Update the communication link used in the application to the latest configuration, retry data interaction, and finally ensure successful communication.
[0052] Determine whether it is necessary to set up a communication link for any application, the setting includes any of deployment and update. For new deployment or version update of the application, determine whether it is currently necessary to set up or update the communication link. When the above judgment is true, update all communication links involved in the application in the communication link configuration file in the preset file server. In the configuration file of the file server, add or update the communication link information related to the application to ensure that the communication link configuration of all applications is kept up to date. Before the application is deployed, set up the preset file server and establish a communication link configuration file. Deploy the file server as a center for centralized management of communication link configurations. Create an initial communication link configuration file for the application to use.
[0053] When any application needs to perform data interaction in the server cluster, it queries the configuration file of the cache database to check whether the communication link involved in the data interaction exists. If not, the corresponding communication link in the communication link configuration file in the preset file server is obtained and written into the data cache library, and data interaction is performed. The required communication link is obtained from the file server, the obtained communication link is written into the cache database, the local cache is updated, and the new communication link is used for data interaction.
[0054] If the corresponding communication link in the communication link configuration file in the preset file server is inconsistent with the communication link involved in the data interaction, the communication link involved in the data interaction will be updated in the cache database. Update the communication link in the cache database to make it consistent with the configuration in the file server. Re-interact with the data according to the updated communication link in the cache database. Retry the data interaction using the updated communication link. The file format of the communication link configuration file includes any one of JSON, XML, XLSX, CSV, and TXT. The configuration file can adopt a variety of formats to meet the needs of different applications and environments, so as to improve the flexibility and compatibility of the system and facilitate parsing and maintenance.
[0055] The application needs to communicate with other services, triggering the process. Check whether the required communication link exists in the cache. If it exists, try to use the communication link for data interaction. If successful, the process ends and the data interaction is normal. If it fails, determine whether the exception is related to the communication link. If it is related, obtain the latest communication link configuration from the file server, compare and update the communication link, update the cache database, and retry data interaction. If it is not related, follow other exception handling processes. If the communication link does not exist, obtain the communication link configuration from the file server, write it to the cache database, and then interact with data. When deploying or updating the application, determine whether the communication link needs to be set. If necessary, update the communication link in the configuration file of the file server. The configuration file supports multiple file formats to improve compatibility.
[0056] The cache database can provide fast access to communication link information, reduce dependence on remote file servers, improve system performance, and reduce network latency. Communication link-related exceptions indicate network unreachability, address errors, timeouts, etc. The communication link needs to be updated to ensure successful data interaction. Non-communication link-related exceptions indicate data format errors, insufficient permissions, etc., and follow the regular exception handling process without involving communication link updates.
[0057] The preset file server configuration file uniformly stores and manages the communication link configuration of all applications. When the communication link changes, you only need to update the file server configuration file to simplify maintenance. When deploying or updating an application, determine whether the communication link needs to be set or updated, and update the communication link configuration file of the file server. During runtime detection, when the application fails to interact with data and the exception is related to the communication link, the application obtains the latest configuration from the file server. Common formats and their characteristics: JSON is lightweight, easy to parse, and suitable for Web applications. XML is structured, extensible, and suitable for complex data. XLSX is in tabular form and easy to view and edit manually. CSV is simple, plain text, and suitable for simple data exchange. TXT is flexible and customizable. Select the appropriate format based on application requirements and environment.
[0058] Automatically update the communication link. When the communication link changes, the system can automatically detect and update it to reduce human errors. Reduce data interaction failures, update the communication link in time, and ensure smooth communication between applications. Improve the flexibility and scalability of the system, support multiple configuration file formats, meet the needs of different applications, and enhance system compatibility. Combined with the cache database and file server, it has both the efficiency of caching and the convenience of centralized management. Reduce operation and maintenance and development costs, automate configuration management, reduce the workload of manual configuration and maintenance, and unify configuration management, simplify the configuration update process, improve work efficiency, make problem location and resolution more convenient, and make each module have clear responsibilities for easy expansion and optimization.
[0059] It is suitable for situations where there are many nodes in the server cluster and the configuration management is complex. It can realize centralized management configuration and improve system consistency. In addition, many applications and services change dynamically and communication links are frequently updated. It can automatically detect and update communication links to adapt to dynamic environments. In the face of the problem that multiple updates may lead to version confusion, a version control system (such as Git) is introduced to manage configuration files, and version numbers are added to configuration files to ensure version consistency.
[0060] During the configuration of the server cluster, the establishment of the file server takes precedence over the deployment of business applications. Files uploaded in each application are stored in the file server, and when each application accesses a file, the access address is based on the relative path to access the file server, without having to worry about changes in the server's IP address or application domain name.
[0061] Assume that there are three applications A, B, and C deployed in the server cluster. Application A communicates with application B and application C to exchange data. The data exchange method is in the form of providing an interface to the outside world:
[0062] Under normal circumstances, application A requests the interface of application B to obtain data in application B. Through network requests (Http and other methods), it accesses the data interface provided by application B to obtain data and calculate, store, and display it in the application A system. When application B migrates, changes its IP address, or changes its domain name, application A needs to update the network request address in this application and then use the above process to ensure normal data acquisition. Similarly, for application C, the same process is also required to ensure data communication between application C and application A.
[0063] The process of updating the communication link is only when the service environment of application A changes. If the above situation occurs simultaneously in applications A, B, and C, it is necessary to update a series of communication links such as application A to application B, application A to application C, and application B to application A. The above process requires the cooperation of operation and maintenance personnel and developers to ensure the accuracy and reliability of the data acquisition link.
[0064] By utilizing the file sharing feature of the file server in the server cluster, a unified configuration file is used to provide data service links to each application for data update. All applications interact with the configuration files in the file server. The specific process of the method implementation is as follows:
[0065] 1. Develop a standard format file as the configuration file for each application to update configuration information, which is also the file that the operation and maintenance personnel need to update during the migration work. The file can be in JSON, XML, XLSX, CSV, TXT and other file formats, but the primary consideration is to facilitate developers to read and operation and maintenance personnel to update the content. Taking the JSON format file as an example, create a config.json file in the shared file server. Whenever the above-mentioned application migration and other tasks occur, update the information in the config.json file. The code is as follows:
[0066]
[0067]
[0068]
[0069] 2. Cache update process (each application updates the access address through the configuration file). This process usually occurs first after the application is deployed, and also occurs during the business process. Figure 2 shown.
[0070] 1) The application queries the cache database to see whether the configuration information of the application to be accessed exists in the cache.
[0071] 2) If it exists, enter the business process and request the required data.
[0072] 3) If it does not exist, go to the directory where the configuration file is located in the file server and search for the config.json file. If the file exists, go to the next step. Otherwise, send a text message to notify the operation and maintenance personnel to perform maintenance.
[0073] 4) Access the configuration file to check whether the required application information exists. If so, write the corresponding information to the cache database (the cache duration is customized by the business scenario). Otherwise, notify the operation and maintenance personnel to update the data.
[0074] 5) After completing the corresponding information caching work, enter the business process.
[0075] 3. Business processes occur during the daily operation of the application. When completing migration and other scenarios, they will occur after the update process, as shown in the attached Figure 3 shown.
[0076] 1) Applications request data based on business needs.
[0077] 2) Determine whether the request is within the normal range in the request. If it can be returned normally, continue with the subsequent business process.
[0078] 3) If the data cannot be returned normally, the exception handling process is entered to capture the access exception and determine whether it is related to the access address exception (such as capturing network exception or link exception, etc.).
[0079] 4) If the captured exception is not related to the access address or cannot be determined, notify the project leader of the business module for manual verification.
[0080] 5) If the captured exception is related to the access address, query the configuration file and access the required application configuration information in the configuration file, compare the obtained information with the information in the current application cache one by one, and if the current cache content is the same as the configuration file content, notify the operation and maintenance personnel to confirm whether the configuration information needs to be updated.
[0081] 6) If the cache content is different from the configuration file content, the cache update process is entered, and in the cache process, the business process is re-triggered to ensure that the program can be closed-loop, ensuring data real-time and program reliability.
[0082] The technical solution in this embodiment realizes the automatic detection, update and maintenance of multi-application communication links through the combination of cache database and preset file server. It reduces manual intervention and improves work efficiency; uses cache database to increase access speed and reduce network latency. By automatically updating the communication link, the success rate of data interaction is ensured; supports multiple configuration file formats to adapt to different application requirements. In modern distributed systems and microservice architectures, the management of communication links is a key issue; the access links of each application can be updated to achieve fast and accurate deployment of multiple applications and ensure the technical effect of stable communication between applications.
[0083] In one embodiment, Figure 4 FIG. 1 is a block diagram of a device for setting a multi-application communication link applied to a service cluster according to an exemplary embodiment. Figure 4 As shown, the device for setting a multi-application communication link applied to a service cluster includes a query module 41, a first judgment module 42, a second judgment module 43, a third judgment module 44 and a modification module 45.
[0084] The query module 41 is used to query the configuration file of the cache database to check whether the communication link involved in the data interaction exists when any application needs to perform data interaction in the server cluster;
[0085] The first determination module 42 is used to determine whether the access according to the communication link is successful if it exists;
[0086] The second judgment module 43 is used to judge whether the captured exception is related to the communication link if the access fails;
[0087] The third determination module 44, if relevant, determines whether the corresponding communication link in the communication link configuration file in the preset file server is consistent with the communication link involved in the data interaction;
[0088] If there is inconsistency, the changing module 45 changes the communication link involved in the data interaction to a corresponding communication link in the communication link configuration file.
[0089] The query module 41, the first judgment module 42, the second judgment module 43, the third judgment module 44 and the change module 45 included in the block diagram of the device for setting up a multi-application communication link applied to a service cluster are controlled to execute the method for setting up a multi-application communication link applied to a service cluster described in any of the above embodiments.
[0090] like Figure 5 As shown, the present invention provides an electronic device 500, the electronic device comprising: a communication interface, a processor 501, and a memory 502;
[0091] Among them, the memory 502 is used to store program instructions. When the program instructions are executed by the processor 501 that is communicatively connected to the memory 502 through the communication interface, when any application needs to perform data interaction in the server cluster, it is queried by querying the configuration file of the cache database to inquire whether the communication link involved in the data interaction exists; if it exists, it is determined whether the access according to the communication link is successful; if the access fails, it is determined whether the captured exception is related to the communication link; if it is related, it is determined whether the corresponding communication link in the communication link configuration file in the preset file server is consistent with the communication link involved in the data interaction; if not, the communication link involved in the data interaction is changed to the corresponding communication link in the communication link configuration file.
[0092] The present invention provides a computer-readable storage medium, on which computer program instructions are stored. When the computer program instructions are executed by a processor, when any application needs to perform data interaction in a server cluster, by querying a configuration file of a cache database, it is queried whether a communication link involved in the data interaction exists; if so, it is determined whether access is successful according to the communication link; if the access fails, it is determined whether a captured exception is related to the communication link; if so, it is determined whether a corresponding communication link in a communication link configuration file in a preset file server is consistent with the communication link involved in the data interaction; if not, the communication link involved in the data interaction is changed to a corresponding communication link in the communication link configuration file.
[0093] It should be understood that the specific features, operations and details described hereinabove about the method of the present invention may also be similarly applied to the device and system of the present invention, or, vice versa. In addition, each step of the method of the present invention described above may be performed by the corresponding parts or units of the device or system of the present invention.
[0094] It should be understood that each module / unit of the device of the present invention can be implemented in whole or in part by software, hardware, firmware or a combination thereof. Each module / unit can be embedded in the processor of the computer device in the form of hardware or firmware or independent of the processor, or can be stored in the memory of the computer device in the form of software for the processor to call to perform the operation of each module / unit. Each module / unit can be implemented as an independent component or module, or two or more modules / units can be implemented as a single component or module.
[0095] In one embodiment, a computer device is provided, which includes a memory and a processor, and the memory stores computer instructions executable by the processor, and the computer instructions instruct the processor to execute each step of the method of the embodiment of the present invention when executed by the processor. The computer device can be a server, a terminal, or any other electronic device with necessary computing and / or processing capabilities in a broad sense. In one embodiment, the computer device may include a processor, a memory, a network interface, a communication interface, etc. connected through a system bus. The processor of the computer device can be used to provide necessary computing, processing and / or control capabilities. The memory of the computer device may include a non-volatile storage medium and an internal memory. An operating system, a computer program, etc. may be stored in or on the non-volatile storage medium. The internal memory can provide an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface and the communication interface of the computer device can be used to connect and communicate with external devices through a network. The steps of the method of the present invention are executed by the processor.
[0096] The present invention may be implemented as a computer-readable storage medium having a computer program stored thereon, which causes the steps of the method of an embodiment of the present invention to be executed when executed by a processor. In one embodiment, the computer program is distributed on a plurality of computer devices or processors coupled to a network so that the computer program is stored, accessed, and executed in a distributed manner by one or more computer devices or processors. A single method step / operation, or two or more method steps / operations, may be performed by a single computer device or processor or by two or more computer devices or processors. One or more method steps / operations may be performed by one or more computer devices or processors, and one or more other method steps / operations may be performed by one or more other computer devices or processors. One or more computer devices or processors may perform a single method step / operation, or perform two or more method steps / operations.
[0097] It will be understood by those skilled in the art that the method steps of the present invention can be completed by instructing related hardware such as a computer device or a processor through a computer program, and the computer program can be stored in a non-temporary computer-readable storage medium, and the steps of the present invention are executed when the computer program is executed. Depending on the circumstances, any reference to memory, storage, database or other media herein may include non-volatile and / or volatile memory. Examples of non-volatile memory include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (which can update the access links of each application, ultimately achieving rapid and accurate deployment of multiple applications, ensuring stable communication between applications and stable data), flash memory, magnetic tape, floppy disk, magneto-optical data storage device, optical data storage device, hard disk, solid state disk, etc. Examples of volatile memory include random access memory (RAM), external cache memory, etc.
[0098] The various technical features described above can be combined arbitrarily. Although all possible combinations of these technical features are not described, any combination of these technical features should be considered to be covered by this specification as long as there is no contradiction in such combination.
[0099] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for setting a multi-application communication link for a service cluster, characterized in that: include: When any application needs to perform data interaction in the server cluster, it queries the configuration file of the cache database to check whether the communication link involved in the data interaction exists; If so, determining whether access according to the communication link is successful; If the access fails, determine whether the captured exception is related to the communication link; If relevant, determining whether the corresponding communication link in the communication link configuration file in the preset file server is consistent with the communication link involved in the data interaction; If they are inconsistent, the communication link involved in the data interaction is changed to a corresponding communication link in the communication link configuration file.
2. The method for setting a multi-application communication link applied to a service cluster as claimed in claim 1, characterized in that: Also includes: Determining whether a communication link needs to be set for any application, wherein the setting includes any one of deployment and update; When the above judgment is true, all communication links involved in the application are updated in the communication link configuration file in the preset file server.
3. The method for setting a multi-application communication link applied to a service cluster as claimed in claim 2, characterized in that: Also includes: Before application deployment, the preset file server is built and a communication link configuration file is created.
4. The method for setting a multi-application communication link applied to a service cluster as claimed in claim 1, characterized in that: Also includes: When any application needs to perform data interaction in the server cluster, it queries the configuration file of the cache database to check whether the communication link involved in the data interaction exists; If it does not exist, the corresponding communication link in the communication link configuration file in the preset file server is obtained and written into the data cache library, and data interaction is performed.
5. The method for setting a multi-application communication link for a service cluster as claimed in claim 1, characterized in that: Also includes: If they are inconsistent, the communication links involved in data interaction will be updated in the cache database; Data interaction is performed again according to the communication link updated in the cache database.
6. The method for setting a multi-application communication link for a service cluster as claimed in claim 1, characterized in that: Also includes: The file format of the communication link configuration file includes any one of JSON, XML, XLSX, CSV, and TXT.
7. A device for setting a multi-application communication link for a service cluster, characterized in that: include: A query module is used to query the configuration file of the cache database to check whether the communication link involved in the data interaction exists when any application needs to interact with data in the server cluster; A first determination module, used to determine whether access according to the communication link is successful, if any; The second judgment module is used to judge whether the captured exception is related to the communication link if the access fails; A third judgment module, if relevant, judges whether the corresponding communication link in the communication link configuration file in the preset file server is consistent with the communication link involved in the data interaction; The changing module changes the communication link involved in the data interaction to a corresponding communication link in the communication link configuration file if there is inconsistency.
8. The device for setting a multi-application communication link for a service cluster as claimed in claim 7, characterized in that: The query module, the first judgment module, the second judgment module, the third judgment module and the change module are controlled to execute the method for setting a multi-application communication link applied to a service cluster as described in any one of claims 1-6.
9. An electronic device, characterized in that: include: Communication interface, processor, memory; Wherein, the memory is used to store program instructions, and when the program instructions are executed by the processor that is communicatively connected to the memory through the communication interface, the electronic device implements the method for setting up a multi-application communication link applied to a service cluster as described in any one of claims 1 to 6.
10. A computer-readable storage medium having program instructions stored thereon, characterized in that: When the program instructions are executed by a computer, the computer implements the method for setting a multi-application communication link applied to a service cluster as described in any one of claims 1 to 6.