Disclosure of Invention
In order to overcome the problems in the related art, the invention provides a request processing method and a request processing device.
According to a first aspect of the embodiments of the present invention, there is provided a request processing method, including:
when an accounting processing request carrying a hotspot account identifier is received, judging whether the hotspot account identifier exists in locally stored configuration information; the configuration information at least comprises a list of locking account identifications, or the corresponding relation between the request type and the locking account identifications;
when the hotspot account identification does not exist in the locally stored configuration information, storing the hotspot account identification in the configuration information;
processing the accounting information which is stored in the storage server and corresponds to the hotspot account identification;
and after the processing is finished and a processing result is obtained, deleting the hotspot account identification from the configuration information.
Further, the method further comprises:
and when the hotspot account identification exists in the locally stored configuration information, executing the step of judging whether the hotspot account identification exists in the locally stored configuration information.
The determining whether the hotspot account identifier exists in the locally stored configuration information includes:
searching a locally stored locking account identification list according to the hotspot account identification;
if the hotspot account identifier is found in the locking account identifier list, determining that the hotspot account identifier exists in locally stored configuration information;
and if the hotspot account identifier is not found in the locking account identifier list, determining that the hotspot account identifier does not exist in the locally stored configuration information.
Wherein, the accounting processing request also carries a request type;
the determining whether the hotspot account identifier exists in the locally stored configuration information includes:
searching a corresponding relation between the request type and a locking account identifier according to the hotspot account identifier and the request type;
if the record comprising the hotspot account identifier and the request type is found in the corresponding relation, determining that the hotspot account identifier exists in locally stored configuration information;
and if the record comprising the hotspot account identifier and the request type is not found in the corresponding relation, determining that the hotspot account identifier does not exist in the locally stored configuration information.
Further, the method further comprises:
and sending the processing result to a sender of the accounting processing request.
According to a second aspect of embodiments of the present invention, there is provided a request processing apparatus, the apparatus including:
the system comprises a judging module and a processing module, wherein the judging module is used for judging whether the locally stored configuration information has the hotspot account identification or not when receiving an account processing request carrying the hotspot account identification; the configuration information at least comprises a list of locking account identifications, or the corresponding relation between the request type and the locking account identifications;
the storage module is used for storing the hotspot account identifier in the configuration information when the hotspot account identifier does not exist in the locally stored configuration information;
the processing module is used for processing the accounting information which is stored in the storage server and corresponds to the hotspot account identification;
and the deleting module is used for deleting the hotspot account identification from the configuration information after the processing is finished and the processing result is obtained.
Further, the determining module is further configured to determine whether the locally stored configuration information includes the hotspot account identifier when the locally stored configuration information includes the hotspot account identifier.
Wherein, the judging module comprises:
the searching unit is used for searching a locally stored locking account identifier list according to the hotspot account identifier;
a first determining unit, configured to determine that the hotspot account identifier exists in locally stored configuration information if the hotspot account identifier is found in the locked account identifier list;
a second determining unit, configured to determine that the hotspot account identifier does not exist in the locally stored configuration information if the hotspot account identifier is not found in the locked account identifier list.
Wherein, the accounting processing request also carries a request type;
the judging module comprises:
the second searching unit is used for searching the corresponding relation between the request type and the locking account identification according to the hotspot account identification and the request type;
a third determining unit, configured to determine that the hotspot account identifier exists in locally stored configuration information if the record including the hotspot account identifier and the request type is found in the correspondence;
a fourth determining unit, configured to determine that the hotspot account identifier does not exist in the locally stored configuration information if the record including the hotspot account identifier and the request type is not found in the correspondence.
Further, the apparatus further comprises:
and the sending module is used for sending the processing result to a sender of the accounting processing request.
The technical scheme provided by the embodiment of the invention can have the following beneficial effects:
in the embodiment of the invention, when an accounting processing request carrying a hot account identifier is received, whether the hot account identifier exists in locally stored configuration information is judged; when the hot spot account identification does not exist in the locally stored configuration information, storing the hot spot account identification in the configuration information; processing the accounting information which is stored in the storage server and corresponds to the hotspot account identification; and after the processing is finished and the processing result is obtained, deleting the hotspot account identification from the locally stored configuration information.
In the embodiment of the invention, when accounting information corresponding to the hot account identifier and stored in the storage server needs to be locked, a database lock does not need to be applied to the accounting information corresponding to the hot account identifier and stored in a database in the storage server, but the hot account identifier is stored in local storage configuration information of the business server, so that the accounting information corresponding to the hot account identifier and stored in the storage server is locked, the locking is performed locally in the business server in the whole locking process, and interaction between the business server and the storage server is not needed like the prior art, so that compared with the embodiment of the invention in the prior art, the interaction time can be saved; and, because the mechanism for applying and releasing the database lock in the database is complicated, the time taken for applying the database lock in the database is longer than the time taken for storing an account identifier in the configuration information, and the time taken for releasing the database lock in the database is longer than the time taken for deleting an account identifier in the configuration information, so in summary, the embodiment of the present invention can reduce the time taken for locking the accounting information corresponding to the hot account identifier stored in the storage server compared with the prior art, thereby improving the processing efficiency of the accounting processing request.
Secondly, a database lock applied by the storage server to the locally stored accounting information corresponding to the hot spot account identifier may cause deadlock, and once deadlock occurs, the accounting information corresponding to the hot spot account identifier and locally stored by the storage server cannot be processed, which seriously affects the smooth operation of the service. The embodiment of the invention does not need to apply a database lock on the accounting information which is stored in the storage server and corresponds to the hotspot account identification like the prior art, so that the deadlock phenomenon can not occur.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the invention, as claimed.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the invention, as detailed in the appended claims.
FIG. 1 is a flow chart illustrating a method of request processing, as shown in FIG. 1, including the following steps, according to an example embodiment.
In step S101, when an accounting processing request carrying a hotspot account identifier is received, it is determined whether a hotspot account identifier exists in locally stored configuration information;
in the embodiment of the present invention, the configuration information at least includes a list of locked account identifiers, or a correspondence between a request type and a locked account identifier.
In the embodiment of the present invention, the configuration information is used to store the locked account id, and when an account id is stored in the configuration information, it indicates that the business server is processing the accounting information corresponding to the account id, which is stored in the storage server, according to an accounting processing request at this time. The accounting information may be a balance or points in the account, etc.
The accounting processing request in the embodiment of the present invention may be a payment request for payment or the like. The process of transferring money from one account to another is involved in the processing of accounting processing requests, such as payment requests. In the embodiment of the invention, in the payment process, the price of the commodity is transferred into the guarantee transaction intermediate account from the payment account of the user, the guarantee transaction intermediate account can be a payment account and the like, when the user receives the commodity sent by the merchant, the user can determine to receive the commodity, and then the business server transfers the money amount of the commodity from the guarantee transaction intermediate account into the payment account of the merchant. Since the service server is involved in processing each online payment, the intermediate account of the guaranteed transaction becomes a hot account when a large number of users make online payments in a short time.
This step is illustrated by a practical example: when a user selects a commodity to be purchased on a terminal used by the user and carries out payment operation, the terminal generates a payment request, the payment request at least carries an account identifier of a payment account of the user and an account identifier of a hot account, then the payment request is sent to a service server, the service server receives the payment request sent by the terminal, extracts the hot account identifier from the payment request, and judges whether the hot account identifier exists in locally stored configuration information.
When the hot account identifier exists in the locally stored configuration information, returning to step S101: judging whether hot account identification exists in locally stored configuration information;
when the hot account identifier exists in the locally stored configuration information, it indicates that the business server is processing the accounting information stored in the storage server and corresponding to the hot account identifier according to a certain accounting processing request, and in order to avoid the problem of resource loss, etc., the business server cannot process the accounting information stored in the storage server and corresponding to the hot account identifier according to the accounting processing request received in step S101 at the same time, and the business server must wait until the business server finishes processing the accounting information stored in the storage server and corresponding to the hot account identifier according to the certain processing request, and then process the accounting information stored in the storage server and corresponding to the hot account identifier according to the accounting processing request received in step S101.
Therefore, when the hot spot account identifier exists in the locally stored configuration information, the step of determining whether the hot spot account identifier exists in the locally stored configuration information needs to be performed again until the step S102 is performed when it is determined that the hot spot account identifier does not exist in the locally stored configuration information.
When the hot spot account identifier exists in the locally stored configuration information, the step of determining whether the hot spot account identifier exists in the locally stored configuration information may be periodically or periodically performed, for example, the step of determining whether the hot spot account identifier exists in the locally stored configuration information is performed every 0.1 second or 0.2 second.
When the hot spot account identifier does not exist in the locally stored configuration information, in step S102, the hot spot account identifier is stored in the configuration information;
when the hot account identifier does not exist in the locally stored configuration information, it indicates that the business server is not processing the accounting information corresponding to the hot account identifier and stored in the storage server according to a certain processing request, and at this time, the problem of loss and the like does not occur when processing the account corresponding to the hot account identifier and stored in the storage server according to the accounting processing request received in step S101. Therefore, when the configuration information stored locally does not have the hotspot account identifier, the account stored in the storage server and corresponding to the hotspot account identifier may be processed according to the accounting processing request received in step S101.
In the embodiment of the present invention, in order to further avoid the problem of financial loss, in the process of processing the accounting information corresponding to the hot-spot account identifier and stored in the storage server according to the accounting processing request received in step S101, it is necessary to avoid the business server processing the accounting information corresponding to the hot-spot account identifier and stored in the storage server according to another accounting processing request.
Therefore, when the hot account identifier does not exist in the locally stored configuration information, the accounting information corresponding to the hot account identifier stored in the storage server needs to be firstly locked, so that when the business server is processing the accounting information corresponding to the hot account identifier stored in the storage server according to the accounting processing request received in step S101, the business server is prevented from processing the accounting information corresponding to the hot account identifier according to other accounting processing requests. In the embodiment of the present invention, a specific method for locking the accounting information corresponding to the hot-spot account identifier and stored in the storage server does not apply a database lock to the accounting information corresponding to the hot-spot account identifier in the storage server, but stores the hot-spot account identifier in the configuration information, so that the embodiment of the present invention releases the dependency on the database lock when locking the hot-spot account identifier.
Therefore, in the embodiment of the present invention, when the locally stored configuration information does not have a hotspot account identifier, the hotspot account identifier needs to be stored in the locally stored configuration information, and then the accounting information stored in the storage server and corresponding to the hotspot account identifier is processed. Thus, in the process that the business server processes the accounting information corresponding to the hot account identifier and stored in the storage server according to the accounting processing request received in step S101, if another accounting processing request carrying the hot account identifier is received, before the business server processes the accounting information corresponding to the hot account identifier and stored in the storage server according to the another accounting processing request, it needs to determine whether the hot account identifier exists in the locally stored configuration information, when the locally stored configuration information does not have the hot account identifier, the business server processes the accounting information corresponding to the hot account identifier and stored in the storage server according to the another accounting processing request, and when the locally stored configuration information has the hot account identifier, the business server does not process the accounting information corresponding to the hot account identifier and stored in the storage server according to the another accounting processing request, And the accounting information corresponding to the hotspot account identification is processed, so that the problems of investment loss and the like can be avoided.
In step S103, processing the accounting information stored in the storage server and corresponding to the hotspot account identifier;
in step S104, after the processing is completed and the processing result is obtained, the hotspot account identifier is deleted from the locally stored configuration information.
After the accounting information corresponding to the hot account identifier and stored in the storage server is processed according to the accounting processing request received in step S101 and a processing result is obtained, if the hot account identifier is not deleted from the locally stored configuration information, then if the service server receives another accounting processing request, the service server may determine whether the hot account identifier exists in the locally stored configuration information and determine that the hot account identifier exists in the locally stored configuration information, so that the service server may not immediately process the accounting information corresponding to the hot account identifier according to the another accounting processing request, but may periodically or periodically determine whether the hot account identifier exists in the locally stored configuration information, until it is determined that the hot account identifier does not exist in the locally stored configuration information, according to the another accounting processing request, the accounting information corresponding to the hot account identifier may be processed according to the another accounting processing request And (5) line processing.
However, if the hot account identifier is not deleted from the locally stored configuration information, the service server will always determine that the hot account identifier exists in the locally stored configuration information, so that the service server will not always process the accounting information stored in the storage server and corresponding to the hot account identifier according to the another accounting processing request; this may cause the business server to always not process the accounting information corresponding to the hotspot account identifier and stored in the storage server according to the further accounting processing request, and further cause a processing timeout or a processing failure of the further accounting processing request.
But this is the case: at this time, the business server has processed the accounting information corresponding to the hot account id and stored in the storage server according to the accounting processing request received in step S101, and at this time, the business server does not process the accounting information corresponding to the hot account id and stored in the storage server according to any one accounting processing request, and the business server may process the accounting information corresponding to the hot account id and stored in the storage server according to the other accounting processing request,
therefore, in order to enable each accounting processing request carrying the hotspot account identifier to be processed by the service server at the first time, in the embodiment of the present invention, after the processing of the hotspot accounting processing request is completed and a processing result is obtained, the hotspot account identifier needs to be deleted from the locally stored configuration information.
Further, in order to enable the sender of the accounting processing request to timely know the processing result of the accounting processing request processed by the business server, after this step, the processing result may be sent to the sender of the accounting processing request.
In the embodiment shown in fig. 1 of the present invention, when an accounting processing request carrying a hotspot account identifier is received, it is determined whether a hotspot account identifier exists in locally stored configuration information; when the hot spot account identification does not exist in the locally stored configuration information, storing the hot spot account identification in the configuration information; processing the accounting information which is stored in the storage server and corresponds to the hotspot account identification; and after the processing is finished and the processing result is obtained, deleting the hotspot account identification from the locally stored configuration information.
In the embodiment of the invention, when accounting information corresponding to the hot account identifier and stored in the storage server needs to be locked, a database lock does not need to be applied to the accounting information corresponding to the hot account identifier and stored in a database in the storage server, but the hot account identifier is stored in local storage configuration information of the business server, so that the accounting information corresponding to the hot account identifier and stored in the storage server is locked, the locking is performed locally in the business server in the whole locking process, and interaction between the business server and the storage server is not needed like the prior art, so that compared with the embodiment of the invention in the prior art, the interaction time can be saved; and, because the mechanism for applying and releasing the database lock in the database is complicated, the time taken for applying the database lock in the database is longer than the time taken for storing an account identifier in the configuration information, and the time taken for releasing the database lock in the database is longer than the time taken for deleting an account identifier in the configuration information, so in summary, the embodiment of the present invention can reduce the time taken for locking the accounting information corresponding to the hot-spot account identifier stored in the storage server compared with the prior art, thereby improving the processing efficiency of the accounting processing request.
Secondly, a database lock applied by the storage server to the locally stored accounting information corresponding to the hot spot account identifier may cause deadlock, and once deadlock occurs, the accounting information corresponding to the hot spot account identifier and locally stored by the storage server cannot be processed, which seriously affects the smooth operation of the service. In the embodiment of the invention, a database lock is not required to be applied to the financial information which is stored in the storage server and corresponds to the hotspot account identification as in the prior art, so that the phenomenon of deadlock is avoided.
In another embodiment of the present invention, the locally stored configuration information is a locked account id list, in step S103 in the embodiment shown in fig. 1 of the present invention, the service server adds the hotspot account id to the locked account id list, where the locked account id list is used to store the locked account id, and when an account id is stored in the locked account id list, it indicates that the service server is processing the accounting information stored in the storage server and corresponding to the account id according to an accounting processing request at this time.
Therefore, referring to fig. 2, the step S101 of "determining whether the hotspot account identifier exists in the locally stored configuration information" includes:
in step S201, a locally stored lock account identifier list is searched for according to the hotspot account identifier;
specifically, one locking account identifier in the locking account identifier list may be acquired, and the acquired one locking account identifier is compared with the hotspot account identifier; if the obtained locking account identifier is the same as the hotspot account identifier, determining that the hotspot account identifier is found in the locking account identifier list; if the obtained locking account identifier is different from the hotspot account identifier, obtaining a next locking account identifier in the locking account identifier list, and comparing the obtained next locking account identifier with the hotspot account identifier; if the obtained next locking account identifier is the same as the hotspot account identifier, determining that the hotspot account identifier is found in the locking account identifier list; if the obtained next locking account identifier is different from the hotspot account identifier, obtaining another locking account identifier in the locking account identifier list, and continuing to execute the comparison step until one locking account identifier which is the same as the hotspot account identifier is obtained from the locking account identifier list, at this moment, determining that the hotspot account identifier is found in the locking account identifier list; and if each locking account identifier in the locking account identifier list is different from the hotspot account identifier, determining that the hotspot account identifier is not found in the locking account identifier list.
In step S202, if the hotspot account identifier is found in the locked account identifier list, it is determined that the hotspot account identifier exists in the locally stored configuration information;
in step S203, if the hotspot account id is not found in the locked account id list, it is determined that the hotspot account id does not exist in the locally stored configuration information.
In the embodiment of the present invention, the accounting processing requests are classified into many types, for example, a modification request for modifying accounting information, a query request for querying accounting information, and the like. For any account identifier, the business server can process the accounting information which is stored in the storage server and corresponds to the account identifier according to different accounting processing requests at the same time, and the problem of capital loss is not caused.
For example, for a certain account id, it is assumed that the business server is querying the accounting information corresponding to the account id stored in the storage server, and the accounting information corresponding to the account id is only obtained from the storage server during querying, and no addition, deletion, or modification is performed on the accounting information corresponding to the account id, so that the accounting information corresponding to the account id is not substantially affected.
If the business server receives a modification request for modifying the accounting information corresponding to the account id while the business server is querying the accounting information corresponding to the account id stored in the storage server, the business server may also modify the accounting information corresponding to the account id stored in the storage server according to the modification request, at this time, although the accounting information corresponding to the account id stored in the storage server is processed according to two different types of accounting processing requests, only one of the two types of accounting processing requests will substantially affect the accounting information corresponding to the account id, and thus, the problem of investment and the like will not be caused.
Therefore, when accounting processing requests are divided into many types, in order to improve the processing efficiency of processing received accounting processing requests, in another embodiment of the present invention, the locally stored configuration information is a corresponding relationship between a request type and a locked account identifier, and in step S101 in the embodiment shown in fig. 1 of the present invention, the received accounting processing request also carries the request type, so in step S103 in the embodiment shown in fig. 1 of the present invention, a record is formed by the request type carried by the accounting processing request and a hotspot account identifier and stored in the corresponding relationship between the request type and the locked account identifier,
the corresponding relation between the request type and the locked account identifier comprises two columns, wherein the first column is used for storing the request type, and the second column is used for storing the locked account identifier; for any record in the corresponding relation between the request type and the locked account identifier, the business server processes the accounting information which is stored in the storage server and corresponds to the accounting identifier in the record according to an accounting processing request with the request type being the request type in the record.
Therefore, referring to fig. 3, the step S101 of "determining whether the hotspot account identifier exists in the locally stored configuration information" includes:
in step S301, a correspondence between a locally stored request type and a locked account identifier is searched for according to the hotspot account identifier and the request type;
specifically, a record in the correspondence between the request type and the locked account identifier may be acquired, the request type in the acquired record is compared with the request type carried in the accounting processing request received in step S101, and the locked account identifier in the acquired record is compared with the hotspot account identifier;
if the request type in the obtained record is the same as the request type carried by the accounting processing request received in step S101, and the lock account identifier in the obtained record is the same as the hotspot account identifier, determining that the record including the hotspot account identifier and the request type is found in the correspondence;
if the request type in one acquired record is different from the request type carried by the accounting processing request received in step S101 or the lock account identifier in one acquired record is different from the hotspot account identifier, acquiring the next record in the correspondence between the request type and the lock account identifier;
comparing the request type in the next acquired record with the request type carried by the accounting processing request received in step S101, and comparing the locked account identifier in the next acquired record with the hotspot account identifier;
if the request type in the obtained next record is the same as the request type carried by the accounting processing request received in step S101, and the lock account identifier in the obtained next record is the same as the hotspot account identifier, determining that the record including the hotspot account identifier and the request type is found in the correspondence;
if the request type in the next record is different from the request type carried by the accounting processing request received in step S101 or the locked account identifier in the next record is different from the hotspot account identifier;
obtaining a next record in the corresponding relationship between the request type and the locking account identifier, and continuing to execute the step of comparing until one record is obtained from the corresponding relationship between the request type and the locking account identifier, the request type in the record is the same as the request type carried by the accounting processing request received in step S101, and the locking account identifier in the record is the same as the hotspot account identifier, at this time, it can be determined that the record including the hotspot account identifier and the request type is found in the corresponding relationship;
if the request type in the record is different from the request type carried by the accounting processing request received in step S101 or the lock account identifier in the record is different from the hotspot account identifier for any record in the correspondence between the request type and the lock account identifier, the same is true for each other record in the correspondence between the request type and the lock account identifier; it may be determined that no record including the hotspot account identification and the request type is found in the correspondence.
In step S302, if the record including the hotspot account identifier and the request type is found in the correspondence, it is determined that the hotspot account identifier exists in the locally stored configuration information;
in step S303, if the record including the hotspot account identifier and the request type is not found in the correspondence, it is determined that the hotspot account identifier does not exist in the locally stored configuration information.
In the embodiment shown in fig. 2 of the present invention, for any account identifier, if a large number of accounting processing requests of different request types carrying hotspot account identifiers are received at the same time, accounting information corresponding to the hotspot account identifier can only be processed according to one accounting processing request at a time.
In the embodiment shown in fig. 3 of the present invention, accounting information corresponding to a hotspot account identifier may be processed simultaneously according to a plurality of accounting processing requests, and only the request types of any two accounting processing requests in the plurality of accounting processing requests need to be different, so that the processing efficiency of processing the accounting processing requests may be improved, and meanwhile, the problems of resource loss and the like may not be caused.
FIG. 2 is a block diagram illustrating a request processing device according to an example embodiment. Referring to fig. 4, the apparatus includes:
the determining module 11 is configured to determine whether the locally stored configuration information includes a hotspot account identifier when an accounting processing request with the hotspot account identifier is received; the configuration information at least comprises a list of locking account identifications, or the corresponding relation between the request type and the locking account identifications;
the storage module 12 is configured to store the hotspot account identifier in the configuration information when the hotspot account identifier does not exist in the locally stored configuration information;
the processing module 13 is configured to process the accounting information stored in the storage server and corresponding to the hotspot account identifier;
and the deleting module 14 is configured to delete the hotspot account identifier from the configuration information after the processing is completed and a processing result is obtained.
Further, the determining module 11 is further configured to determine whether the locally stored configuration information includes the hotspot account identifier when the locally stored configuration information includes the hotspot account identifier.
Wherein, the judging module 11 includes:
the searching unit is used for searching a locally stored locking account identifier list according to the hotspot account identifier;
a first determining unit, configured to determine that the hotspot account identifier exists in locally stored configuration information if the hotspot account identifier is found in the locked account identifier list;
a second determining unit, configured to determine that the hotspot account identifier does not exist in the locally stored configuration information if the hotspot account identifier is not found in the locked account identifier list.
Wherein, the accounting processing request also carries a request type;
the judging module 11 includes:
the second searching unit is used for searching the corresponding relation between the request type and the locking account identification according to the hotspot account identification and the request type;
a third determining unit, configured to determine that the hotspot account identifier exists in locally stored configuration information if the record including the hotspot account identifier and the request type is found in the correspondence;
a fourth determining unit, configured to determine that the hotspot account identifier does not exist in the locally stored configuration information if the record including the hotspot account identifier and the request type is not found in the correspondence.
Further, the apparatus further comprises:
and the sending module is used for sending the processing result to a sender of the accounting processing request.
In the embodiment shown in fig. 4 of the present invention, when an accounting processing request carrying a hotspot account identifier is received, it is determined whether a hotspot account identifier exists in locally stored configuration information; when the hot spot account identification does not exist in the locally stored configuration information, storing the hot spot account identification in the configuration information; processing the accounting information which is stored in the storage server and corresponds to the hotspot account identification; and after the processing is finished and the processing result is obtained, deleting the hotspot account identification from the locally stored configuration information.
In the embodiment of the invention, when accounting information corresponding to the hot account identifier and stored in the storage server needs to be locked, a database lock does not need to be applied to the accounting information corresponding to the hot account identifier and stored in a database in the storage server, but the hot account identifier is stored in local storage configuration information of the business server, so that the accounting information corresponding to the hot account identifier and stored in the storage server is locked, the locking is performed locally in the business server in the whole locking process, and interaction between the business server and the storage server is not needed like the prior art, so that compared with the embodiment of the invention in the prior art, the interaction time can be saved; and, because the mechanism for applying and releasing the database lock in the database is complicated, the time taken for applying the database lock in the database is longer than the time taken for storing an account identifier in the configuration information, and the time taken for releasing the database lock in the database is longer than the time taken for deleting an account identifier in the configuration information, so in summary, the embodiment of the present invention can reduce the time taken for locking the accounting information corresponding to the hot account identifier stored in the storage server compared with the prior art, thereby improving the processing efficiency of the accounting processing request.
Secondly, a database lock applied by the storage server to the locally stored accounting information corresponding to the hot spot account identifier may cause deadlock, and once deadlock occurs, the accounting information corresponding to the hot spot account identifier and locally stored by the storage server cannot be processed, which seriously affects the smooth operation of the service. The embodiment of the invention does not need to apply a database lock on the accounting information which is stored in the storage server and corresponds to the hotspot account identification like the prior art, so that the deadlock phenomenon can not occur.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
Other embodiments of the invention will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the invention following, in general, the principles of the invention and including such departures from the present disclosure as come within known or customary practice within the art to which the invention pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the invention being indicated by the following claims.
It will be understood that the invention is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the invention is limited only by the appended claims.