Abnormal data processing method and device for distributed system
By storing the identification information of the abnormal data unit and the identification information of the application server in the shared server, locking the abnormal data unit and extending the storage time according to the preset frequency, the problem of complex resource allocation and locking in the prior art is solved, and the difficulty of processing abnormal data in distributed systems is reduced and the application scenario is expanded.
Patent Information
- Application Number
- CN202311778837.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-22
- Publication Date
- 2025-06-24
AI Technical Summary
When processing exception data, the resource allocation module of the existing distributed system is complex in logic and cannot adapt to complex business scenarios and has poor scalability. At the same time, when using the distributed lock mechanism, the application downtime causes the locked processing unit to be unable to be released in time, increasing the system complexity.
By storing the identification information of the abnormal data unit and the identification information of the application server in the shared server, the application server can only perform business logic processing after the storage is successful, thereby realizing the locking of the abnormal data unit. At the same time, extend the storage time according to the preset frequency to avoid locking problems caused by application server downtime or failure.
It reduces the difficulty of processing exception data in distributed system, simplifies the business logic of the resource allocation module, avoids locking problems caused by application server downtime, realizes unified locking and repeated locking, and expands the application scenarios of abnormal data processing in distributed system.
Smart Images

Figure CN120196466A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of distributed technologies, and in particular, to a method and apparatus for processing abnormal data in a distributed system. Background Art
[0002] This section aims to provide background or context for the embodiments of the present invention described in the claims. The description herein is not admitted to be prior art merely by virtue of being included in this section.
[0003] During the process of processing distributed system data, due to reasons such as distributed system failures, a certain proportion of abnormal data will appear in the distributed system. These abnormal data will appear in different data units, and a data unit is the smallest data set for applying business logic processing in the distributed system. To solve the above problems, it is generally necessary to scan all data units to confirm abnormal data during abnormal data processing. In order to make full use of the advantages of system resources and clustering, data units will be regularly allocated to each server in the cluster for parallel processing.
[0004] There are generally the following two schemes for allocating data units in the prior art:
[0005] 1. Design a separate resource allocation module, confirm the processing result of the data unit through network interaction with the application, and determine the next resource allocation scheme according to the processing result. The logic design of this scheme is relatively complex, unable to adapt to complex business scenarios, and has poor scalability.
[0006] 2. Implement a distributed lock mechanism through components such as databases / Redis. The application locks when obtaining a processing unit and unlocks after processing is completed. This scheme simplifies the business logic of the resource allocation module, but at the same time, it will cause the locked processing unit to not be released in a timely manner in the case of application downtime. Therefore, different expiration times need to be designed for different business logics when locking, increasing the system complexity. Summary of the Invention
[0007] Embodiments of the present invention provide a method for processing abnormal data in a distributed system, which is used to reduce the difficulty of processing abnormal data in the distributed system and expand the application scenarios for processing abnormal data in the distributed system. Among them, the distributed system includes a shared server and multiple application servers. The shared server is used to allocate abnormal data processing tasks to the application servers, and the application servers are used to execute abnormal data business logic processing. The method is applied to any application server and includes:
[0008] Receiving an abnormal data processing task; the abnormal data processing task includes identification information of an abnormal data unit;
[0009] Send the identification information of the abnormal data unit and the identification information of the first application server to the shared server, so that the shared server: determine whether the identification information of the abnormal data unit and the identification information of other application servers except the first application server have been stored. When the identification information of the abnormal data unit and the identification information of other application servers except the first application server have not been stored, store the identification information of the abnormal data unit and the identification information of the first application server, and send a message indicating successful storage to the first application server; wherein, in the shared server, the storage duration of the identification information of the abnormal data unit and the identification information of the first application server is the first preset duration. When the end time point of the first preset duration is reached, the shared server deletes the identification information of the abnormal data unit and the identification information of the first application server;
[0010] Receive the message indicating successful storage;
[0011] Execute the abnormal data service logic processing according to the identification information of the abnormal data unit. When the end time point of the first preset duration has not been reached, send the second preset duration information for requesting to extend the storage of the identification information of the abnormal data unit and the identification information of the first application server to the shared server at a preset frequency, so that the shared server: according to the second preset duration information, extend the storage duration of the identification information of the abnormal data unit and the identification information of the first application server, and send a message indicating successful extension of the storage duration to the first application server; the second preset duration is greater than the reciprocal of the preset frequency;
[0012] When the data service logic processing of the abnormal data unit is completed, send a message indicating completion of processing to the shared server, so that the shared server: according to the message indicating completion of processing, delete the identification information of the abnormal data unit and the identification information of the first application server.
[0013] An embodiment of the present invention provides a method for processing abnormal data in a distributed system, which is used to reduce the difficulty of processing abnormal data in the distributed system and expand the application scenarios of processing abnormal data in the distributed system. Among them, the distributed system includes a shared server and multiple application servers. The shared server is used to allocate abnormal data processing tasks to the application servers, and the application servers are used to execute abnormal data service logic processing. The method is applied to the shared server, and the method includes:
[0014] Send an abnormal data processing task to the first application server, so that the first application server: send the identification information of the abnormal data unit and the identification information of the first application server to the shared server; the abnormal data processing task includes the identification information of the abnormal data unit; the first application server is any one of the application servers;
[0015] Receive the identification information of the abnormal data unit and the identification information of the first application server sent by the first application server;
[0016] Determine whether the identification information of the abnormal data unit and the identification information of other application servers except the first application server have been stored. When the identification information of the abnormal data unit and the identification information of other application servers except the first application server have not been stored, store the identification information of the abnormal data unit and the identification information of the first application server; wherein, the storage duration of the identification information of the abnormal data unit and the identification information of the first application server is the first preset duration. When the end time point of the first preset duration is reached, delete the identification information of the abnormal data unit and the identification information of the first application server.
[0017] Send a message indicating successful storage to the first application server, so that the first application server: perform abnormal data service logic processing according to the identification information of the abnormal data unit. When the end time point of the first preset duration has not been reached, send the second preset duration information for requesting an extended storage of the identification information of the abnormal data unit and the identification information of the first application server to the shared server at a preset frequency; the second preset duration is less than the reciprocal of the preset frequency.
[0018] Receive the second preset duration information sent by the first application server for requesting an extended storage of the identification information of the abnormal data unit and the identification information of the first application server.
[0019] According to the second preset duration information, extend the storage duration of the identification information of the abnormal data unit and the identification information of the first application server, and send a message indicating successful extended storage duration to the first application server, so that the first application server: perform abnormal data service logic processing according to the identification information of the abnormal data unit. When the data service logic processing of the abnormal data unit is completed, send a message indicating completion of processing to the shared server.
[0020] Delete the identification information of the abnormal data unit and the identification information of the first application server according to the message indicating completion of processing sent by the first application server.
[0021] An embodiment of the present invention provides a distributed system abnormal data processing device for reducing the difficulty of distributed system abnormal data processing and expanding the application scenarios of distributed system abnormal data processing. Among them, the distributed system includes a shared server and multiple application servers. The shared server is used to allocate abnormal data processing tasks to the application servers, and the application servers are used to perform abnormal data service logic processing. The device is applied to any one of the application servers, and the device includes:
[0022] A task receiving module, configured to receive an abnormal data processing task; the abnormal data processing task includes the identification information of the abnormal data unit.
[0023] A request locking module, configured to send the identification information of the abnormal data unit and the identification information of the first application server to the shared server, so that the shared server: determines whether the identification information of the abnormal data unit and the identification information of other application servers except the first application server have been stored, and when the identification information of the abnormal data unit and the identification information of other application servers except the first application server have not been stored, stores the identification information of the abnormal data unit and the identification information of the first application server, and sends a message indicating successful storage to the first application server; wherein, the storage duration of the identification information of the abnormal data unit and the identification information of the first application server is a first preset duration, and when the end time point of the first preset duration is reached, the shared server deletes the identification information of the abnormal data unit and the identification information of the first application server; receives the message indicating successful storage;
[0024] A request locking extension module, configured to perform abnormal data service logic processing according to the identification information of the abnormal data unit. When the end time point of the first preset duration has not been reached, it sends the second preset duration information for requesting to extend the storage of the identification information of the abnormal data unit and the identification information of the first application server to the shared server at a preset frequency, so that the shared server: extends the storage duration of the identification information of the abnormal data unit and the identification information of the first application server according to the second preset duration information, and sends a message indicating successful extension of the storage duration to the first application server; the second preset duration is greater than the reciprocal of the preset frequency;
[0025] A task end module, configured to send a message indicating that the processing is completed to the shared server when the data service logic processing of the abnormal data unit is completed, so that the shared server: deletes the identification information of the abnormal data unit and the identification information of the first application server according to the message indicating that the processing is completed.
[0026] An embodiment of the present invention provides a distributed system abnormal data processing device, which is used to reduce the difficulty of distributed system abnormal data processing and expand the application scenarios of distributed system abnormal data processing. Among them, the distributed system includes a shared server and multiple application servers. The shared server is used to allocate abnormal data processing tasks to the application servers, and the application servers are used to perform abnormal data service logic processing. The device is applied to the shared server, and the device includes:
[0027] A task distribution module, configured to distribute an abnormal data processing task to the first application server, so that the first application server: sends the identification information of the abnormal data unit and the identification information of the first application server to the shared server; the abnormal data processing task includes the identification information of the abnormal data unit; the first application server is any one of the application servers,
[0028] A locking module, configured to receive the identification information of an abnormal data unit and the identification information of a first application server sent by the first application server; determine whether the identification information of the abnormal data unit and the identification information of other application servers except the first application server have been stored, and when the identification information of the abnormal data unit and the identification information of other application servers except the first application server have not been stored, store the identification information of the abnormal data unit and the identification information of the first application server; wherein, the storage duration of the identification information of the abnormal data unit and the identification information of the first application server is a first preset duration, and when the end time point of the first preset duration is reached, delete the identification information of the abnormal data unit and the identification information of the first application server; send a message indicating successful storage to the first application server, so that the first application server: perform abnormal data service logic processing according to the identification information of the abnormal data unit, and when the end time point of the first preset duration has not been reached, send the second preset duration information for requesting to extend the storage of the identification information of the abnormal data unit and the identification information of the first application server to the shared server at a preset frequency; the second preset duration is less than the reciprocal of the preset frequency.
[0029] A locking extension module, configured to receive the second preset duration information for requesting to extend the storage of the identification information of the abnormal data unit and the identification information of the first application server sent by the first application server; extend the storage duration of the identification information of the abnormal data unit and the identification information of the first application server according to the second preset duration information, and send a message indicating successful extension of the storage duration to the first application server, so that the first application server: perform abnormal data service logic processing according to the identification information of the abnormal data unit, and when the data service logic processing of the abnormal data unit is completed, send a message indicating completion of processing to the shared server.
[0030] A locking release module, configured to delete the identification information of the abnormal data unit and the identification information of the first application server according to the message indicating completion of processing sent by the first application server.
[0031] An embodiment of the present invention further provides a computer device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein when the processor executes the computer program, the above-mentioned method for processing abnormal data in a distributed system is implemented.
[0032] An embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the above-mentioned method for processing abnormal data in a distributed system is implemented.
[0033] An embodiment of the present invention further provides a computer program product, wherein the computer program product includes a computer program, and when the computer program is executed by a processor, the above-mentioned method for processing abnormal data in a distributed system is implemented.
[0034] In an embodiment of the present invention, by storing the identification information of the abnormal data unit and the identification information of the application server in the shared server, only when the storage is successful can the application server execute the business logic processing of the abnormal data unit. By this method, it is realized that other application servers are prohibited from executing the abnormal data business logic processing according to the abnormal data unit, achieving the purpose of locking the abnormal data unit. Moreover, the storage duration is extended regularly at a preset frequency to achieve repeated locking, which can effectively avoid situations such as the application server crashing or malfunctioning. And all application servers adopt the same method of locking and extending the lock, avoiding the situation in the prior art where each application server separately sets its own locking duration, making the solution implementation simpler, reducing the difficulty of abnormal data processing in the distributed system, and expanding the application scenario of abnormal data processing in the distributed system. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the following drawings are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings. In the drawings:
[0036] Figure 1 It is a schematic flowchart of the method for processing abnormal data in a distributed system in an embodiment of the present invention, applied to the first application server;
[0037] Figure 2 It is a specific embodiment of the method for processing abnormal data in a distributed system in an embodiment of the present invention;
[0038] Figure 3 It is a specific embodiment of the method for processing abnormal data in a distributed system in an embodiment of the present invention;
[0039] Figure 4 It is a specific implementation of the method for processing abnormal data in a distributed system in an embodiment of the present invention;
[0040] Figure 5 It is a schematic flowchart of the method for processing abnormal data in a distributed system in an embodiment of the present invention, applied to the shared server;
[0041] Figure 6 It is a schematic diagram of the device for processing abnormal data in a distributed system in an embodiment of the present invention, applied to the first application server;
[0042] Figure 7 It is a schematic diagram of the device for processing abnormal data in a distributed system in an embodiment of the present invention, applied to the shared server. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0043] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer and more understandable, the following further elaborates on the embodiments of the present invention with reference to the accompanying drawings. Herein, the illustrative embodiments of the present invention and their descriptions are used to explain the present invention, but not to limit the present invention.
[0044] The applicant has found that when allocating abnormal data units in the existing distributed system abnormal data processing method, the scheme logic design is relatively complex and difficult. Therefore, the applicant has proposed a distributed system abnormal data processing method to improve the existing processing mechanism of abnormal data units, reduce the difficulty of distributed system abnormal data processing, and expand the application scenarios of distributed system abnormal data processing.
[0045] In the technical solution of this application, the acquisition, storage, use, processing, etc. of data all comply with the relevant provisions of national laws and regulations.
[0046] Figure 1 It is a schematic flowchart of the distributed system abnormal data processing method in the embodiments of the present invention applied to the first application server. Figure 1 In the figure, the distributed system includes a shared server and multiple application servers. The shared server is used to allocate abnormal data processing tasks to the application servers, and the application servers are used to execute abnormal data service logic processing. The method is applied to the first application server, and the first application server is any one of the application servers. The method includes:
[0047] Step 101: Receive an abnormal data processing task.
[0048] Step 102: Send the identification information of the abnormal data unit and the identification information of the first application server to the shared server.
[0049] Step 103: Receive a message indicating successful storage.
[0050] Step 104: Execute abnormal data service logic processing according to the identification information of the abnormal data unit. When the end time point of the first preset duration is not reached, send the second preset duration information for requesting to extend the storage of the identification information of the abnormal data unit and the identification information of the first application server to the shared server at a preset frequency.
[0051] Step 105: When the data service logic processing of the abnormal data unit is completed, send a message indicating completion of processing to the shared server, so that the shared server deletes the identification information of the abnormal data unit and the identification information of the first application server according to the message indicating completion of processing.
[0052] Reference Figure 1As can be seen from the process, in the embodiments of the present invention, by storing the identification information of the abnormal data unit and the identification information of the application server in the shared server, only when the storage is successful can the application server execute the business logic processing of the abnormal data unit. Through this method, it is realized that other application servers are prohibited from executing the abnormal data business logic processing according to the abnormal data unit, and the purpose of locking the abnormal data unit is achieved. Moreover, the storage duration is extended regularly at a preset frequency to achieve repeated locking, which can effectively avoid situations such as the application server crashing or malfunctioning. And all application servers adopt the same method of locking and extending the lock, avoiding the situation in the prior art where each application server sets its own locking duration separately, making the solution implementation simpler, reducing the difficulty of abnormal data processing in the distributed system, and expanding the application scenarios of abnormal data processing in the distributed system.
[0053] The following specifically explains Figure 1 the distributed system abnormal data processing method shown in
[0054] First of all, it should be noted that in the embodiments of the present invention, the distributed system includes a shared server and multiple application servers. The shared server is used to allocate abnormal data processing tasks to the application servers, store the identification information of the abnormal data unit and the identification information of the application servers, receive the storage requests of the application servers, etc. The application server is mainly used to execute the abnormal data business logic processing according to the identification information of the abnormal data unit. Among them, the identification information of the abnormal data unit can be the name of the abnormal data unit, ID, the name of the business module where the abnormal data unit is located, etc., and the identification information of the application server can be the IP address of the application server, arrangement serial number, etc.
[0055] The overall processing link of the distributed system abnormal data processing method in the present invention refers to Figure 2 , Figure 2 which is a specific embodiment of the distributed system abnormal data processing method in the embodiments of the present invention. As shown in Figure 2 , first, the shared server simultaneously issues abnormal data processing tasks to multiple application servers. After each application server receives the processing task, it requests to lock the abnormal data unit from the shared server according to the identification information of the abnormal data unit to be processed. Only after the lock is successful can it execute the abnormal data business logic processing according to the identification information of the abnormal data unit. During the processing, it requests to extend the lock from the shared server at a preset frequency until the business logic processing is completed, and then requests to release the lock of the abnormal data unit from the shared server. It should be noted that in the embodiments of the present invention, the shared server sets a specific duration for locking the abnormal data unit. Under normal circumstances, when requesting to lock for the first time, as long as the locking duration reaches the specific duration, the abnormal data unit will be unlocked. From Figure 2As can be seen from the method shown, in the embodiment of the present invention, by continuously extending the duration of locking the abnormal data unit, situations such as system anomalies or the long-term locking of data units that cannot be released due to application server failures are avoided. For example, if an application server fails, it will not be able to request an extension of the lock from the shared server at the preset frequency. Then, after the locking duration expires, the shared server will automatically unlock the abnormal data unit so that other servers can continue to process the abnormal data unit. Through frequent re-locking, while ensuring that a data unit can only be processed by one application server, a certain degree of anomaly disaster tolerance can be achieved.
[0056] Figure 1 In this case, the first application server receives an abnormal data processing task, and the abnormal data processing task includes the identification information of the abnormal data unit. The first application server can be any application server. Among them, the abnormal data processing task is assigned by the shared server. The shared server pre-allocates the identification information of all abnormal data units to be processed to all application servers in the distributed system according to a preset method. The preset method includes, for example, numbering the application servers and evenly allocating the identification information of all abnormal data units to be processed to each application server according to the number of all abnormal data units to be processed and the numbers of the application servers. Another example is to install different business applications on each application server. The types of abnormal data units that each application server can process are limited and selectable. The shared server allocates the identification information of all abnormal data units to be processed to the corresponding application servers according to the types of abnormal data units that the application servers can process.
[0057] In one embodiment, receiving the abnormal data processing task may include:
[0058] Receiving the abnormal data processing task allocated by the shared server according to a pre-established task allocation table; the task allocation table stores the corresponding relationship between the identification information of the abnormal data unit and the identification information of the application server. The corresponding relationship between the identification information of the abnormal data unit and the identification information of the application server is determined according to the business logic for performing calculations using the abnormal data unit and the business applications installed on the application server. Among them, the business logic corresponds to the business application.
[0059] In this example, according to the business logic for performing calculations using the abnormal data unit and the business applications installed on the application server, a task allocation table is established. When an abnormal data unit to be processed is obtained, the appropriate application server is determined according to the task allocation table to achieve accurate task distribution.
[0060] After the first application server receives the abnormal data processing task, it extracts the identification information of the abnormal data unit therein and starts the locking process.
[0061] In the embodiment of the present invention, locking is achieved by storing in a shared server. Specifically, the first application server sends the identification information of the abnormal data unit and the identification information of the first application server to the shared server, so that the shared server: 1. Determine whether the identification information of the abnormal data unit and the identification information of other application servers except the first application server have been stored; 2. When the identification information of the abnormal data unit and the identification information of other application servers except the first application server have been stored, reject storing the identification information of the abnormal data unit and the identification information of the first application server; 3. When the identification information of the abnormal data unit and the identification information of other application servers except the first application server have not been stored, store the identification information of the abnormal data unit and the identification information of the first application server; 4. Send a message indicating successful storage to the first application server. Among them, in the shared server, the storage duration of the identification information of the abnormal data unit and the identification information of the first application server is the first preset duration. When the end time point of the first preset duration is reached, the shared server deletes the identification information of the abnormal data unit and the identification information of the first application server.
[0062] In one embodiment, the identification information of the abnormal data unit and the identification information of the first application server are stored in the shared server in the form of key-value pairs, where the key is the identification information of the abnormal data unit and the value is the identification information of the first application server. For example, store the IP address information of the application server into a key-value storage module such as Redis. This storage module is the module responsible for locking processing in the shared server and mainly executes Figure 3 、 Figure 5 the method shown.
[0063] Figure 3 This is a specific embodiment of the method for processing abnormal data in a distributed system in the embodiment of the present invention. As Figure 3 shown, it shows the locking processing process of the shared server:
[0064] 1. For the identification information of the abnormal data unit and the identification information of the first application server sent by the first application server, first determine whether the identification information of the abnormal data unit has been stored in pairs with the identification information of other application servers; if it has been stored, the first application server can no longer process this abnormal data unit, that is, the shared server rejects locking;
[0065] 2. If not stored, the shared server stores the identification information of the abnormal data unit and the identification information of the first application server in key-value pairs;
[0066] 3. When the storage is successful, feedback the message of successful storage to the first application server; when the storage fails, which means the locking fails, at this time, it is also necessary to send the message of locking failure to the first application server so that the first application server can send the identification information of the abnormal data unit and the identification information of the first application server to the shared server for storage again;
[0067] 4. Preset a first preset duration in the shared server, such as 30 seconds or 40 seconds. The shared server only stores the identification information of the abnormal data unit and the identification information of the first application server for 30 seconds and automatically deletes them after 30 seconds.
[0068] Therefore, the first application server needs to request an extension of the storage from the shared server subsequently to avoid contradictions in the business logic processing.
[0069] In step 104, the first application server performs abnormal data business logic processing according to the identification information of the abnormal data unit. When the end time point of the first preset duration is not reached, it is necessary to send the second preset duration information for requesting an extension of the storage of the identification information of the abnormal data unit and the identification information of the first application server to the shared server at a preset frequency.
[0070] That is, before the business logic processing of the first application server is completed and before the time point of the first preset duration is reached, request an extension of the locking from the shared server.
[0071] For example, referring to Figure 2 in, the first application server pre-sets multiple time points at a preset frequency and requests an extension from the shared server at each time point before the business logic processing is completed.
[0072] In the first application server, the business logic processing and the request for locking are in different and concurrent threads.
[0073] Among them, the second preset duration is greater than the reciprocal of the preset frequency.
[0074] For example, the preset frequency is F times per second, and each time the second preset duration is requested for locking from the shared server. This second preset duration can be, for example, 2 / F seconds. Ensure that the locking duration is extended before it reaches.
[0075] When the data business logic processing of the abnormal data unit is completed, send the message of processing completion to the shared server so that the shared server: deletes the identification information of the abnormal data unit and the identification information of the first application server according to the message of processing completion.
[0076] In one embodiment, the message of processing completion includes the identification information of the processed abnormal data unit and the identification information of the first application server that performs the processing;
[0077] When the data service logic processing of the abnormal data unit is completed, send the message indicating the completion of processing to the shared server, so that the shared server: according to the message indicating the completion of processing, delete the identification information of the abnormal data unit and the identification information of the first application server, which may include:
[0078] When the data service logic processing of the abnormal data unit is completed, send the identification information of the processed abnormal data unit and the identification information of the first application server that executes the processing to the shared server, so that the shared server: compare the identification information of the processed abnormal data unit and the identification information of the first application server that executes the processing with the identification information of the abnormal data unit and the identification information of the first application server stored in the form of key-value pairs. When the comparison is successful, delete the identification information of the abnormal data unit and the identification information of the first application server.
[0079] In this example, when unlocking, it is necessary to compare whether the received application server identification information matches the stored key-value pair information. After the match is consistent, delete the key-value pair information to achieve unlocking.
[0080] In one embodiment, the application server further includes an asynchronous processing locking process. In step 101, the received abnormal data processing task carries the identification information of multiple abnormal data units. The application server constructs a list of units to be locked according to the identification information of the multiple abnormal data units, and sequentially executes the locking process according to the order of the list of units to be locked. Refer to Figure 4 , Figure 4 This is a specific implementation of the method for processing abnormal data in a distributed system in an embodiment of the present invention. As Figure 4 shown, the asynchronous processing locking process includes obtaining the constructed list of units to be locked, obtaining the next data unit, locking the data unit, and then obtaining the next data unit, and determining whether the current virtual machine (application server) holds the data unit. When the data unit is not held, interrupt the task of processing the data unit.
[0081] Figure 5 This is a schematic flowchart of the method for processing abnormal data in a distributed system in an embodiment of the present invention, applied to the shared server. Figure 5 In, the distributed system includes a shared server and multiple application servers. The shared server is used to allocate abnormal data processing task data to the application servers, and the application servers are used to execute data service logic processing for abnormal data. The method is applied to the shared server and includes:
[0082] Step 501: Send an abnormal data processing task to the first application server;
[0083] Step 502: Receive the identification information of the abnormal data unit and the identification information of the first application server sent by the first application server;
[0084] Step 503: Determine whether the identification information of the abnormal data unit and the identification information of other application servers except the first application server have been stored. When the identification information of the abnormal data unit and the identification information of other application servers except the first application server have not been stored, store the identification information of the abnormal data unit and the identification information of the first application server; wherein, the storage duration of the identification information of the abnormal data unit and the identification information of the first application server is the first preset duration. When the end time point of the first preset duration is reached, delete the identification information of the abnormal data unit and the identification information of the first application server.
[0085] Step 504: Send a message indicating successful storage to the first application server.
[0086] Step 505: Receive the second preset duration information sent by the first application server to request an extension of the storage duration of the identification information of the abnormal data unit and the identification information of the first application server.
[0087] Step 506: Extend the storage duration of the identification information of the abnormal data unit and the identification information of the first application server according to the second preset duration information.
[0088] Step 507: Delete the identification information of the abnormal data unit and the identification information of the first application server according to the message indicating the completion of processing sent by the first application server.
[0089] Figure 5 The method shown and Figure 1 is basically the same, the difference being Figure 5 is applied to the shared server in Figure 1 is applied to the application server in
[0090] Refer to Figure 5 According to the process, in the embodiments of the present invention, by storing the identification information of the abnormal data unit and the identification information of the application server in the shared server, only when the storage is successful can the application server execute the business logic processing of the abnormal data unit. Through this method, it is achieved to prohibit other application servers from executing the abnormal data business logic processing according to the abnormal data unit, and the purpose of locking the abnormal data unit is realized. Moreover, the storage duration is extended regularly at a preset frequency to achieve repeated locking, which can effectively avoid situations such as application server downtime and failures. And all application servers adopt the same method of locking and extending the lock, avoiding the situation in the prior art where each application server separately sets its own locking duration, making the solution implementation simpler, reducing the difficulty of abnormal data processing in the distributed system, and expanding the application scenarios of abnormal data processing in the distributed system.
[0091] Figure 5Among them, the shared server issues an abnormal data processing task to the first application server. During implementation, the shared server pre-allocates the identification information of all abnormal data units to be processed to all application servers in the distributed system according to a preset method. The preset method includes, for example, numbering the application servers and evenly allocating the identification information of all abnormal data units to be processed to each application server according to the number of all abnormal data units to be processed and the numbers of the application servers. Another example is to install different business applications on each application server. The types of abnormal data units that each application server can process are limited and selectable. The shared server allocates the identification information of all abnormal data units to be processed to the corresponding application servers according to the types of abnormal data units that the application servers can process.
[0092] In one embodiment, issuing an abnormal data processing task to the first application server includes:
[0093] Issuing an abnormal data processing task to the first application server according to a pre-established task allocation table; the task allocation table stores the corresponding relationship between the identification information of the abnormal data units and the identification information of the application servers. The corresponding relationship between the identification information of the abnormal data units and the identification information of the application servers is determined according to the business logic for performing calculations using the abnormal data units and the business applications installed on the application servers. Among them, the business logic corresponds to the business application.
[0094] In this example, according to the business logic for performing calculations using the abnormal data units and the business applications installed on the application servers, a task allocation table is established. When an abnormal data unit to be processed is obtained, the appropriate application server is determined according to the task allocation table to achieve accurate task issuance.
[0095] After receiving the abnormal data processing task, the first application server extracts the identification information of the abnormal data units therein and starts the locking process. The first application server sends the identification information of the abnormal data units and the identification information of the first application server to the shared server.
[0096] The shared server refers to Figure 3 the method shown in
[0097] to execute the locking process. It should be noted that this locking process can be executed by a storage module in the shared server. During the first storage, the storage time is the first preset duration. When the storage duration is met, the shared server automatically deletes the key-value pair information. This is the characteristic of the storage module in the shared server.
[0097] Due to the characteristics of the storage module in the shared server, the application server needs to request an extension of the lock before the local task is completed and frequently and repeatedly request an extension of the lock according to the actual processing situation. For example, refer to Figure 2Among them, the first application server requests to extend the lock to the shared server at a preset frequency. During implementation, multiple time points are determined at the preset frequency, and a request to extend is sent to the shared server at each time point before the business logic processing is completed.
[0098] Among them, the second preset duration is less than the reciprocal of the preset frequency.
[0099] Each time the application server requests an extension to the second preset duration from the shared server, it can be determined according to the preset frequency, that is, to ensure that the lock duration is extended before it reaches.
[0100] Finally, when the business logic processing of the application server is completed, according to the message indicating the completion of processing sent by the application server, the identification information of the abnormal data unit and the identification information of the application server are deleted to achieve unlocking.
[0101] In one embodiment, storing the identification information of the abnormal data unit and the identification information of the first application server includes:
[0102] Storing the identification information of the abnormal data unit and the identification information of the first application server in the form of key-value pairs, where the key is the identification information of the abnormal data unit and the value is the identification information of the first application server.
[0103] In one embodiment, the message indicating the completion of processing includes the identification information of the processed abnormal data unit and the identification information of the first application server that performs the processing;
[0104] According to the message indicating the completion of processing sent by the first application server, deleting the identification information of the abnormal data unit and the identification information of the first application server includes:
[0105] Comparing the identification information of the processed abnormal data unit and the identification information of the first application server that performs the processing with the identification information of the abnormal data unit and the identification information of the first application server stored in the form of key-value pairs. When the comparison is successful, the identification information of the abnormal data unit and the identification information of the first application server are deleted.
[0106] In summary, in the embodiments of the present invention, through the locking process of the cooperation between the application server and the shared server, the business complexity of the resource allocation function is reduced. Through the repeated lock extension mechanism, the unification of the lock timeout time is achieved, and the modification permission control during concurrent operations is realized, avoiding data anomalies caused by concurrent processing.
[0107] In the embodiments of the present invention, a distributed system abnormal data processing device is also provided as described in the following embodiments. Since the principle of the device for solving problems is similar to that of the distributed system abnormal data processing method, the implementation of the device can refer to the implementation of the distributed system abnormal data processing method, and the repeated parts will not be described again.
[0108] Figure 6 A schematic diagram of the abnormal data processing device in the embodiment of the present invention, which is applied to the first application server. The distributed system includes a shared server and multiple application servers. The shared server is used to allocate abnormal data processing tasks to the application servers, and the application servers are used to execute abnormal data service logic processing. The device is applied to the first application server, and the first application server is any one of the application servers. For example Figure 6 As shown, the device includes:
[0109] A task receiving module 601, configured to receive an abnormal data processing task; the abnormal data processing task includes identification information of an abnormal data unit;
[0110] A request locking module 602, configured to send the identification information of the abnormal data unit and the identification information of the first application server to the shared server, so that the shared server: determines whether the identification information of the abnormal data unit and the identification information of other application servers except the first application server have been stored. When the identification information of the abnormal data unit and the identification information of other application servers except the first application server have not been stored, stores the identification information of the abnormal data unit and the identification information of the first application server, and sends a message indicating successful storage to the first application server; wherein, the storage duration of the identification information of the abnormal data unit and the identification information of the first application server is a first preset duration. When reaching the end time point of the first preset duration, the shared server deletes the identification information of the abnormal data unit and the identification information of the first application server; receives the message indicating successful storage;
[0111] A request locking extension module 603, configured to execute abnormal data service logic processing according to the identification information of the abnormal data unit. When the end time point of the first preset duration has not been reached, sends second preset duration information for requesting to extend the storage of the identification information of the abnormal data unit and the identification information of the first application server to the shared server at a preset frequency, so that the shared server: extends the storage duration of the identification information of the abnormal data unit and the identification information of the first application server according to the second preset duration information, and sends a message indicating successful extension of the storage duration to the first application server; the second preset duration is greater than the reciprocal of the preset frequency;
[0112] A task end module 604, configured to send a message indicating that the processing is completed to the shared server when the data service logic processing of the abnormal data unit is completed, so that the shared server: deletes the identification information of the abnormal data unit and the identification information of the first application server according to the message indicating that the processing is completed.
[0113] In one embodiment, the task receiving module 601 is specifically configured to:
[0114] Receive the exception data processing task assigned by the shared server according to the pre-established task assignment form; the task assignment form stores the corresponding relationship between the identification information of the exception data unit and the identification information of the application server. The corresponding relationship between the identification information of the exception data unit and the identification information of the application server is determined according to the business logic for performing calculations using the exception data unit and the business applications installed on the application server. Among them, the business logic corresponds to the business application.
[0115] In one embodiment, the identification information of the exception data unit and the identification information of the first application server are stored in the shared server in the form of key-value pairs, where the key is the identification information of the exception data unit and the value is the identification information of the first application server.
[0116] In one embodiment, the processing completion message includes the identification information of the processed exception data unit and the identification information of the first application server that performs the processing;
[0117] The task end module 604 is specifically configured to:
[0118] When the data service logic processing of the exception data unit is completed, send the identification information of the processed exception data unit and the identification information of the first application server that performs the processing to the shared server, so that the shared server: compare the identification information of the processed exception data unit and the identification information of the first application server that performs the processing with the identification information of the exception data unit and the identification information of the first application server stored in the form of key-value pairs. When the comparison is successful, delete the identification information of the exception data unit and the identification information of the first application server.
[0119] Figure 7 It is a schematic diagram of the distributed system exception data processing device in an embodiment of the present invention, which is applied to the shared server. The distributed system includes a shared server and multiple application servers. The shared server is used to allocate exception data processing task data to the application servers, and the application servers are used to perform exception data service logic processing. The device is applied to the shared server, as Figure 7 shown, the device includes:
[0120] The task distribution module 701 is used to send the exception data processing task to the first application server, so that the first application server: send the identification information of the exception data unit and the identification information of the first application server to the shared server; the exception data processing task includes the identification information of the exception data unit; the first application server is any one of the application servers.
[0121] The locking module 702 is configured to receive the identification information of the abnormal data unit and the identification information of the first application server sent by the first application server; determine whether the identification information of the abnormal data unit and the identification information of other application servers except the first application server have been stored. When the identification information of the abnormal data unit and the identification information of other application servers except the first application server have not been stored, store the identification information of the abnormal data unit and the identification information of the first application server; wherein, the storage duration of the identification information of the abnormal data unit and the identification information of the first application server is the first preset duration. When the end time point of the first preset duration is reached, delete the identification information of the abnormal data unit and the identification information of the first application server; send a message indicating successful storage to the first application server, so that the first application server: execute abnormal data service logic processing according to the identification information of the abnormal data unit. When the end time point of the first preset duration has not been reached, send the second preset duration information for requesting to extend the storage of the identification information of the abnormal data unit and the identification information of the first application server to the shared server at a preset frequency; the second preset duration is less than the reciprocal of the preset frequency.
[0122] The locking extension module 703 is configured to receive the second preset duration information sent by the first application server for requesting to extend the storage of the identification information of the abnormal data unit and the identification information of the first application server; extend the storage duration of the identification information of the abnormal data unit and the identification information of the first application server according to the second preset duration information, and send a message indicating successful extension of the storage duration to the first application server, so that the first application server: execute abnormal data service logic processing according to the identification information of the abnormal data unit. When the data service logic processing of the abnormal data unit is completed, send a message indicating completion of processing to the shared server.
[0123] The locking release module 704 is configured to delete the identification information of the abnormal data unit and the identification information of the first application server according to the message indicating completion of processing sent by the first application server.
[0124] In one embodiment, the task distribution module 701 is specifically configured to:
[0125] According to a pre-established task assignment table, issue an abnormal data processing task to the first application server; the task assignment table stores the correspondence between the identification information of the abnormal data unit and the identification information of the application server. The correspondence between the identification information of the abnormal data unit and the identification information of the application server is determined according to the service logic for performing calculations using the abnormal data unit and the service applications installed on the application server, where the service logic corresponds to the service application.
[0126] In one embodiment, the locking module 702 is specifically configured to:
[0127] Store the identification information of the abnormal data unit and the identification information of the first application server in the form of key-value pairs, where the key is the identification information of the abnormal data unit and the value is the identification information of the first application server.
[0128] In one embodiment, the processed message includes the identification information of the processed abnormal data unit and the identification information of the first application server that performs the processing.
[0129] The lock release module 704 is specifically configured to:
[0130] Compare the identification information of the processed abnormal data unit and the identification information of the first application server that performs the processing with the identification information of the abnormal data unit and the identification information of the first application server stored in the form of key-value pairs. When the comparison is successful, delete the identification information of the abnormal data unit and the identification information of the first application server.
[0131] An embodiment of the present invention further provides a computer device, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, the above-mentioned distributed system abnormal data processing method is implemented.
[0132] An embodiment of the present invention further provides a computer-readable storage medium. The computer-readable storage medium stores a computer program. When the computer program is executed by a processor, the above-mentioned distributed system abnormal data processing method is implemented.
[0133] An embodiment of the present invention further provides a computer program product. The computer program product includes a computer program. When the computer program is executed by a processor, the above-mentioned distributed system abnormal data processing method is implemented.
[0134] In the embodiment of the present invention, by storing the identification information of the abnormal data unit and the identification information of the application server in the shared server, only when the storage is successful can the application server execute the business logic processing of the abnormal data unit. Through this method, it is realized to prohibit other application servers from executing the abnormal data business logic processing according to the abnormal data unit, and the purpose of locking the abnormal data unit is achieved. Moreover, the storage duration is extended regularly at a preset frequency to achieve repeated locking, which can effectively avoid situations such as application server downtime and failures. And all application servers adopt the same method of locking and extending the lock, avoiding the situation in the prior art where each application server sets its own locking duration separately. The solution is more simple to implement, reduces the difficulty of distributed system abnormal data processing, and expands the application scenarios of distributed system abnormal data processing.
[0135] Those skilled in the art should understand that the embodiments of the present invention can be provided as a method, a system, or a computer program product. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present invention can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk memory, CD-ROM, optical memory, etc.) that contain computer-usable program code.
[0136] The present invention is described with reference to the flowcharts and / or block diagrams of methods, apparatuses (systems), and computer program products according to embodiments of the present invention. It should be understood that each flow and / or block in the flowchart and / or block diagram, and the combination of flows and / or blocks in the flowchart and / or block diagram, can be realized by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to generate a machine, such that the instructions executed by the processor of the computer or other programmable data processing devices generate means for realizing the functions specified in Figure 1 one flow or multiple flows and / or blocks Figure 1 one block or multiple blocks.
[0137] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, such that the instructions stored in the computer-readable memory generate a manufactured article including instruction means that realize the functions specified in Figure 1 one flow or multiple flows and / or blocks Figure 1 one block or multiple blocks.
[0138] These computer program instructions can also be loaded onto a computer or other programmable data processing device, such that a series of operation steps are executed on the computer or other programmable device to generate a computer-implemented process, and thus the instructions executed on the computer or other programmable device provide steps for realizing the functions specified in Figure 1 one flow or multiple flows and / or blocks Figure 1 one block or multiple blocks.
[0139] The specific embodiments described above further elaborate on the objectives, technical solutions, and beneficial effects of the present invention. It should be understood that the above are only specific embodiments of the present invention and are not used to limit the protection scope of the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present invention shall be included in the protection scope of the present invention.
Claims
1. A method for processing abnormal data in a distributed system, characterized in that The distributed system includes a shared server and multiple application servers. The shared server is used to allocate abnormal data processing tasks to the application servers, and the application servers are used to execute the business logic processing of abnormal data. The method is applied to a first application server, and the first application server is any one of the application servers, including: Receiving an abnormal data processing task; the abnormal data processing task includes the identification information of the abnormal data unit; Sending the identification information of the abnormal data unit and the identification information of the first application server to the shared server, so that the shared server: determines whether the identification information of the abnormal data unit and the identification information of other application servers except the first application server have been stored. When the identification information of the abnormal data unit and the identification information of other application servers except the first application server have not been stored, stores the identification information of the abnormal data unit and the identification information of the first application server, and sends a message indicating successful storage to the first application server; wherein, in the shared server, the storage duration of the identification information of the abnormal data unit and the identification information of the first application server is a first preset duration. When the end time point of the first preset duration is reached, the shared server deletes the identification information of the abnormal data unit and the identification information of the first application server; Receiving the message indicating successful storage; Performing business logic processing on the abnormal data according to the identification information of the abnormal data unit. When the end time point of the first preset duration has not been reached, sending the second preset duration information for requesting to extend the storage of the identification information of the abnormal data unit and the identification information of the first application server to the shared server at a preset frequency, so that the shared server: according to the second preset duration information, extends the storage duration of the identification information of the abnormal data unit and the identification information of the first application server, and sends a message indicating successful extension of the storage duration to the first application server; the second preset duration is greater than the reciprocal of the preset frequency; When the data business logic processing of the abnormal data unit is completed, sending a message indicating completion of processing to the shared server, so that the shared server: according to the message indicating completion of processing, deletes the identification information of the abnormal data unit and the identification information of the first application server.
2. The method according to claim 1, characterized in that, Receiving the abnormal data processing task includes: Receiving the abnormal data processing task allocated by the shared server according to the pre-established task allocation table; the task allocation table stores the corresponding relationship between the identification information of the abnormal data unit and the identification information of the application server. The corresponding relationship between the identification information of the abnormal data unit and the identification information of the application server is determined according to the business logic of performing calculations using the abnormal data unit and the business applications installed on the application server. Among them, the business logic corresponds to the business application.
3. The method according to claim 1, characterized in that, The identification information of the abnormal data unit and the identification information of the first application server are stored in the shared server in the form of key-value pairs, where the key is the identification information of the abnormal data unit and the value is the identification information of the first application server.
4. The method according to claim 3, characterized in that, The message indicating completion of processing includes the identification information of the abnormal data unit that has been processed and the identification information of the first application server that performed the processing; When the data service logic processing of the abnormal data unit is completed, send the message indicating the completion of the processing to the shared server, so that the shared server: delete the identification information of the abnormal data unit and the identification information of the first application server according to the message indicating the completion of the processing, including: When the data service logic processing of the abnormal data unit is completed, send the identification information of the processed abnormal data unit and the identification information of the first application server that executes the processing to the shared server, so that the shared server: compare the identification information of the processed abnormal data unit and the identification information of the first application server that executes the processing with the identification information of the abnormal data unit and the identification information of the first application server stored in the form of key-value pairs. When the comparison is successful, delete the identification information of the abnormal data unit and the identification information of the first application server.
5. A method for processing abnormal data in a distributed system, characterized in that, The distributed system includes a shared server and multiple application servers. The shared server is used to allocate abnormal data processing task data to the application servers, and the application servers are used to execute the data service logic processing of the abnormal data. The method is applied to the shared server and includes: Send an abnormal data processing task to the first application server, so that the first application server: send the identification information of the abnormal data unit and the identification information of the first application server to the shared server; the abnormal data processing task includes the identification information of the abnormal data unit; the first application server is any one of the application servers; Receive the identification information of the abnormal data unit and the identification information of the first application server sent by the first application server; Determine whether the identification information of the abnormal data unit and the identification information of other application servers except the first application server have been stored. When the identification information of the abnormal data unit and the identification information of other application servers except the first application server have not been stored, store the identification information of the abnormal data unit and the identification information of the first application server; wherein, the storage duration of the identification information of the abnormal data unit and the identification information of the first application server is the first preset duration. When the end time point of the first preset duration is reached, delete the identification information of the abnormal data unit and the identification information of the first application server; Send a message indicating successful storage to the first application server, so that the first application server: execute the data service logic processing of the abnormal data according to the identification information of the abnormal data unit. When the end time point of the first preset duration has not been reached, send the second preset duration information for requesting to extend the storage of the identification information of the abnormal data unit and the identification information of the first application server to the shared server at a preset frequency; the second preset duration is less than the reciprocal of the preset frequency; Receive the second preset duration information for requesting to extend the storage of the identification information of the abnormal data unit and the identification information of the first application server sent by the first application server; According to the second preset duration information, extend the storage duration of the identification information of the abnormal data unit and the identification information of the first application server, and send a message indicating successful extension of the storage duration to the first application server, so that the first application server: execute the abnormal data service logic processing according to the identification information of the abnormal data unit, and when the data service logic processing of the abnormal data unit is completed, send a message indicating completion of processing to the shared server; Delete the identification information of the abnormal data unit and the identification information of the first application server according to the message indicating completion of processing sent by the first application server.
6. The method according to claim 5, wherein Send an abnormal data processing task to the first application server, including: Send an abnormal data processing task to the first application server according to the pre-established task allocation table; the task allocation table stores the corresponding relationship between the identification information of the abnormal data unit and the identification information of the application server. The corresponding relationship between the identification information of the abnormal data unit and the identification information of the application server is determined according to the service logic for performing calculations using the abnormal data unit and the service applications installed on the application server, where the service logic corresponds to the service application.
7. The method according to claim 5, wherein Store the identification information of the abnormal data unit and the identification information of the first application server, including: Store the identification information of the abnormal data unit and the identification information of the first application server in the form of key-value pairs, where the key is the identification information of the abnormal data unit and the value is the identification information of the first application server.
8. The method according to claim 5, wherein The message indicating completion of processing includes the identification information of the abnormal data unit that has been processed and the identification information of the first application server that performed the processing; Delete the identification information of the abnormal data unit and the identification information of the first application server according to the message indicating completion of processing sent by the first application server, including: Compare the identification information of the abnormal data unit that has been processed and the identification information of the first application server that performed the processing with the identification information of the abnormal data unit and the identification information of the first application server stored in the form of key-value pairs. When the comparison is successful, delete the identification information of the abnormal data unit and the identification information of the first application server.
9. A distributed system abnormal data processing device, characterized in that The distributed system includes a shared server and multiple application servers. The shared server is used to allocate abnormal data processing tasks to the application servers, and the application servers are used to execute abnormal data service logic processing. The device is applied to the first application server, and the first application server is any one of the application servers, including: A task receiving module, configured to receive an abnormal data processing task; the abnormal data processing task includes the identification information of the abnormal data unit; The request locking module is used to send the identification information of the abnormal data unit and the identification information of the first application server to the shared server, so that the shared server can: determine whether the identification information of the abnormal data unit and the identification information of other application servers except the first application server have been stored. When the identification information of the abnormal data unit and the identification information of other application servers except the first application server have not been stored, store the identification information of the abnormal data unit and the identification information of the first application server, and send a message indicating successful storage to the first application server; wherein, the storage duration of the identification information of the abnormal data unit and the identification information of the first application server is the first preset duration. When the end time point of the first preset duration is reached, the shared server deletes the identification information of the abnormal data unit and the identification information of the first application server; receive the message indicating successful storage; The request locking extension module is used to perform abnormal data service logic processing according to the identification information of the abnormal data unit. When the end time point of the first preset duration has not been reached, send the second preset duration information for requesting to extend the storage of the identification information of the abnormal data unit and the identification information of the first application server to the shared server at a preset frequency, so that the shared server can: according to the second preset duration information, extend the storage duration of the identification information of the abnormal data unit and the identification information of the first application server, and send a message indicating successful extension of the storage duration to the first application server; the second preset duration is greater than the reciprocal of the preset frequency; The task end module is used to send a message indicating that the processing is completed to the shared server when the data service logic processing of the abnormal data unit is completed, so that the shared server can: delete the identification information of the abnormal data unit and the identification information of the first application server according to the message indicating that the processing is completed.
10. A distributed system abnormal data processing device, characterized in that, The distributed system includes a shared server and multiple application servers. The shared server is used to allocate abnormal data processing task data to the application servers, and the application servers are used to perform abnormal data service logic processing. The device is applied to the shared server and includes: The task distribution module is used to distribute an abnormal data processing task to the first application server, so that the first application server can: send the identification information of the abnormal data unit and the identification information of the first application server to the shared server; the abnormal data processing task includes the identification information of the abnormal data unit; the first application server is any one of the application servers, A locking module, configured to receive the identification information of an abnormal data unit and the identification information of a first application server sent by the first application server; determine whether the identification information of the abnormal data unit and the identification information of other application servers except the first application server have been stored, and when the identification information of the abnormal data unit and the identification information of other application servers except the first application server have not been stored, store the identification information of the abnormal data unit and the identification information of the first application server; wherein, the storage duration of the identification information of the abnormal data unit and the identification information of the first application server is a first preset duration, and when the end time point of the first preset duration is reached, delete the identification information of the abnormal data unit and the identification information of the first application server; send a message indicating successful storage to the first application server, so that the first application server: perform abnormal data service logic processing according to the identification information of the abnormal data unit, and when the end time point of the first preset duration has not been reached, send the second preset duration information for requesting to extend the storage of the identification information of the abnormal data unit and the identification information of the first application server to the shared server at a preset frequency; the second preset duration is less than the reciprocal of the preset frequency. A locking extension module, configured to receive the second preset duration information for requesting to extend the storage of the identification information of the abnormal data unit and the identification information of the first application server sent by the first application server; extend the storage duration of the identification information of the abnormal data unit and the identification information of the first application server according to the second preset duration information, and send a message indicating successful extension of the storage duration to the first application server, so that the first application server: perform abnormal data service logic processing according to the identification information of the abnormal data unit, and when the data service logic processing of the abnormal data unit is completed, send a message indicating completion of processing to the shared server. A locking release module, configured to delete the identification information of the abnormal data unit and the identification information of the first application server according to the message indicating completion of processing sent by the first application server.
11. A computer device, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, When the processor executes the computer program, the method according to any one of claims 1 to 8 is implemented.
12. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, and when the computer program is executed by the processor, the method according to any one of claims 1 to 8 is implemented.
13. A computer program product, characterized in that, The computer program product includes a computer program, and when the computer program is executed by the processor, the method according to any one of claims 1 to 8 is implemented.