CN113220487A - Calling method and calling equipment based on distributed server and centralized server - Google Patents

Calling method and calling equipment based on distributed server and centralized server Download PDF

Info

Publication number
CN113220487A
CN113220487A CN202110587940.5A CN202110587940A CN113220487A CN 113220487 A CN113220487 A CN 113220487A CN 202110587940 A CN202110587940 A CN 202110587940A CN 113220487 A CN113220487 A CN 113220487A
Authority
CN
China
Prior art keywords
quota
service
server
calling
information
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.)
Pending
Application number
CN202110587940.5A
Other languages
Chinese (zh)
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.)
Industrial and Commercial Bank of China Ltd ICBC
Original Assignee
Industrial and Commercial Bank of China Ltd ICBC
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 Industrial and Commercial Bank of China Ltd ICBC filed Critical Industrial and Commercial Bank of China Ltd ICBC
Priority to CN202110587940.5A priority Critical patent/CN113220487A/en
Publication of CN113220487A publication Critical patent/CN113220487A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/547Remote procedure calls [RPC]; Web services
    • G06F9/548Object oriented; Remote method invocation [RMI]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/465Distributed object oriented systems

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Hardware Redundancy (AREA)

Abstract

The disclosure provides a calling method and calling equipment based on a distributed server and a centralized server. Mainly relates to the technical field of computer communication networks, and can be used in the financial field or other fields. The calling method based on the distributed server and the centralized server comprises the following steps: calling quota service of the distributed server, and judging the fusing identifier of the centralized server; responding to the fusing identifier, calling first quota information of the distributed server, judging based on the first quota information, and generating a first judgment result and first process information; or calling second quota information of the centralized server, judging based on the second quota information, and generating a second judgment result.

Description

