A concurrency control method, device, equipment and medium for concurrent processing requests
By setting identification information for concurrent processing requests and sequentially updating target identification information, the problem of low concurrency control efficiency in the existing technology is solved, normal execution of concurrent requests is achieved and overall processing efficiency is improved, and rollback operations are avoided. Improved system stability and user experience.
Patent Information
- Application Number
- CN202011582779.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-28
- Publication Date
- 2024-09-03
- Estimated Expiration
- 2040-12-28
AI Technical Summary
When existing concurrency control methods process requests concurrently, pessimistic concurrency control causes resource locking that affects efficiency, and optimistic concurrency control causes rollback operations that affect overall processing efficiency. It is difficult to ensure normal execution of requests and improve processing efficiency at the same time.
By setting identification information for each processing request, the target identification information is determined and updated in turn, allowing the target processing requests to perform operations until all requests are completed, avoiding rollback operations, and priority and data identification are used to distinguish and update data.
It achieves the normal execution of concurrent processing requests and improves the overall processing efficiency, avoids rollback operations, and improves system stability and user experience.
Smart Images

Figure CN112596866B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of concurrency control, and in particular to a concurrency control method, device, equipment and computer-readable storage medium for concurrent processing requests. Background Art
[0002] With the rapid development of information technology, there may be concurrent processing requests when processing target data, so concurrency control methods come into being. Concurrency control methods refer to control methods for each processing request in concurrent processing requests when concurrent processing requests simultaneously process target data. Concurrency control methods in the prior art include pessimistic concurrency control and optimistic concurrency control; wherein, pessimistic concurrency control refers to locking the target data when one processing request in the concurrent processing request performs a processing operation on the target data, and other processing requests can no longer perform processing operations on the target data; therefore, pessimistic concurrency control will affect the normal execution of other processing requests in the concurrent processing request. In optimistic concurrency control, after a processing request performs a processing operation on the target data, it is determined whether there are other processing requests that perform operations on the target data again. If so, after other processing requests perform processing operations, error information is generated, and other processing requests will perform corresponding rollback operations according to the error information. Obviously, this method will seriously affect the processing efficiency of other processing requests in the concurrent processing request, and affect the overall processing efficiency of concurrent processing requests.
[0003] Therefore, how to relatively guarantee the normal execution of each processing request in the concurrent processing request and improve the overall processing efficiency of the concurrent processing request is a technical problem that technical personnel in this field need to solve at present. Summary of the invention
[0004] In view of this, an object of the present invention is to provide a concurrency control method for concurrent processing requests, which can not only relatively guarantee the normal execution of each processing request in the concurrent processing requests, but also improve the overall processing efficiency of the concurrent processing requests; another object of the present invention is to provide a concurrency control device, equipment and computer-readable storage medium for concurrent processing requests, all of which have the above-mentioned beneficial effects.
[0005] In order to solve the above technical problems, the present invention provides a concurrency control method for concurrent processing requests, comprising:
[0006] After each processing request in the concurrent processing request obtains the target data to be processed concurrently, corresponding identification information is set for each processing request;
[0007] Determine target identification information from the identification information, and allow a target processing request corresponding to the target identification information to perform a processing operation on the target data;
[0008] After the execution of the target processing request is completed, the target data of each of the processing requests that have not been executed is updated and the step of determining the target identification information from the identification information and allowing the target processing request corresponding to the target identification information to perform a processing operation on the target data is entered, until each of the processing requests in the concurrent processing requests performs a processing operation.
[0009] Preferably, after the target processing request is executed, the target data of each of the processing requests that have not been executed is updated and the step of determining the target identification information from the identification information and allowing the target processing request corresponding to the target identification information to perform a processing operation on the target data is entered, until each of the processing requests in the concurrent processing requests performs a processing operation, specifically including:
[0010] After the target processing request is executed, using the target identification information to set a data identification for the target data;
[0011] According to the execution result of the target processing request and the data identifier, the target data of each processing request that has not been executed is updated, and the step of determining the target identification information from the identification information and allowing the target processing request corresponding to the target identification information to perform a processing operation on the target data is entered, until each of the processing requests in the concurrent processing requests performs a processing operation.
[0012] Preferably, after the target processing request is executed, the target data of each of the processing requests that have not been executed is updated and the step of determining the target identification information from the identification information and allowing the target processing request corresponding to the target identification information to perform a processing operation on the target data is entered, until the execution of each of the processing requests in the concurrent processing requests is completed, specifically includes:
[0013] After the target processing request is executed, the target processing request in the concurrent processing requests is deleted, and corresponding identification information is reset for the processing request that has not been executed in the concurrent processing requests;
[0014] The target data of each of the processing requests that have not been executed is updated and the step of determining target identification information from the identification information and allowing the target processing request corresponding to the target identification information to perform a processing operation on the target data is entered.
[0015] Preferably, the process of respectively setting corresponding identification information for each of the processing requests specifically includes:
[0016] Setting corresponding identification information for each processing request according to the priority of each processing request;
[0017] Correspondingly, the process of determining the target identification information from the identification information is specifically as follows:
[0018] The target identification information is determined from the identification information according to the corresponding relationship between the identification information and the priority.
[0019] Preferably, it further comprises:
[0020] After determining that each of the concurrent processing requests has executed a processing operation, a corresponding prompt message is issued.
[0021] Preferably, it further comprises:
[0022] The current concurrent processing progress is determined according to the total number of processing requests in the concurrent processing requests and the number of the processing requests that have been executed.
[0023] Preferably, the process of determining the target identification information from the identification information and allowing the target processing request corresponding to the target identification information to perform a processing operation on the target data specifically includes:
[0024] Determining target identification information from the identification information;
[0025] Determining a target processing request corresponding to the target identification information;
[0026] The target processing request is subjected to security verification, and if the verification passes, the target processing request is allowed to perform a processing operation on the target data.
[0027] In order to solve the above technical problems, the present invention further provides a concurrency control device for concurrently processing requests, comprising:
[0028] A setting module, used for setting corresponding identification information for each of the concurrent processing requests after each of the concurrent processing requests obtains the target data to be processed concurrently;
[0029] a determination module, configured to determine target identification information from the identification information, and allow a target processing request corresponding to the target identification information to perform a processing operation on the target data;
[0030] The execution module is used to update the target data of each processing request that has not been executed and call the determination module after the execution of the target processing request is completed, until each processing request in the concurrent processing request executes the processing operation.
[0031] In order to solve the above technical problems, the present invention further provides a concurrency control device for concurrently processing requests, comprising:
[0032] Memory for storing computer programs;
[0033] A processor is used to implement the steps of any of the above-mentioned concurrency control methods for concurrent processing requests when executing the computer program.
[0034] To solve the above technical problems, the present invention also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the concurrency control method for any of the above concurrent processing requests are implemented.
[0035] The present invention provides a concurrency control method for concurrent processing requests. After each processing request in the concurrent processing request obtains the target data to be processed concurrently, the corresponding identification information is set for each processing request; the target identification information is determined from the identification information, and the target processing request corresponding to the target identification information is allowed to perform processing operations on the target data; after the target processing request is executed, the target data of each processing request is updated and the step of determining the target identification information from the identification information and allowing the target processing request corresponding to the target identification information to perform processing operations on the target data is entered, until each processing request in the concurrent processing request performs processing operations. It can be seen that the method determines the target identification information from the identification information in turn, and allows the target processing request corresponding to the target identification information to perform processing operations on the target data, that is, controls the execution of each processing request in the concurrent processing request in turn, so that the normal execution of each processing request in the concurrent processing request can be relatively guaranteed; and each processing request is based on the target data updated after the previous processing request executes the processing operation and executes the processing operation again, so the need for rollback operation is avoided, thereby improving the overall processing efficiency of the concurrent processing request.
[0036] In order to solve the above technical problems, the present invention also provides a concurrency control device, equipment and computer-readable storage medium for concurrent processing requests, all of which have the above beneficial effects. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] In order to more clearly illustrate the embodiments of the present invention or the technical solutions of the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0038] Figure 1 A flowchart of a concurrency control method for concurrently processing requests provided by an embodiment of the present invention;
[0039] Figure 2A process diagram of a concurrency control method for concurrently processing requests provided by an embodiment of the present invention;
[0040] Figure 3 A structural diagram of a concurrent control device for concurrently processing requests provided by an embodiment of the present invention;
[0041] Figure 4 A structural diagram of a concurrency control device for concurrently processing requests provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0042] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0043] The core of an embodiment of the present invention is to provide a concurrency control method for concurrent processing requests, which can not only relatively guarantee the normal execution of each processing request in the concurrent processing requests, but also improve the overall processing efficiency of the concurrent processing requests; another core of the present invention is to provide a concurrency control device, equipment and computer-readable storage medium for concurrent processing requests, all of which have the above-mentioned beneficial effects.
[0044] In order to enable those skilled in the art to better understand the scheme of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific implementation methods.
[0045] Figure 1 A flowchart of a concurrency control method for concurrently processing requests provided by an embodiment of the present invention; Figure 2 A process diagram of a concurrency control method for concurrently processing requests provided by an embodiment of the present invention. Figure 1 and Figure 2 As shown, a concurrency control method for concurrently processing requests includes:
[0046] S10: After each processing request in the concurrent processing request obtains the target data to be processed concurrently, corresponding identification information is set for each processing request.
[0047] Specifically, in actual operation, when a concurrent processing request for target data arrives, each processing request in the concurrent processing request obtains the target data to be processed concurrently respectively; then corresponding identification information is set for each processing request in the concurrent processing request, and the identification information is used to uniquely identify each different processing request, that is, n processing requests will correspond to n different identification information, and the unique corresponding processing request can be determined according to the identification information; wherein the identification information can specifically be a change parameter, and this embodiment does not limit the specific type of the identification information.
[0048] S20: determining target identification information from the identification information, and allowing the target processing request corresponding to the target identification information to perform a processing operation on the target data;
[0049] S30: After the execution of the target processing request is completed, the target data of each processing request that has not been executed is updated and the process enters S20: the target identification information is determined from the identification information, and the target processing request corresponding to the target identification information is allowed to perform the processing operation on the target data, until each processing request in the concurrent processing request performs the processing operation.
[0050] Specifically, when each processing request is respectively provided with corresponding identification information, the target identification information is determined from multiple identification information, that is, the target processing request is determined from multiple processing requests of the concurrent processing requests, and the target processing request is allowed to perform processing operations on the target data, while other processing requests in the concurrent processing requests except the target processing request cannot currently perform processing operations on the target data and wait for the next round of selection.
[0051] It should be noted that a determination rule for determining the target identification information is set according to the type of identification information, so that the target identification information can be determined from multiple identification information according to the determination rule. Specifically, when the identification information is a numerical number, the identification information with the smallest / largest numerical number can be used as the target identification information; when the identification information is a character, each identification information can be arranged in alphabetical order of the characters, and the identification information corresponding to the first character can be used as the target identification information; this embodiment does not limit the type of identification information and the corresponding determination rule.
[0052] It should be noted that by allowing the target processing request to perform processing operations on the target data, it means that the target processing request will perform corresponding change operations on the target data according to its own request content. After the target processing request is executed, that is, the target processing request has changed the target data, it is necessary to use the target data obtained after the target processing request is changed to update the target data pre-acquired by each processing request that has not been executed; then determine whether each processing request in the concurrent processing request has performed the processing operation; if so, end the process; if not, enter S20 and enter a loop operation; until each processing request in the concurrent processing request has performed the processing operation, that is, the concurrent processing business is completed.
[0053] Furthermore, in this embodiment, after the target processing request of the previous round is executed and processed, the target processing request of the current round is determined from the processing requests that have not been executed in the concurrent processing requests.
[0054] It should be noted that in actual operation, after the next round of target processing requests is determined, only the target data corresponding to the next round of target processing requests is updated; that is, the target data after the current target processing request is changed is used to update the target data pre-acquired by the target processing request determined in the next round, and this cycle is repeated until the concurrent processing business is completed.
[0055] It should also be noted that after each processing request in the concurrent processing request executes the processing operation, the identification information of each processing request may be deleted.
[0056] The embodiment of the present invention provides a concurrency control method for concurrent processing requests. After each processing request in the concurrent processing request obtains the target data to be processed concurrently, the corresponding identification information is set for each processing request; the target identification information is determined from the identification information, and the target processing request corresponding to the target identification information is allowed to perform processing operations on the target data; after the target processing request is executed, the target data of each processing request is updated and the step of determining the target identification information from the identification information and allowing the target processing request corresponding to the target identification information to perform processing operations on the target data is entered, until each processing request in the concurrent processing request performs processing operations. It can be seen that the method determines the target identification information from the identification information in turn, and allows the target processing request corresponding to the target identification information to perform processing operations on the target data, that is, controls the execution of each processing request in the concurrent processing request in turn, so that the normal execution of each processing request in the concurrent processing request can be relatively guaranteed; and each processing request is based on the target data updated after the previous processing request executes the processing operation and executes the processing operation again, so the need for rollback operation is avoided, thereby improving the overall processing efficiency of the concurrent processing request.
[0057] On the basis of the above-mentioned embodiment, this embodiment further illustrates and optimizes the technical solution. Specifically, in this embodiment, after the execution of the target processing request is completed, the target data of each processing request that has not been executed is updated and the step of determining the target identification information from the identification information and allowing the target processing request corresponding to the target identification information to perform the processing operation on the target data is entered, until each processing request in the concurrent processing request executes the processing operation. The process specifically includes:
[0058] After the target processing request is executed, a data identifier is set for the target data using the target identifier information;
[0059] According to the execution result and data identifier of the target processing request, the target data of each processing request that has not been executed is updated, and the step of determining the target identification information from the identification information and allowing the target processing request corresponding to the target identification information to perform the processing operation on the target data is entered, until each processing request in the concurrent processing request executes the processing operation.
[0060] Specifically, in this embodiment, after the target processing request completes the processing operation on the target data, the target identification information of the target processing request is further used to set a data identifier for the target data, so as to use the data identifier to distinguish which processing request performs the processing operation on the changed target data.
[0061] For example, assuming that the initial target data is A, after the target processing request (identification information is change_1) modifies the target data to B, the corresponding data identifier (change_1) is set for the target data, and the target data B (B_change_1) is obtained; after the target processing request (identification information is change_2) modifies the target data B to target data C, the corresponding data identifier (change_2) is set for the target data, and the target data C (C_change_2) is obtained; in this way, when the target data C is subsequently acquired, it can be determined based on the data identifier (change_2) of the target data C that the target data C is obtained after the processing operation is executed by the processing request with the identification information as change_2.
[0062] It can be seen that according to the method of this embodiment, it is further convenient for users to know the processing operation status of target data, and it is convenient to trace the execution status of processing requests according to the target data, thereby further improving the user experience.
[0063] On the basis of the above-mentioned embodiment, this embodiment further illustrates and optimizes the technical solution. Specifically, in this embodiment, after the target processing request is executed, the target data of each processing request that has not been executed is updated, and the target identification information is determined from the identification information, and the target processing request corresponding to the target identification information is allowed to perform the processing operation on the target data, until each processing request in the concurrent processing request is executed and completed, the process specifically includes:
[0064] After the target processing request is executed, the target processing request in the concurrent processing request is deleted, and the corresponding identification information is reset for the processing request that has not been executed in the concurrent processing request;
[0065] The target data of each processing request that has not been executed is updated and the step of determining the target identification information from the identification information and allowing the target processing request corresponding to the target identification information to perform a processing operation on the target data is entered.
[0066] It should be noted that, in a specific implementation, after setting identification information for each processing request, the identification information will become invalid only after each processing request in the concurrent processing request has executed the processing operation, that is, the validity period of the identification information is until each processing request in the concurrent processing request has executed the processing operation; therefore, each time the target identification information is determined, it is necessary to first exclude the identification information of the executed processing request from all the identification information, and then determine the target identification information from the remaining identification information.
[0067] This embodiment is another preferred implementation method. Specifically, after the target processing request is executed, the target processing request that has been executed in this round is deleted from the concurrent processing request, and the target identification information corresponding to the target processing request is deleted. Then, the corresponding identification information is reset for the processing request that has not been executed in the concurrent processing request; and the target identification information is determined again based on the reset identification information. It can be understood that after the execution of the target processing request is completed and the corresponding target identification information is deleted, the total number of identification information will be reduced by one compared with the previous round. If there are n processing requests in the concurrent processing request, after deleting (n-1) target identification information, the remaining one identification information will be directly determined as the target identification information.
[0068] It can be seen that according to the method of this embodiment, the target identification information can be determined from the identification information quickly and conveniently.
[0069] Based on the above embodiment, this embodiment further illustrates and optimizes the technical solution. Specifically, in this embodiment, the process of setting corresponding identification information for each processing request includes:
[0070] According to the priority of each processing request, corresponding identification information is set for each processing request;
[0071] Correspondingly, the process of determining the target identification information from the identification information is specifically as follows:
[0072] According to the correspondence between the identification information and the priority, the target identification information is determined from the identification information.
[0073] It should be noted that, in the present embodiment, corresponding identification information is set for each processing request according to the priority of the processing request; the type of the identification information here can still be a numerical number or character, etc., and then the target identification information is determined from multiple identification information in turn according to the correspondence between the identification information and the priority.
[0074] Specifically, in a specific implementation, a corresponding numerical number is set for each processing request in order from high to low priority. For example, assuming that the priority of processing request 1 is > the priority of processing request 2 > the priority of processing request 3; then the identification information of processing request 1 can be set to 1, the identification information of processing request 2 can be set to 2, and the identification information of processing request 3 can be set to 3; when determining the target identification information from multiple identification information, the corresponding target identification information can be determined in order from small to large according to the identification information, that is, first determine the identification information 1 as the target identification information, and the corresponding processing request 1 as the target processing request, and give priority to the processing request with a high priority among the concurrent processing requests.
[0075] It can be seen that according to the method of this embodiment, each processing request in the concurrent processing request can be processed in sequence according to the priority order, thereby further improving the user experience.
[0076] Based on the above embodiments, this embodiment further illustrates and optimizes the technical solution. Specifically, this embodiment further includes:
[0077] After determining that each of the concurrent processing requests has executed the processing operation, a corresponding prompt message is issued.
[0078] Specifically, in this embodiment, after determining that each processing request of the concurrent processing request has executed the processing operation, that is, after determining that the concurrent processing business is completed, the preset prompt device is further triggered to send out the corresponding prompt information. It should be noted that the prompt device can be specifically a buzzer and / or an indicator light and / or a display. By triggering the prompt device such as a buzzer / indicator light / display to send out the corresponding prompt information, such as a buzzer sound / flashing light / display text or image, etc., the user is intuitively prompted that the concurrent processing request has been completed, thereby further improving the user's experience.
[0079] Based on the above embodiments, this embodiment further illustrates and optimizes the technical solution. Specifically, this embodiment further includes:
[0080] The current concurrent processing progress is determined based on the total number of processing requests in the concurrent processing requests and the number of processing requests that have been executed.
[0081] Specifically, in this embodiment, the total number of processing requests in the concurrent processing requests and the number of processing requests currently executed are further obtained, and the current concurrent processing progress is calculated accordingly; wherein, the concurrent processing progress can be expressed as a percentage, and this embodiment does not make any specific limitation on this.
[0082] It should be noted that in actual operation, after calculating the current concurrent processing progress, the preset display device can be further used to display the determined current concurrent processing progress so that the user can intuitively know the execution status of the current concurrent processing request, thereby further improving the user experience.
[0083] Based on the above embodiment, this embodiment further illustrates and optimizes the technical solution. Specifically, in this embodiment, the process of determining the target identification information from the identification information and allowing the target processing request corresponding to the target identification information to perform the processing operation on the target data specifically includes:
[0084] Determining target identification information from the identification information;
[0085] Determining a target processing request corresponding to the target identification information;
[0086] The target processing request is subjected to security verification, and if the verification passes, the target processing request is allowed to perform processing operations on the target data.
[0087] Specifically, in this step, after determining the target identification information from the identification information and determining the corresponding target processing request based on the target identification information, the target processing request is further verified for security; if the verification passes, the target processing request is allowed to perform processing operations on the target data; if the verification fails, the target processing request is ignored and the target processing request is determined again from the unexecuted processing requests in the concurrent processing requests, or a corresponding warning message is further issued.
[0088] It should be noted that, in this embodiment, the method for performing security verification on the target processing request may be to determine whether the target processing request carries preset verification information such as a digital signature, and to determine whether the security verification of the target processing request has passed by verifying whether the digital signature is legal and valid. This embodiment does not limit the specific method for performing security verification on the target processing request.
[0089] It can be seen that this embodiment can further ensure the security of concurrent processing and the security of target data by further performing security verification on the target processing request before the target processing request executes the processing operation.
[0090] The above describes in detail an embodiment of a concurrent control method for concurrent processing requests provided by the present invention. The present invention also provides a concurrent control device, equipment and computer-readable storage medium for concurrent processing requests corresponding to the method. Since the embodiments of the device, equipment and computer-readable storage medium part correspond to the embodiments of the method part, the embodiments of the device, equipment and computer-readable storage medium part refer to the description of the embodiments of the method part, and will not be repeated here.
[0091] Figure 3 A structural diagram of a concurrent control device for concurrently processing requests provided by an embodiment of the present invention, such as Figure 3 As shown, a concurrency control device for concurrently processing requests includes:
[0092] A setting module 31, configured to set corresponding identification information for each processing request after each processing request in the concurrent processing request obtains target data to be processed concurrently;
[0093] A determination module 32, configured to determine target identification information from the identification information, and allow a target processing request corresponding to the target identification information to perform a processing operation on target data;
[0094] The execution module 33 is used to update the target data of each processing request that has not been executed and call the determination module after the execution of the target processing request is completed, until each processing request in the concurrent processing request executes the processing operation.
[0095] The concurrency control device for concurrent processing requests provided by the embodiment of the present invention has the beneficial effects of the concurrency control method for concurrent processing requests described above.
[0096] Figure 4 A structural diagram of a concurrent control device for concurrently processing requests provided by an embodiment of the present invention, such as Figure 4 As shown, a concurrency control device for concurrently processing requests includes:
[0097] A memory 41, used for storing computer programs;
[0098] The processor 42 is used to implement the steps of the concurrency control method for concurrently processing requests as described above when executing a computer program.
[0099] The concurrency control device for concurrent processing requests provided by the embodiment of the present invention has the beneficial effects of the concurrency control method for concurrent processing requests described above.
[0100] To solve the above technical problem, the present invention also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the concurrency control method for concurrent processing requests as described above are implemented.
[0101] The computer-readable storage medium provided by the embodiment of the present invention has the beneficial effects of the above-mentioned concurrency control method for concurrent processing requests.
[0102] The above is a detailed introduction to the concurrent control method, device, equipment and computer-readable storage medium for concurrent processing requests provided by the present invention. Specific embodiments are used herein to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of the present invention, several improvements and modifications can be made to the present invention, and these improvements and modifications also fall within the scope of protection of the claims of the present invention.
[0103] The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description.
[0104] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
Claims
1. A concurrency control method for concurrently processing requests, It is characterized in that include: After each processing request in the concurrent processing request obtains the target data to be processed concurrently, corresponding identification information is set for each processing request; Determine target identification information from the identification information, and allow a target processing request corresponding to the target identification information to perform a processing operation on the target data; After the target processing request is executed, using the target identification information to set a data identification for the target data; updating the target data of each of the processing requests that have not been executed according to the execution result of the target processing request and the data identifier, and entering the step of determining the target identification information from the identification information, and allowing the target processing request corresponding to the target identification information to execute the processing operation on the target data, until each of the processing requests in the concurrent processing requests executes the processing operation; After the target processing request is executed, the target processing request in the concurrent processing requests is deleted, and corresponding identification information is reset for the processing request that has not been executed in the concurrent processing requests; The target data of each of the processing requests that have not been executed is updated and the step of determining target identification information from the identification information and allowing the target processing request corresponding to the target identification information to perform a processing operation on the target data is entered.
2. The method according to claim 1, It is characterized in that The process of respectively setting corresponding identification information for each processing request specifically includes: Setting corresponding identification information for each processing request according to the priority of each processing request; Correspondingly, the process of determining the target identification information from the identification information is specifically as follows: The target identification information is determined from the identification information according to the corresponding relationship between the identification information and the priority.
3. The method according to claim 1, It is characterized in that Further including: After determining that each of the concurrent processing requests has executed a processing operation, a corresponding prompt message is issued.
4. The method according to claim 1, It is characterized in that Further including: The current concurrent processing progress is determined according to the total number of processing requests in the concurrent processing requests and the number of the processing requests that have been executed.
5. The method according to any one of claims 1 to 4, It is characterized in that The process of determining the target identification information from the identification information and allowing the target processing request corresponding to the target identification information to perform a processing operation on the target data specifically includes: Determining target identification information from the identification information; Determining a target processing request corresponding to the target identification information; The target processing request is subjected to security verification, and if the verification passes, the target processing request is allowed to perform a processing operation on the target data.
6. A concurrency control device for concurrently processing requests, It is characterized in that include: A setting module, configured to set corresponding identification information for each of the concurrent processing requests after each of the concurrent processing requests obtains target data to be processed concurrently; a determination module, configured to determine target identification information from the identification information, and allow a target processing request corresponding to the target identification information to perform a processing operation on the target data; An execution module, configured to set a data identifier for the target data using the target identification information after the target processing request is executed; updating the target data of each of the processing requests that have not been executed according to the execution result of the target processing request and the data identifier and triggering a determination module until each of the processing requests in the concurrent processing requests executes a processing operation; After the target processing request is executed, the target processing request in the concurrent processing requests is deleted, and corresponding identification information is reset for the processing request that has not been executed in the concurrent processing requests; The target data of each of the unexecuted processing requests is updated and a determination module is triggered.
7. A concurrency control device for concurrently processing requests, It is characterized in that include: Memory for storing computer programs; A processor, configured to implement the steps of the concurrency control method for concurrent processing requests as described in any one of claims 1 to 5 when executing the computer program.
8. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the concurrency control method for concurrent processing requests according to any one of claims 1 to 5 are implemented.
