CN111737300A - Service processing method, device, equipment and computer readable storage medium - Google Patents

Service processing method, device, equipment and computer readable storage medium Download PDF

Info

Publication number
CN111737300A
CN111737300A CN202010578404.4A CN202010578404A CN111737300A CN 111737300 A CN111737300 A CN 111737300A CN 202010578404 A CN202010578404 A CN 202010578404A CN 111737300 A CN111737300 A CN 111737300A
Authority
CN
China
Prior art keywords
service
processed
processing
locking
result
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010578404.4A
Other languages
Chinese (zh)
Inventor
陈红
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Tongbang Zhuoyi Technology Co ltd
Original Assignee
Beijing Tongbang Zhuoyi Technology 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 Beijing Tongbang Zhuoyi Technology Co ltd filed Critical Beijing Tongbang Zhuoyi Technology Co ltd
Priority to CN202010578404.4A priority Critical patent/CN111737300A/en
Publication of CN111737300A publication Critical patent/CN111737300A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/248Presentation of query results

Abstract

The present disclosure provides a service processing method, device, apparatus and computer readable storage medium, the method comprising: acquiring a service processing request triggered by a user, wherein the service processing request comprises a service identifier of a service to be processed; setting a distributed lock for the service to be processed according to the service identifier in the service handling request to obtain a locking result; according to the service handling request, inquiring whether the service data corresponding to the service identification is included in a data server or not to obtain an inquiry result; and processing the service to be processed according to the locking result and the query result. Therefore, the same task to be processed can be effectively prevented from being processed for multiple times, the efficiency and the speed of service processing are improved, and the user experience can be further improved.

Description