Calling method and calling equipment based on distributed server and centralized server
Technical Field
The present disclosure relates to the field of computer communication network technologies, and in particular, to a calling method and a calling device based on a distributed server and a centralized server, an electronic device, a computer storage medium, and a computer program product.
Background
The internet banking system of the bank generally adopts a centralized server, protocol information of the centralized server and the like are stored in a centralized instruction library, and a single-point risk exists, that is, when a certain point in the system fails, the whole system cannot operate normally. In the related art, when the instruction library is unavailable, for example, a target application or service is abnormal or overtime, the whole centralized server cannot be used, and the problem that a user cannot perform transactions through an online banking system occurs, which is easy to cause great economic loss to the user.
Disclosure of Invention
In view of the above, the present disclosure provides a calling method and a calling device based on a distributed server and a centralized server, an electronic device, a computer storage medium, and a computer program product.
One aspect of the present disclosure provides a calling method based on a distributed server and a centralized server, wherein the calling method includes: calling quota service of the distributed server, and judging the fusing identifier of the centralized server; responding to the fusing identifier, calling first quota information of the distributed server, judging based on the first quota information, and generating a first judgment result and first process information; or calling second quota information of the centralized server, judging based on the second quota information, and generating a second judgment result.
According to the embodiment of the disclosure, the calling method further comprises determining the type of the quota service in response to the fusing identifier; the type of quota service comprises one of an accumulation service and a fallback service.
According to an embodiment of the present disclosure, the determining the type of the quota service in response to the fuse identifier includes: and determining the type of the quota service as an accumulated service, calling the second quota information through the centralized server, and generating a second judgment result.
According to an embodiment of the present disclosure, the determining the type of the quota service in response to the fuse identifier includes: determining the type of the quota service as a backspacing service, and determining the accumulated number of tasks to be played back in the distributed server based on the determined type of the quota service; the number of accumulated tasks to be played back is an integer greater than or equal to 0.
According to an embodiment of the present disclosure, the determining that the type of the quota service is a fallback service, and the determining, based on the determining that the type of the quota service, the cumulative number of tasks to be played back included in the distributed server includes: and determining that the number of the accumulated tasks to be played back is equal to 0, and calling the second quota information through the centralized server to generate a second judgment result.
According to an embodiment of the present disclosure, the determining that the type of the quota service is a fallback service, and the determining, based on the determining that the type of the quota service, the cumulative number of tasks to be played back included in the distributed server includes: and determining that the number of the accumulated tasks to be played back is greater than 0, calling the first quota information through the distributed server, and generating the first judgment result and the first process information.
According to an embodiment of the present disclosure, the first process information includes at least one of an accumulated log, a rollback log, and a rollback task.
According to an embodiment of the present disclosure, the calling method further includes synchronizing the first process information to the centralized server in response to the fusing identifier after generating the first determination result and the first process information.
According to the embodiment of the disclosure, the calling method further includes copying the second quota information from the centralized server to the distributed server to form the first quota information in response to the fusing identifier.
Another aspect of the present disclosure provides a calling device based on a distributed server and a centralized server, including: a first calling module configured to call a quota service of the distributed server; a judging module configured to judge a fusing identifier of the centralized server; the second calling module is configured to respond to the fusing identifier, call first quota information of the distributed server, perform judgment based on the first quota information, and generate a first judgment result and first process information; or calling second quota information of the centralized server, judging based on the second quota information, and generating a second judgment result.
Another aspect of the present disclosure also provides an electronic device, including: one or more processors; storage means for storing executable instructions that, when executed by the processor, implement the calling method according to the above.
Another aspect of the present disclosure also provides a computer-readable storage medium having stored thereon executable instructions that, when executed by a processor, implement the calling method according to the above.
Another aspect of the present disclosure also provides a computer program product, wherein the product stores a computer program, which when executed is capable of implementing the calling method according to the above.
According to the embodiment of the disclosure, the distributed server and the centralized server are arranged, and the first quota information of the distributed server or the second quota information of the centralized server is called by judging the fusing identifier of the centralized server. The distributed server system can provide service guarantee through the distributed server when the centralized server fails, so that loss caused by service interruption is prevented, and the service efficiency of the server is effectively improved.
Drawings
The above and other objects, features and advantages of the present disclosure will become more apparent from the following description of embodiments of the present disclosure with reference to the accompanying drawings, in which:
FIG. 1 schematically illustrates an application scenario in which a calling method and a calling device may be applied, according to an embodiment of the present disclosure;
FIG. 2 schematically shows a flow diagram of a calling method according to an embodiment of the present disclosure;
FIG. 3 schematically illustrates a flow chart of a call between a distributed server and a centralized server for a calling method according to an embodiment of the disclosure;
FIG. 4 schematically illustrates a flow diagram for determining a fuse identifier of a calling method according to an embodiment of the disclosure;
FIG. 5 schematically shows a block diagram of a calling device according to an embodiment of the disclosure;
FIG. 6 schematically illustrates a block diagram of an electronic device suitable for implementing the calling method of the present disclosure, in accordance with an embodiment of the present disclosure.
Detailed Description
Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. It should be understood that the description is illustrative only and is not intended to limit the scope of the present disclosure. In the following detailed description, for purposes of explanation, numerous specific details are set forth in order to provide a thorough understanding of the embodiments of the disclosure. It may be evident, however, that one or more embodiments may be practiced without these specific details. Moreover, in the following description, descriptions of well-known structures and techniques are omitted so as to not unnecessarily obscure the concepts of the present disclosure.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. The terms "comprises," "comprising," and the like, as used herein, specify the presence of stated features, steps, operations, and/or components, but do not preclude the presence or addition of one or more other features, steps, operations, or components.
All terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art unless otherwise defined. It is noted that the terms used herein should be interpreted as having a meaning that is consistent with the context of this specification and should not be interpreted in an idealized or overly formal sense.
Where a convention analogous to "at least one of A, B and C, etc." is used, in general such a construction is intended in the sense one having skill in the art would understand the convention (e.g., "a system having at least one of A, B and C" would include but not be limited to systems that have a alone, B alone, C alone, a and B together, a and C together, B and C together, and/or A, B, C together, etc.). It will be further understood by those within the art that virtually any disjunctive word and/or phrase presenting two or more alternative terms, whether in the description, claims, or drawings, should be understood to contemplate the possibilities of including one of the terms, either of the terms, or both terms. For example, the phrase "a or B" should be understood to include the possibility of "a" or "B", or "a and B".
The terms "first", "second" and "first" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, features defined as "first", "second", may explicitly or implicitly include one or more of the described features.
The term "fusing" means that a target application or server is abnormal or has a large amount of timeout, at this time, the call of the application or server is directly interrupted, part of service logic is locally implemented or directly returned for a subsequent call request, the call is automatically recovered when the condition of the target server is monitored to be improved, and a local service log is returned to the main application or the main server.
The term "playback" means that after the service of a server is fused for a request or a transaction, the total credit data and the log data are accumulated locally, and after the server is recovered, the total credit data and the log data are synchronized into the management and control data of a main application or a main server through an asynchronous thread, so that the accuracy of the final management and control data is ensured.
The embodiment of the disclosure provides a calling method based on a distributed server and a centralized server. The calling method comprises the following steps: and calling the quota service of the distributed server, and judging the fusing identifier of the centralized server. And responding to the fusing identifier, calling first quota information of the distributed server, judging based on the first quota information, and generating a first judgment result and first process information. Or calling second quota information of the centralized server, judging based on the second quota information, and generating a second judgment result. According to the embodiment of the disclosure, a distributed server and a centralized server are set, and first quota information of the distributed server or second quota information of the centralized server is called by judging a fusing identifier of the centralized server. The distributed server system can provide service guarantee through the distributed server when the centralized server fails, so that loss caused by service interruption is prevented, and the service efficiency of the server is effectively improved.
Fig. 1 schematically illustrates an application scenario of a distributed server and centralized server based calling method and device according to an embodiment of the present disclosure. It should be noted that fig. 1 is only an example of a calling method and a device to which the embodiments of the present disclosure may be applied to help those skilled in the art understand the technical content of the present disclosure, and does not mean that the embodiments of the present disclosure may not be used in other devices, systems, environments or scenarios. It should be noted that the calling method and device based on the distributed server and the centralized server provided by the embodiment of the present disclosure may be used in the server calling related aspects in the financial field, and may also be used in various fields other than the server calling in the financial field, such as the technical field of computer communication networks.
As shown in fig. 1, an exemplary system architecture 100 to which the distributed server and centralized server based calling method may be applied according to the embodiments of the present disclosure may include terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 serves as a medium for providing communication links between the terminal devices 101, 102, 103 and the server 105. Network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
The user may use the terminal devices 101, 102, 103 to interact with the server 105 via the network 104 to receive or send messages or the like. The terminal devices 101, 102, 103 may have installed thereon various communication client applications, such as shopping-like applications, web browser applications, search-like applications, instant messaging tools, mailbox clients, social platform software, etc. (by way of example only).
The terminal devices 101, 102, 103 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like.
The server 105 may be a server providing various services, such as a background management server (for example only) providing support for websites browsed by users using the terminal devices 101, 102, 103. The background management server may analyze and perform other processing on the received data such as the user request, and feed back a processing result (e.g., a webpage, information, or data obtained or generated according to the user request) to the terminal device.
It should be noted that the calling method provided by the embodiment of the present disclosure may be generally executed by the server 105. Accordingly, the invoking device provided by the embodiments of the present disclosure may be generally disposed in the server 105. The calling method provided by the embodiment of the present disclosure may also be executed by a server or a server cluster different from the server 105 and capable of communicating with the terminal devices 101, 102, 103 and/or the server 105. Accordingly, the invoking device provided by the embodiment of the present disclosure may also be disposed in a server or a server cluster different from the server 105 and capable of communicating with the terminal devices 101, 102, 103 and/or the server 105.
It should be understood that the number of terminal devices, networks, and servers in the embodiments of the disclosure are merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
FIG. 2 schematically shows a flow diagram of a calling method according to an embodiment of the disclosure.
As shown in fig. 2, the distributed server and centralized server based calling method of the present disclosure includes steps S1 to S3.
In step S1, the quota service of the distributed server is invoked.
In the embodiment of the disclosure, the quota service may be, for example, an amount management and control protocol in the server, and the user sets the amount management and control protocol in the server to control the transfer amount of bills or funds accumulated in a single day or a month of the account of the user, and controls the bills or funds of the account by controlling the amount, so as to avoid abnormal operation of the account.
By receiving a user instruction, the quota service in the distributed server is called first, the quota service of the distributed server is used for replacing or making up the quota service of the centralized server, and compared with the method only using the centralized server to execute the quota service, the method has higher fault tolerance rate. The provision of distributed servers can solve this problem, in contrast to the single point of risk that exists with centralized servers.
In step S2, the fusing flag of the centralized server is determined.
In the embodiment of the present disclosure, the key management and control protocol of the centralized server is stored in the centralized instruction library, and is prone to failure. Whether the centralized server operates normally is determined by judging the fusing identifier of the centralized server, and the centralized server or the distributed server is called based on the fusing identifier, so that the service efficiency of the server is effectively improved.
In step S3, in response to the fuse identifier, first quota information of the distributed server is called, and a determination is made based on the first quota information, and a first determination result and first process information are generated. Or calling second quota information of the centralized server, judging based on the second quota information, and generating a second judgment result.
For example, the blown flag may include an on (blown state) indicating that a service of the centralized server is unavailable due to a failure. The blown flag may also include an off (not blown state) indicating that the service operation of the centralized server is properly available.
When the centralized server fails, first quota information of the distributed server is called, judgment is carried out based on the first quota information, and a first judgment result and first process information are generated. When the operation of the centralized server is normal, the first quota information of the distributed server can be selected to be called, the second quota information of the centralized server can also be selected to be called, and a specific calling scheme can be set according to a specific situation.
Fig. 3 schematically shows a call flow diagram of a calling method between a distributed server and a centralized server according to an embodiment of the disclosure. The call flow includes steps S01 to S08, where a denotes a distributed server and B denotes a centralized server. Fig. 3 illustrates an exemplary flow of invoking the quota service, and in other alternative embodiments, the quota service is not limited to the quota service, and other services may be invoked.
As shown in fig. 3, for example, when the user uses an account, the server receives an input operation from the user, and executes the start instruction of step S01. For example, the start instruction may be a transfer operation performed on an account, or an instruction for checking account input by the user, or the like.
After step S01, step S02 is executed, i.e., the quota service of the distributed server is invoked. Step S02 is performed in the distributed server a, and the calling quota service is executed by the distributed server, so that the deficiency of the centralized server can be effectively made up, and the service interruption after the failure of the centralized server is prevented.
After step S02, step S03 is performed to determine the fusing flag of the centralized server. The centralized server or the distributed server is further determined to be called by judging the fusing identifier of the centralized server, so that the calling efficiency of the centralized server and the distributed server can be effectively improved, and the fault tolerance rate of the system is improved.
If the fusing flag is on, that is, it indicates that the centralized server is in a fusing state, step S07 is executed: and calling first quota information of the distributed server, judging based on the first quota information, and generating a first judgment result and first process information.
If the centralized server is in a fusing state and indicates that the service of the centralized server is unavailable, the operation required by the user is completed by calling the first quota information of the distributed server, so that the problem that the centralized server cannot normally operate when the centralized server fails can be solved, and the normal operation of the service required by the user is ensured.
In embodiments of the present disclosure, the centralized server and the distributed server are typically in a state of running simultaneously. When the centralized server is in a non-fusing state, the first quota information of the distributed server and the second quota information of the centralized server are in a synchronous state. For example, in response to the fuse identifier, the second quota information is copied from the centralized repository to the distributed servers by a copy utility of the centralized server when the fuse identifier is off (i.e., not in a fused state) to form the first quota information.
For example, the second quota information is synchronized to the publish-subscribe messaging system (e.g., kafka) of the distributed server by a replication tool (cdc tool) of Oracle (centralized repository of centralized servers), and the distributed server starts a thread according to the first quota information to pull the latest quota information from the publish-subscribe messaging system of the distributed server and updates the shard repository with the distributed server to form the first quota information.
If the fusing flag is off (not fusing state), it indicates that the service of the centralized server is operating normally. In response to the blown flag being off, determining a type of quota service, wherein the type of quota service comprises one of an accumulated service and a fallback service.
The accumulative service may be a credit overlay within a limit for the bill or fund transfer out of the account during the use of the subscriber. For example, the user's limited quota is M, the used quota is N, the quota transferred in the current operation is X, when N + X is less than or equal to M, the service is determined as an accumulated service, that is, the used quota of the user after the current operation is calculated as N + X.
The rollback service may be the reduction of the used quota N caused by other factors or operation influence during the use process and the operation process of the user. For example, when the user performs a transfer operation and the transfer amount is Y, the account number information of the transfer account finally input by the user is wrong, so that the transfer fails, the last transfer amount Y will be returned from the used amount N in which the value of Y is recorded. For example, the last operation failure of the user results in a rollback, and at this time, the used quota of the user after the rollback is N-Y.
In the embodiment of the present disclosure, in step S04, if it is determined that the type of the quota service is the accumulated service, step S05 is executed, that is, the centralized server calls the second quota information to generate the second determination result. At this time, the fuse flag is off, i.e., in an unblown state, and thus the second quota information is called by using the service of the centralized server, and a second determination result is generated. The centralized server may be fully utilized, for example, if the second determination is successful, i.e., indicating that the user has not exceeded the limit, other operations may be performed, such as transferring money, etc. Or the generated judgment result is failure, namely the user exceeds the limited limit range, and the user is prevented from executing corresponding operation.
In the embodiment of the present disclosure, in step S04, if it is determined that the type of the quota service is the fallback service, step S06 is performed, that is, the number of accumulated tasks to be played back included in the distributed server is determined based on the determined type of the quota service, where the number of accumulated tasks to be played back is an integer greater than or equal to 0.
The accumulated tasks to be played back represent the tasks of accumulated services stored in the distributed servers, and when the fusing identifier of the centralized server is on, namely in a fusing state, both the accumulated services and the rollback services in the quota service type occur in the distributed servers. Thus, there may be a task record in the distributed server that accumulates services until the blown state of the centralized server has not changed (i.e., remains blown). The task records of the rollup service are not synchronized to the centralized server. At this time, the fusing identifier has changed from the fusing state to the un-fusing state, and the tasks of the accumulative services still exist in the distributed servers, and it is necessary to synchronize the tasks of the accumulative services in the distributed servers to the centralized server. And executing the rollback task, thereby ensuring the accuracy of the first quota information.
In the embodiment of the present disclosure, if it is determined that the cumulative number of tasks to be played back is equal to 0, step S05 is executed, that is, the centralized server calls the second quota information to generate a second determination result. The fact that the number of the accumulated tasks to be played back is equal to 0 indicates that the tasks to be played back which need to be synchronized to the centralized server do not exist in the distributed servers. And directly calling second quota information of the centralized server to generate a second judgment result.
In the embodiment of the present disclosure, if it is determined that the cumulative number of tasks to be played back is greater than 0, step S07 is executed, that is, the first quota information of the distributed server is called, and a first determination result and first process information are generated. For example, the cumulative number of tasks to be played back exists in the distributed server, and the first quota information in the distributed server needs to be calculated with the numerical value in the fallback service and then synchronized to the centralized server, so that the consistency of the first quota information and the second quota information is ensured, and errors or deviations caused by data asynchronism when the distributed server and the centralized server are called are prevented.
In the embodiment of the present disclosure, the first determination result generated at step S07 and the second determination result generated at step S05 are finally output through step S08 to perform the subsequent operations.
In an embodiment of the present disclosure, the first process information includes at least one of an accumulated log, a rollback log, and a rollback task.
For example, the cumulative log may include cumulative tasks to be played back, i.e., cumulative tasks stored in the distributed servers that need to be synchronized to the centralized server after the centralized server is restored from the blown state to the un-blown state.
For example, the rollback log may include billing information, rollback values, and the like that require rollback, and the rollback tasks may include, for example, values of tasks that need to be performed, time, and the like.
In the embodiment of the disclosure, the rollback task may be a case where the quota in the distributed processor needs to be rolled back due to other reasons (for example, a password input by a user is incorrect, or information of an input transfer account is wrong, etc.) when a service of the centralized server is in a blown state and the distributed server performs task processing. The rollback tasks may be single or multiple, and are stored in distributed servers.
In an embodiment of the present disclosure, the calling method further includes synchronizing the first process information to the centralized server in response to the fusing identifier after generating the first determination result and the first process information.
For example, when the fusing identifier changes to off (i.e., returns from the fused state to the un-fused state), in response to an instruction that the fusing identifier is off, the first process information in the distributed server is synchronized to the centralized server, so that the centralized server can acquire information of tasks processed by the distributed server when in the fused state and synchronize the information in real time, thereby ensuring that the first process information and the second process information are in a synchronized state and preventing the first process information and the second process information from being inconsistent. For example, the tasks to be played back in the first process information are inquired, 100 tasks form a group, and a quota playback service tool in the centralized processor is called to perform data updating. For example, the quota playback service tool needs to support idempotent, that is, under the condition that the data of the service request is not changed, the processing results of multiple times are the same.
According to the embodiment of the disclosure, after the centralized server is restored to the non-fusing state, the first process information is synchronized to the centralized server, so that the centralized server can be ensured to be synchronized with the data of the distributed server after being restored to the non-fusing state, and meanwhile, the centralized server can continue to work in cooperation with the distributed server after being restored, the efficiency is improved, and the situation of data inconsistency is prevented.
For example, when the fuse flag is on (in the fuse state), the centralized server still cannot work normally, and the synchronization process is not performed.
FIG. 4 schematically shows a flow diagram for determining a fuse identifier of a calling method according to an embodiment of the disclosure.
In an embodiment of the present disclosure, the fusing flag is controlled by a fusing switch. A fusing master switch for controlling a master service state in the master server and a fusing slave switch may be provided. The fusing sub-switch is used for controlling the fusing state of the branch service in the total service. For example, the total fused switch or the sub fused switch is accumulated according to the calling times of the service failure calling the centralized server, including the calling times in the set time, and when the calling times in the set time exceed the set value, the corresponding service is determined to be fused. For example, the parameter is set to be that the number of call failures is less than or equal to 10 times within 10 minutes, and when the number of call failures for calling the service failure of the centralized server exceeds 10 times within 10 minutes, the fusing master switch is switched to the fusing state, which indicates that the centralized server fails, or an alarm is given to the monitoring platform.
As shown in fig. 4, in step S41, the automatic fuse main switch includes three states, namely, automatic fuse warning, and manual fuse. When the automatic fuse warning is on, the process proceeds to step S42. When the automatic fuse main switch is on, the process proceeds to step S43. When the manual fuse main switch is off, the process proceeds to step S46.
In step S42, the fusing status of the centralized server is off, that is, according to the non-fusing process, the service of the centralized server is called, that is, the corresponding fusing flag is off (non-fusing status).
In step S43, the automatic fuse main switch is turned on, and at this time, it is determined whether or not any one of the automatic fuse sub switch and the manual fuse sub switch is turned on. If either one of the automatic fuse tap switch and the manual fuse tap switch is on, the fuse flag is on (blown state).
In the embodiment of the present disclosure, when the automatic fusing master switch of the centralized server is turned on, the state of the fusing slave switches of the corresponding other branch services needs to be further determined. For example, the automatic fusing master switch is on, but the automatic fusing slave switch is off, indicating that the corresponding branch service of the automatic fusing slave switch is not fused. In this case, the flow proceeds from step S43 to step S42, and the branch service call centralized server is processed in accordance with the non-fusing processing.
In step S44, if the automatic fusing sub-switch and the manual fusing sub-switch are both on, the automatic fusing sub-switch is modified to off, and the number of call failures is reset.
In step S45, it is determined that the fusing flag of the branch service is on, and at this time, the centralized server cannot be called normally, and the corresponding service is executed by the distributed server.
In step S46, the master switch for manual fusing is turned on, and further in step S46, the state of the branch switch for branch service is determined.
If the status of the branch service manual fusing sub switch is off, it indicates that the branch service manual fusing is off, i.e. the process goes to step S42, and the centralized server is called according to the non-fusing processing.
If the state of the manual fusing sub switch of the branch service is on, it indicates that the manual fusing of the branch service is on, i.e. step S47 is entered, the corresponding branch service modifies the automatic fusing sub switch to be off according to the fusing processing, and resets the number of call failures to 0.
After step S42, step S51 is executed to determine the status of the automatic fusing master switch, and further adjust the automatic fusing slave switch or set a branch service event monitoring alarm according to the status of the automatic fusing master switch.
For example, when the automatic fusing main switch is turned on, step S52 is executed, and when the maximum call failure number of the branch service is equal to the allowable maximum number, the automatic fusing sub switch is set to be turned on, and the call failure number is reset to 0.
For example, when the automatic fuse warning is on, step S53 is executed, and when the maximum number of call failures of the branch service is equal to the allowable maximum number, the branch service event monitoring alarm is increased, and the number of call failures is reset to 0. And continuing to execute the step S54, setting an aging time for the cumulative call failure times corresponding to each branch service, wherein the call failure times are expired and invalidated, that is, the call failure times are accumulated within a certain time, and the call failure times exceeding the set time interval are invalidated, and the invalidated call failure times are not counted into the call failure times.
Fig. 5 schematically shows a block diagram of a calling device according to an embodiment of the present disclosure.
As shown in fig. 5, the calling device 500 includes a first calling module 510, a judging module 520, and a second calling module 530.
The first invocation module 510 is configured to invoke a quota service of a distributed server.
For example, the first invoking module 510 invokes the quota service of the distributed server according to the instruction after the user inputs a corresponding instruction, to determine whether the instruction of the user can be executed, for example, when the instruction input by the user exceeds the limit amount of the quota service, returns a result that the instruction input by the user does not meet the requirement.
The determination module 520 is configured to determine a blown identification of the centralized server.
For example, the determining module 520 is used to determine the fusing flag, for example, after the service fusing is triggered, the determining module determines whether the fusing flag is in an on (i.e., fused) or off (i.e., not fused) state according to a plurality of factors.
The second calling module 530 is configured to respond to the fusing identifier, call the first quota information of the distributed server, perform judgment based on the first quota information, and generate a first judgment result and first process information; or calling second quota information of the centralized server, judging based on the second quota information, and generating a second judgment result.
For example, the calling module may call quota information for a distributed server, or call quota information for a centralized server. And the information of the server called by the calling module is determined based on the fusing identifier. Therefore, when the centralized server fails, the normal operation of the server can be ensured by calling the quota information of the distributed server, and the loss caused by service interruption is prevented.
Any number of modules, sub-modules, units, sub-units, or at least part of the functionality of any number thereof according to embodiments of the present disclosure may be implemented in one module. Any one or more of the modules, sub-modules, units, and sub-units according to the embodiments of the present disclosure may be implemented by being split into a plurality of modules. Any one or more of the modules, sub-modules, units, sub-units according to embodiments of the present disclosure may be implemented at least in part as a hardware circuit, such as a Field Programmable Gate Array (FPGA), a Programmable Logic Array (PLA), a system on a chip, a system on a substrate, a system on a package, an Application Specific Integrated Circuit (ASIC), or may be implemented in any other reasonable manner of hardware or firmware by integrating or packaging a circuit, or in any one of or a suitable combination of software, hardware, and firmware implementations. Alternatively, one or more of the modules, sub-modules, units, sub-units according to embodiments of the disclosure may be at least partially implemented as a computer program module, which when executed may perform the corresponding functions.
For example, any number of the first calling module 510, the determining module 520, and the second calling module 530 may be combined and implemented in one module, or any one of them may be split into a plurality of modules. Alternatively, at least part of the functionality of one or more of these modules may be combined with at least part of the functionality of the other modules and implemented in one module. According to an embodiment of the present disclosure, at least one of the first calling module 510, the determining module 520, and the second calling module 530 may be implemented at least partially as a hardware circuit, such as a Field Programmable Gate Array (FPGA), a Programmable Logic Array (PLA), a system on a chip, a system on a substrate, a system on a package, an Application Specific Integrated Circuit (ASIC), or may be implemented by hardware or firmware in any other reasonable manner of integrating or packaging a circuit, or may be implemented by any one of three implementations of software, hardware, and firmware, or any suitable combination of any of the three. Alternatively, at least one of the first calling module 510, the determining module 520 and the second calling module 530 may be at least partially implemented as a computer program module, which when executed, may perform a corresponding function.
FIG. 6 schematically illustrates a block diagram of an electronic device suitable for implementing the above-described distributed server and centralized server based invocation methods in accordance with an embodiment of the present disclosure. The electronic device shown in fig. 6 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in fig. 6, an electronic device 600 according to an embodiment of the present disclosure includes a processor 601, which can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM)602 or a program loaded from a storage section 608 into a Random Access Memory (RAM) 603. Processor 601 may include, for example, a general purpose microprocessor (e.g., a CPU), an instruction set processor and/or associated chipset, and/or a special purpose microprocessor (e.g., an Application Specific Integrated Circuit (ASIC)), among others. The processor 601 may also include onboard memory for caching purposes. Processor 601 may include a single processing unit or multiple processing units for performing different actions of a method flow according to embodiments of the disclosure.
In the RAM 603, various programs and data necessary for the operation of the electronic apparatus 600 are stored. The processor 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. The processor 601 performs various operations of the method flows according to the embodiments of the present disclosure by executing programs in the ROM 602 and/or RAM 603. It is to be noted that the programs may also be stored in one or more memories other than the ROM 602 and RAM 603. The processor 601 may also perform various operations of the method flows according to embodiments of the present disclosure by executing programs stored in the one or more memories.
Electronic device 600 may also include input/output (I/O) interface 605, input/output (I/O) interface 605 also connected to bus 604, according to an embodiment of the disclosure. The system 600 may also include one or more of the following components connected to the I/O interface 605: an input portion 606 including a keyboard, a mouse, and the like; an output portion 607 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage section 608 including a hard disk and the like; and a communication section 609 including a network interface card such as a LAN card, a modem, or the like. The communication section 609 performs communication processing via a network such as the internet. The driver 610 is also connected to the I/O interface 605 as needed. A removable medium 611 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 610 as necessary, so that a computer program read out therefrom is mounted in the storage section 608 as necessary.
The present disclosure also provides a computer-readable storage medium, which may be contained in the apparatus/device/system described in the above embodiments; or may exist separately and not be assembled into the device/apparatus/system. The computer-readable storage medium carries one or more programs which, when executed, implement the method according to an embodiment of the disclosure.
According to embodiments of the present disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium, which may include, for example but is not limited to: a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. For example, according to embodiments of the present disclosure, a computer-readable storage medium may include the ROM 602 and/or RAM 603 described above and/or one or more memories other than the ROM 602 and RAM 603.
Embodiments of the present disclosure also include a computer program product comprising a computer program containing program code for performing the method provided by the embodiments of the present disclosure, when the computer program product is run on an electronic device, the program code being adapted to cause the electronic device to carry out the calling method provided by the embodiments of the present disclosure.
The computer program, when executed by the processor 601, performs the above-described functions defined in the system/apparatus of the embodiments of the present disclosure. The systems, apparatuses, modules, units, etc. described above may be implemented by computer program modules according to embodiments of the present disclosure.
In one embodiment, the computer program may be hosted on a tangible storage medium such as an optical storage device, a magnetic storage device, or the like. In another embodiment, the computer program may also be transmitted, distributed in the form of a signal on a network medium, downloaded and installed through the communication section 609, and/or installed from the removable medium 611. The computer program containing program code may be transmitted using any suitable network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the foregoing.
In accordance with embodiments of the present disclosure, program code for executing computer programs provided by embodiments of the present disclosure may be written in any combination of one or more programming languages, and in particular, these computer programs may be implemented using high level procedural and/or object oriented programming languages, and/or assembly/machine languages. The programming language includes, but is not limited to, programming languages such as Java, C + +, python, the "C" language, or the like. The program code may execute entirely on the user computing device, partly on the user device, partly on a remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., through the internet using an internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
Those skilled in the art will appreciate that various combinations and/or combinations of features recited in the various embodiments and/or claims of the present disclosure can be made, even if such combinations or combinations are not expressly recited in the present disclosure. In particular, various combinations and/or combinations of the features recited in the various embodiments and/or claims of the present disclosure may be made without departing from the spirit or teaching of the present disclosure. All such combinations and/or associations are within the scope of the present disclosure.
The embodiments of the present disclosure have been described above. However, these examples are for illustrative purposes only and are not intended to limit the scope of the present disclosure. Although the embodiments are described separately above, this does not mean that the measures in the embodiments cannot be used in advantageous combination. The scope of the disclosure is defined by the appended claims and equivalents thereof. Various alternatives and modifications can be devised by those skilled in the art without departing from the scope of the present disclosure, and such alternatives and modifications are intended to be within the scope of the present disclosure.

