CN114531492A - Service calling method and device, storage medium and computer equipment - Google Patents

Service calling method and device, storage medium and computer equipment Download PDF

Info

Publication number
CN114531492A
CN114531492A CN202011222802.9A CN202011222802A CN114531492A CN 114531492 A CN114531492 A CN 114531492A CN 202011222802 A CN202011222802 A CN 202011222802A CN 114531492 A CN114531492 A CN 114531492A
Authority
CN
China
Prior art keywords
service
database
identifier
service center
center
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.)
Granted
Application number
CN202011222802.9A
Other languages
Chinese (zh)
Other versions
CN114531492B (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.)
NetsUnion Clearing Corp
Original Assignee
NetsUnion Clearing Corp
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 NetsUnion Clearing Corp filed Critical NetsUnion Clearing Corp
Priority to CN202011222802.9A priority Critical patent/CN114531492B/en
Publication of CN114531492A publication Critical patent/CN114531492A/en
Application granted granted Critical
Publication of CN114531492B publication Critical patent/CN114531492B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/21Design, administration or maintenance of databases
    • G06F16/214Database migration support
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/25Integrating 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 service calling device, a storage medium and computer equipment, which are applied to a first calling device, wherein the first calling device is any one 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 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 routing the service request to the second service center according to the identifier of the second service center. By the method and the device, the complexity of the architecture of the business system can be effectively reduced, the business service calling path is shortened, and the business service calling effect is improved.

Description