Service processing method, device, equipment and computer readable storage medium
Technical Field
The present disclosure relates to the field of data processing, and in particular, to a method, an apparatus, a device, and a computer-readable storage medium for service processing.
Background
In order to improve the efficiency of service processing, the prior art generally adopts an online processing mode to perform centralized processing on the services of the users. Therefore, the service system often receives service requests from a plurality of users. In the process of service handling, a user may initiate multiple service handling requests for the same service.
In the prior art, in order to handle the online service, the service to be processed is generally processed according to the time sequence of receiving the service request.
However, in the process of performing service handling by using the above method, when a user initiates a plurality of service handling requests for the same service, the same task may be repeatedly processed for a plurality of times, which results in low service processing efficiency and long waiting time of the user, and further affects the user experience.
Disclosure of Invention
The present disclosure provides a service processing method, a device, and a computer-readable storage medium, which are used to solve the technical problem that the existing service processing method can repeatedly process the same task, resulting in low service processing efficiency.
A first aspect of the present disclosure provides a service processing method, including:
acquiring a service processing request triggered by a user, wherein the service processing request comprises a service identifier of a service to be processed;
setting a distributed lock for the service to be processed according to the service identifier in the service handling request to obtain a locking result;
according to the service handling request, inquiring whether the service data corresponding to the service identification is included in a data server or not to obtain an inquiry result;
and processing the service to be processed according to the locking result and the query result.
According to the service processing method provided by the disclosure, after a service processing request triggered by a user is obtained, a distributed lock is set for a service to be processed according to the service identifier, whether service data corresponding to the service identifier is stored or not is inquired in the data server according to the service identifier, an inquiry result is obtained, and the service to be processed is correspondingly processed according to the locking result and the inquiry result, so that the same task to be processed can be effectively prevented from being processed for many times, the efficiency and the speed of service processing are improved, and further the user experience can be improved.
In a possible design, the processing the service to be processed according to the locking result and the query result includes:
and if the locking result is successful and the query result is that the data server does not include the service data corresponding to the service identifier, processing the service to be processed, otherwise, ignoring the service processing request.
In a possible design, the setting a distributed lock for the service to be processed according to the service identifier in the service transaction request to obtain a locking result includes:
taking the service identification of the service handling request as a keyword, executing a preset locking thread according to the keyword, and obtaining a value fed back by the locking thread;
if the value fed back by the locking thread is a first numerical value, the locking result is that locking is successful;
and if the value fed back by the locking thread is a second numerical value, the locking result is locking failure.
In one possible design, the method further includes:
respectively setting target indexes for the businesses to be processed according to the business identification of the businesses to be processed;
the querying whether the service data corresponding to the service identifier is included in the data server according to the service handling request to obtain a query result includes:
and according to the service handling request, inquiring whether the service data corresponding to the service identification is included in a data server through the target index corresponding to the service identification to obtain an inquiry result.
According to the service processing method provided by the disclosure, the target index is respectively set for each service to be processed according to the service identifier of each service to be processed, so that the service data can be subsequently inquired according to the target index, the inquiry speed is increased, the same task to be processed can be effectively prevented from being processed for many times, the service processing efficiency and speed are increased, and the user experience can be improved.
In one possible design, the pending transaction includes a debit transaction or a payment transaction.
In a possible design, after the processing the service to be processed, the method further includes:
and storing the service data corresponding to the service to be processed into a data server.
In a possible design, after the processing the service to be processed, the method further includes:
and sending the processing result corresponding to the service to be processed to the terminal equipment for displaying.
In one possible design, the processing the service to be processed includes:
adding the service to be processed to a preset queue to be processed;
and processing the to-be-processed services in the to-be-processed queue according to a preset sequence.
According to the service processing method provided by the disclosure, the service to be processed is added to the preset queue to be processed. And then, the plurality of services to be processed in the queue to be processed can be processed according to the preset sequence, so that the processing efficiency of the services to be processed can be further improved on the basis of avoiding repeated processing of the same service to be processed for many times.
A second aspect of the present disclosure provides a service processing apparatus, including:
the system comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is used for acquiring a service processing request triggered by a user, and the service processing request comprises a service identifier of a service to be processed;
the locking module is used for setting a distributed lock for the service to be processed according to the service identifier in the service handling request to obtain a locking result;
the query module is used for querying whether the service data corresponding to the service identification is included in the data server according to the service handling request to obtain a query result;
and the processing module is used for processing the service to be processed according to the locking result and the query result.
According to the service processing device, after a service processing request triggered by a user is obtained, a distributed lock is set for a service to be processed according to the service identifier, whether service data corresponding to the service identifier is stored or not is inquired in the data server according to the service identifier, an inquiry result is obtained, and the service to be processed is correspondingly processed according to the locking result and the inquiry result, so that the same task to be processed can be effectively prevented from being processed for many times, the efficiency and the speed of service processing are improved, and further the user experience can be improved.
In one possible design, the processing module is to:
and if the locking result is successful and the query result is that the data server does not include the service data corresponding to the service identifier, processing the service to be processed, otherwise, ignoring the service processing request.
In one possible design, the locking module is configured to:
taking the service identification of the service handling request as a keyword, executing a preset locking thread according to the keyword, and obtaining a value fed back by the locking thread;
if the value fed back by the locking thread is a first numerical value, the locking result is that locking is successful;
and if the value fed back by the locking thread is a second numerical value, the locking result is locking failure.
In one possible design, the pending transaction includes a debit transaction or a payment transaction.
In one possible design, the apparatus further includes:
the setting module is used for respectively setting target indexes for the businesses to be processed according to the business identification of the businesses to be processed;
and the data query module is used for querying whether the service data corresponding to the service identifier is included in the data server through the target index corresponding to the service identifier according to the service handling request to obtain a query result.
In one possible design, the apparatus further includes:
and the storage module is used for storing the service data corresponding to the service to be processed into a data server.
In one possible design, the apparatus further includes:
and the sending module is used for sending the processing result corresponding to the service to be processed to the terminal equipment for displaying.
In one possible design, the processing module includes:
the adding unit is used for adding the service to be processed to a preset queue to be processed;
and the processing unit is used for processing the to-be-processed services in the to-be-processed queue according to a preset sequence.
A third aspect of the present disclosure provides a service processing device, including: a memory, a processor;
a memory; a memory for storing the processor-executable instructions;
wherein the processor is configured to perform the traffic processing method according to the first aspect by the processor.
A fourth aspect of the present disclosure is to provide a computer-readable storage medium, in which computer-executable instructions are stored, and when the computer-executable instructions are executed by a processor, the computer-executable instructions are used for implementing the business processing method according to the first aspect.
According to the service processing method, the device, the equipment and the computer readable storage medium, after a service processing request triggered by a user is obtained, the distributed lock is set for the service to be processed according to the service identifier, whether the service data corresponding to the service identifier is stored or not is inquired in the data server according to the service identifier, an inquiry result is obtained, and the service to be processed is correspondingly processed according to the locking result and the inquiry result, so that the same task to be processed can be effectively prevented from being processed for many times, the efficiency and the speed of service processing are improved, and further the user experience can be improved.
Drawings
In order to more clearly illustrate the embodiments of the present disclosure or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present disclosure, and other drawings can be obtained by those skilled in the art according to the drawings.
FIG. 1 is a schematic diagram of a system architecture upon which the present disclosure is based;
fig. 2 is a schematic flowchart of a service processing method according to an embodiment of the present disclosure;
FIG. 3 is a schematic diagram of a display interface provided by an embodiment of the present disclosure;
FIG. 4 is a schematic view of yet another display interface provided by an embodiment of the present disclosure;
fig. 5 is a schematic flow chart of a service processing method provided in the second embodiment of the present disclosure;
fig. 6 is a schematic flow chart of a service processing method provided in the third embodiment of the present disclosure;
fig. 7 is a schematic structural diagram of a service processing apparatus according to a fourth embodiment of the present disclosure;
fig. 8 is a schematic structural diagram of a service processing apparatus according to a fifth embodiment of the present disclosure;
fig. 9 is a schematic structural diagram of a service processing apparatus according to a sixth embodiment of the present disclosure;
fig. 10 is a schematic structural diagram of a service processing device according to a seventh embodiment of the present disclosure.
Detailed Description
To make the objects, technical solutions and advantages of the embodiments of the present disclosure more clear, the technical solutions of the embodiments of the present disclosure will be described clearly and completely with reference to the drawings in the embodiments of the present disclosure, and it is obvious that the described embodiments are some, but not all embodiments of the present disclosure. All other embodiments obtained based on the embodiments in the disclosure belong to the protection scope of the disclosure.
In view of the above-mentioned technical problem that the same task is repeatedly processed in the existing service processing method, which results in low service processing efficiency, the present disclosure provides a service processing method, apparatus, device, and computer-readable storage medium.
It should be noted that the service processing method, device, apparatus, and computer-readable storage medium provided in the present application may be applied to various online service processing scenarios.
In the process of on-line service handling by a user, multiple service handling requests may be triggered for the same service, and the existing service handling methods generally process the service handling requests in sequence according to the triggering time of the service handling requests. However, the same task is often repeatedly processed, which affects the efficiency of business processing.
In the process of solving the above technical problem, the inventors found through research that, when a plurality of service processing requests are acquired, it may be determined whether a to-be-processed service corresponding to the service processing request has already been processed or is being processed first. Specifically, since a thread is not unlocked after it is set with a distributed lock, the locking operation cannot be performed again with the distributed lock. Therefore, in order to avoid processing the same service to be processed for multiple times, a distributed lock can be set for the service to be processed according to the identifier corresponding to the service to be processed.
The inventor further researches and discovers that after a service processing request triggered by a user is obtained, distributed locks are set for services to be processed according to the service identification, whether service data corresponding to the service identification is stored in the data server or not is inquired according to the service identification, an inquiry result is obtained, and the services to be processed are correspondingly processed according to the locking result and the inquiry result, so that the same task to be processed can be effectively prevented from being processed for many times, the efficiency and the speed of service processing are improved, and further the user experience can be improved.
Fig. 1 is a schematic diagram of a system architecture based on the present disclosure, as shown in fig. 1, the system architecture based on the present disclosure at least includes: a terminal device 1, a service processing apparatus 2 and a data server 3. The business processing device 2 is written by C/C + +, Java, Shell or Python languages and the like; the terminal device 1 may be a desktop computer, a tablet computer, or the like. The data server 3 may be a cloud server or a server cluster, and a large amount of data is stored therein. The service processing device 2 is in communication connection with the terminal device 1 and the data server 3, respectively, so as to be capable of performing information interaction with the terminal device 1 and the data server 3, respectively.
Based on the system architecture diagram, the service processing device 2 can obtain a service transaction request triggered by the user through the terminal device 1, set a distributed lock according to an identifier of a service to be processed in the service transaction request, and process the service to be processed according to a locking result. In addition, according to the identifier of the service to be processed in the service handling request, the service data corresponding to the identifier to be processed can be queried in the data server 3, so that the service to be processed is processed according to the query result.
Fig. 2 is a schematic flow chart of a service processing method provided in an embodiment of the present disclosure, and as shown in fig. 2, the method includes:
step 101, acquiring a service processing request triggered by a user, wherein the service processing request comprises a service identifier of a service to be processed.
The execution subject of this embodiment is a service processing device, which may be set in a terminal device of a user to process a service processing request sent by the user on the terminal device, or may be a device independent from the terminal device of the user, which is not limited in this disclosure.
In the present embodiment, the user can transact various services online, for example, borrowing and loan operations online. When a user needs to perform online service handling, the triggering operation of the service handling request can be performed on the terminal equipment. Specifically, the triggering operation of the service processing request can be realized by performing interface interaction with a preset display interface on the terminal device. Fig. 3 is a schematic view of a display interface provided in the embodiment of the present disclosure, and as shown in fig. 3, a borrowing and loan icon is arranged on the display interface, and a user can trigger the borrowing and loan icon to trigger a service handling request. Specifically, the triggering may be realized by a single click, a double click, or a long press, which is not limited in this disclosure. Accordingly, after the user triggers the preset icon at the terminal to generate the service processing request, the service processing device may obtain the service processing request. Specifically, in order to implement accurate processing of the service to be processed, the service processing request further includes an identifier of the service to be processed, where the identifier may uniquely identify the service to be processed. The service to be processed may be a borrowing service or a repayment service.
And 102, setting a distributed lock for the service to be processed according to the service identifier in the service handling request, and obtaining a locking result.
In this embodiment, after the service handling request is obtained, a distributed lock may be set for the service to be processed according to the service identifier in the service handling request, so as to obtain a locking result.
It should be noted that, for each service to be processed, after the distributed lock is set for the service to be processed according to the identifier of the service to be processed, the distributed lock cannot be obtained any more without unlocking the service to be processed. Since the identifier can uniquely identify the service to be processed, the distributed lock generated according to the identifier is also unique. Therefore, whether the task to be processed is processed or not can be accurately determined according to the locking result. If the locking result is that the locking is successful, representing that the service to be processed is not processed; and if the locking result is that the locking is successful, the service to be processed is characterized to be processed or processed.
Step 103, inquiring whether the service data corresponding to the service identification is included in the data server according to the service handling request, and obtaining an inquiry result.
In this embodiment, in order to identify whether the service to be processed has been processed, after the service to be processed is processed, data corresponding to the service to be processed may be stored in a preset data server. Therefore, after the service handling request triggered by the user is obtained, whether the service data corresponding to the service identifier to be processed is included or not can be inquired in the data server according to the service request to be processed, and an inquiry result is obtained.
Specifically, if the query result is that the data server includes the service data corresponding to the service identifier, it represents that the service to be processed has been processed; otherwise, if the query result is that the data server does not include the service data corresponding to the service identifier, the service to be processed is represented to be unprocessed.
And 104, processing the service to be processed according to the locking result and the query result.
In this embodiment, after the locking result and the query result are obtained respectively, whether the service to be processed has been processed may be determined by combining the locking result and the query result, and the service to be processed is processed according to the determination result.
Specifically, on the basis of the first embodiment, if the locking result is that the locking is successful and the query result is that the service data corresponding to the service identifier is not included in the data server, the service to be processed is processed, otherwise, the service processing request is ignored.
In this embodiment, if the data corresponding to the service to be processed is not queried in the data server, the service to be processed may be being processed. At this time, in order to avoid performing repeated processing on the same service to be processed for multiple times, a distributed lock may be further set for the service to be processed according to the identifier of the service to be processed, and the processing state of the service to be processed may be determined according to the locking result. If the locking is successful, the service to be processed can be processed, otherwise, the service processing request is ignored.
It should be noted that the two embodiments described above may also be implemented separately, that is, the to-be-processed service may be processed only according to the locking result or the query result.
Optionally, when processing is performed only according to the locking result, if the locking is successful, processing the service to be processed; and if the locking fails, ignoring the service processing request.
In this embodiment, if the locking result is that the locking is successful, it is characterized that the service to be processed is not processed, and at this time, the service to be processed may be processed. On the contrary, if the locking result is that the locking is successful, the service to be processed is characterized to be processed or being processed, and at this time, in order to avoid repeated processing on the same service to be processed, the service processing request can be ignored. The processing condition of the service to be processed is determined by setting the distributed lock, so that the processed or currently processed service to be processed can be effectively screened, and the processing efficiency of the service to be processed is improved.
Optionally, when processing is performed only according to the query result, if the query result is that the data server includes the service data corresponding to the service identifier, the to-be-processed service is represented to have been processed, so that the to-be-processed service does not need to be processed any more, and the service handling request is ignored; otherwise, if the query result is that the data server does not include the service data corresponding to the service identifier, it is represented that the service to be processed is not processed, so that the service to be processed can be processed.
Specifically, on the basis of the first embodiment, the step 102 specifically includes:
taking the service identification of the service handling request as a keyword, executing a preset locking thread according to the keyword, and obtaining a value fed back by the locking thread;
if the value fed back by the locking thread is a first numerical value, the locking result is that locking is successful;
and if the value fed back by the locking thread is a second numerical value, the locking result is locking failure.
In this embodiment, the service identifier of the service handling request may be used as a keyword, and a preset locking thread is executed according to the keyword, so as to implement a locking operation on the service handling request. Specifically, when executing the locking thread, the locking thread may feed back a corresponding value as a locking result. When the value fed back by the locking thread is a first value, the locking result is that locking is successful, wherein the first value may be 1. When the value fed back by the locking thread is a second value, the locking result is a locking failure, wherein the second value may be 0.
For example, the service processing request may be a borrowing service, and the borrowing service has a unique identifier. In order to avoid the situation of multiple borrowing, after a borrowing request generated by a user on a display interface through triggering a preset borrowing icon is obtained, a distributed lock can be set for the borrowing request through a preset thread according to the identification of the borrowing service, and a locking result is obtained. If the value fed back by the thread is 1, that is, the locking result is successful, it is represented that the borrowing request is not processed, and the borrowing request can be processed. Otherwise, if the value fed back by the thread is 0, that is, the locking result is a locking failure, it indicates that the borrowing request has been processed, and in order to avoid repeated borrowing, the borrowing request may be ignored at this time.
Still in practical applications, for example, the service processing request may be a payment service, and the payment service has a unique identifier. In order to avoid the situation of multiple repayment, after a repayment request generated by triggering a preset repayment icon on a display interface by a user is acquired, a distributed lock can be set for the repayment request through a preset thread according to the identifier of the repayment service, and a locking result is obtained. If the value fed back by the thread is 1, that is, the locking result is successful, it is represented that the repayment request is not processed, and the repayment request can be processed. On the contrary, if the value fed back by the thread is 0, that is, the locking result is locking failure, it is indicated that the repayment request has been processed, and in order to avoid repeated repayment, the repayment request may be ignored at this time.
Further, on the basis of the first embodiment, after the step 103, the method further includes:
and storing the service data corresponding to the service to be processed into a data server.
In this embodiment, in order to identify whether the service to be processed has been processed, after the service to be processed is processed, data corresponding to the service to be processed may be stored in a preset data server. Therefore, the processing state of the service to be processed can be determined directly according to the stored data in the data server.
Fig. 4 is a schematic view of another display interface provided in an embodiment of the present disclosure, and on the basis of any one of the above embodiments, as shown in fig. 4, after step 103, the method further includes:
and sending the processing result corresponding to the service to be processed to the terminal equipment for displaying.
In this embodiment, in order to make the user know the current state of the service to be processed, after the service to be processed is processed, the processing result may be sent to the terminal for displaying. For example, after a user initiates a loan through a terminal device, the user may determine information such as credit of the user according to a request of the user, determine an amount of the loan that the user can make, and send the amount to the terminal device of the user, so that the user can know about the loan condition.
In the service processing method provided by this embodiment, after a service processing request triggered by a user is obtained, a distributed lock is set for a service to be processed according to the service identifier, whether service data corresponding to the service identifier is stored in the data server according to the service identifier is queried, a query result is obtained, and the service to be processed is correspondingly processed according to the locking result and the query result, so that multiple processing on the same task to be processed can be effectively avoided, the efficiency and speed of service processing are improved, and further, user experience can be improved.
Fig. 5 is a schematic flow chart of a service processing method provided in the second embodiment of the present disclosure, and on the basis of the first embodiment, as shown in fig. 5, the method further includes:
step 201, respectively setting target indexes for each service to be processed according to the service identification of each service to be processed;
step 103 specifically comprises:
step 202, according to the service handling request, querying whether the data server includes the service data corresponding to the service identifier through the target index corresponding to the service identifier, and obtaining a query result.
In this embodiment, in order to identify whether the service to be processed has been processed, after the service to be processed is processed, data corresponding to the service to be processed may be stored in a preset data server. Therefore, after the service handling request triggered by the user is obtained, whether the service data corresponding to the service identifier to be processed is included or not can be inquired in the data server according to the service request to be processed, and an inquiry result is obtained.
Specifically, in order to increase the query speed and ensure the uniqueness of the service data corresponding to the service identifier, a target index may be set for each service to be processed according to the service identifier of each service to be processed. And then the business data can be inquired according to the target index.
In the service processing method provided by this embodiment, the target index is respectively set for each service to be processed according to the service identifier of each service to be processed, so that service data can be subsequently queried according to the target index, the query speed is increased, multiple processing of the same task to be processed can be effectively avoided, the efficiency and speed of service processing are increased, and user experience can be improved.
Fig. 6 is a schematic flow chart of a service processing method provided in a third embodiment of the present disclosure, and on the basis of any of the above embodiments, as shown in fig. 6, step 103 specifically includes:
step 301, adding the service to be processed to a preset queue to be processed;
step 302, processing the to-be-processed services in the to-be-processed queue according to a preset sequence.
In this embodiment, the service processing apparatus may receive a plurality of pending services at the same time, and at this time, the pending services may be added to the preset pending queue. And then, the plurality of services to be processed in the queue to be processed can be processed according to a preset sequence.
Specifically, the preset sequence may be a sequence in which services to be processed are sequentially processed according to a time sequence; the preset sequence can also be that the services to be processed are processed in sequence according to the priority of the services to be processed; in addition, the service processing request may further include an identifier of a user who initiates the service to be processed, and the preset sequence may also be to sequentially process the service to be processed according to different permissions of the user.
In addition, in order to improve the processing efficiency of the to-be-processed service, the to-be-processed service can be processed in parallel in a multi-thread mode.
The service processing method provided by this embodiment adds the service to be processed to the preset queue to be processed. And then, the plurality of services to be processed in the queue to be processed can be processed according to the preset sequence, so that the processing efficiency of the services to be processed can be further improved on the basis of avoiding repeated processing of the same service to be processed for many times.
Fig. 7 is a schematic structural diagram of a service processing apparatus provided in a fourth embodiment of the present disclosure, and as shown in fig. 7, the apparatus includes: the system comprises an acquisition module 41, a locking module 42, an inquiry module 43 and a processing module 44, wherein the acquisition module 41 is configured to acquire a service processing request triggered by a user, and the service processing request includes a service identifier of a service to be processed; a locking module 42, configured to set a distributed lock for the service to be processed according to the service identifier in the service transaction request, and obtain a locking result; the query module 43 is configured to query, according to the service handling request, whether the service data corresponding to the service identifier is included in the data server, so as to obtain a query result; and the processing module 44 is configured to process the service to be processed according to the locking result.
Further, on the basis of the fourth embodiment,
the service to be processed comprises a borrowing service or a repayment service.
Specifically, on the basis of the fourth embodiment, the processing module is configured to:
and if the locking result is successful and the query result is that the data server does not include the service data corresponding to the service identifier, processing the service to be processed, otherwise, ignoring the service processing request.
Further, on the basis of the fourth embodiment, the locking module is configured to:
taking the service identification of the service handling request as a keyword, executing a preset locking thread according to the keyword, and obtaining a value fed back by the locking thread;
if the value fed back by the locking thread is a first numerical value, the locking result is that locking is successful;
and if the value fed back by the locking thread is a second numerical value, the locking result is locking failure.
Further, on the basis of the fourth embodiment, the apparatus further includes:
and the storage module is used for storing the service data corresponding to the service to be processed into a data server.
Further, on the basis of the fourth embodiment,
the device further comprises:
and the sending module is used for sending the processing result corresponding to the service to be processed to the terminal equipment for displaying.
In the service processing apparatus provided in this embodiment, after a service processing request triggered by a user is obtained, a distributed lock is set for a service to be processed according to the service identifier, and whether service data corresponding to the service identifier is stored in the data server according to the service identifier is queried, a query result is obtained, and the service to be processed is correspondingly processed according to the locking result and the query result, so that multiple processes on the same task to be processed can be effectively avoided, the efficiency and speed of service processing are improved, and further, user experience can be improved.
Fig. 8 is a schematic structural diagram of a service processing apparatus provided in a fifth embodiment of the present disclosure, and on the basis of a fourth embodiment, as shown in fig. 8, the apparatus further includes:
a setting module 51, configured to set a target index for each service to be processed according to the service identifier of each service to be processed;
and the data query module 52 is configured to query, according to the service transaction request, whether the service data corresponding to the service identifier is included in the data server through the target index corresponding to the service identifier, so as to obtain a query result.
The service processing apparatus provided in this embodiment sets the target index for each service to be processed according to the service identifier of each service to be processed, so that query of service data can be subsequently implemented according to the target index, query speed is increased, multiple processing of the same task to be processed can be effectively avoided, efficiency and speed of service processing are increased, and user experience can be improved.
Fig. 9 is a schematic structural diagram of a service processing apparatus provided in a sixth embodiment of the present disclosure, and on the basis of any of the foregoing embodiments, as shown in fig. 9, the processing module includes:
an adding unit 61, configured to add the service to be processed to a preset queue to be processed;
and the processing unit 62 is configured to process the to-be-processed services in the to-be-processed queue according to a preset sequence.
The service processing apparatus provided in this embodiment adds the service to be processed to the preset queue to be processed. And then, the plurality of services to be processed in the queue to be processed can be processed according to the preset sequence, so that the processing efficiency of the services to be processed can be further improved on the basis of avoiding repeated processing of the same service to be processed for many times.
Fig. 10 is a schematic structural diagram of a service processing device provided in a seventh embodiment of the present disclosure, and as shown in fig. 10, the service processing device includes: a memory 71, a processor 72;
a memory 71; a memory 71 for storing instructions executable by the processor 72;
wherein the processor 72 is configured to execute the service processing method according to any of the above embodiments by the processor 72.
The memory 71 stores programs. In particular, the program may include program code comprising computer operating instructions. The memory 71 may comprise a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.
The processor 72 may be a Central Processing Unit (CPU), an Application Specific Integrated Circuit (ASIC), or one or more Integrated circuits configured to implement the embodiments of the present disclosure.
Alternatively, in a specific implementation, if the memory 71 and the processor 72 are implemented independently, the memory 71 and the processor 72 may be connected to each other through a bus and perform communication with each other. The bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, an Extended ISA (enhanced Industry Standard Architecture) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown in FIG. 10, but this is not intended to represent only one bus or type of bus.
Alternatively, in a specific implementation, if the memory 71 and the processor 72 are integrated on a chip, the memory 71 and the processor 72 may perform the same communication through an internal interface.
Yet another embodiment of the present disclosure further provides a computer-readable storage medium, in which computer-executable instructions are stored, and when the computer-executable instructions are executed by a processor, the computer-readable storage medium is configured to implement the service processing method according to any one of the above embodiments.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working process of the apparatus described above may refer to the corresponding process in the foregoing method embodiment, and is not described herein again.
Those of ordinary skill in the art will understand that: all or a portion of the steps of implementing the above-described method embodiments may be performed by hardware associated with program instructions. The program may be stored in a computer-readable storage medium. When executed, the program performs steps comprising the method embodiments described above; and the aforementioned storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic or optical disks.
Finally, it should be noted that: the above embodiments are only used for illustrating the technical solutions of the present disclosure, and not for limiting the same; while the present disclosure has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art will understand that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present disclosure.