Claims (13)

1. A calling method based on a distributed server and a centralized server comprises the following steps:
invoking a quota service of the distributed server;
judging a fusing identifier of the centralized server;
responding to the fusing identifier, calling first quota information of the distributed server, judging based on the first quota information, and generating a first judgment result and first process information; or calling second quota information of the centralized server, judging based on the second quota information, and generating a second judgment result.
2. The calling method of claim 1, further comprising determining a type of the quota service in response to the fuse identifier;
the type of quota service comprises one of an accumulation service and a fallback service.
3. The calling method of claim 2, wherein the determining the type of quota service in response to the fuse identifier comprises:
and determining the type of the quota service as an accumulated service, calling the second quota information through the centralized server, and generating a second judgment result.
4. The calling method of claim 2, wherein the determining the type of quota service in response to the fuse identifier comprises:
determining the type of the quota service as a backspacing service, and determining the accumulated number of tasks to be played back in the distributed server based on the determined type of the quota service;
the number of accumulated tasks to be played back is an integer greater than or equal to 0.
5. The calling method of claim 4, wherein the determining that the type of the quota service is a fallback service, the determining the cumulative number of tasks to be played back included in the distributed server based on determining the type of the quota service comprises:
and determining that the number of the accumulated tasks to be played back is equal to 0, and calling the second quota information through the centralized server to generate a second judgment result.
6. The calling method of claim 4, wherein the determining that the type of the quota service is a fallback service, the determining the cumulative number of tasks to be played back included in the distributed server based on determining the type of the quota service comprises:
and determining that the number of the accumulated tasks to be played back is greater than 0, calling the first quota information through the distributed server, and generating the first judgment result and the first process information.
7. The calling method of any of claims 1 to 6, wherein the first process information comprises at least one of a cumulative log, a rollback log, and a rollback task.
8. The calling method of claim 7, further comprising synchronizing the first process information to the centralized server in response to the fuse identifier after generating the first determination and the first process information.
9. The calling method according to any one of claims 1 to 6, further comprising:
and in response to the fusing identifier, copying the second quota information from the centralized server to the distributed server to form the first quota information.
10. A calling device based on distributed server and centralized server, comprising:
a first calling module configured to call a quota service of the distributed server;
a judging module configured to judge a fusing identifier of the centralized server;
the second calling module is configured to respond to the fusing identifier, call first quota information of the distributed server, perform judgment based on the first quota information, and generate a first judgment result and first process information; or calling second quota information of the centralized server, judging based on the second quota information, and generating a second judgment result.
11. An electronic device, comprising:
one or more processors;
storage means for storing executable instructions that, when executed by the processor, implement the calling method of any of claims 1 to 9.
12. A computer readable storage medium having stored thereon executable instructions which, when executed by a processor, implement the calling method of any one of claims 1 to 9.
13. A computer program product, wherein the product stores a computer program which, when executed, is capable of implementing the calling method according to any one of claims 1 to 9.
CN202110587940.5A 2021-05-27 2021-05-27 Calling method and calling equipment based on distributed server and centralized server Pending CN113220487A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110587940.5A CN113220487A (en) 2021-05-27 2021-05-27 Calling method and calling equipment based on distributed server and centralized server

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110587940.5A CN113220487A (en) 2021-05-27 2021-05-27 Calling method and calling equipment based on distributed server and centralized server

