Business processing method, system and device, storage medium and product
By judging the number of active databases in the banking system and sending business requests to the remaining active databases for processing, the problem of unstable business allocation caused by mobile phone number modification is solved, and the reliability and system stability of business processing are improved.
Patent Information
- Application Number
- CN202411552784.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-01
- Publication Date
- 2025-03-25
AI Technical Summary
In the banking system, when using mobile phone numbers as the routing factor for business traffic allocation, the user's mobile phone numbers may be modified, resulting in business operations being allocated to different data databases, affecting the reliability of business processing.
By receiving the client's service processing request, the number of active databases in the database is judged. If it is less than the preset value, the service request is sent to the server of the remaining active databases for processing, avoiding independent deployment of user management and login functions.
It improves the reliability of business processing, avoids login failures and business scenarios caused by user service system failure, and enhances the overall stability of the system.
Smart Images

Figure CN119690642A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a business processing method, system, device, storage medium and product. Background Art
[0002] In most banking systems, mobile phone numbers are widely recognized by users as the most traditional and convenient login method, but using them as a routing factor for business traffic allocation is not ideal, because users' mobile phone numbers may be modified. If they are used as the basis for traffic allocation, the business operations of the same user may be allocated to different data sub-databases at different times, which will cause a series of problems. User IDs are the only unchanging identifier used to distinguish different users within the system. They are highly bound to user business operations and are often the best choice as diversion factors.
[0003] In the related technology, user management and login-related functions are extracted and deployed as an independent application for user identity authentication. However, when the user service system fails, login failure will occur, affecting the use of all business scenarios and reducing the overall reliability of business processing. Summary of the invention
[0004] The main purpose of this application is to provide a business processing method, which aims to solve the technical problem of extracting user management and login-related functions and deploying them as an independent application for user identity authentication. However, when the user service system fails, it will cause login failures, affecting the use of all business scenarios and reducing the overall reliability of business processing.
[0005] To achieve the above objectives, the present application proposes a business processing method, which includes:
[0006] Receive a business processing request sent by a client, and based on the business processing request, determine the number of active sub-databases in the database used for business processing to obtain a determination result, wherein the number of active sub-databases is obtained based on the number sent by the microservice center;
[0007] If the judgment result is that the number of active sub-databases is less than the preset value, the business processing request is sent to the active servers corresponding to the remaining active sub-databases, so that the active servers can perform business processing based on the business processing request and obtain business processing results.
[0008] In one embodiment, the step of receiving a business processing request sent by a client, and judging the number of active sub-databases in a database used for business processing based on the business processing request, and obtaining a judgment result further includes:
[0009] If the active number is equal to a preset value, obtaining a user number based on the business processing request;
[0010] Based on the preset business diversion rules and the user number, a target sub-library for business processing is determined from multiple sub-libraries, and the received business processing request is sent to a target server corresponding to the target sub-library.
[0011] In one embodiment, if the result of the judgment is that the number of active sub-databases is less than a preset value, the step of sending the business processing request to the active servers corresponding to the remaining active sub-databases includes:
[0012] Obtain the library names corresponding to the remaining active sub-libraries, and add the library names to the local cache;
[0013] The step of obtaining the library names corresponding to the remaining active sub-libraries and adding the library names to the local cache includes:
[0014] When the gateway performs business processing again, the business processing request is forwarded to the remaining active sub-libraries corresponding to the library name.
[0015] In one embodiment, the step of receiving a business processing request sent by a client, and judging the number of active sub-databases in a database used for business processing based on the business processing request, and obtaining a judgment result includes:
[0016] Receive a login request from a user, and based on the login request, obtain the number of active sub-databases;
[0017] If the active number is equal to a preset value, the login request is randomly forwarded to any server.
[0018] In addition, to achieve the above purpose, the present application also proposes a business processing method, wherein the method comprises:
[0019] Receiving a login request sent by the gateway, and obtaining a user number based on the login request;
[0020] Verify the user number, generate verification information after successful verification, and store the login credentials in the verification information obtained after successful verification locally;
[0021] Determine the activity of the second sub-database corresponding to the second server, and if it is active, synchronize the stored login credentials to the second server in real time;
[0022] Until the real-time synchronization of the login credentials is completed, the user number in the verification information is fed back to the gateway, so that the gateway can feed back the user number to the client.
[0023] In one embodiment, until the real-time synchronization of the login credentials is completed, after the step of feeding back the user number in the verification information to the gateway so that the gateway feeds back the user number to the client, the step includes:
[0024] If the second sub-database is not active, register the business data for asynchronous synchronization to the second sub-database, and when the second sub-database becomes active, asynchronously synchronize the registered business data to the second sub-database;
[0025] After the step of completing the real-time synchronization of the login credentials and feeding back the user number in the verification information to the gateway so that the gateway feeds back the user number to the client, the method further includes:
[0026] If the second sub-database is active, based on the business processing request, the business data stored in the first sub-database is obtained, business processing is performed based on the business data to obtain the business processing result, and after obtaining the business processing result, the business data is asynchronously synchronized to the second sub-database.
[0027] In addition, to achieve the above-mentioned purpose, the present application also proposes a service processing device, the service processing device comprising:
[0028] A receiving module, used to receive a business processing request sent by a client, and based on the business processing request, determine the number of active sub-databases in the database used for business processing to obtain a determination result, wherein the number of active sub-databases is obtained based on the number sent by the microservice center;
[0029] The judgment module is used to send the business processing request to the server corresponding to the active sub-library if the judgment result is that the number of active sub-libraries is less than a preset value, so that the server can perform business processing based on the business processing request and obtain a business processing result.
[0030] In addition, to achieve the above objectives, the present application also proposes a business processing device, the device comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the business processing method as described above.
[0031] In addition, to achieve the above objectives, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the business processing method described above are implemented.
[0032] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the steps of the business processing method described above are implemented.
[0033] One or more technical solutions proposed in this application have at least the following technical effects:
[0034] Compared with the related art, in which user management and login-related functions are extracted and deployed as an independent application for user identity authentication, but when the user service system fails, login failure will occur, affecting the use of all business scenarios and reducing the overall reliability of business processing, the present application receives a business processing request sent by a client, and based on the business processing request, judges the number of active sub-databases in the database used for business processing to obtain a judgment result, wherein the active number is obtained based on the microservice center; if the judgment result is that the number of active sub-databases is less than a preset value, the business processing request is sent to the active servers corresponding to the remaining active sub-databases, so that the active servers can perform business processing based on the business processing request to obtain business processing results. It can be understood that after obtaining the business processing request, the present application judges the number of active sub-databases used for business processing, and when the number of active sub-databases is less than the preset value, the business traffic is sent to the server corresponding to the active sub-database for business processing. There is no need to extract user management and login-related functions and deploy them as an independent application, thereby obtaining business processing results, which can avoid the situation that when the user service system fails, login failure will occur, affecting the use of all business scenarios and reducing the overall reliability of business processing. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0036] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0037] Figure 1 A flowchart of the first embodiment of the business processing method of this application is provided;
[0038] Figure 2 This is the overall architecture diagram of the business processing method for this application;
[0039] Figure 3 This is a gateway flow chart of the business processing method for this application;
[0040] Figure 4 A flowchart of the second embodiment of the business processing method of this application is provided;
[0041] Figure 5 This is the back-end login flow chart of the business processing method for this application;
[0042] Figure 6 A business sequence diagram of the business processing method of this application;
[0043] Figure 7 This is a schematic diagram of the module structure of the service processing device according to an embodiment of the present application;
[0044] Figure 8 This is a schematic diagram of the device structure of the hardware operating environment involved in the business processing method in the embodiment of the present application.
[0045] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0046] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.
[0047] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.
[0048] The main solution of the embodiment of the present application is: receiving a business processing request sent by a client, and based on the business processing request, judging the active number of active sub-databases in the database used for business processing to obtain a judgment result, wherein the active number is obtained based on the sending of the microservice center; if the judgment result is that the number of active sub-databases is less than a preset value, the business processing request is sent to the active servers corresponding to the remaining active sub-databases, so that the active servers can perform business processing based on the business processing request to obtain a business processing result.
[0049] In the related art, user management and login-related functions are extracted and deployed as an independent application for user identity authentication. However, when the user service system fails, login failure will occur, affecting the use of all business scenarios and reducing the overall reliability of business processing. In the related art, user management and login-related functions are extracted and deployed as an independent application for user identity authentication. However, when the user service system fails, login failure will occur, affecting the use of all business scenarios and reducing the overall reliability of business processing.
[0050] After obtaining the business processing request, this application determines the number of active sub-databases used for business processing. When the number of active sub-databases is less than the preset value, the business traffic is sent to the server corresponding to the active sub-database for business processing. There is no need to extract user management and login-related functions and deploy them as an independent application. In this way, the business processing results are obtained and it can be avoided that when the user service system fails, it will cause login failure, affect the use of all business scenarios, and reduce the overall reliability of business processing.
[0051] It should be noted that the execution subject of this embodiment may be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or an electronic device capable of realizing the above functions, etc. The following takes business processing as an example to illustrate this embodiment and the following embodiments.
[0052] Based on this, the present application embodiment provides a business processing method, referring to Figure 1 , Figure 1 This is a flowchart of the first embodiment of the business processing method of the present application.
[0053] In this embodiment, refer to Figure 2 , Figure 2 The business processing method includes steps S100 to S200:
[0054] Step S100, receiving a business processing request sent by a client, and judging the number of active sub-databases in the database used for business processing based on the business processing request to obtain a judgment result, wherein the number of active sub-databases is obtained based on the number sent by the microservice center;
[0055] It should be noted that the executor of this embodiment is a business processing device, which is equipped with a microservice center, a server, a gateway and a database. The database is equipped with a first sub-library and a second sub-library. The microservice center is used to monitor the active status of the sub-library corresponding to the server, and the gateway is used to intelligently process login and business requests.
[0056] It is understandable that after receiving the business processing request sent by the user on the client, the gateway of the business processing device obtains the current number of active sub-libraries from the microservice center, and determines the number of active sub-libraries to obtain a determination result.
[0057] Step S200, if the judgment result is that the number of active sub-databases is less than the preset value, the business processing request is sent to the active servers corresponding to the remaining active sub-databases, so that the active servers can perform business processing based on the business processing request and obtain business processing results.
[0058] It should be noted that the preset value is two. An active sub-database refers to a sub-database that does not have any fault or downtime errors. An active server is a server that can be used for business processing. The gateway of the business processing device distinguishes between login requests and business requests and adopts different routing strategies. The gateway will determine whether multiple sub-databases are available. If it is determined that the number of available sub-databases is less than two, the business processing request will be forwarded to the available sub-database instance for business processing, and then the business processing result will be obtained.
[0059] Specifically, when a sub-database goes down during business processing, in order to ensure the stable operation of the system, the gateway can automatically switch from dual-active to single-active. Before processing the request, the gateway needs to obtain the current active sub-database from the microservice center. When only one sub-database is available, all traffic is routed to the instance under the sub-database to ensure service continuity.
[0060] In particular, to ensure service continuity, services for the same user are all executed in the same sub-database.
[0061] In a feasible implementation manner, the following steps are further included after step S100:
[0062] If the active number is equal to a preset value, obtaining a user number based on the business processing request;
[0063] It is understandable that the user number is a unique and unchanging identifier used to distinguish different users as a user ID, and is often the best choice as a diversion factor when it is highly bound to the user's business operations. If the gateway of the business processing device determines that the number of active sub-databases is equal to the preset value, that is, after all sub-databases are active and available, the gateway will judge the request sent by the client. After determining that the client's request is a login request, the gateway will determine the user ID, which is a unique and unchanging identifier used to distinguish different users, based on the business processing request.
[0064] In particular, at this time all sub-databases are active sub-databases.
[0065] Based on the preset business diversion rules and the user number, a target sub-library for business processing is determined from multiple sub-libraries, and the received business processing request is sent to a target server corresponding to the target sub-library.
[0066] It should be noted that the target sub-database is a database dedicated to business processing for the user corresponding to the user ID. The gateway of the business processing device determines the target sub-database dedicated to business processing for the user corresponding to the user ID from multiple sub-databases based on the user ID. After determining the target sub-database, the gateway forwards the request to the target server corresponding to the target sub-database for business processing.
[0067] In particular, the user ID is a unique and unchanging identifier determined based on the user's mobile phone number to distinguish different users, avoiding the use of the user's mobile phone number as the basis for traffic allocation. Due to changes in the mobile phone number, the business operations of the same user may be allocated to different data sub-databases at different times, causing a series of problems. When using the user ID as a diversion factor, the diversion can be based on the characteristics of the user ID. For example, the parity of the last digit of the user ID can be used as the basis for diversion.
[0068] In a feasible implementation manner, the following steps are included after step S200:
[0069] Obtain the library names corresponding to the remaining active sub-libraries, and add the library names to the local cache;
[0070] It is understandable that the library name is the unique identifier of the sub-library. When the gateway of the business processing device detects that only one sub-library is available, it obtains the library name of the sub-library and stores the library name in the gateway's cache, ensuring that business traffic will only be sent to normal sub-libraries before the abnormal sub-library is restored and asynchronous data synchronization is completed, avoiding phantom reads that may be caused when the abnormal sub-library is restored but asynchronous data synchronization is not completed.
[0071] The step of obtaining the library names corresponding to the remaining active sub-libraries and adding the library names to the local cache includes:
[0072] Get the currently active sub-library and the corresponding server from the microservice center.
[0073] It should be noted that after receiving the business processing request again, the gateway of the business processing device no longer needs to obtain the current active sub-library from the microservice center, but directly forwards the business processing request to the server corresponding to the storage library name in the local cache.
[0074] In particular, when the failed sub-database becomes active again, the gateway will still forward the business processing request to the server corresponding to the storage library name in the local cache. Only when the reactivated sub-database asynchronously synchronizes the data registered by other sub-databases will the library name stored in the cache be cleared and normal working status will be restored again.
[0075] In a feasible implementation manner, the following steps are included before step S100:
[0076] Receive a login request from a user, and based on the login request, obtain the number of active sub-databases;
[0077] It is understandable that after receiving the login request, the gateway of the business processing device needs to determine whether multiple sub-databases are active and available, and then obtain the number of active sub-databases sent to the service center.
[0078] If the active number is equal to a preset value, the login request is randomly forwarded to any server.
[0079] It should be noted that if the gateway of the business processing device detects that the number of active sub-databases is equal to the preset value, that is, there is no downtime sub-database, the gateway will immediately forward the login request to any server. Please refer to Figure 3 , Figure 3 A gateway flow chart is provided.
[0080] Specifically, when all sub-databases are available, the gateway adopts a more sophisticated traffic management strategy, using a random routing forwarding strategy for login requests and a user ID-based forwarding routing strategy for business requests, thereby improving the system's parallel processing capabilities and overall performance.
[0081] In this implementation, when a single sub-database crashes during business processing, all traffic is switched to another sub-database in the active-active mode to perform business processing, thereby improving the overall reliability of business processing.
[0082] The present application embodiment provides a service processing method, referring to Figure 4 , Figure 4 This is a flowchart of the second embodiment of the business processing method of the present application.
[0083] In this embodiment, refer to Figure 5 , Figure 5 The back-end login flow chart shows that the business processing method includes steps A100 to A400:
[0084] Step A100, receiving a login request sent by the gateway, and obtaining a user number based on the login request;
[0085] It should be noted that the user number is the user's mobile phone number. The server includes a first server and a second server, and the first server includes an active server or a target server. The first server of the business processing device receives a login request sent by the gateway, and obtains the user's mobile phone number based on the login request.
[0086] Step A200, verifying the user number, generating verification information after successful verification, and storing the login credentials in the verification information obtained after successful verification locally;
[0087] It is understandable that the verification information includes login credentials and user ID. The login credential is a Token, which is a string generated by the server and used to verify the identity of the user. After successfully verifying the user's mobile phone number, the first server of the business processing device generates verification information including login credentials and user ID. After generating the verification information, the login credentials such as Token are retained locally.
[0088] In particular, the first server of the business processing device needs to check the validity period of the Token before the user logs in.
[0089] Step A300, determining the activity of the second sub-database corresponding to the second server, and if it is active, synchronizing the stored login credentials to the second server in real time;
[0090] It is understandable that, considering the particularity of the login process, once the user logs in successfully, the system will automatically trigger a series of business-related query operations. If the previous login request and the business request directed based on the user ID are not in the same sub-library, the business query operation will fail. Therefore, the back-end service needs to synchronize the login credentials to the second server corresponding to the other sub-library in real time when performing local login, so that subsequent business requests can be executed normally no matter which sub-library they enter. Before synchronizing the login credentials, the first server of the business processing device will obtain the active status of the second sub-library that needs to be synchronized from the microservice center and judge the active status.
[0091] It should be noted that the first server of the business processing device determines whether the sub-database is multi-active before synchronizing the login credentials in real time, so that the system login automatically completes the switch from multi-active to single-active, thereby improving the reliability of the system.
[0092] Specifically, the first server of the business processing device ensures that subsequent business traffic can be authenticated normally no matter which sub-database it is diverted to by synchronizing login credentials in real time, thereby eliminating the need to build an additional user service system, simplifying the system architecture, reducing system management, maintenance and monitoring costs, and reducing the occupation of software and hardware resources.
[0093] In particular, when the first server of the business processing device synchronizes the login credentials in real time, it needs to monitor the synchronization status of the login credentials. If it is detected that the synchronization of the login credentials fails, the reversal operation is used to roll back the local record, delete the locally stored login credentials, and prompt an error to exit the business processing.
[0094] Specifically, Figure 5As shown, the first server of the business processing device uses the distributed data synchronization solution of the SAGA (Sequentially Aggregated Generalized Transactions) reversal mode to implement. The basic principle of the SAGA mode is that there are multiple participants in a distributed transaction, and each participant has a reversal compensation service. During the execution of the distributed transaction, the forward operations of each participant are executed in turn. If all forward operations are executed successfully, the distributed transaction is committed. If any forward operation fails to execute, the distributed transaction will execute the reverse rollback operation of the previous participants, roll back the submitted participants, and return the distributed transaction to the initial state. The implementation process applied to this solution mainly includes the following aspects:
[0095] 1. Split sub-events: The SAGA mode first splits a complex atomic operation into multiple sub-transactions, each of which corresponds to an event operation. This can reduce the complexity of transactions, making them easier to manage and understand. In this solution, data synchronization is split into two sub-events: updating local records and synchronizing login credentials online.
[0096] 2. Reversal and rollback mechanism: When a sub-event fails, the system will call the reversal operation in the reverse order and roll back all previous successful operation states. This solution sets up a reversal and rollback operation for event one when event two fails (that is, when the other sub-database is normal, server one has real-time login credentials).
[0097] 3. SAGA transaction coordinator: SAGA transaction coordinator coordinates the entire transaction processing process. This solution mainly coordinates the processing of events 1 and 2. If the transaction ends normally, the entire process is completed normally; if the event 2 operation fails, the reversal and rollback of event 1 is called to ensure the consistency of the transaction.
[0098] Specifically, before event 2 synchronizes the login credentials in real time, check whether the other sub-database is normal. If the other sub-database is abnormal, register the asynchronous synchronization record to return to the normal login record, and the application automatically completes the switch from dual-active to single-active. At the same time, in order to ensure that user queries will not generate phantom reads when the other sub-database is restored, the consistency of the data on both sides of the sub-database must be ensured, so the asynchronous data synchronization job must be registered locally, and the data of the asynchronous job must be synchronized first when the other sub-database is restored.
[0099] Step A400, until the real-time synchronization of the login credentials is completed, the user number in the verification information is fed back to the gateway, so that the gateway can feed back the user number to the client.
[0100] It should be noted that, considering the particularity of the login process, once the user logs in successfully, the system will automatically trigger a series of business-related query operations. If the previous login request and the business request based on the user ID are not in the same sub-library, the business query operation will fail. Therefore, the back-end service needs to synchronize the login credentials to the second server corresponding to the other sub-library in real time when performing local login, so that subsequent business requests can be executed normally no matter which sub-library they enter. Before synchronizing the login credentials, the first server of the business processing device will obtain the active status of the second sub-library to be synchronized from the microservice center, and judge the active status. When the real-time synchronization of the login credentials is completed, the first server of the business processing device will feedback the user ID corresponding to the user to the gateway. After receiving it, the gateway will send the user ID to the client for identity authentication for subsequent business processing.
[0101] In a feasible implementation manner, the following steps are included after step A400:
[0102] If the second sub-database is not active, register the business data for asynchronous synchronization to the second sub-database, and when the second sub-database becomes active, asynchronously synchronize the registered business data to the second sub-database;
[0103] It is understandable that the business data asynchronously synchronized to the second sub-library is the data that the first sub-library needs to synchronize to the second sub-library. If the second sub-library is not active when the first server of the business processing device receives the business processing request, the first server will register the business data that needs to be synchronized to the second sub-library when the second sub-library is active, until the microservice center detects that the second sub-library is active again, and the first server of the business processing device will asynchronously synchronize the registered business data to the second sub-library.
[0104] In a feasible implementation manner, step A400 further includes the following steps:
[0105] If the second sub-database is active, based on the business processing request, the business data stored in the first sub-database is obtained, business processing is performed based on the business data to obtain the business processing result, and after obtaining the business processing result, the business data is asynchronously synchronized to the second sub-database.
[0106] It should be noted that when the first server of the business processing device obtains a business processing request and the second sub-library is active, the first server will call the business data stored in the first sub-library. The first server of the business processing device performs business processing based on the business data of the first sub-library obtained. After obtaining the business processing result, the obtained business processing result is returned to the gateway, and the gateway then sends the obtained business processing result to the client to realize the full-process business processing. The first server of the business processing device will asynchronously synchronize the business data of the first sub-library to the second sub-library. Each sub-library not only stores its own business data but also stores the data of another sub-library. Since the real-time requirements for synchronization of this part of the data are relatively low and synchronization failure should not affect normal business operations, an asynchronous synchronization strategy is adopted to balance system performance and reliability. Please refer to Figure 6 , Figure 6 A business sequence diagram is provided.
[0107] In particular, in order to ensure the accuracy of asynchronous synchronization data, the first server of the business processing device can obtain the first business table in the first sub-library (first server) and the second business table in the second sub-library (second server), which are the business data stored in the first sub-library and the business data after asynchronous synchronization stored in the second sub-library; the first server of the business processing device puts the first hash value used to verify the integrity of the data in each row of the first business table and the second hash value of the corresponding row of the second business table; and compares the first hash value of each row of the first business table with the second hash value of the corresponding row of the second business table. If it is found that the hash values of any row are different, it means that the two rows of data are inconsistent. Once an inconsistent row is found, it is necessary to locate the row of data and resend the inconsistent data to the second sub-library for synchronization.
[0108] In this implementation, the business processing device checks whether the other sub-database is normal before real-time synchronization of login credentials. If the other sub-database is abnormal, the asynchronous synchronization record is registered to return to the normal login record, and the application automatically completes the switch from dual-active to single-active, thereby improving the reliability of the system.
[0109] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the business processing method of the present application. More simple transformations based on this technical concept are all within the scope of protection of the present application.
[0110] The present application also provides a business processing system, the business processing system includes a gateway and a first server, please refer to Figure 7 :
[0111] The gateway 10 is used to receive a business processing request sent by a client, and based on the business processing request, judge the active number of active sub-databases in the database used for business processing to obtain a judgment result, wherein the active number is obtained based on the microservice center; if the judgment result is that the number of active sub-databases is less than a preset value, the business processing request is sent to the active servers corresponding to the remaining active sub-databases, so that the active servers can perform business processing based on the business processing request and obtain business processing results;
[0112] The first server 20 is used to receive a login request sent by the gateway, and obtain a user number based on the login request; verify the user number, generate verification information after successful verification, and store the login credentials in the verification information obtained after successful verification locally; judge the activity of the second sub-database corresponding to the second server, and if it is active, synchronize the stored login credentials to the second server in real time; until the real-time synchronization of the login credentials is completed, feed back the user number in the verification information to the gateway, so that the gateway can feed back the user number to the client.
[0113] The business processing device provided by the present application adopts the business processing method in the above embodiment to solve the technical problems of business processing. Compared with the prior art, the beneficial effects of the business processing device provided by the present application are the same as the beneficial effects of the business processing method provided by the above embodiment, and other technical features in the business processing device are the same as the features disclosed in the above embodiment method, which will not be repeated here.
[0114] The present application provides a business processing device, which includes: at least one processor; and a memory that is communicatively connected to the at least one processor; wherein the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the business processing method in the above-mentioned embodiment one.
[0115] Reference below Figure 8 , which shows a schematic diagram of the structure of a business processing device suitable for implementing the embodiment of the present application. The business processing device in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptops, tablet computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 8 The business processing device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0116] like Figure 8 As shown, the business processing device may include a processing device 1001 (e.g., a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the business processing device are also stored. The processing device 1001, ROM1002, and RAM1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the business processing device to communicate with other devices wirelessly or by wire to exchange data. Although the figure shows a business processing device with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or have alternatively.
[0117] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.
[0118] The business processing device provided by the present application adopts the business processing method in the above embodiment to solve the technical problems of business processing. Compared with the prior art, the beneficial effects of the business processing device provided by the present application are the same as the beneficial effects of the business processing method provided by the above embodiment, and other technical features in the business processing device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.
[0119] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.
[0120] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
[0121] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, wherein the computer-readable program instructions are used to execute the business processing method in the above-mentioned embodiment.
[0122] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the above.
[0123] The above-mentioned computer-readable storage medium may be included in the business processing device; or it may exist independently without being installed in the business processing device.
[0124] The above-mentioned computer-readable storage medium carries one or more programs. When the above-mentioned one or more programs are executed by the business processing device, the business processing device: receives the business processing request sent by the client, and based on the business processing request, judges the active number of active sub-databases in the database used for business processing to obtain a judgment result, wherein the active number is obtained based on the sending of the microservice center; if the judgment result is that the number of active sub-databases is less than a preset value, the business processing request is sent to the active servers corresponding to the remaining active sub-databases, so that the active servers can perform business processing based on the business processing request to obtain business processing results.
[0125] Computer program code for performing the operations of the present application may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0126] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0127] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.
[0128] The readable storage medium provided in this application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned business processing method, and can solve the technical problems of business processing. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in this application are the same as the beneficial effects of the business processing method provided in the above-mentioned embodiment, and will not be repeated here.
[0129] The present application also provides a computer program product, including a computer program, which implements the steps of the above-mentioned business processing method when executed by a processor.
[0130] The computer program product provided by this application can solve the technical problems of business processing. Compared with the prior art, the beneficial effects of the computer program product provided by this application are the same as the beneficial effects of the business processing method provided by the above embodiment, which will not be repeated here.
[0131] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.
Claims
1. A business processing method, characterized in that: Applied to a gateway, the service processing method includes: Receive a business processing request sent by a client, and based on the business processing request, determine the number of active sub-databases in the database used for business processing to obtain a determination result, wherein the number of active sub-databases is obtained based on the number sent by the microservice center; If the judgment result is that the number of active sub-databases is less than the preset value, the business processing request is sent to the active servers corresponding to the remaining active sub-databases, so that the active servers can perform business processing based on the business processing request and obtain business processing results.
2. The service processing method according to claim 1, characterized in that: The step of receiving a business processing request sent by a client, and judging the number of active sub-databases in a database used for business processing based on the business processing request, and obtaining the judgment result further includes: If the active number is equal to a preset value, obtaining a user number based on the business processing request; Based on the preset business diversion rules and the user number, a target sub-library for business processing is determined from multiple sub-libraries, and the received business processing request is sent to a target server corresponding to the target sub-library.
3. The service processing method according to claim 1, characterized in that: If the result of the judgment is that the number of active sub-databases is less than a preset value, the step of sending the business processing request to the active servers corresponding to the remaining active sub-databases includes: Obtain the library names corresponding to the remaining active sub-libraries, and add the library names to the local cache; The step of obtaining the library names corresponding to the remaining active sub-libraries and adding the library names to the local cache includes: When the gateway performs business processing again, the business processing request is forwarded to the remaining active sub-libraries corresponding to the library name.
4. The service processing method according to claim 1, characterized in that: The step of receiving a business processing request sent by a client, and judging the number of active sub-databases in the database used for business processing based on the business processing request to obtain a judgment result, wherein the step of obtaining the number of active sub-databases based on the number of active sub-databases sent by the microservice center includes: Receive a login request from a user, and based on the login request, obtain the number of active sub-databases; If the active number is equal to a preset value, the login request is randomly forwarded to any server.
5. A business processing method, characterized in that: Applied to a first server, the first server is an active server or a target server, the first server is communicatively connected to at least one second server, and the service processing method includes: Receiving a login request sent by the gateway, and obtaining a user number based on the login request; Verify the user number, generate verification information after successful verification, and store the login credentials in the verification information obtained after successful verification locally; Determine the activity of the second sub-database corresponding to the second server, and if it is active, synchronize the stored login credentials to the second server in real time; Until the real-time synchronization of the login credentials is completed, the user number in the verification information is fed back to the gateway, so that the gateway can feed back the user number to the client.
6. The service processing method according to claim 5, characterized in that: After the step of completing the real-time synchronization of the login credentials and feeding back the user number in the verification information to the gateway so that the gateway feeds back the user number to the client, the following steps are included: If the second sub-database is not active, register the business data for asynchronous synchronization to the second sub-database, and when the second sub-database becomes active, asynchronously synchronize the registered business data to the second sub-database; After the step of completing the real-time synchronization of the login credentials and feeding back the user number in the verification information to the gateway so that the gateway feeds back the user number to the client, the method further includes: If the second sub-database is active, based on the business processing request, the business data stored in the first sub-database is obtained, business processing is performed based on the business data to obtain the business processing result, and after obtaining the business processing result, the business data is asynchronously synchronized to the second sub-database.
7. A business processing system, characterized in that: The business processing system includes a gateway and a first server: The gateway is used to receive a business processing request sent by a client, and based on the business processing request, judge the active number of active sub-databases in the database used for business processing to obtain a judgment result, wherein the active number is obtained based on the microservice center; if the judgment result is that the number of active sub-databases is less than a preset value, the business processing request is sent to the active server corresponding to the remaining active sub-databases, so that the active server performs business processing based on the business processing request and obtains a business processing result; The first server is used to receive a login request sent by the gateway, and obtain a user number based on the login request; verify the user number, generate verification information after successful verification, and store the login credentials in the verification information obtained after successful verification locally; judge the activity of the second sub-database corresponding to the second server, and if it is active, synchronize the stored login credentials to the second server in real time; until the real-time synchronization of the login credentials is completed, feed back the user number in the verification information to the gateway, so that the gateway can feed back the user number to the client.
8. A service processing device, characterized in that: The device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the business processing method according to any one of claims 1 to 6.
9. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the business processing method according to any one of claims 1 to 6 are implemented.
10. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the steps of the service processing method according to any one of claims 1 to 6 are implemented.