Claims (15)

1. A method for processing a service, comprising:
acquiring a service processing request triggered by a user, wherein the service processing request comprises a service identifier of a service to be processed;
setting a distributed lock for the service to be processed according to the service identifier in the service handling request to obtain a locking result;
according to the service handling request, inquiring whether the service data corresponding to the service identification is included in a data server or not to obtain an inquiry result;
and processing the service to be processed according to the locking result and the query result.
2. The method according to claim 1, wherein the processing the to-be-processed service according to the locking result and the query result comprises:
if the locking result is successful and the query result is that the data server does not include the service data corresponding to the service identifier, processing the service to be processed;
otherwise, the service processing request is ignored.
3. The method according to claim 1, wherein the setting a distributed lock for the service to be processed according to the service identifier in the service transaction request to obtain a locking result comprises:
taking the service identification of the service handling request as a keyword, executing a preset locking thread according to the keyword, and obtaining a value fed back by the locking thread;
if the value fed back by the locking thread is a first numerical value, the locking result is that locking is successful;
and if the value fed back by the locking thread is a second numerical value, the locking result is locking failure.
4. The method of claim 1, further comprising:
respectively setting target indexes for the businesses to be processed according to the business identification of the businesses to be processed;
the querying whether the service data corresponding to the service identifier is included in the data server according to the service handling request to obtain a query result includes:
and according to the service handling request, inquiring whether the service data corresponding to the service identification is included in a data server through the target index corresponding to the service identification to obtain an inquiry result.
5. The method according to any of claims 1-4, wherein the pending transaction comprises a debit transaction or a payment transaction.
6. The method according to any of claims 1-4, wherein after processing the service to be processed, further comprising:
and storing the service data corresponding to the service to be processed into a data server.
7. The method according to any of claims 1-4, wherein after processing the service to be processed, further comprising:
and sending the processing result corresponding to the service to be processed to the terminal equipment for displaying.
8. The method according to any of claims 1-4, wherein said processing said service to be processed comprises:
adding the service to be processed to a preset queue to be processed;
and processing the to-be-processed services in the to-be-processed queue according to a preset sequence.
9. A traffic processing apparatus, comprising:
the system comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is used for acquiring a service processing request triggered by a user, and the service processing request comprises a service identifier of a service to be processed;
the locking module is used for setting a distributed lock for the service to be processed according to the service identifier in the service handling request to obtain a locking result;
the query module is used for querying whether the service data corresponding to the service identification is included in the data server according to the service handling request to obtain a query result;
and the processing module is used for processing the service to be processed according to the locking result and the query result.
10. The method of claim 9, wherein the processing module is configured to:
if the locking result is successful and the query result is that the data server does not include the service data corresponding to the service identifier, processing the service to be processed;
otherwise, the service processing request is ignored.
11. The method of claim 9, wherein the locking module is configured to:
taking the service identification of the service handling request as a keyword, executing a preset locking thread according to the keyword, and obtaining a value fed back by the locking thread;
if the value fed back by the locking thread is a first numerical value, the locking result is that locking is successful;
and if the value fed back by the locking thread is a second numerical value, the locking result is locking failure.
12. The method of claim 9, wherein the apparatus further comprises:
the setting module is used for respectively setting target indexes for the businesses to be processed according to the business identification of the businesses to be processed;
and the data query module is used for querying whether the service data corresponding to the service identifier is included in the data server through the target index corresponding to the service identifier according to the service handling request to obtain a query result.
13. The method according to any one of claims 9-12, wherein the processing module comprises:
the adding unit is used for adding the service to be processed to a preset queue to be processed;
and the processing unit is used for processing the to-be-processed services in the to-be-processed queue according to a preset sequence.
14. A traffic processing device, comprising: a memory, a processor;
a memory; a memory for storing the processor-executable instructions;
wherein the processor is configured to perform the traffic processing method of any of claims 1-8 by the processor.
15. A computer-readable storage medium having computer-executable instructions stored thereon, which when executed by a processor, are configured to implement the business process method of any one of claims 1-8.
CN202010578404.4A 2020-06-23 2020-06-23 Service processing method, device, equipment and computer readable storage medium Pending CN111737300A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010578404.4A CN111737300A (en) 2020-06-23 2020-06-23 Service processing method, device, equipment and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010578404.4A CN111737300A (en) 2020-06-23 2020-06-23 Service processing method, device, equipment and computer readable storage medium