Publications (1)

Publication Number Publication Date
CN113220487A true CN113220487A (en) 2021-08-06

Family

ID=77099681

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110587940.5A Pending CN113220487A (en) 2021-05-27 2021-05-27 Calling method and calling equipment based on distributed server and centralized server

Country Status (1)

Country Link
CN (1) CN113220487A (en)

Similar Documents

Publication Publication Date Title
CN110708196B (en) Data processing method and device
US9887889B1 (en) State reconciliation using event tracking and polling
CN111209110B (en) Task scheduling management method, system and storage medium for realizing load balancing
CN114253673A (en) Transaction processing method and transaction processing device of distributed system
CN112860343A (en) Configuration changing method, system, device, electronic equipment and storage medium
CN115544044A (en) Data consistency keeping method, device, equipment and storage medium
CN112561506B (en) Live broadcast data processing method, system, equipment and medium based on virtual currency
CN111538585A (en) Js-based server process scheduling method, system and device
CN111639086B (en) Data reconciliation method, device, equipment and storage medium
CN116957560A (en) Method for supervising prepaid transaction funds by using predictor
CN113220487A (en) Calling method and calling equipment based on distributed server and centralized server
CN116166390A (en) Service processing method and device, electronic equipment and storage medium
CN115629920A (en) Data request exception handling method and device and computer readable storage medium
CN114036164A (en) High-concurrency transaction locking method and system combining optimistic lock and pessimistic lock
CN113177052A (en) Method and device for processing service data consistency of distributed system
CN112463887A (en) Data processing method, device, equipment and storage medium
CN114691395A (en) Fault processing method and device, electronic equipment and storage medium
CN111722946A (en) Distributed transaction processing method and device, computer equipment and readable storage medium
CN107783852B (en) Dump file generation method and terminal
CN111666132A (en) Distributed transaction implementation method, device, computer system and readable storage medium
CN105574020B (en) Database operation method and device
CN111176959A (en) Early warning method, system and storage medium for cross-domain application server
CN112463514A (en) Monitoring method and device for distributed cache cluster
CN113485930B (en) Business process verification method, device, computer system and readable storage medium
CN109067611B (en) Method, device, storage medium and processor for detecting communication state between systems

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