[go: up one dir, main page]

CN115473942B - A routing allocation method and system based on master database priority - Google Patents

A routing allocation method and system based on master database priority Download PDF

Info

Publication number
CN115473942B
CN115473942B CN202211057837.0A CN202211057837A CN115473942B CN 115473942 B CN115473942 B CN 115473942B CN 202211057837 A CN202211057837 A CN 202211057837A CN 115473942 B CN115473942 B CN 115473942B
Authority
CN
China
Prior art keywords
information
api gateway
identification information
database
different
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202211057837.0A
Other languages
Chinese (zh)
Other versions
CN115473942A (en
Inventor
周欢
周竣涛
辛子英
王一嘉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
CITIC Aibank Corp Ltd
Original Assignee
CITIC Aibank Corp Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by CITIC Aibank Corp Ltd filed Critical CITIC Aibank Corp Ltd
Priority to CN202211057837.0A priority Critical patent/CN115473942B/en
Publication of CN115473942A publication Critical patent/CN115473942A/en
Application granted granted Critical
Publication of CN115473942B publication Critical patent/CN115473942B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/02Topology update or discovery
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/30Routing of multiclass traffic
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/74Address processing for routing

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

本发明涉及一种基于主库优先的路由分配方法及系统,包括第一系统向API网关发送调用请求调用第二系统,所述调用请求包括所述第二系统的ip地址信息和系统标识信息;API网关根据所述ip地址信息、系统标识信息和数据主库ip信息确定与数据库主库在同一机房的第二系统;将所述调用请求分配至所述与数据库主库在同一机房的第二系统。基于主库优先的路由分配既能达到单机房灾难的容灾目的,又能降低跨机房调用发生的概率,以避免请求分配到非主库机房导致的网络耗时增加的情况。

The present invention relates to a method and system for routing allocation based on master database priority, comprising: a first system sends a call request to an API gateway to call a second system, the call request includes the IP address information and system identification information of the second system; the API gateway determines the second system in the same computer room as the database master database according to the IP address information, the system identification information and the IP information of the database master database; and the call request is allocated to the second system in the same computer room as the database master database. Routing allocation based on master database priority can achieve the purpose of disaster recovery for single computer room disasters and reduce the probability of cross-computer room calls, so as to avoid the situation where the network time consumption increases due to the request being allocated to a non-master database computer room.

Description

Route distribution method and system based on master library priority
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method and a system for route allocation based on master library priority.
Background
In a financial information system, a distributed architecture is more and more popular, and under the distributed architecture system, a large number of information systems are used inter-mutually and have application access to a database, a large number of enterprises adopt an API gateway mode to manage and control inter-system call, and a general distribution mode is to uniformly distribute flow based on the downstream response system condition. Under the background that financial enterprises carry out IT system disaster recovery construction, even distribution flow can lead to a part of flow to be distributed to other machine rooms along with the occurrence of double-activity demands, when the application and a database main library are not in one machine room, a write request can be connected with the database main library, when a transaction contains a large number of write requests, a large number of cross-machine room access conditions exist, and the response time caused by the increase of the time consumption of calling a network across the machine rooms is prolonged, so that the user experience is reduced.
Disclosure of Invention
In order to solve the defects in the prior art, the invention provides a routing distribution method and a system based on the priority of a master library, which can not only achieve the disaster recovery purpose of a single-machine-room disaster, but also reduce the probability of cross-machine-room calling so as to avoid the condition of increased network time consumption caused by the fact that a request is distributed to a non-master-library machine room.
In order to achieve the above object, the present invention adopts the technical scheme that:
a routing allocation method based on master library priority comprises the following steps:
S1, a first system sends a calling request to an API gateway to call a second system, wherein the calling request comprises ip address information and system identification information of the second system;
S2, the API gateway determines a second system which is in the same machine room with the database main library according to the ip address information, the system identification information and the database main library ip information;
S3, distributing the call request to the second system which is in the same machine room with the database main library.
Further, before the step S1, the method further comprises the steps of disposing the first system and the second system on servers of different machine rooms;
when the first system and the second system register service to the API gateway, corresponding ip address information and system identification information are attached;
The second system is a downstream information system of the first system.
Further, the method further comprises the step that the API gateway pre-stores the database master base ip information.
Further, the first system corresponds to a plurality of different second systems, and the system identification information of the different second systems is different.
The invention also relates to a routing distribution system based on the master library priority, which comprises:
the calling request transmission module is used for sending a calling request to the API gateway by the first system to call the second system, wherein the calling request comprises ip address information and system identification information of the second system;
The judging module is used for determining a second system which is in the same machine room with the database main library according to the ip address information, the system identification information and the data main library ip information by the API gateway;
And the processing module is used for distributing the calling request to the second system which is in the same machine room with the database main library.
The invention also relates to a computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, implements the above-mentioned method.
The invention also relates to an electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, which processor implements the above-mentioned method when executing the computer program.
The invention also relates to a computer program product comprising a computer program and/or instructions, characterized in that the computer program and/or instructions, when executed by a processor, implement the steps of the above-mentioned method.
The beneficial effects of the invention are as follows:
The method comprises the steps of pre-storing the ip information of a main library through an API gateway, determining the ip address information of a downstream information system in the same machine room as the main library according to the ip and system identification information sent by the downstream information system during registration service, and preferentially distributing flow to the downstream information systems in the same machine room as the main library. The route distribution based on the priority of the main library can not only achieve the disaster recovery purpose of the single-machine-room disaster, but also effectively reduce the probability of cross-machine-room calling.
Drawings
Fig. 1 is a schematic flow chart of a routing allocation method based on master pool priority in the present invention.
Fig. 2 is a flow chart of uploading IP address information and system identification information in an embodiment of the present invention.
Fig. 3 is a schematic diagram of a route allocation determining process according to an embodiment of the present invention.
FIG. 4 is a schematic diagram of a routing distribution system based on master pool priority according to the present invention
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
The first aspect of the present invention relates to a routing allocation method based on master pool priority, which is shown in fig. 1 and includes:
Step one, a first system sends a calling request to an API gateway to call a second system, wherein the calling request comprises ip address information and system identification information of the second system;
Specifically, the first step further comprises deploying the first system and the second system on servers of different machine rooms;
when the first system and the second system register service to the API gateway, 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, the system identification information of the different second systems being different.
Specifically, in the embodiment of the present application, the credit order system and the credit line system are systems necessary for financial credit business, taking the credit order system as a first system (upstream information system) and the credit line system as a second system (downstream information system) as examples, the credit order system and the credit line system each deploy an example to provide services in two machine rooms a and B, wherein the credit order system is identified as M, and the system identification information is used for determining the downstream information system of the service call because the upstream information system corresponds to a plurality of downstream information systems. The example ip address of the machine room A is 192.168.1.1, the example ip address of the machine room B is 192.168.2.1, the credit line system is identified as N, the example ip address of the machine room A is 192.168.1.2, the example ip address of the machine room B is 192.168.2.2, the credit line system uses a mysql database, and the main database is 192.168.1.3 in the machine room A. Wherein, maintaining ip addresses 192.168.1.1,192.168.1.2 and 192.168.1.3 in the back pipe provided by the API gateway belongs to the a machine room, and ip addresses 192.168.2.1 and 192.168.2.2 belong to the B machine room.
The main repository ip of credit line system N is maintained at 192.168.1.3 in the back pipe provided by the API gateway.
The credit order system and credit line system service register to send IP address information to the API gateway 192.168.1.1,192.168.2.1,192.168.1.2,192.168.2.2, respectively, while the send information systems are identified as M and N, as shown in FIG. 2.
When the credit order system with the ip address of the machine room A being 192.168.1.1 wants to call the credit line system through the API gateway, the downstream information system (the credit line system) is sent to the API gateway for identifying N.
Step two, the API gateway determines a second system which is in the same machine room with the database main library according to the ip address information, the system identification information and the database main library ip information;
Specifically, in the embodiment of the present application, the API gateway may obtain the information of the machine room to which the API gateway belongs according to the system identifier N and the master repository ip (192.168.1.3), and may know that the master repository of the downstream information system (credit line system) of the call request is in the machine room a, and may obtain that ip of the credit line system in the machine room a is 192.168.1.2.
And thirdly, distributing the calling request to the second system which is in the same machine room with the database main library.
Specifically, in an embodiment of the present application, the API gateway distributes a call request to the credit line system with ip address 192.168.1.2, and the flow is shown in fig. 3.
In the prior art, the general allocation mode is that the flow is evenly allocated based on the condition of a downstream response system, and the even allocation flow can lead to that a part of flow is allocated to other machine rooms, so that the situation that an application and a database main library are not in one machine room exists at the moment, and a write request is only needed to be connected with the database main library, when a transaction contains a large number of write requests, a large number of cross-machine room access situations exist, and the response time caused by the increase of the time consumption of calling a network across the machine rooms is prolonged, so that the user experience is reduced. According to the invention, the ip address information of the downstream information system in the same machine room as the main library is determined, so that the flow is preferentially distributed to the downstream information system in the same machine room as the main library, and the condition that the time consumption of the network is increased due to the fact that the request is distributed to the machine room of the non-main library is effectively avoided.
Another aspect of the present invention further relates to a routing allocation processing system based on master pool priority, where the structure of the routing allocation processing system is as shown in fig. 4, and the routing allocation processing system includes:
the calling request transmission module is used for sending a calling request to the API gateway by the first system to call the second system, wherein the calling request comprises ip address information and system identification information of the second system;
The judging module is used for determining a second system which is in the same machine room with the database main library according to the ip address information, the system identification information and the data main library ip information by the API gateway;
And the processing module is used for distributing the calling request to the second system which is in the same machine room with the database main library.
By using the system, the above-mentioned operation processing method can be executed and the corresponding technical effects can be achieved.
The embodiment of the present invention also provides a computer readable storage medium capable of implementing all the steps of the master-library-priority-based route allocation method in the above embodiment, the computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements all the steps of the master-library-priority-based route allocation method in the above embodiment.
The embodiment of the invention also provides an electronic device for executing the method, which is used as an implementation device of the method, and at least comprises a processor and a memory, wherein the memory is particularly used for storing data and related computer programs required by executing the method, and the data and the programs in the memory are called by the processor to execute all the steps of the implementation method, so that the corresponding technical effects are obtained.
Preferably, the electronic device may comprise a bus architecture, and the bus may comprise any number of interconnected buses and bridges, the buses linking together various circuits, including the one or more processors and memory. The bus may also link together various other circuits such as peripheral devices, voltage regulators, power management circuits, etc., as are well known in the art and, therefore, will not be further described herein. The bus interface provides an interface between the bus and the receiver and transmitter. The receiver and the transmitter may be the same element, 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 in performing operations.
Additionally, the electronic device may further include a communication module, an input unit, an audio processor, a display, a power supply, and the like. The processor (or referred to as a controller, an operation control) employed may comprise a microprocessor or other processor device and/or logic device that receives input and controls operation of various components of the electronic device, the memory may be one or more of a buffer, a flash memory, a hard drive, a removable medium, a volatile memory, a non-volatile memory, or other suitable device, may store data information related to the above, may further store a program that executes the related information, and the processor may execute the program stored by the memory to implement information storage or processing, etc., the input unit is for providing input to the processor, which may be, for example, a key or touch input device, the power supply is for providing power to the electronic device, and the display is for performing display of display objects such as images and text, which may be, for example, an LCD display. The communication module is a transmitter/receiver that transmits and receives signals via an antenna. The communication module (transmitter/receiver) is coupled to the processor to provide an input signal and to receive an output signal, which may be the same as in the case of a conventional mobile communication terminal. Based on different communication technologies, a plurality of communication modules, such as a cellular network module, a bluetooth module, and/or a wireless local area network module, etc., may be provided in the same electronic device. The communication module (transmitter/receiver) is also coupled to the speaker and microphone via the audio processor to provide audio output via the speaker and to receive audio input from the microphone to implement the usual telecommunications functions. The audio processor may include any suitable buffers, decoders, amplifiers and so forth. In addition, the audio processor is also coupled to the central processor so that sound can be recorded on the host through the microphone and sound stored on the host can be played through the speaker.
It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create a system for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks. While preferred embodiments of the present invention have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. It is therefore intended that the following claims be interpreted as including the preferred embodiments and all such alterations and modifications as fall within the scope of the invention.
The foregoing is only a preferred embodiment of the present invention, but the scope of the present invention is not limited thereto, and any changes or substitutions easily contemplated by those skilled in the art within the scope of the present invention should be included in the scope of the present invention. Therefore, the protection scope of the present invention should be subject to the protection scope of the claims.

Claims (6)

1. A method for routing assignment based on master pool priority, comprising:
S1, a first system sends a calling request to an API gateway to call a second system, wherein the calling request comprises ip address information and system identification information of the second system;
S2, the API gateway determines a second system which is in the same machine room with the database main library according to the ip address information, the system identification information and the database main library ip information;
s3, distributing the call request to the second system which is in the same machine room with the database main library;
Before the step S1, the method further comprises the steps of disposing the first system and the second system on servers of different machine rooms;
when the first system and the second system register service to the API gateway, 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, the system identification information of the different second systems being different.
2. The method of claim 1, further comprising an API gateway pre-storing the database master base ip information.
3. A master-library-based priority routing distribution system, comprising:
the calling request transmission module is used for sending a calling request to the API gateway by the first system to call the second system, wherein the calling request comprises ip address information and system identification information of the second system;
The judging module is used for determining a second system which is in the same machine room with the database main library according to the ip address information, the system identification information and the data main library ip information by the API gateway;
the processing module is used for distributing the calling request to the second system which is in the same machine room with the database main library;
The system further comprises that before the first system sends a call request to the API gateway to call the second system, the first system and the second system are deployed on servers of different machine rooms;
When registering service to an API gateway, the first system and the second system attach corresponding ip address information and system identification information;
The first system corresponds to a plurality of different second systems, the system identification information of the different second systems being different.
4. A computer readable storage medium, characterized in that the storage medium has stored thereon a computer program which, when executed by a processor, implements the method of any of claims 1 to 2.
5. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the method of any of claims 1 to 2 when executing the computer program.
6. A computer program product comprising a computer program and/or instructions which, when executed by a processor, implement the steps of the method of any one of claims 1 to 2.
CN202211057837.0A 2022-08-31 2022-08-31 A routing allocation method and system based on master database priority Active CN115473942B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211057837.0A CN115473942B (en) 2022-08-31 2022-08-31 A routing allocation method and system based on master database priority

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211057837.0A CN115473942B (en) 2022-08-31 2022-08-31 A routing allocation method and system based on master database priority

Publications (2)

Publication Number Publication Date
CN115473942A CN115473942A (en) 2022-12-13
CN115473942B true CN115473942B (en) 2024-12-24

Family

ID=84369313

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211057837.0A Active CN115473942B (en) 2022-08-31 2022-08-31 A routing allocation method and system based on master database priority

Country Status (1)

Country Link
CN (1) CN115473942B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111181865A (en) * 2019-12-11 2020-05-19 天翼电子商务有限公司 A service-based traffic distribution method and system, storage medium and terminal
CN113961529A (en) * 2021-10-27 2022-01-21 唯品会(广州)软件有限公司 Distributed file system and file caching method

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11689414B2 (en) * 2017-11-10 2023-06-27 International Business Machines Corporation Accessing gateway management console
CN114564450B (en) * 2022-03-04 2023-02-28 北京宇信科技集团股份有限公司 Processing method, device, system, medium and equipment of distributed file system

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111181865A (en) * 2019-12-11 2020-05-19 天翼电子商务有限公司 A service-based traffic distribution method and system, storage medium and terminal
CN113961529A (en) * 2021-10-27 2022-01-21 唯品会(广州)软件有限公司 Distributed file system and file caching method

Also Published As

Publication number Publication date
CN115473942A (en) 2022-12-13

Similar Documents

Publication Publication Date Title
US11146502B2 (en) Method and apparatus for allocating resource
CN109857551B (en) Service resource scheduling method and device based on cloud computing and electronic equipment
CN106713028B (en) Service degradation method, device and distributed task scheduling system
CN110673964A (en) Audio playing control method and device of vehicle-mounted system
CN103294444B (en) The supplying method of computing machine shared platform sound intermediate frequency data and device
CN112199193A (en) Resource scheduling method and device, electronic equipment and storage medium
CN112003957B (en) Method, device, server and storage medium for scheduling access point
CN111858050A (en) Server cluster mixed deployment method, cluster management node and related system
CN111222862A (en) Data processing method and system, medium and computer system
CN111930843B (en) Database-based data system and processing method
CN111949614B (en) Bank system file conversion method and device
CN116414527A (en) Method and system for greatly improving performance of distributed transaction coordinator
CN109508912B (en) Service scheduling method, device, equipment and storage medium
CN115473942B (en) A routing allocation method and system based on master database priority
US20180253809A1 (en) Method and system for distributing floating licenses for real-time services
CN115756868A (en) Memory allocation method, device, equipment, storage medium and computer program product
CN115412610A (en) Traffic Scheduling Method and Device in Failure Scenario
CN111930626B (en) Automated testing method and device based on PaaS cloud service
CN116185755B (en) Data processing method and device for distributed load balancing system
CN115098593B (en) Dynamic cache financial wind control event data processing method and system
CN112445574A (en) Application container multi-cluster migration method and device
CN116756161A (en) Serverless-based distributed batch anti-duplication method and device
US11695853B1 (en) Content management systems providing zero recovery point objective
CN116069855A (en) Distributed service routing method and device
CN117499490A (en) Multi-cluster-based network scheduling method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant