A routing allocation method and system based on master database priority
By adopting the main database priority routing allocation method in the financial information system, using the API gateway to determine the downstream information system in the same computer room as the main database, and prioritize the allocation of traffic, the cross-client room call problem caused by evenly allocating traffic is solved, and the response is improved Speed and realize disaster recovery in a single-computer room.
Patent Information
- Application Number
- CN202211057837.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-31
- Publication Date
- 2024-12-24
- Estimated Expiration
- 2042-08-31
AI Technical Summary
In the distributed architecture of financial information systems, even distribution of traffic causes the application and the database main library to be in the same computer room, resulting in cross-computer room calls increasing network time-consuming and affecting user experience.
Using the routing allocation method based on the main library priority, the IP information of the database main library is pre-saved through the API gateway, and based on the IP and system identification information sent when the downstream information system is registered for the downstream information system, the downstream information system in the same computer room as the main library is determined. , priority is given to allocating traffic to the system in the same computer room of the main library.
It effectively reduces the probability of cross-client room calls, improves response time, realizes the purpose of disaster recovery in a single-client room, and avoids the increase in network time-consuming caused by requests to be allocated to non-main library rooms.
Smart Images

Figure CN115473942B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a routing allocation method and system based on master database priority. Background Art
[0002] In financial information systems, distributed architecture is becoming more and more common. Under the distributed architecture system, there will be a large number of mutual calls between information systems and application access to databases. A large number of enterprises use API gateways to manage and control calls between systems. The general distribution method is to evenly distribute traffic based on the downstream response system. In the context of financial enterprises building disaster recovery for IT systems, with the emergence of active-active requirements, evenly distributing traffic will cause part of the traffic to be distributed to other computer rooms. At this time, there is a situation where the application and the database master are not in the same computer room, and the write request must be connected to the database master. When a transaction includes a large number of write requests, there will be a large number of cross-computer room accesses. The response time becomes longer due to the increase in the time-consuming network call across computer rooms, which leads to a decline in user experience. Summary of the invention
[0003] In order to address the deficiencies of the prior art, the present invention proposes a routing allocation method and system based on primary database priority. The routing allocation based on primary database priority can not only achieve the disaster recovery purpose of a single computer room disaster, but also reduce the probability of cross-computer room calls, so as to avoid the increase in network time consumption caused by the request being allocated to a non-primary database computer room.
[0004] To achieve the above objectives, the technical solutions adopted by the present invention include:
[0005] A routing allocation method based on primary database priority, comprising:
[0006] S1. The first system sends a call request to the API gateway to call the second system, where the call request includes the IP address information and system identification information of the second system;
[0007] S2. The API gateway determines the second system in the same computer room as the database master database according to the IP address information, system identification information and the database master database IP information;
[0008] S3. Allocate the call request to the second system in the same computer room as the main database.
[0009] Furthermore, before S1, the method further includes: deploying the first system and the second system on servers in different computer rooms;
[0010] When the first system and the second system register services with the API gateway, the corresponding IP address information and system identification information are attached;
[0011] The second system is a downstream information system of the first system.
[0012] Furthermore, the method also includes the API gateway pre-saving the database master database IP information.
[0013] Furthermore, the first system corresponds to a plurality of different second systems, and the system identification information of the different second systems is different.
[0014] The present invention also relates to a routing distribution system based on primary database priority, comprising:
[0015] A call request transmission module, used for the first system to send a call request to the API gateway to call the second system, wherein the call request includes the IP address information and system identification information of the second system;
[0016] A judgment module, used for the API gateway to determine the second system in the same computer room as the database master database according to the IP address information, system identification information and the database master database IP information;
[0017] The processing module is used to distribute the call request to the second system in the same computer room as the main database.
[0018] The present invention also relates to a computer-readable storage medium, on which a computer program is stored, and the computer program implements the above method when executed by a processor.
[0019] The present invention also relates to an electronic device, comprising a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the above method when executing the computer program.
[0020] The present invention also relates to a computer program product, comprising a computer program and / or instructions, characterized in that the computer program and / or instructions implement the steps of the above method when executed by a processor.
[0021] The beneficial effects of the present invention are:
[0022] The API gateway pre-saves the IP information of the main database and the IP and system identification information sent by the downstream information system when registering the service, determines the IP address information of the downstream information system in the same computer room as the main database, and preferentially allocates traffic to the downstream information system in the same computer room as the main database. The routing allocation based on the priority of the main database can not only achieve the disaster recovery purpose of a single computer room disaster, but also effectively reduce the probability of cross-computer room calls. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] Figure 1 The present invention is a schematic flow chart of a routing allocation method based on primary database priority.
[0024] Figure 2 The figure is a schematic diagram of the process of sending IP address information and system identification information in an embodiment of the present invention.
[0025] Figure 3 The figure is a schematic diagram of a process for determining route allocation in an embodiment of the present invention.
[0026] Figure 4 A schematic diagram of the structure of a routing distribution system based on master database priority according to the present invention DETAILED DESCRIPTION
[0027] 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.
[0028] The first aspect of the present invention relates to a process of steps as follows Figure 1 The routing allocation method based on primary database priority shown includes:
[0029] Step 1: The first system sends a call request to the API gateway to call the second system, where the call request includes the IP address information and system identification information of the second system;
[0030] Specifically, before step 1, the method further includes deploying the first system and the second system on servers in different computer rooms;
[0031] When the first system and the second system register services with the API gateway, the corresponding IP address information and system identification information are attached;
[0032] The second system is a downstream information system of the first system.
[0033] The first system corresponds to a plurality of different second systems, and the system identification information of the different second systems is different.
[0034] Specifically, in the embodiment of the present application, the credit order system and the credit line system are essential systems for financial credit business. Taking the credit order system as the first system (upstream information system) and the credit line system as the second system (downstream information system) as an example, the credit order system and the credit line system are deployed in two computer rooms A and B, respectively, to provide services. The credit order system system identifier is M. Since the upstream information system corresponds to multiple downstream information systems, the system identifier information is used to determine the downstream information system called by this service. The instance IP address in computer room A is 192.168.1.1, and the instance IP address in computer room B is 192.168.2.1; the credit line system system identifier is N, the instance IP address in computer room A is 192.168.1.2, and the instance IP address in computer room B is 192.168.2.2; the credit line system uses the MySQL database, and the IP information of the main database in computer room A is 192.168.1.3. Among them, the IP addresses 192.168.1.1, 192.168.1.2 and 192.168.1.3 belong to computer room A, and the IP addresses 192.168.2.1 and 192.168.2.2 belong to computer room B.
[0035] The main database IP of the credit limit system N maintained in the backend provided by the API gateway is 192.168.1.3.
[0036] When registering, the credit order system and credit limit system services send IP address information to the API gateway, which are 192.168.1.1, 192.168.2.1, 192.168.1.2, and 192.168.2.2 respectively. At the same time, the information system identifiers sent are M and N, such as Figure 2 shown.
[0037] When the credit order system with the IP address of computer room A at 192.168.1.1 wants to call the credit limit system through the API gateway, it sends the downstream information system (credit limit system) identifier N to the API gateway.
[0038] Step 2: The API gateway determines the second system in the same computer room as the database master database according to the IP address information, system identification information and the database master database IP information;
[0039] Specifically, in the embodiment of the present application, the API gateway can obtain the information of the computer room to which it belongs based on the uploaded system identifier N and the main database IP (192.168.1.3). It can be known that the main database of the downstream information system (credit line system) of the call request is in computer room A, and at the same time, it can be obtained that the IP of the credit line system in computer room A is 192.168.1.2.
[0040] Step three: distribute the call request to the second system in the same computer room as the main database.
[0041] Specifically, in the embodiment of the present application, the API gateway allocates the call request to the credit line system with the IP address 192.168.1.2, and the process is as follows Figure 3 shown.
[0042] In the prior art, the general distribution method is to evenly distribute traffic based on the downstream response system. Evenly distributing traffic will cause part of the traffic to be distributed to other computer rooms. At this time, there is a situation where the application and the database master are not in the same computer room, and the write request must be connected to the database master. When a transaction includes a large number of write requests, there are a large number of cross-computer room access situations. The response time becomes longer due to the increase in the time consumption of calling the network across computer rooms, thereby causing a decrease in user experience. The present invention determines the IP address information of the downstream information system in the same computer room as the master library, and preferentially distributes traffic to the downstream information system in the same computer room as the master library, effectively avoiding the situation where the network time consumption increases due to the distribution of requests to non-master library computer rooms.
[0043] Another aspect of the present invention also relates to a routing distribution processing system based on primary database priority, the structure of which is as follows: Figure 4 As shown, including:
[0044] A call request transmission module, used for the first system to send a call request to the API gateway to call the second system, wherein the call request includes the IP address information and system identification information of the second system;
[0045] A judgment module, used for the API gateway to determine the second system in the same computer room as the database master database according to the IP address information, system identification information and the database master database IP information;
[0046] The processing module is used to distribute the call request to the second system in the same computer room as the main database.
[0047] By using this system, the above-mentioned operation processing method can be executed and the corresponding technical effects can be achieved.
[0048] An embodiment of the present invention also provides a computer-readable storage medium capable of implementing all the steps of the routing allocation method based on primary database priority in the above embodiment, wherein a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, all the steps of the routing allocation method based on primary database priority in the above embodiment are implemented.
[0049] An embodiment of the present invention also provides an electronic device for executing the above method. As an implementation device of the method, the electronic device has at least a processor and a memory, and in particular, the memory stores data and related computer programs required for executing the method, and the processor calls the data and programs in the memory to execute all steps of the implementation method and obtains the corresponding technical effect.
[0050] Preferably, the electronic device may include a bus architecture, the bus may include any number of interconnected buses and bridges, and the bus will include various circuits linked together by one or more processors and memories. The bus may also link together various other circuits such as peripherals, voltage regulators, and power management circuits, which are all well known in the art and are therefore not further described herein. The bus interface provides an interface between the bus and the receiver and transmitter. The receiver and transmitter may be the same component, i.e., a transceiver, providing a unit for communicating with various other systems over a transmission medium. The processor is responsible for managing the bus and general processing, while the memory may be used to store data used by the processor when performing operations.
[0051] In addition, the electronic device may further include components such as a communication module, an input unit, an audio processor, a display, and a power supply. The processor (or controller, operation control) used may include a microprocessor or other processor device and / or a logic device, which receives input and controls the operation of various components of the electronic device; the memory may be one or more of a cache, a flash memory, a hard drive, a removable medium, a volatile memory, a non-volatile memory, or other suitable devices, which may store the above-mentioned related data information, and may also store a program for executing related information, and the processor may execute the program stored in the memory to realize information storage or processing, etc.; the input unit is used to provide input to the processor, for example, it may be a key or a touch input device; the power supply is used to provide power to the electronic device; the display is used to display display objects such as images and text, for example, it may be an LCD display. The communication module is a transmitter / receiver that sends and receives signals via an antenna. The communication module (transmitter / receiver) is coupled to the processor to provide input signals and receive output signals, which may be the same as the case of a conventional mobile communication terminal. Based on different communication technologies, multiple communication modules may be provided in the same electronic device, such as a cellular network module, a Bluetooth module and / or a wireless local area network module, etc. The communication module (transmitter / receiver) is also coupled to a speaker and a microphone via an audio processor to provide an audio output via the speaker and receive an audio input from the microphone, thereby realizing a common telecommunication function. The audio processor may include any suitable buffer, decoder, amplifier, etc. In addition, the audio processor is also coupled to a central processor, so that recording can be performed on the machine through the microphone, and the sound stored on the machine can be played through the speaker.
[0052] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take 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.) containing computer-usable program code.
[0053] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of 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 produce 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 A process or multiple processes and / or boxes Figure 1 A system that specifies the functions of a box or multiple boxes.
[0054] These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable memory produce a product including an instruction system, which is implemented in the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0055] 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 A process or multiple processes and / or boxes Figure 1 The steps of the functions specified in a box or multiple boxes. Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they know the basic creative concept. Therefore, the attached claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.
[0056] The above is only a preferred specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed by the present invention 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.
Claims
1. A routing allocation method based on primary database priority, characterized in that: include: S1. The first system sends a call request to the API gateway to call the second system, where the call request includes the IP address information and system identification information of the second system; S2. The API gateway determines the second system in the same computer room as the database master database according to the IP address information, system identification information and the database master database IP information; S3, allocating the call request to the second system in the same computer room as the main database; Before S1, the method further includes: deploying the first system and the second system on servers in different computer rooms; When the first system and the second system register services with the API gateway, the corresponding IP address information and system identification information are attached; The second system is a downstream information system of the first system; The first system corresponds to a plurality of different second systems, and the system identification information of the different second systems is different.
2. The method according to claim 1, characterized in that The method also includes the API gateway pre-saving the database master database IP information.
3. A routing distribution system based on primary database priority, characterized in that: include: A call request transmission module, used for the first system to send a call request to the API gateway to call the second system, wherein the call request includes the IP address information and system identification information of the second system; A judgment module, used for the API gateway to determine the second system in the same computer room as the database master database according to the IP address information, system identification information and the database master database IP information; A processing module, used for allocating the call request to the second system in the same computer room as the main database; The system further includes: deploying the first system and the second system on servers in different computer rooms before the first system sends a call request to the API gateway to call the second system; When the first system and the second system register services with the API gateway, the corresponding IP address information and system identification information are attached; the second system is the downstream information system of the first system; The first system corresponds to a plurality of different second systems, and the system identification information of the different second systems is different.
4. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 2 is implemented.
5. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 2 is implemented.
6. A computer program product comprising a computer program and / or instructions, characterized in that: When the computer program and / or the instructions are executed by a processor, the steps of the method according to any one of claims 1 to 2 are implemented.