Publications (1)

Publication Number Publication Date
CN111737300A true CN111737300A (en) 2020-10-02

Family

ID=72650542

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010578404.4A Pending CN111737300A (en) 2020-06-23 2020-06-23 Service processing method, device, equipment and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN111737300A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112860680A (en) * 2021-03-18 2021-05-28 杭州云灵科技有限公司 Data processing method and system, and data query method and system
CN113704297A (en) * 2021-08-03 2021-11-26 深圳兆日科技股份有限公司 Method and module for processing service processing request and computer readable storage medium
CN113891262A (en) * 2021-10-29 2022-01-04 北京声智科技有限公司 Information sending method and device and electronic equipment
CN115756768A (en) * 2023-01-10 2023-03-07 深圳复临科技有限公司 Distributed transaction processing method, device, equipment and medium based on saga
CN117435092A (en) * 2023-12-21 2024-01-23 荣耀终端有限公司 Click operation information processing method, electronic device and readable storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105550052A (en) * 2015-12-28 2016-05-04 东软集团股份有限公司 Distributed lock realization method and apparatus
CN105915627A (en) * 2016-05-30 2016-08-31 北京小米移动软件有限公司 Service request processing method and service request processing device
CN109656724A (en) * 2018-09-27 2019-04-19 深圳壹账通智能科技有限公司 Method for processing business, device, equipment and computer readable storage medium

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105550052A (en) * 2015-12-28 2016-05-04 东软集团股份有限公司 Distributed lock realization method and apparatus
CN105915627A (en) * 2016-05-30 2016-08-31 北京小米移动软件有限公司 Service request processing method and service request processing device
CN109656724A (en) * 2018-09-27 2019-04-19 深圳壹账通智能科技有限公司 Method for processing business, device, equipment and computer readable storage medium

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112860680A (en) * 2021-03-18 2021-05-28 杭州云灵科技有限公司 Data processing method and system, and data query method and system
CN113704297A (en) * 2021-08-03 2021-11-26 深圳兆日科技股份有限公司 Method and module for processing service processing request and computer readable storage medium
CN113704297B (en) * 2021-08-03 2024-02-23 深圳兆日科技股份有限公司 Processing method, module and computer readable storage medium for business processing request
CN113891262A (en) * 2021-10-29 2022-01-04 北京声智科技有限公司 Information sending method and device and electronic equipment
CN115756768A (en) * 2023-01-10 2023-03-07 深圳复临科技有限公司 Distributed transaction processing method, device, equipment and medium based on saga
CN117435092A (en) * 2023-12-21 2024-01-23 荣耀终端有限公司 Click operation information processing method, electronic device and readable storage medium