Service calling method and device, storage medium and computer equipment
Technical Field
The present application relates to the field of computer technologies, and in particular, to a service invocation method, an apparatus, a storage medium, and a computer device.
Background
In the internet domain, a system platform can be generally 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 simultaneously in multiple data centers, where the geographic locations of the different data centers may be the same or different, and servers (e.g., a single server or a server cluster) supporting service operations are deployed in each data center.
In the related art, an Application Programming Interface (API) Gateway (API Gateway) is separately configured between a service consumer layer and a service provider layer, so as to route a service request issued by the service consumer layer to a data center corresponding to the service provider layer, so as to invoke a service of a corresponding service center. However, this method of deploying an independent API gateway results in a complex system architecture, which affects the calling effect of the business service.
Disclosure of Invention
The present application is directed to solving, at least to some extent, one of the technical problems in the related art.
Therefore, the service calling method, the service calling device, the storage medium and the computer equipment are provided, so that the architecture complexity of a service system can be effectively reduced, a service calling path can be shortened, and the service calling effect can be improved.
In order to achieve the above object, a service invocation method provided in an embodiment of a first aspect of the present application is applied to a first invocation device, where the first invocation device is any one of a plurality of invocation devices, and the first invocation device is configured to provide a routing service for a corresponding first service center, where the method includes: when a service request is received, determining a master database identifier corresponding to the service request; determining the identifier of a second service center corresponding to the database to which the master database identifier belongs according to the master database identifier and the mapping relation between the master database identifier and the service center; and routing the service request to the second service center according to the identifier of the second service center.
According to the service calling method provided by the embodiment of the first aspect of the application, when a service request is received, a main database identifier corresponding to the service request is determined, an identifier of a second service center corresponding to a 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 master database identifier belongs according to the master database identifier and the mapping relation between the master 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.
The service invoking device provided in the embodiment of the second aspect of the present application determines the identifier of the master database 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 master database identifier belongs according to the identifier of the master database and the mapping relationship between the master 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.
A non-transitory computer-readable storage medium according to an embodiment of a third aspect of the present application, where instructions of the storage medium, when executed by a processor of a computer device, enable the computer device to perform a service invocation method, the method including: the embodiment of the first aspect of the application provides a service calling method.
The non-transitory computer-readable storage medium according to the third aspect of the present application determines, when receiving a service request, a primary database identifier corresponding to the service request, and determines, according to the primary database identifier and a mapping relationship between the primary database identifier and a service center, an identifier of a second service center corresponding to a database to which the primary database identifier belongs, and routes the service request to the second service center according to the identifier of the second service center.
A computer device provided in an embodiment of a fourth aspect of the present application, the computer device includes: 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 enclosed 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 each circuit or device 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 execute the service calling method provided by the embodiment of the first aspect of the application.
According to the computer device provided by the embodiment of the fourth aspect of the application, when a service request is received, a master database identifier corresponding to the service request is determined, an identifier of a second service center corresponding to a database to which the master database identifier belongs is determined according to the master database identifier and the mapping relation between the master 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.
Additional aspects and advantages of the present 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 present application.
Drawings
The foregoing and/or additional aspects and advantages of the present application will become apparent and readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings of which:
fig. 1 is a schematic flowchart of a service invocation method according to an embodiment of the present application;
FIG. 2 is a schematic diagram of the architecture of a clearing system in an embodiment of the present application;
fig. 3 is a flowchart illustrating a service invocation method according to another embodiment of the present application;
fig. 4 is a flowchart illustrating a service invocation method according to another embodiment of the present application;
fig. 5 is a schematic structural diagram of a service invocation device according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of a service invocation device 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
Reference will now be made in detail to embodiments of the present application, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the drawings are exemplary only for the purpose of explaining the present application and are not to be construed as limiting the present application. On the contrary, the embodiments of the application include all changes, modifications and equivalents coming within the spirit and terms of the claims appended hereto.
Fig. 1 is a flowchart illustrating a service invocation method according to an embodiment of the present application.
The present embodiment is exemplified in a case where the service invocation method is configured as a service invocation apparatus.
The service invoking method in this embodiment is applied to a first invoking device, where the first invoking device is any one of a plurality of invoking devices, and the first invoking device is configured to provide a routing service for a corresponding first service center, and a service center corresponding to the first invoking device may be referred to as a first service center.
The invoking device may be configured in the clearing system, for example, and the invoking device may be used to manage a corresponding service center in the clearing system, and the invoking device in this embodiment may provide a routing service, so as to route the service request to the corresponding service center, and of course, the invoking device may also be configured in any other service system, which is not limited to this.
Embodiments of the present application are exemplified in a clearing system with a calling device configuration.
For example, the architecture of the clearing system generally includes a plurality of service centers, each service center corresponds to one data center, one or more databases are configured in one data center, or a database cluster is configured, the service centers provide service to the outside by accessing service data stored in the corresponding data center, services provided by different service centers may be the same or different, and different service centers may also be configured in the same geographical location or in different geographical locations.
The invoking device in the embodiment of the present application may be generally disposed in a server of a service center of a clearing system, such as a single server or a server cluster, which is not limited in this respect.
Optionally, each calling device is configured in the server corresponding to the service center, so that a separate hardware or software device does not need 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 meanwhile, the design implementation cost of the service system is reduced.
Referring to fig. 2, fig. 2 is a schematic structural diagram of the liquidation system in the embodiment of the present application, where the schematic structural diagram includes six service centers, each service center is configured with a corresponding invoking device, the invoking devices provide routing services, and different service centers are generally distributed in different or the same geographic locations, for example, in fig. 2, the six service centers are distributed in three places, namely beijing, shanghai, and shenzhen, so that the whole liquidation system forms a three-place six-center architecture.
Referring to fig. 1, the method includes:
s101: and when a service request is received, determining a main database identifier corresponding to the service request.
The first calling device is any one of a plurality of calling devices of the liquidation system, and the service center corresponding to the first calling device can be called a first service center.
The service request is configured to invoke some service provided by the service center of the clearing system, and the service is, for example, a clearing service, and the like, without limitation.
In a specific implementation process, a message monitoring interface may be configured at a service consumer layer of the clearing system, and the message monitoring interface is called to monitor whether each calling device receives a service request, and when it is monitored that any calling device receives a service request (at this time, the calling device that receives the service request may be referred to as a first calling device), a routing service provided by the first calling device may 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 layer of API gateway separately configured routes the service request.
In the embodiment of the present application, since the corresponding calling device is configured for each service center and the calling device is configured to provide the routing service (Outer Provider), the routing service provided by the first calling device may be directly called to route the service request, for example, the service request is routed to the service provided by the service Provider layer of the clearing system.
In the service system in the embodiment of the present application, a database with a master-slave structure is usually configured, or a distributed database system is configured to provide service to the outside, so as to support flexibility of service and high availability of service data, and the corresponding database may be divided into a master database and a slave database, that is, the service system usually 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 as to achieve high availability of the service system.
In this embodiment of the present application, when a service request is received, a master database identifier corresponding to the service request is determined, where the master database identifier can be uniquely used to identify the master data, and the master database stores service data required for providing a service to the outside.
The master database identifier may be carried in the service request, and the first invoking device may analyze the service request by using a local analysis processing logic after receiving the service request, so as to identify the master database identifier carried therein, which is not limited thereto.
S102: and 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.
It will be appreciated that, since the clearing system includes a plurality of service centers, and at least some of the service centers provide service services, different service centers provide different service services, and a service request usually does not have to invoke a service provided by the service center, but may invoke a service provided by another service center, after receiving the service request, the service request may first determine a primary database identifier corresponding to the service request, and route the service request to a second service center corresponding to a database to which the primary database identifier belongs.
That is, the service center in which the master database is located may be referred to as a second service center.
In the embodiment of the application, the identifier of the second service center corresponding to the database to which the master database identifier belongs can be determined according to the master database identifier and the mapping relation between the master database identifier and the service center, so that the implementation is convenient and fast, and the acquisition efficiency is high.
The mapping relationship may be detected and generated in advance, and specific reference may be made to the following embodiments.
The mapping relation pre-stores the corresponding relation between the latest main database identifier and the service center, and is obtained by pre-detecting the service center of the calling device management corresponding to the main database and configuring the service center according to the identifier of the calling device management corresponding to the main database.
In some embodiments, before determining the identifier of the second service center corresponding to the database to which the master database identifier belongs according to the master database identifier and the mapping relationship between the master database identifier and the service center, the mapping relationship between the master database identifier and the service center may be obtained in a cache corresponding to the first invoking device, that is, the mapping relationship is pre-stored in the cache, so that the invoking path can be further shortened, and the invoking time can be shortened.
Of course, the mapping relationship may also be pre-stored in other storage locations, such as in a storage device of the clearing system, without limitation.
In the embodiment of the present application, in order to avoid querying the calling device corresponding to the master database when receiving the service request each time, service calling efficiency is improved, and the routing service provided by the first calling device may also be called, so that the identifier 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 the clearing system, and the identification of the service center corresponding to the main database and used for calling device management is dynamically determined by executing the timing detection task and is read when a service request is routed.
S103: and routing the service request to the second service center according to the identifier 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 master database identifier belongs by determining the master database identifier corresponding to the service request, so as to call the service provided by the second service center, thereby reducing a service call path without using an API gateway and improving the service call efficiency.
In some embodiments, the routing of the service request to the second service center according to the identifier of the second service center may be determining a second invocation device corresponding to the second service center according to the identifier of the second service center, and sending the service request to the second invocation device, so that the second invocation device routes the service request to the second service center, thereby invoking the service provided by the second service center with 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 service to be called is determined through the routing service provided by the first calling device, the service request is directly routed to the second service center corresponding to the second calling device through the routing service provided by the first calling device, the function of the routing service is effectively enriched, a service consumer only needs to directly request the routing service of the calling device, the service request is forwarded to the corresponding calling device through the routing service, the corresponding service center operation processing is assisted, the responsibility of the service consumer is reduced, the service consumer is light in weight, an additional operation and maintenance server is not needed, additional network calling is not needed, and the service calling effect is improved.
In addition, in some 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 cache 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, and thus when a service provider provides the service in a new service center, the configuration of the routing service only 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 identifier belongs is newly added to the configuration of the routing service, which can be completed without modifying the program code of the liquidation system, thereby reducing the complexity of the system, reducing the operation and maintenance cost, and improving the continuity of the service.
In the embodiment, when a service request is received, a master database identifier corresponding to the service request is determined, an identifier of a second service center corresponding to a database to which the master database identifier belongs is determined according to the master database identifier and a mapping relation between the master 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.
Fig. 3 is a flowchart illustrating 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 a mapping relationship between a master database identifier and a service center is provided, for example, a timing probe task may be executed, so as to update the mapping relationship between the master database identifier and the service center, and whether the master database is migrated to a first database may be detected by using an active probing manner, so that when the master database is migrated, the mapping relationship in the cache is actively updated by using the timing active probing manner, so as to ensure the accuracy of the mapping relationship, and enable a service system to automatically route a service request to a migrated service center without affecting the service, ensure the routing effect of the service request, and ensure the continuity of the service.
See specifically below:
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, detecting whether the master database is migrated to the first database may be determining whether test data can be written into the master database, and if test data cannot be written into the master database, determining that the master database has been migrated, and writing the test data into another database; if the test data can be written into the first database in other databases, the main database is determined to be migrated to the first database, whether the main database is migrated can be effectively detected, and the service center identification in the local cache can be updated later in time.
In other embodiments, the detecting whether the master database is migrated to the first database may be by invoking a preconfigured query master database location interface, so as to detect whether the master database is migrated to the first database, thereby effectively reducing operations on the database and reducing system risks caused by database operations.
S302: and if the main database is migrated to the first database, determining the identifier 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 the 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 identifier of the first database and the identifier of the target service center.
As an example, a mechanism of timing probe and retry failure may be used to update the identifier of the existing service center in the cache, as shown in fig. 4, a mapping relationship is stored in the cache corresponding to the routing service, the mapping relationship includes an identifier of a service center, meanwhile, the clearing system starts a timing probe task, when the timing probe task is triggered, the identifier of the master database corresponding to the service center is first obtained through the cache, then the database of the service center to which the identifier of the service center belongs is used as the database to be probed first, if the database probe of the service center returns an unwritable error, the database is considered not to be the master database, the probing may be performed in the order of beijing 10 center, shanghai 20 center, and hezhen 31 center, and when the database probe of one service center returns a success, the database (which may be referred to as the first database) of the service center is considered to be the master database, and taking the service center identification as a target service center identification, and updating the existing service center identification in the cache.
In the embodiment, whether the master database is migrated to the first database is detected regularly, if the master 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 the mapping relationship in the cache can be updated in time when the master database is migrated, the accuracy of the mapping relationship is ensured, the influence on the normal service request routing 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 device according to an embodiment of the present application.
The device is applied to a first calling device, the first calling device is one of at least two calling devices in the 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:
a first determining module 501, configured to determine, when a service request is received, a master database identifier corresponding to the service request.
The second determining module 502 is configured to determine, according to the identifier of the master database and the mapping relationship between the identifier of the master database and the service center, an identifier of a second service center corresponding to a database to which the identifier of the master database belongs.
The invoking 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 invoking 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:
an obtaining module 504, configured to obtain, in a cache corresponding to the first calling device, a mapping relationship between the identifier of the master database and the service center before determining an identifier of a second service center corresponding to a database to which the identifier of the master database belongs.
In some embodiments of the present application, referring to fig. 6, further comprising:
and the updating module 505 is configured to execute a timing probe task and update a mapping relationship between the master 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 or not;
if the main database is migrated to the first database, determining the identifier of the target service center corresponding to the first database;
and updating the mapping relation according to the identifier of the first database and the identifier of the target service center.
In some embodiments of the present application, the update module 505 is further configured to:
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;
if the test data can be written to a first database of the other databases, it is determined that the master database is migrated to the first database.
In some embodiments of the present application, the update module 505 is further configured to:
and calling a pre-configured interface for inquiring the position of the main database, and detecting whether the main database is migrated to the first database.
In some embodiments of the present application, each calling device is configured in a server of a corresponding service center.
It should be noted that the explanation of the service invoking method embodiment in the foregoing embodiments of fig. 1 to fig. 4 also applies to the service invoking device 500 of the embodiment, and the implementation principle is similar and is not described herein again.
In the embodiment, when a service request is received, a master database identifier corresponding to the service request is determined, an identifier of a second service center corresponding to a database to which the master database identifier belongs is determined according to the master database identifier and a mapping relation between the master 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.
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 device 700 of the present embodiment includes a housing 701, an invoking device 702, a memory 703, a circuit board 704, and a power circuit 705, wherein the circuit board 704 is disposed inside a space surrounded by the housing 701, and the invoking device 702 and the memory 703 are disposed on the circuit board 704; a power supply circuit 705 for supplying power to the respective circuits or devices of the computer apparatus 700; the memory 703 is used to store executable program code; the calling device 702 runs a program corresponding to the executable program code by reading the executable program code stored in the memory 703, for performing:
when a service request is received, determining a main database identifier corresponding to the service request;
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 routing the service request to the second service center according to the identifier of the second service center.
It should be noted that the foregoing explanations of the service invocation method embodiment in fig. 1 to fig. 4 also apply to the computer device 700 of this embodiment, and the implementation principle is similar and will not be described herein again.
In the embodiment, when a service request is received, a master database identifier corresponding to the service request is determined, an identifier of a second service center corresponding to a database to which the master database identifier belongs is determined according to the master database identifier and a mapping relation between the master 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 implement the foregoing embodiments, the present application provides a non-transitory computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the computer program implements the service invocation method of the foregoing method embodiments.
It should be noted that, in the description of the present application, the terms "first", "second", etc. are used for descriptive purposes only and are not to be construed as indicating or implying relative importance. In addition, in the description of the present application, the meaning of "a plurality" is two or more unless otherwise specified.
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 the scope of the preferred embodiments of the present application includes other implementations 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 should be understood that portions of the present application may be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, the various steps or methods may be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, any one or combination of the following techniques, which are known in the art, may be used: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application specific integrated circuit having an appropriate combinational logic gate circuit, a Programmable Gate Array (PGA), a Field Programmable Gate Array (FPGA), or the like.
It will be understood by those skilled in the art that all or part of the steps carried by the method for implementing the above embodiments may be implemented by hardware related to instructions of a program, which may be stored in a computer readable storage medium, and when the program is executed, the program includes one or a combination of the steps of the method embodiments.
In addition, functional units in the embodiments of the present application may be integrated into one processing module, or each unit may exist alone physically, or two or more units are integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode. The integrated module, if implemented in the form of a software functional module and sold or used as a stand-alone product, may also be stored in a computer readable storage medium.
The storage medium mentioned above may be a read-only memory, a magnetic or optical disk, etc.
In the description herein, reference to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," 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 application. In this specification, the schematic representations of the terms used above do not necessarily refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
Although embodiments of the present application have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present application, and that variations, modifications, substitutions and alterations may be made to the above embodiments by those of ordinary skill in the art within the scope of the present application.

