CN107146075B - Request processing method and device - Google Patents

Request processing method and device Download PDF

Info

Publication number
CN107146075B
CN107146075B CN201610115705.7A CN201610115705A CN107146075B CN 107146075 B CN107146075 B CN 107146075B CN 201610115705 A CN201610115705 A CN 201610115705A CN 107146075 B CN107146075 B CN 107146075B
Authority
CN
China
Prior art keywords
account identifier
configuration information
hotspot
locally stored
processing
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201610115705.7A
Other languages
Chinese (zh)
Other versions
CN107146075A (en
Inventor
田野
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Advanced New Technologies Co Ltd
Advantageous New Technologies Co Ltd
Original Assignee
Advanced New Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Advanced New Technologies Co Ltd filed Critical Advanced New Technologies Co Ltd
Priority to CN201610115705.7A priority Critical patent/CN107146075B/en
Publication of CN107146075A publication Critical patent/CN107146075A/en
Application granted granted Critical
Publication of CN107146075B publication Critical patent/CN107146075B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/02Payment architectures, schemes or protocols involving a neutral party, e.g. certification authority, notary or trusted third party [TTP]
    • G06Q20/023Payment architectures, schemes or protocols involving a neutral party, e.g. certification authority, notary or trusted third party [TTP] the neutral party being a clearing house

Landscapes

  • Engineering & Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Computer Security & Cryptography (AREA)
  • Accounting & Taxation (AREA)
  • Strategic Management (AREA)
  • Physics & Mathematics (AREA)
  • General Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the invention provides a request processing method and device. The method comprises the following steps: when an accounting processing request carrying a hotspot account identifier is received, judging whether the locally stored configuration information has the hotspot account identifier; 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. Compared with the prior art, the method and the device can reduce the time spent on locking the accounting information which is stored in the storage server and corresponds to the hotspot account identification, thereby improving the processing efficiency of the accounting processing request.

Description

Request processing method and device
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a request processing method and apparatus.
Background
With the rapid development of the technology, more and more users shop on the internet, in the process of online shopping, after the users select the commodities to be purchased, online payment is needed to be carried out on the selected commodities, the prices of the commodities are transferred into the intermediate account of the guaranteed transaction from the payment account of the users in the payment process, for example, the intermediate account of the guaranteed transaction can be a pay account, when the users receive the commodities sent by merchants, the users can determine to receive the commodities, and then the intermediate account of the guaranteed transaction transfers the money amount of the commodities into the payment account of the merchants.
However, each online payment involves a guaranteed transaction intermediate account, which becomes a hotspot account when a large number of users make online payments in a short time. For the service server, a large number of payment requests carrying the guarantee transaction intermediate account can be received in a short time, then all the received payment requests need to be processed, in order to guarantee the real-time accuracy of the amount of money in the guarantee transaction intermediate account, the service server can only process one payment request at a time, in order to avoid the problem that the service server simultaneously processes the payment requests carrying the guarantee transaction intermediate account to avoid causing the expense of the guarantee transaction intermediate account, and the like, before the service server processes any one payment request, a database lock needs to be applied to the financial information of the guarantee transaction intermediate account stored in a database in a storage server, so that the service server cannot process other payment requests in the process of processing the one payment request, and releasing the database lock applied to the accounting information of the transaction intermediate account till the business server finishes processing the payment request, so that the business server can continue to process other payment requests.
In the prior art, a process of applying a database lock to accounting information of a transaction-securing intermediate account stored in a database in a storage server may specifically be:
the business server sends a query request for querying whether the accounting information of the intermediate account of the guaranteed transaction is applied with a database lock to the storage server; the storage server receives the query request, extracts the hotspot account identification from the query request, queries whether the accounting information of the locally stored guarantee transaction intermediate account is applied with a database lock, and returns a query result to the service server; the business server receives a query result returned by the storage server, and if the query result is used for indicating that the accounting information of the intermediate account of the guaranty transaction is not applied with the database lock, the business server sends a locking request for applying the database lock to the accounting information of the intermediate account of the guaranty transaction to the storage server; the storage server receives the locking request and applies a database lock to the locally stored accounting information of the vouched-for-transaction intermediate account.
However, the inventor found that, since it takes a lot of time for the business server to apply the database lock once to the account information of the intermediate account of the guaranteed transaction stored in the database of the storage server, since the database lock is applied once to the account information of the intermediate account of the guaranteed transaction stored in the database of the storage server before each pair of payment requests are processed, when a lot of payment requests are received in a short time, the lot of payment requests cannot be processed quickly, and the processing efficiency is low.
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.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and together with the description, serve to explain the principles of the invention.
FIG. 1 is a flow diagram illustrating a method of request processing in accordance with an exemplary embodiment;
FIG. 2 is a flow diagram illustrating a method of request processing in accordance with an exemplary embodiment;
FIG. 3 is a flow diagram illustrating a method of request processing in accordance with an exemplary embodiment;
FIG. 4 is a block diagram illustrating a request processing device in accordance with an exemplary embodiment.
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.

Claims (8)

1. A method for processing a request, the method comprising:
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 a storage server and corresponds to the hotspot account identification;
after the processing is finished and a processing result is obtained, deleting the hotspot account identification from the 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.
2. The method of claim 1, further comprising:
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.
3. The method of claim 1, wherein the accounting processing request further 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.
4. The method of claim 1, further comprising:
and sending the processing result to a sender of the accounting processing request.
5. A request processing apparatus, characterized in that the apparatus comprises:
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;
the deleting module is used for deleting the hotspot account identifier from the configuration information after the processing is finished and a processing result is obtained;
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.
6. The apparatus of claim 5, wherein the determining module is further configured to determine whether the hotspot account id exists in the locally stored configuration information when the hotspot account id exists in the locally stored configuration information.
7. The apparatus of claim 5, wherein the accounting processing request further 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.
8. The apparatus of claim 5, further comprising:
and the sending module is used for sending the processing result to a sender of the accounting processing request.
CN201610115705.7A 2016-03-01 2016-03-01 Request processing method and device Active CN107146075B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610115705.7A CN107146075B (en) 2016-03-01 2016-03-01 Request processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610115705.7A CN107146075B (en) 2016-03-01 2016-03-01 Request processing method and device

Publications (2)

Publication Number Publication Date
CN107146075A CN107146075A (en) 2017-09-08
CN107146075B true CN107146075B (en) 2020-11-10

Family

ID=59783036

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610115705.7A Active CN107146075B (en) 2016-03-01 2016-03-01 Request processing method and device

Country Status (1)

Country Link
CN (1) CN107146075B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107767264A (en) * 2017-10-27 2018-03-06 中国银行股份有限公司 Online transaction system focus account trading flow pressure real-time monitoring method and device
CN111104144B (en) * 2019-12-27 2023-10-20 珠海金山数字网络科技有限公司 Anchor point updating method and device

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1367908A (en) * 1999-08-23 2002-09-04 李东声 Method for accomplishment secure transaction for electronicbankbook (purse)
CN101620703A (en) * 2008-07-04 2010-01-06 阿里巴巴集团控股有限公司 Buffer bookkeeping method and device
CN101639792A (en) * 2008-07-29 2010-02-03 阿里巴巴集团控股有限公司 Method and device for processing concurrent data and electronic accounting system
CN101901237A (en) * 2009-12-04 2010-12-01 四川川大智胜软件股份有限公司 Type-Index-Value distributed database built based on SQIite
CN101989213A (en) * 2009-08-07 2011-03-23 阿里巴巴集团控股有限公司 Account concurrent processing method and account concurrent processing system
CN102088484A (en) * 2010-12-20 2011-06-08 南京中兴新软件有限责任公司 Write lock method of distributed file system and a system thereof
CN103297456A (en) * 2012-02-24 2013-09-11 阿里巴巴集团控股有限公司 Method for accessing sharing resources in distributed system and distributed system
CN103793843A (en) * 2012-10-26 2014-05-14 阿里巴巴集团控股有限公司 Account data processing method and device

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1367908A (en) * 1999-08-23 2002-09-04 李东声 Method for accomplishment secure transaction for electronicbankbook (purse)
CN101620703A (en) * 2008-07-04 2010-01-06 阿里巴巴集团控股有限公司 Buffer bookkeeping method and device
CN101639792A (en) * 2008-07-29 2010-02-03 阿里巴巴集团控股有限公司 Method and device for processing concurrent data and electronic accounting system
CN101989213A (en) * 2009-08-07 2011-03-23 阿里巴巴集团控股有限公司 Account concurrent processing method and account concurrent processing system
CN101901237A (en) * 2009-12-04 2010-12-01 四川川大智胜软件股份有限公司 Type-Index-Value distributed database built based on SQIite
CN102088484A (en) * 2010-12-20 2011-06-08 南京中兴新软件有限责任公司 Write lock method of distributed file system and a system thereof
CN103297456A (en) * 2012-02-24 2013-09-11 阿里巴巴集团控股有限公司 Method for accessing sharing resources in distributed system and distributed system
CN103793843A (en) * 2012-10-26 2014-05-14 阿里巴巴集团控股有限公司 Account data processing method and device

Also Published As

Publication number Publication date
CN107146075A (en) 2017-09-08

Similar Documents

Publication Publication Date Title
CN108470298B (en) Method, device and system for transferring resource numerical value
US10366443B1 (en) Systems and methods for secure management of a universal shopping cart
CN107230092B (en) Accounting processing method and device and server
CN109146451A (en) A kind of channel of disbursement recommended method and device
CN105488688A (en) Commodity information pushing method, device and system
CN108389080A (en) Transaction processing method and platform
US11200558B2 (en) Automatic vending
CN107133788B (en) Refund processing method and device
TW201801017A (en) Service return method and apparatus
US20140114786A1 (en) Method and apparatus for processing resource returns
US20110145844A1 (en) Systems and methods for facilitating call request aggregation over a network
CN109800063A (en) Business method for parallel processing, device, server, storage medium
CN116610765A (en) Object handling method and device
CN107146075B (en) Request processing method and device
CN111695970A (en) Order processing method and system
CN108829495B (en) Verification method, device, equipment and storage medium for multi-database modification transaction
CN106034148B (en) Rapid information interaction method, local server, remote server and system
CN112200595A (en) Coupon checking method, payment method, device, equipment and medium
US20070226738A1 (en) Enabling a Designer to Specify Workflows to Process Various Results of Execution of Transactions
WO2020216022A1 (en) Method and apparatus for creating times card credential, and method and apparatus for verifying and cancelling times card credential
US20150310437A1 (en) Avoiding transaction rollback
US20130304715A1 (en) Systems and methods for providing an automated validity check of transactional data postings
CN110895759B (en) Resource updating method, device, equipment and system
US10929484B2 (en) System and method of integrating data
CN112819479A (en) Order state processing method and device, storage medium and server

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20200922

Address after: Grand Cayman Islands

Applicant after: Innovative advanced technology Co.,Ltd.

Address before: Grand Cayman Islands

Applicant before: Advanced innovation technology Co.,Ltd.

Effective date of registration: 20200922

Address after: Grand Cayman Islands

Applicant after: Advanced innovation technology Co.,Ltd.

Address before: Grand Cayman Islands

Applicant before: Alibaba Group Holding Ltd.

GR01 Patent grant
GR01 Patent grant