Similar Documents

Publication Publication Date Title
CN111737300A (en) Service processing method, device, equipment and computer readable storage medium
WO2018184535A1 (en) Insurance service processing method and device, server, and storage medium
CN106687955B (en) Simplifying invocation of an import procedure to transfer data from a data source to a data target
CN113364853B (en) Business service system, business request method and gateway equipment
CN108897729B (en) Transaction template sharing method and device, electronic equipment and storage medium
CN112053149A (en) Method and device for preventing repeated payment, electronic equipment and readable storage medium
CN110909022A (en) Data query method and device
WO2023174119A1 (en) Digital content processing method and apparatus, electronic device, storage medium and product
CN112487071A (en) Transaction query method and device, electronic equipment and readable storage medium
CN110619204A (en) Invitation code generation method and device, terminal equipment and storage medium
CN110852603B (en) High-throughput wind control data processing method, device, equipment and storage medium
CN108920278B (en) Resource allocation method and device
CN112199404A (en) Report creating method and device, electronic equipment and computer readable storage medium
CN111737055A (en) Service processing method, device, equipment and computer readable storage medium
CN111538555A (en) Interface processing method, device, equipment and computer readable storage medium
WO2024021409A1 (en) Data retrieval method and device
CN113111078B (en) Resource data processing method and device, computer equipment and storage medium
CN115421922A (en) Current limiting method, device, equipment, medium and product of distributed system
CN109214884B (en) Demand matching method and device and electronic equipment
CN107704557B (en) Processing method and device for operating mutually exclusive data, computer equipment and storage medium
CN112799791A (en) Method and device for calling distributed lock, electronic equipment and storage medium
CN115222390A (en) Security check method, device, equipment and storage medium
CN112447279A (en) Task processing method and device, electronic equipment and storage medium
CN110825477A (en) Method, device and equipment for loading graphical interface and storage medium
CN111045983A (en) Nuclear power station electronic file management method and device, terminal equipment and medium

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