Claims (11)

1. A service invocation method applied to a first invocation device, where the first invocation device invokes a service for any one of a plurality of invocation devices, and the first invocation device is configured to provide a routing service for a corresponding first service center, where the method includes:
when a service request is received, determining a main database identifier corresponding to the service request;
determining the identifier of a second service center corresponding to the database to which the master database identifier belongs according to the master database identifier and the mapping relation between the master database identifier and the service center;
and routing the service request to the second service center according to the identifier of the second service center.
2. The service invocation method according to claim 1, wherein said routing said service request to said second service center based on an identity 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 according to claim 1, wherein, before said determining the identity of the second business center corresponding to the database to which the master database identity belongs according to the master database identity and the mapping relationship between the master database identity and the business center, further comprising:
and acquiring the mapping relation between the main database identifier and the service center in a cache corresponding to the first calling device.
4. The service invocation method according to claim 1, further comprising:
and executing a timing detection task, and updating the mapping relation between the main database identifier and the service center.
5. The service invocation method according to claim 4, wherein the executing of the timing probe task and the updating of the mapping relationship between the master database identifier and the service center comprises:
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 or not;
if the main database is migrated to the first database, determining the identifier of a target service center corresponding to the first database;
and updating the mapping relation according to the identifier of the first database and the identifier of the target service center.
6. The service invocation method according to claim 5, wherein said detecting whether the master 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;
determining that the master database is migrated to a first database of the other databases if the test data can be written to the first database.
7. The service invocation method according to claim 5, wherein said detecting whether the master database is migrated to the first database comprises:
and calling a pre-configured interface for inquiring the position of the main database, and detecting whether the main database is migrated to the first database.
8. The service invocation method according to any of claims 1-7, characterized in that each of said invocation means is arranged in a server of the corresponding service center.
9. An apparatus for invoking a service, 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;
the second determining module is used for determining the identifier of a second service center corresponding to the database to which the master database identifier belongs according to the master database identifier and the mapping relation between the master 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.
10. A non-transitory computer readable storage medium having stored thereon a computer program, characterized in that the program, when executed by a processor, implements the service invocation method according to any of claims 1-8.
11. A computer device, comprising a housing, a calling device, a memory, a circuit board and a power circuit, wherein the circuit board is arranged inside a space enclosed by the housing, and the calling device and the memory are arranged on the circuit board; the power supply circuit is used for supplying power to each circuit or device 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 8.
CN202011222802.9A 2020-11-05 2020-11-05 Service calling method, device, storage medium and computer equipment Active CN114531492B (en)

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 true CN114531492A (en) 2022-05-24
CN114531492B 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 (20)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070115855A1 (en) * 2003-12-25 2007-05-24 Xianli Hu Route servicing device, method and system applying the device
US20130250960A1 (en) * 2012-03-21 2013-09-26 Sean Hickman System and Method for Routing Service Request Messages
CN105450757A (en) * 2015-12-02 2016-03-30 联动优势电子商务有限公司 Service management method and system
US20170026488A1 (en) * 2015-07-20 2017-01-26 Verizon Patent And Licensing Inc. Internet of things (iot) api platform
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
US20180227385A1 (en) * 2017-02-08 2018-08-09 Linkedin Corporation Invocation context caching
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
CN110474841A (en) * 2019-08-30 2019-11-19 中国人民财产保险股份有限公司 The route processing method and terminal device of service request
CN110471915A (en) * 2019-07-02 2019-11-19 网联清算有限公司 Account route determining methods and device
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
US20200259928A1 (en) * 2019-02-13 2020-08-13 Red Hat, Inc. Automatic version routing among multiple instances of an application

