CN114531492B - Service calling method, device, storage medium and computer equipment - Google Patents
Service calling method, device, storage medium and computer equipment Download PDFInfo
- Publication number
- CN114531492B CN114531492B CN202011222802.9A CN202011222802A CN114531492B CN 114531492 B CN114531492 B CN 114531492B CN 202011222802 A CN202011222802 A CN 202011222802A CN 114531492 B CN114531492 B CN 114531492B
- Authority
- CN
- China
- Prior art keywords
- service
- database
- service center
- identifier
- main database
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 48
- 238000013507 mapping Methods 0.000 claims abstract description 45
- 238000001514 detection method Methods 0.000 claims description 17
- 238000012360 testing method Methods 0.000 claims description 12
- 238000004590 computer program Methods 0.000 claims description 2
- 230000000694 effects Effects 0.000 abstract description 9
- 239000010410 layer Substances 0.000 description 11
- 238000010586 diagram Methods 0.000 description 7
- 230000006870 function Effects 0.000 description 5
- 230000008569 process Effects 0.000 description 3
- 238000012545 processing Methods 0.000 description 3
- 238000003491 array Methods 0.000 description 2
- 238000013461 design Methods 0.000 description 2
- 238000012423 maintenance Methods 0.000 description 2
- 239000000463 material Substances 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000012544 monitoring process Methods 0.000 description 2
- 238000004458 analytical method Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000007246 mechanism Effects 0.000 description 1
- 238000013508 migration Methods 0.000 description 1
- 230000005012 migration Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 239000002356 single layer Substances 0.000 description 1
- 230000001960 triggered effect Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/21—Design, administration or maintenance of databases
- G06F16/214—Database migration support
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/25—Integrating or interfacing systems involving database management systems
Landscapes
- Engineering & Computer Science (AREA)
- Databases & Information Systems (AREA)
- Theoretical Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The application provides a service calling method, a device, a storage medium and computer equipment, which are applied to a first calling device, wherein the first calling device is any one calling device of a plurality of calling devices, and the first calling device is used for providing routing service for a corresponding first service center, and the method comprises the following steps: when a service request is received, determining a main database identifier corresponding to the service request; determining the identification of a second service center corresponding to the database to which the main database identification belongs according to the main database identification and the mapping relation between the main database identification and the service center; and routing the service request to the second service center according to the identification of the second service center. The application can effectively reduce the architecture complexity of the business system, shorten the business service calling path and improve the business service calling effect.
Description
Technical Field
The present application relates to the field of computer technologies, and in particular, to a service calling method, a device, a storage medium, and a computer apparatus.
Background
In the internet domain, system platforms can generally be divided into a three-tier architecture of a service consumer tier, a service provider tier, and a database tier. The service consumer layer issues a service request to the service provider layer to invoke a service provided by the service provider layer. In some application scenarios, the system platform may be deployed in multiple data centers at the same time, where the geographic locations deployed by different data centers may be the same or different, and where servers (e.g., a single server or a cluster of servers) supporting the operation of the service are deployed in each data center.
In the related art, a layer of API (Application Programming Interface, application program interface) gateway (API GATEWAY) is separately configured between a service consumer layer and a service provider layer, so that a service request issued by the service consumer layer is routed to a data center corresponding to the service provider layer to invoke a service of a corresponding service center. However, this way of deploying a layer of independent API gateway will result in a complex system architecture, which affects the calling effect of the business service.
Disclosure of Invention
The present application aims to solve at least one of the technical problems in the related art to some extent.
Therefore, the application provides a service calling method, a device, a storage medium and computer equipment, which can effectively reduce the architecture complexity of a service system, shorten the service calling path and improve the service calling effect.
In order to achieve the above object, a service calling method according to an embodiment of a first aspect of the present application is applied to a first calling device, where the first calling device is any one of a plurality of calling devices, and the first calling device is configured to provide a routing service for a corresponding first service center, and the method includes: when a service request is received, determining a main database identifier corresponding to the service request; determining an identification of a second service center corresponding to a database to which the main database identification belongs according to the main database identification and the mapping relation between the main database identification and the service center; and routing the service request to the second service center according to the identification of the second service center.
According to the service calling method provided by the embodiment of the first aspect of the application, when the service request is received, the main database identifier corresponding to the service request is determined, the identifier of the second service center corresponding to the database to which the main database identifier belongs is determined according to the main database identifier and the mapping relation between the main database identifier and the service center, and the service request is routed to the second service center according to the identifier of the second service center.
In order to achieve the above object, an embodiment of a second aspect of the present application provides a service invocation apparatus, including: the first determining module is used for determining a main database identifier corresponding to a service request when the service request is received; the second determining module is used for determining the identifier of a second service center corresponding to the database to which the main database identifier belongs according to the main database identifier and the mapping relation between the main database identifier and the service center; and the calling module is used for routing the service request to the second service center according to the identifier of the second service center.
According to the service calling device provided by the embodiment of the second aspect of the application, when the service request is received, the main database identifier corresponding to the service request is determined, the identifier of the second service center corresponding to the database to which the main database identifier belongs is determined according to the main database identifier and the mapping relation between the main database identifier and the service center, and the service request is routed to the second service center according to the identifier of the second service center.
A non-transitory computer readable storage medium according to an embodiment of the third aspect of the present application, when executed by a processor of a computer device, causes the computer device to perform a service invocation method, the method comprising: the embodiment of the first aspect of the application provides a service calling method.
According to the non-transitory computer readable storage medium provided by the third aspect of the embodiment of the application, when the service request is received, the main database identifier corresponding to the service request is determined, the identifier of the second service center corresponding to the database to which the main database identifier belongs is determined according to the main database identifier and the mapping relation between the main database identifier and the service center, and the service request is routed to the second service center according to the identifier of the second service center.
An embodiment of a fourth aspect of the present application provides a computer device, including: the device comprises a shell, a calling device, a memory, a circuit board and a power circuit, wherein the circuit board is arranged in a space surrounded by the shell, and the calling device and the memory are arranged on the circuit board; the power supply circuit is used for supplying power to various circuits or devices of the computer equipment; the memory is used for storing executable program codes; the calling device runs a program corresponding to the executable program code by reading the executable program code stored in the memory, so as to be used for executing the service calling method provided by the embodiment of the first aspect of the application.
The computer device provided by the fourth aspect of the embodiment of the application determines the main database identifier corresponding to the service request when receiving the service request, determines the identifier of the second service center corresponding to the database to which the main database identifier belongs according to the main database identifier and the mapping relation between the main database identifier and the service center, and routes the service request to the second service center according to the identifier of the second service center.
Additional aspects and advantages of the application will be set forth in part in the description which follows and, in part, will be obvious from the description, or may be learned by practice of the application.
Drawings
The foregoing and/or additional aspects and advantages of the application will become apparent and readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings, in which:
FIG. 1 is a flowchart of a service invocation method according to an embodiment of the present application;
FIG. 2 is a schematic diagram of a clearing system according to an embodiment of the present application;
FIG. 3 is a flowchart of a service invocation method according to another embodiment of the present application;
FIG. 4 is a flowchart of a service invocation method according to another embodiment of the present application;
FIG. 5 is a schematic diagram of a service invocation apparatus according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of a service invocation apparatus according to another embodiment of the present application;
fig. 7 is a schematic structural diagram of a computer device according to an embodiment of the present application.
Detailed Description
Embodiments of the present application are described in detail below, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to like or similar elements or elements having like or similar functions throughout. The embodiments described below by referring to the drawings are illustrative only and are not to be construed as limiting the application. On the contrary, the embodiments of the application include all alternatives, modifications and equivalents as may be included within the spirit and scope of the appended claims.
Fig. 1 is a flowchart of a service invocation method according to an embodiment of the present application.
The present embodiment is exemplified in the service invocation method configured in the service invocation apparatus.
The service calling method in this embodiment is applied to a first calling device, where the first calling device is any one calling device of multiple calling devices, and the first calling device is configured to provide a routing service for a corresponding first service center, where a service center corresponding to the first calling device may be referred to as a first service center.
The calling device can be configured in a clearing system, for example, the calling device can be used for managing a corresponding service center in the clearing system, and the calling device in the embodiment of the application can provide a routing service so as to route a service request to the corresponding service center, and of course, the calling device can also be configured in any other service system, so that the method is not limited.
Embodiments of the present application are illustrated in a clearing system with a calling device configuration.
For example, the architecture of the clearing system generally includes a plurality of service centers, one data center corresponding to each service center, where one or more databases are configured, or a database cluster is configured, where the service centers access service data stored in the corresponding data centers to provide service to the outside, and the services provided by different service centers may be the same or different, and different service centers may also be configured in the same geographic location or in different geographic locations.
The calling device in the embodiment of the application can be generally arranged in a server of a service center of the clearing system, and the server such as a single server or a server cluster is not limited.
Optionally, each calling device is configured in a server corresponding to the service center, so that no separate hardware or software device is required to be configured, the architecture design of the service system is further simplified, the architecture complexity of the service system is effectively reduced, the service calling path is shortened, the service calling effect is improved, and the design realization cost of the service system is reduced.
Referring to fig. 2, fig. 2 is a schematic diagram of an architecture of a clearing system according to an embodiment of the present application, where six service centers are included, each service center is configured with a corresponding calling device, the calling device provides a routing service, and different service centers are typically distributed in different or the same geographic locations, for example, in fig. 2, the six service centers are distributed in three places of Beijing, shanghai, shenzhen, so that the entire clearing system forms a three-place six-center architecture.
Referring to fig. 1, the method includes:
S101: and when the service request is received, determining a main database identifier corresponding to the service request.
The first calling device is any calling device of a plurality of calling devices of the clearing system, and a service center corresponding to the first calling device can be called a first service center.
Wherein the service request is configured to invoke some service provided by a service center of the clearing system, such as a clearing service, without limitation.
In a specific implementation process, a message monitoring interface can be configured at a service consumer layer of the clearing system, the message monitoring interface is called to monitor whether each calling device receives the service request, and when any calling device is monitored to receive the service request (at this time, the calling device receiving the service request can be called a first calling device), the routing service provided by the first calling device can be called in real time to route the service request.
In the related art, after receiving a service request, the service request is sent to an API gateway, so that a single layer of API gateway routes the service request.
In the embodiment of the present application, since each service center is configured with a corresponding calling device and the calling device is configured to provide a routing service (Outer Provider), the routing service provided by the first calling device can be directly called to route the service request, for example, the service request is routed to the service Provider layer of the clearing system to provide the service externally.
In the service system in the embodiment of the application, the database with a master-slave structure is generally configured, or the distributed database system is used for providing service to the outside, so that the flexibility of service and the high availability of service data are supported, the corresponding databases can be divided into the master database and the slave databases, that is, the service system generally adopts the master database to provide service to the outside, and adopts the slave database to backup the service data of the master database, so that the high availability of the service system is realized.
In the embodiment of the application, when the service request is received, the main database identifier corresponding to the service request is determined, the main database identifier can be uniquely used for identifying the main data, and the main database stores service data required by providing service outside.
The primary database identifier may be carried in the service request, and after receiving the service request, the first calling device may analyze the service request by adopting local analysis processing logic, so as to identify the primary database identifier carried therein, which is not limited.
S102: and determining the identification of a second service center corresponding to the database to which the main database identification belongs according to the main database identification and the mapping relation between the main database identification and the service center.
It will be appreciated that, since the clearing system includes a plurality of service centers, at least some of which provide service services, and different service centers provide different service services, a service request generally does not have to call a service provided by the service center, but may call a service provided by another service center, thereby, after receiving the service request, first determining a primary database identifier corresponding to the service request, and routing the service request to a second service center corresponding to a database to which the primary database identifier belongs.
That is, the service center where the above-mentioned master database is located may be referred to as a second service center.
In the embodiment of the application, the identification of the second service center corresponding to the database to which the main database identification belongs can be determined according to the main database identification and the mapping relation between the main database identification and the service center, so that the method and the device are convenient to realize and have higher acquisition efficiency.
The mapping relation may be pre-detected and generated, and specific reference may be made to the following embodiments.
The mapping relation pre-stores the latest corresponding relation between the main database identification and the service center, and the mapping relation is obtained by pre-detecting the service center managed by the calling device corresponding to the main database and configuring the service center managed by the calling device corresponding to the main database.
In some embodiments, before determining, according to the main database identifier and the mapping relationship between the main database identifier and the service center, the identifier of the second service center corresponding to the database to which the main database identifier belongs, the mapping relationship between the main database identifier and the service center may be obtained in a buffer corresponding to the first calling device, that is, the mapping relationship is pre-stored in the buffer, so that the calling path can be further shortened, and the calling time is shortened.
Of course, the mapping relationship may be stored in other storage locations in advance, for example, in a storage device of the clearing system, which is not limited.
In the embodiment of the application, in order to avoid querying the calling device corresponding to the main database when receiving the service request each time, the service calling efficiency is improved, and the routing service provided by the first calling device can be called, so that the identification of the second service center is searched in the cache corresponding to the first calling device.
In the embodiment of the application, a timing detection task can be configured for a clearing system, and the identification of the service center managed by the calling device corresponding to the main database is dynamically determined by executing the timing detection task, so that the service center can be read when a service request is routed.
S103: and routing the service request to the second service center according to the identification of the second service center.
In the embodiment of the application, the service request is routed to the second service center corresponding to the database to which the main database identifier belongs by determining the main database identifier corresponding to the service request, so that the service provided by the second service center is called, an API gateway is not needed, the service calling path is shortened, and the service calling efficiency is improved.
In some embodiments, the service request is routed to the second service center according to the identifier of the second service center, which may be that a second calling device corresponding to the second service center is determined according to the identifier of the second service center, and the service request is sent to the second calling device, so that the second calling device routes the service request to the second service center, and the service provided by the second service center is called by using the service request.
The calling device corresponding to the second service center may be referred to as a second calling device.
Therefore, the second calling device corresponding to the business service to be called is determined through the routing service provided by the first calling device, and the business request is directly routed to the second business center corresponding to the second calling device through the routing service provided by the first calling device, so that the functions of the routing service are effectively enriched, a service consumer only needs to directly request the routing service of the calling device, the business request is forwarded to the corresponding calling device through the routing service, the corresponding business center business processing is assisted, responsibility of the service consumer is reduced, the service consumer is lighter, an additional operation and maintenance server is not needed, and an additional network call is not needed, so that the business service calling effect is improved.
In other embodiments, the mapping relationship between the service center identifier and the service provided by the service center to which the service center identifier belongs may be stored in the buffer corresponding to the first routing service, so that the service request is directly routed to the service provided by the second service center corresponding to the second calling device, thereby realizing that when the service provider provides the service in the new service center, only the configuration of the routing service needs to be modified, and the mapping relationship between the service center identifier and the service provided by the service center to which the service center belongs is newly added to the configuration of the routing service, and the service can be completed without modifying the program code of the clearing system, thereby reducing the complexity of the system, reducing the operation and maintenance cost and improving the service continuity.
In this embodiment, when a service request is received, a main database identifier corresponding to the service request is determined, and according to the main database identifier and a mapping relationship between the main database identifier and a service center, an identifier of a second service center corresponding to a database to which the main database identifier belongs is determined, and according to the identifier of the second service center, the service request is routed to the second service center, and because routing service provided by the first calling device is directly called to assist in routing the service request, architecture complexity of a service system can be effectively reduced, service calling paths are shortened, and service calling effects are improved.
Fig. 3 is a flowchart of a service invocation method according to another embodiment of the present application.
In the embodiment shown in fig. 3, a method for updating and managing the mapping relationship between the main database identifier and the service center is provided, for example, a timing detection task can be executed, so that the mapping relationship between the main database identifier and the service center is updated, whether the main database is migrated to the first database can be detected in an active detection mode, when the main database is migrated, the mapping relationship in the cache is actively updated in a timing active detection mode, so that the accuracy of the mapping relationship is ensured, and a service system can automatically route a service request to the migrated service center without affecting service, the routing effect of the service request is ensured, and the continuity of the service is ensured.
The specific reference is as follows:
Referring to fig. 3, the method includes:
s301: and if the current time reaches the time point set by the timing detection task, triggering and detecting whether the main database is migrated to the first database.
In some embodiments, whether the primary database is migrated to the first database is detected, which may be whether test data can be written into the primary database is determined, if test data cannot be written into the primary database, the primary database is determined to have been migrated, and test data is written into other databases; if the test data can be written into the first database in the other databases, determining that the main database is migrated to the first database, and effectively detecting whether the main database is migrated or not so as to assist in updating the service center identifier in the local cache in time later.
In other embodiments, the method for detecting whether the primary database is migrated to the first database may be to invoke a preconfigured query primary database location interface to detect whether the primary database is migrated to the first database, thereby effectively reducing operations on the databases and reducing system risks caused by database operations.
S302: if the main database is migrated to the first database, determining the identification of the target service center corresponding to the first database.
The database to which the master database is migrated may be referred to as a first database, and a service center corresponding to the first database may be referred to as a target service center.
S303: and updating the mapping relation according to the identification of the first database and the identification of the target service center.
As an example, a mechanism of timing detection and failed retry may be adopted to update the identifier of the existing service center in the cache, as shown in fig. 4, a mapping relationship may be stored in the cache corresponding to the routing service, where the mapping relationship includes an identifier of the service center, meanwhile, the clearing system starts a timing detection task, when the timing detection task is triggered, the identifier of the service center corresponding to the main database is obtained through the cache first, then the database of the service center to which the service center identifier belongs is used as the first detected database, if the database of the service center detects and returns a non-writable error, the database is considered to be not the main database, and detection may be performed according to the order of the north 10 center, the Shanghai 20 center and the Shenzhen 31 center, and when the database of a certain service center detects and returns successfully, the database (may be referred to as the first database) of the service center is considered as the main database, the service center identifier is regarded as the target service center identifier, and the existing service center identifier in the cache is updated.
In this embodiment, by regularly detecting whether the main database is migrated to the first database, if the main database is migrated to the first database, the identifier of the target service center corresponding to the first database is determined, and the mapping relationship is updated according to the identifier of the first database and the identifier of the target service center, so that when the main database is migrated, the mapping relationship in the cache can be updated timely, the accuracy of the mapping relationship is ensured, the influence on the normal service request route of the service system is avoided, and the service access continuity of the service system is ensured.
Fig. 5 is a schematic structural diagram of a service invocation apparatus according to an embodiment of the present application.
The device is applied to a first calling device, the first calling device is one calling device of at least two calling devices in a clearing system, the calling device is used for managing a corresponding service center, and the calling device provides routing service.
Referring to fig. 5, the apparatus 500 includes:
The first determining module 501 is configured to determine, when a service request is received, a primary database identifier corresponding to the service request.
The second determining module 502 is configured to determine, according to the main database identifier and the mapping relationship between the main database identifier and the service center, an identifier of a second service center corresponding to a database to which the main database identifier belongs.
And the calling module 503 is configured to route the service request to the second service center according to the identifier of the second service center.
In some embodiments of the present application, the calling module 503 is specifically configured to:
Determining a second calling device corresponding to the second service center according to the identifier of the second service center;
and sending the service request to the second calling device so that the second calling device routes the service request to the second service center.
In some embodiments of the present application, referring to fig. 6, further comprising:
the obtaining module 504 is configured to obtain, in a buffer corresponding to the first calling device, a mapping relationship between the main database identifier and the service center before determining an identifier of the second service center corresponding to the database to which the main database identifier belongs.
In some embodiments of the present application, referring to fig. 6, further comprising:
And the updating module 505 is used for executing the timing detection task and updating the mapping relation between the main database identifier and the service center.
In some embodiments of the present application, the update module 505 is specifically configured to:
If the current time reaches the time point set by the timing detection task, triggering and detecting whether the main database is migrated to the first database;
If the main database is migrated to the first database, determining the identification of the target service center corresponding to the first database;
And updating the mapping relation according to the identification of the first database and the identification of the target service center.
In some embodiments of the present application, the update module 505 is further configured to:
judging whether the test data can be written into the main database;
If the test data cannot be written into the main database, determining that the main database is migrated, and writing the test data into other databases;
If the test data can be written into the first database in the other databases, the migration of the main database to the first database is determined.
In some embodiments of the present application, the updating module 505 is further configured to:
and calling a preconfigured query main database position interface, and detecting whether the main database is migrated to the first database.
In some embodiments of the application, each calling device is configured in a server of the corresponding service center.
It should be noted that the explanation of the embodiment of the service invocation method in the foregoing embodiments of fig. 1 to fig. 4 also applies to the service invocation apparatus 500 of this embodiment, and the implementation principle is similar, and will not be repeated here.
In this embodiment, when a service request is received, a main database identifier corresponding to the service request is determined, and according to the main database identifier and a mapping relationship between the main database identifier and a service center, an identifier of a second service center corresponding to a database to which the main database identifier belongs is determined, and according to the identifier of the second service center, the service request is routed to the second service center, and because routing service provided by the first calling device is directly called to assist in routing the service request, architecture complexity of a service system can be effectively reduced, service calling paths are shortened, and service calling effects are improved.
Fig. 7 is a schematic structural diagram of a computer device according to an embodiment of the present application.
Referring to fig. 7, the computer apparatus 700 of the present embodiment includes a housing 701, a calling device 702, a memory 703, a circuit board 704, and a power circuit 705, wherein the circuit board 704 is disposed inside a space enclosed by the housing 701, and the calling device 702 and the memory 703 are disposed on the circuit board 704; a power circuit 705 for powering the various circuits or devices of the computer device 700; the memory 703 is used for storing executable program codes; the calling device 702 executes a program corresponding to the executable program code by reading the executable program code stored in the memory 703 for executing:
When a service request is received, determining a main database identifier corresponding to the service request;
determining the identification of a second service center corresponding to the database to which the main database identification belongs according to the main database identification and the mapping relation between the main database identification and the service center;
and routing the service request to the second service center according to the identification of the second service center.
It should be noted that the explanation of the embodiment of the service invocation method in the foregoing embodiments of fig. 1 to fig. 4 also applies to the computer device 700 of this embodiment, and the implementation principle is similar, and will not be repeated here.
In this embodiment, when a service request is received, a main database identifier corresponding to the service request is determined, and according to the main database identifier and a mapping relationship between the main database identifier and a service center, an identifier of a second service center corresponding to a database to which the main database identifier belongs is determined, and according to the identifier of the second service center, the service request is routed to the second service center, and because routing service provided by the first calling device is directly called to assist in routing the service request, architecture complexity of a service system can be effectively reduced, service calling paths are shortened, and service calling effects are improved.
In order to achieve the above-described embodiments, an embodiment of the present application proposes a non-transitory computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the service invocation method of the foregoing method embodiment.
It should be noted that in the description of the present application, the terms "first," "second," and the like are used for descriptive purposes only and are not to be construed as indicating or implying relative importance. Furthermore, in the description of the present application, unless otherwise indicated, the meaning of "a plurality" is two or more.
Any process or method descriptions in flow charts or otherwise described herein may be understood as representing modules, segments, or portions of code which include one or more executable instructions for implementing specific logical functions or steps of the process, and further implementations are included within the scope of the preferred embodiment of the present application in which functions may be executed out of order from that shown or discussed, including substantially concurrently or in reverse order, depending on the functionality involved, as would be understood by those reasonably skilled in the art of the present application.
It is to be understood that portions of the present application may be implemented in hardware, software, firmware, or a combination thereof. In the above-described embodiments, the various steps or methods may be implemented in software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, may be implemented using any one or combination of the following techniques, as is well known in the art: discrete logic circuits having logic gates for implementing logic functions on data signals, application specific integrated circuits having suitable combinational logic gates, programmable Gate Arrays (PGAs), field Programmable Gate Arrays (FPGAs), and the like.
Those of ordinary skill in the art will appreciate that all or a portion of the steps carried out in the method of the above-described embodiments may be implemented by a program to instruct related hardware, where the program may be stored in a computer readable storage medium, and where the program, when executed, includes one or a combination of the steps of the method embodiments.
In addition, each functional unit in the embodiments of the present application may be integrated in one processing module, or each unit may exist alone physically, or two or more units may be integrated in one module. The integrated modules may be implemented in hardware or in software functional modules. The integrated modules may also be stored in a computer readable storage medium if implemented in the form of software functional modules and sold or used as a stand-alone product.
The above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, or the like.
In the description of the present specification, a description referring to terms "one embodiment," "some embodiments," "examples," "specific examples," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the present application. In this specification, schematic representations of the above terms do not necessarily refer to the same embodiments or examples. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
While embodiments of the present application have been shown and described above, it will be understood that the above embodiments are illustrative and not to be construed as limiting the application, and that variations, modifications, alternatives and variations may be made to the above embodiments by one of ordinary skill in the art within the scope of the application.
Claims (9)
1. A service invocation method, applied to a first invocation device, the first invocation device being any one of a plurality of invocation devices, the first invocation device being configured to provide a routing service for a corresponding first service center, the method comprising:
When a service request is received, determining a main database identifier corresponding to the service request, wherein the main database identifier is carried in the service request;
Determining an identification of a second service center corresponding to a database to which the main database identification belongs according to the main database identification and the mapping relation between the main database identification and the service center, wherein the main database identification is uniquely used for identifying the main database, and the main database stores service data required for providing service to the outside;
Routing the service request to the second service center according to the identifier of the second service center;
the method further comprises the steps of:
Executing a timing detection task, and updating the mapping relation between the main database identifier and the service center;
The executing the timing detection task and updating the mapping relation between the main database identifier and the service center comprises the following steps:
If the current time reaches the time point set by the timing detection task, triggering and detecting whether the main database is migrated to the first database;
if the main database is migrated to the first database, determining the identification of a target service center corresponding to the first database;
And updating the mapping relation according to the identification of the first database and the identification of the target service center.
2. The service invocation method of claim 1, wherein said routing said service request to said second service center based on said identification of said second service center comprises:
Determining a second calling device corresponding to the second service center according to the identifier of the second service center;
And sending the service request to the second calling device so that the second calling device routes the service request to the second service center.
3. The service invocation method of claim 1, further comprising, before said determining, according to said master database identifier and a mapping relationship between said master database identifier and a service center, an identifier of a second service center corresponding to a database to which said master database identifier belongs:
And acquiring the mapping relation between the main database identifier and the service center in the buffer corresponding to the first calling device.
4. The service invocation method of claim 1, wherein said detecting whether the primary database is migrated to the first database comprises:
judging whether test data can be written into the main database;
If the test data cannot be written into the main database, determining that the main database is migrated, and writing the test data into other databases;
And if the test data can be written into a first database in other databases, determining that the main database is migrated to the first database.
5. The service invocation method of claim 1, wherein said detecting whether the primary database is migrated to the first database comprises:
and calling a preconfigured query main database position interface, and detecting whether the main database is migrated to the first database.
6. The service invocation method of any one of claims 1-5, wherein each of the invocation means is configured in a server of a corresponding service center.
7. A service invocation apparatus, the service invocation apparatus being configured in a server of a corresponding service center, the apparatus comprising:
the first determining module is used for determining a main database identifier corresponding to a service request when the service request is received, wherein the main database identifier is carried in the service request;
The second determining module is used for determining the identifier of a second service center corresponding to the database to which the main database identifier belongs according to the main database identifier and the mapping relation between the main database identifier and the service center;
the calling module is used for routing the service request to the second service center according to the identifier of the second service center;
The device further comprises:
the updating module is used for executing a timing detection task and updating the mapping relation between the main database identifier and the service center;
The updating module is specifically configured to:
If the current time reaches the time point set by the timing detection task, triggering and detecting whether the main database is migrated to the first database;
if the main database is migrated to the first database, determining the identification of a target service center corresponding to the first database;
And updating the mapping relation according to the identification of the first database and the identification of the target service center.
8. A non-transitory computer-readable storage medium, on which a computer program is stored, characterized in that the program, when executed by a processor, implements the service invocation method of any one of claims 1-6.
9. The computer equipment comprises a shell, a calling device, a memory, a circuit board and a power circuit, wherein the circuit board is arranged in a space surrounded by the shell, and the calling device and the memory are arranged on the circuit board; the power supply circuit is used for supplying power to various circuits or devices of the computer equipment; the memory is used for storing executable program codes; the calling device runs a program corresponding to the executable program code by reading the executable program code stored in the memory for executing the service calling method according to any one of claims 1 to 6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011222802.9A CN114531492B (en) | 2020-11-05 | 2020-11-05 | Service calling method, device, storage medium and computer equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011222802.9A CN114531492B (en) | 2020-11-05 | 2020-11-05 | Service calling method, device, storage medium and computer equipment |
Publications (2)
Publication Number | Publication Date |
---|---|
CN114531492A CN114531492A (en) | 2022-05-24 |
CN114531492B true CN114531492B (en) | 2024-05-10 |
Family
ID=81618710
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202011222802.9A Active CN114531492B (en) | 2020-11-05 | 2020-11-05 | Service calling method, device, storage medium and computer equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114531492B (en) |
Citations (15)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105450757A (en) * | 2015-12-02 | 2016-03-30 | 联动优势电子商务有限公司 | Service management method and system |
CN108055312A (en) * | 2017-12-07 | 2018-05-18 | 畅捷通信息技术股份有限公司 | Method for routing and its device and computer installation and its readable storage medium storing program for executing |
CN109189856A (en) * | 2018-08-15 | 2019-01-11 | 中国联合网络通信集团有限公司 | Distributed data base service management, device, server and storage medium |
CN109597854A (en) * | 2018-10-31 | 2019-04-09 | 深圳壹账通智能科技有限公司 | A kind of method for routing of service request, device, computer equipment and computer storage medium |
CN109871370A (en) * | 2019-01-08 | 2019-06-11 | 网联清算有限公司 | Data base management method, device, storage medium and computer equipment |
CN110336753A (en) * | 2019-06-19 | 2019-10-15 | 腾讯科技(深圳)有限公司 | A kind of service calling method, device, equipment and the storage medium in across a network region |
US10469362B1 (en) * | 2015-09-30 | 2019-11-05 | Amazon Technologies, Inc. | Network routing utilization of application programming interfaces |
CN110471915A (en) * | 2019-07-02 | 2019-11-19 | 网联清算有限公司 | Account route determining methods and device |
CN110474841A (en) * | 2019-08-30 | 2019-11-19 | 中国人民财产保险股份有限公司 | The route processing method and terminal device of service request |
WO2019223099A1 (en) * | 2018-05-23 | 2019-11-28 | 平安科技(深圳)有限公司 | Application program calling method and system |
CN110581890A (en) * | 2019-09-10 | 2019-12-17 | 中国建设银行股份有限公司 | Routing method and device for service request |
CN110874311A (en) * | 2019-10-11 | 2020-03-10 | 网联清算有限公司 | Database detection method and device, computer equipment and storage medium |
CN110913025A (en) * | 2019-12-31 | 2020-03-24 | 中国银联股份有限公司 | Service calling method, device, equipment and medium |
CN111314221A (en) * | 2018-12-11 | 2020-06-19 | 北京京东金融科技控股有限公司 | Service processing method, device, equipment and computer readable storage medium |
CN111371684A (en) * | 2020-03-02 | 2020-07-03 | 中国邮政储蓄银行股份有限公司 | Routing processing method and device and double-activity data center system |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1555164B (en) * | 2003-12-25 | 2010-09-29 | 中兴通讯股份有限公司 | Route service device and method and system for realizing calling route using said device |
US20130250960A1 (en) * | 2012-03-21 | 2013-09-26 | Sean Hickman | System and Method for Routing Service Request Messages |
US9967366B2 (en) * | 2015-07-20 | 2018-05-08 | Verizon Patent And Licensing Inc. | Internet of things (IoT) API platform |
US10348800B2 (en) * | 2017-02-08 | 2019-07-09 | Microsoft Technology Licensing, Llc | Invocation context caching |
US11489943B2 (en) * | 2019-02-13 | 2022-11-01 | Red Hat, Inc. | Automatic version routing among multiple instances of an application |
-
2020
- 2020-11-05 CN CN202011222802.9A patent/CN114531492B/en active Active
Patent Citations (15)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US10469362B1 (en) * | 2015-09-30 | 2019-11-05 | Amazon Technologies, Inc. | Network routing utilization of application programming interfaces |
CN105450757A (en) * | 2015-12-02 | 2016-03-30 | 联动优势电子商务有限公司 | Service management method and system |
CN108055312A (en) * | 2017-12-07 | 2018-05-18 | 畅捷通信息技术股份有限公司 | Method for routing and its device and computer installation and its readable storage medium storing program for executing |
WO2019223099A1 (en) * | 2018-05-23 | 2019-11-28 | 平安科技(深圳)有限公司 | Application program calling method and system |
CN109189856A (en) * | 2018-08-15 | 2019-01-11 | 中国联合网络通信集团有限公司 | Distributed data base service management, device, server and storage medium |
CN109597854A (en) * | 2018-10-31 | 2019-04-09 | 深圳壹账通智能科技有限公司 | A kind of method for routing of service request, device, computer equipment and computer storage medium |
CN111314221A (en) * | 2018-12-11 | 2020-06-19 | 北京京东金融科技控股有限公司 | Service processing method, device, equipment and computer readable storage medium |
CN109871370A (en) * | 2019-01-08 | 2019-06-11 | 网联清算有限公司 | Data base management method, device, storage medium and computer equipment |
CN110336753A (en) * | 2019-06-19 | 2019-10-15 | 腾讯科技(深圳)有限公司 | A kind of service calling method, device, equipment and the storage medium in across a network region |
CN110471915A (en) * | 2019-07-02 | 2019-11-19 | 网联清算有限公司 | Account route determining methods and device |
CN110474841A (en) * | 2019-08-30 | 2019-11-19 | 中国人民财产保险股份有限公司 | The route processing method and terminal device of service request |
CN110581890A (en) * | 2019-09-10 | 2019-12-17 | 中国建设银行股份有限公司 | Routing method and device for service request |
CN110874311A (en) * | 2019-10-11 | 2020-03-10 | 网联清算有限公司 | Database detection method and device, computer equipment and storage medium |
CN110913025A (en) * | 2019-12-31 | 2020-03-24 | 中国银联股份有限公司 | Service calling method, device, equipment and medium |
CN111371684A (en) * | 2020-03-02 | 2020-07-03 | 中国邮政储蓄银行股份有限公司 | Routing processing method and device and double-activity data center system |
Non-Patent Citations (2)
Title |
---|
基于SOA的信息交换平台设计;张大平;;福建电脑(第04期);全文 * |
支持业务需求灵活定制的多态路由系统;张岩;兰巨龙;胡宇翔;王鹏;段通;;电子学报(第04期);全文 * |
Also Published As
Publication number | Publication date |
---|---|
CN114531492A (en) | 2022-05-24 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US8055933B2 (en) | Dynamic updating of failover policies for increased application availability | |
TWI511046B (en) | Dynamic cli mapping for clustered software entities | |
JP2013509626A (en) | Method, system, and computer program for fault management in a virtual computing environment | |
CN101847148A (en) | Method and device for implementing high application availability | |
CN108900598B (en) | Network request forwarding and responding method, device, system, medium and electronic equipment | |
CN112291082B (en) | Disaster recovery processing method, terminal and storage medium for machine room | |
CN114205342A (en) | Routing method, electronic device, medium, and program product for service debugging | |
CN117459444A (en) | Method, device and storage medium for micro-service co-city dual-activity concentric priority routing | |
CN101877655A (en) | Network management system, network management server and method | |
CN111031126B (en) | Cluster cache sharing method, system, equipment and storage medium | |
CN108810166A (en) | Route management method, system, computer equipment and computer readable storage medium | |
CN114531492B (en) | Service calling method, device, storage medium and computer equipment | |
CN102279837B (en) | communication processing apparatus and communication processing method | |
CN111506331A (en) | Server BMC refreshing method, system, terminal and storage medium | |
CN112702441B (en) | Container-based access data processing method, device, system and storage medium | |
CN110851528B (en) | Database synchronization method and device, storage medium and computer equipment | |
CN110764838B (en) | Service model loading method and system, electronic equipment and storage medium | |
CN112596371A (en) | Control card switching method and device, electronic equipment and storage medium | |
CN115794769B (en) | Method for managing high-availability database, electronic equipment and storage medium | |
CN116319841A (en) | Distributed storage dynamic capacity expansion method and device and electronic equipment | |
JP6564067B2 (en) | Service management method and apparatus | |
CN105162856B (en) | Network application integrated system and method | |
CN113364892B (en) | Domain name resolution method, related method, device and system for cross-multi-cluster service | |
CN111208949B (en) | Method for determining data rollback time period in distributed storage system | |
CN102868565B (en) | Network application system and method |
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 |