Patent Citations (20)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070115855A1 (en) * 2003-12-25 2007-05-24 Xianli Hu Route servicing device, method and system applying the device
US20130250960A1 (en) * 2012-03-21 2013-09-26 Sean Hickman System and Method for Routing Service Request Messages
US20170026488A1 (en) * 2015-07-20 2017-01-26 Verizon Patent And Licensing Inc. Internet of things (iot) api platform
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
US20180227385A1 (en) * 2017-02-08 2018-08-09 Linkedin Corporation Invocation context caching
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
US20200259928A1 (en) * 2019-02-13 2020-08-13 Red Hat, Inc. Automatic version routing among multiple instances of an application
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)

* Cited by examiner, † Cited by third party
Title
张大平;: "基于SOA的信息交换平台设计", 福建电脑, no. 04 *
张岩;兰巨龙;胡宇翔;王鹏;段通;: "支持业务需求灵活定制的多态路由系统", 电子学报, no. 04 *

Also Published As

Publication number Publication date
CN114531492B (en) 2024-05-10

Similar Documents

Publication Publication Date Title
US10402293B2 (en) System for virtual machine risk monitoring
CN108234191A (en) The management method and device of cloud computing platform
CN108900598B (en) Network request forwarding and responding method, device, system, medium and electronic equipment
US20160261459A1 (en) Package dependency maps for distributed computing
CN111404628B (en) Time synchronization method and device
CN107172214B (en) Service node discovery method and device with load balancing function
CN110018956B (en) Application debugging method and related device
US20130232114A1 (en) Probe System For Replication Monitoring
CN111147312B (en) Resource allocation management method and device, resource allocation cache management method and device, and allocation management system
US11153173B1 (en) Dynamically updating compute node location information in a distributed computing environment
CN101877655A (en) Network management system, network management server and method
CN114003350B (en) Data distribution method and system of super-fusion system
CN107360036A (en) A kind of network failure locating method, terminal and server
CN111506331A (en) Server BMC refreshing method, system, terminal and storage medium
CN111031126B (en) Cluster cache sharing method, system, equipment and storage medium
CN110764838B (en) Service model loading method and system, electronic equipment and storage medium
CN114531492B (en) Service calling method, device, storage medium and computer equipment
CN110851528B (en) Database synchronization method and device, storage medium and computer equipment
CN109743367B (en) Service processing method and device, electronic equipment and readable storage medium
CN116708266A (en) Cloud service topological graph real-time updating method, device, equipment and medium
CN116074195A (en) Domain name synchronization method, service container, cluster, computing node and storage medium
CN116319841A (en) Distributed storage dynamic capacity expansion method and device and electronic equipment
JP5556507B2 (en) Virtual machine management program, virtual machine management method, and virtual machine management apparatus
US20220321457A1 (en) Route discovery for failure detection in computer networks
CN115237889A (en) Database switching method and device, storage medium and computer equipment

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