Data consistency testing methods, devices, electronic equipment and storage media

By acquiring and inspecting the data to be inspected across application services, the problem of high code coupling and high cost in data consistency assurance in existing technologies is solved. Low-intrusion data consistency inspection is achieved, which is applicable to both new and old application services and ensures data consistency during cross-application service calls.

CN116341022BActive Publication Date: 2026-05-26HANGZHOU NETEASE CLOUD MUSIC TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
HANGZHOU NETEASE CLOUD MUSIC TECH CO LTD
Filing Date
2023-03-21
Publication Date
2026-05-26

AI Technical Summary

Technical Problem

Existing cross-application service call methods such as 2PC, 3PC, and TCC suffer from problems such as synchronous blocking, default failure, high code coupling, and high development and maintenance costs when ensuring data consistency, leading to data inconsistency between application services.

Method used

By acquiring the data to be inspected from the first and second application services, it is checked whether the data meets the preset consistency rules. If the data does not meet the rules, the first process is performed to maintain data consistency. The data consistency across application services is detected independently in a low-intrusive manner, including real-time and historical data detection.

Benefits of technology

It achieves data consistency across application services, reduces development and maintenance costs, is applicable to both new and old application services, requires no modification to existing code, and can quickly detect and handle data inconsistency issues.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116341022B_ABST
    Figure CN116341022B_ABST
Patent Text Reader

Abstract

This application provides a data consistency detection method, apparatus, electronic device, and storage medium. The method includes: acquiring data to be inspected, the data to be inspected including first data to be inspected from a first application service and second data to be inspected from a second application service, wherein the first application service and the second application service are any two of a plurality of application services used to execute the same service request; if the first data to be inspected and the second data to be inspected do not meet a preset consistency rule, performing a first processing step to ensure that the data generated by the first application service and the second application service executing the same service request are consistent, thereby verifying whether the data between application services meets the preset consistency rule. When it does not meet the rule, the relevant application service can be subjected to the first processing step to ensure that the data of the application services are consistent, thus ensuring data consistency between application services during cross-service calls.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, specifically to a data consistency detection method, apparatus, electronic device, computer-readable storage medium, and computer program product. Background Technology

[0002] In internet applications, the primary function of application services is to process service requests and return data to the client. Typically, service request processing cannot be completed by a single application service; different application services offer different capabilities due to their different functional divisions. Therefore, application services frequently need to make cross-application service calls.

[0003] Currently, common methods for ensuring data consistency between application services mainly include the following:

[0004] I. Two-Phase Commit (2PC): Two-phase commit is a protocol designed to ensure consistency among all nodes in a distributed system architecture when committing transactions. It is often referred to as a protocol. In a distributed system, while each node knows whether its own operation succeeded or failed, it cannot know whether the operations of other nodes succeeded or failed. When a transaction spans multiple nodes, to guarantee the ACID properties of the transaction, a coordinator component is needed to uniformly control the operation results of all nodes (called participants) and ultimately instruct these nodes whether to actually commit the operation results (e.g., writing the updated data to disk).

[0005] Two-phase commit (3PC): Three-phase commit was designed to address the shortcomings of the two-phase commit protocol. Unlike two-phase commit, three-phase commit is a "non-blocking" protocol. Three-phase commit inserts a preparation phase between the first and second phases of two-phase commit, thus resolving the potentially lengthy delays caused by participants being in an "uncertain state" after voting due to a coordinator crash or error, leaving them unsure whether to commit or abort.

[0006] III. Compensation Transactions (Try-Confirm-Cancel, TCC): For each operation, a corresponding confirmation and cancellation operation is required. When the operation succeeds, the confirmation operation is called; when the operation fails, the cancellation operation is called. This is similar to two-phase commit, except that the commit and rollback here are business-related. Therefore, distributed transactions based on TCC can also be seen as a compensation mechanism for business operations.

[0007] However, among the methods mentioned above, the 2PC protocol suffers from synchronous blocking. During the execution of the two-phase commit, all logic involved in the transaction is blocked. Another issue with 2PC is default failure; only the coordinator has a timeout mechanism, meaning that if no message is received from the participants within a certain time, the transaction defaults to failure. The 3PC protocol solves the synchronous blocking problem of 2PC, but it doesn't address the default failure issue. TCC adds a default compensation mechanism, but the code is highly invasive and has high development costs, making maintenance very difficult.

[0008] Furthermore, the aforementioned methods for ensuring data consistency all involve strong code coupling. On one hand, for new application services, developers need to write functions according to these protocols, and both the caller and the callee of the application service must adhere to these protocols. On the other hand, older application services need to be modified in this way, which is costly and highly invasive. Moreover, it is difficult for technical personnel to manage and control data consistency.

[0009] In other words, in related technologies, failures in cross-application service calls can lead to data inconsistencies between application services. Summary of the Invention

[0010] This application provides a data consistency detection method, apparatus, electronic device, and storage medium to ensure data consistency across application services.

[0011] One aspect of this application provides a data consistency detection method, comprising: acquiring data to be inspected, the data to be inspected including first data to be inspected from a first application service and second data to be inspected from a second application service, wherein the first application service and the second application service are any two of a plurality of application services used to execute the same service request; if the first data to be inspected and the second data to be inspected do not meet a preset consistency rule, performing a first process to ensure that the data generated by the first application service and the second application service executing the same service request are consistent.

[0012] In some embodiments, obtaining the data to be inspected includes: if the time difference between the current time and the time when the service request was generated is greater than or equal to a first preset time, obtaining the data to be inspected.

[0013] In some embodiments, obtaining the data to be inspected includes: obtaining first confirmation data from the first data to be inspected, wherein the first confirmation data is used to indicate that the first application service has sent a cross-service call request to the second application service; obtaining second confirmation data from the second data to be inspected, wherein the second confirmation data is used to indicate that the second application service has sent a first processing result for the cross-service call request to the first application service; and obtaining third confirmation data from the first data to be inspected, wherein the third confirmation data is used to indicate that the first application service has received the first processing result.

[0014] In some embodiments, the step of performing the first processing if the first data to be inspected and the second data to be inspected do not meet the preset consistency rule includes: performing the first processing if the first confirmation data, the second confirmation data, or the third confirmation data is not obtained within the preset delay time; wherein, the preset delay time is the maximum time interval between obtaining two adjacent data.

[0015] In some embodiments, the first data to be inspected includes first business data related to the service request; the second data to be inspected includes second business data related to the service request.

[0016] In some embodiments, the step of performing the first processing if the first data to be inspected and the second data to be inspected do not meet the preset consistency rules includes: performing the first processing if the first business data and the second business data do not match.

[0017] In some embodiments, the first data to be inspected is the first log data of the first application service obtained in real time through the inspected log development kit, and the second data to be inspected is the second log data of the second application service obtained in real time through the inspected log development kit.

[0018] In some embodiments, obtaining the data to be inspected includes: obtaining multiple sets of the data to be inspected based on a first database and a second database, each set of the data to be inspected including a first set of data to be inspected and a second set of data to be inspected corresponding to the first set of data to be inspected; wherein the first set of data to be inspected is stored in the first database and the second set of data to be inspected is stored in the second database.

[0019] In some embodiments, the first database is used to store historical data of the first application service, and the second database is used to store historical data of the second application service; the step of obtaining multiple sets of the data to be inspected based on the first database and the second database includes: obtaining first historical data in the first database and second historical data in the second database within a preset time interval; filtering out multiple sets of the first data to be inspected from the first historical data, and filtering out multiple sets of the second data to be inspected corresponding to the multiple sets of the first data to be inspected from the second historical data, so as to generate multiple sets of the data to be inspected.

[0020] In some embodiments, the step of performing a first process if the first data to be inspected and the second data to be inspected do not meet a preset consistency rule includes: detecting the consistency between the first data to be inspected and the second data to be inspected in each group of data to be inspected; and performing a first process on the mismatched data to be inspected if the first data to be inspected and the second data to be inspected do not match.

[0021] In some embodiments, the first database is a first business database for storing historical business data of the first application service, and the second database is a second business database for storing historical business data of the second application service; or, the first database is a first inspection log database for storing historical inspection log data of the first application service, and the second database is a second inspection log database for storing historical inspection log data of the second application service; or, the first database is a first data warehouse for analyzing the first application service, and the second database is a second data warehouse for analyzing the second application service.

[0022] In some embodiments, performing the first process includes: invoking an external service with compensation functionality in a preset manner to perform compensation processing.

[0023] In some embodiments, the method further includes: sending a warning message if the external service call fails and the number of attempts to call the external service is greater than or equal to a first threshold.

[0024] In some embodiments, performing the first process includes: executing a preset script; the method further includes: if the preset script fails to execute and the number of attempts to execute the preset script is greater than or equal to a second threshold, sending a warning message.

[0025] Another aspect of this application provides a data consistency detection device, comprising: an acquisition unit, configured to acquire data to be inspected, the data to be inspected including first data to be inspected from a first application service and second data to be inspected from a second application service, wherein the first application service and the second application service are any two of a plurality of application services used to execute the same service request; and an execution unit, configured to execute a first processing if the first data to be inspected and the second data to be inspected do not meet a preset consistency rule.

[0026] Another aspect of this application provides an electronic device, including: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to perform the method described in any of the above embodiments by executing the executable instructions.

[0027] Another aspect of this application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the methods described in any of the above embodiments.

[0028] Another aspect of this application provides a computer program product, including a computer program, characterized in that the computer program, when executed by a processor, implements the method as described in any of the above embodiments.

[0029] The data consistency detection method, apparatus, electronic device, and storage medium provided in this application embodiment include: acquiring data to be inspected, the data to be inspected including first data to be inspected from a first application service and second data to be inspected from a second application service, wherein the first application service and the second application service are any two of a plurality of application services used to execute the same service request; if the first data to be inspected and the second data to be inspected do not meet a preset consistency rule, performing a first processing to make the data generated by the first application service and the second application service executing the same service request consistent, thereby verifying whether the data between application services meets the preset consistency rule. When it does not meet the rule, the relevant application service can be subjected to the first processing to make the data of the application services consistent, thereby ensuring the data consistency between application services during cross-service calls. Attached Figure Description

[0030] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0031] Figure 1 This is a schematic diagram of the system structure for applying the data consistency detection method of this application embodiment;

[0032] Figure 2 A flowchart illustrating the data consistency detection method provided in this application embodiment;

[0033] Figure 3 A schematic diagram of a real-time data detection process for a data consistency detection method provided in this application embodiment;

[0034] Figure 4 A schematic diagram of a historical data detection process for a data consistency detection method provided in this application embodiment;

[0035] Figure 5 This is a schematic diagram of the data consistency detection device provided in the embodiments of this application;

[0036] Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0037] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0038] This application provides a data consistency detection method, apparatus, electronic device, and storage medium. Specifically, the data consistency detection method of this application can be executed by an electronic device, which can be a terminal or a server. The terminal can be a smartphone, tablet, laptop, smart voice interaction device, smart home appliance, wearable smart device, aircraft, smart vehicle terminal, etc. The terminal can also include a client, which can be an audio client, video client, browser client, instant messaging client, or mini-program, etc. The server can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery network (CDN), and big data and artificial intelligence platforms.

[0039] First, let's explain the terminology:

[0040] HTTP (Hypertext Transfer Protocol) is a standard for requesting and responding between clients (users) and servers (websites), widely used in various web applications and mobile apps. In summary, the HTTP protocol consists of a URL, a request address, and a response.

[0041] RPC is an abbreviation for Remote Procedure Call. In SAP systems, an RPC call refers to a third-party client program calling a standard or user-defined function within SAP through an interface, obtaining the data returned by the function, processing it, and then displaying or printing it.

[0042] In internet applications, the primary function of application services is to process service requests and return data to the client. Service request processing is typically not something a single application service can handle; different application services offer different capabilities due to their different functionalities. Therefore, application services frequently need to make cross-application service calls, usually using methods such as HTTP and RPC. Because cross-application service calls involve long chains—meaning multiple nested calls and network transmission issues—they are prone to failure. Failures in cross-application service calls can lead to data inconsistencies along the chain.

[0043] To address at least one of the problems in the prior art, embodiments of this application provide a data consistency detection method, apparatus, electronic device, and storage medium. The method includes: acquiring data to be inspected, which includes first data to be inspected from a first application service and second data to be inspected from a second application service, wherein the first and second application services are any two of a plurality of application services used to execute the same service request; if the first and second data to be inspected do not meet a preset consistency rule, performing a first process to ensure that the data generated by the first and second application services executing the same service request are consistent, thereby verifying whether the data between application services meets the preset consistency rule. When the rule is not met, the relevant application service can be subjected to the first process to ensure that the data of the application services are consistent, thus guaranteeing data consistency between application services during cross-service calls.

[0044] The embodiments of this application will be described in detail below with reference to the accompanying drawings.

[0045] Figure 1 This is a schematic diagram of the system structure for applying the data consistency detection method of this application. Please refer to... Figure 1The system includes a terminal 10 and a server 20, etc.; the terminal 10 and the server 20 are connected via a network, such as a wired or wireless network.

[0046] Terminal 10 can be used to display a graphical user interface (GUI). This terminal interacts with the user through the GUI, for example, by downloading and running a client application, by calling and running a mini-program, or by logging into a website and displaying a graphical user interface. In this embodiment, terminal 10 may have a shopping application installed, allowing the user to place orders. Server 20 can obtain data to be inspected, including first data from a first application service and second data from a second application service. The first and second application services are any two of a plurality of application services used to execute the same service request. If the first and second data do not meet a preset consistency rule, a first process is executed to ensure that the data generated by the first and second application services executing the same service request are consistent.

[0047] It should be noted that although a shopping application is used as an example in this description, those skilled in the art should understand that the application can be other suitable programs such as social applications, news applications, etc. Furthermore, the application can be an application installed on a desktop computer, an application installed on a mobile terminal, or a mini-program embedded within an application, etc., and this disclosure does not impose any special limitations in this regard.

[0048] It should be noted that the above application scenarios are shown only to facilitate understanding of the spirit and principles of this disclosure, and the embodiments of this disclosure are not limited in any way. On the contrary, the embodiments of this disclosure can be applied to any applicable scenario.

[0049] The following is a detailed description. It should be noted that the order of description of the following embodiments is not intended to limit the priority of the embodiments.

[0050] Figure 2 A flowchart illustrating the data consistency detection method provided in this application embodiment; please refer to... Figure 2 This application provides a data consistency detection method 100, which includes the following steps S110 and S120.

[0051] Step S110: Obtain the data to be inspected. The data to be inspected includes first data to be inspected from the first application service and second data to be inspected from the second application service. The first application service and the second application service are any two of a plurality of application services used to execute the same service request.

[0052] Step S120: If the first data to be inspected and the second data to be inspected do not meet the preset consistency rules, execute the first processing to ensure that the data generated by the first application service and the second application service that execute the same service request are consistent.

[0053] It's understandable that a service request requires cross-server calls to multiple application services for processing. The first and second application services can be any two of these services. For example, a service request could be a user's order for goods in a shopping application. This request could correspond to multiple application services such as inventory service, order service, logistics service, and bank deduction service. Taking inventory service as the first application service and bank deduction service as the second application service, if the service request corresponds to a user ordering an item priced at 10 RMB, the request would require the first application service to reduce the inventory quantity by 1 and the second application service to deduct 10 RMB from the user's account.

[0054] In addition, the first application service and the second application service can be used as the smallest unit for the data consistency detection method of the service request. If a service request contains 3 application services, the data consistency detection can be performed on the first application service and the second application service first, and then the data consistency detection can be performed on the first application service and the third application service, or the second application service and the third application service, until all application services have been tested for data consistency.

[0055] The data generated by the first application service when executing a service request is the first data to be inspected, and the data generated by the second application service when executing a service request is the second data to be inspected. The first data to be inspected and the second data to be inspected constitute the data to be inspected.

[0056] In step S110, the first data to be inspected generated by the first application service and the second data to be inspected generated by the second application service can be obtained after the service request is executed.

[0057] The preset consistency rule can be a correspondence rule between various application services that request this service. For example, if a user buys an item with a unit price of 10 RMB, the inventory service corresponds to decrementing the inventory by 1, the order service corresponds to increasing the order by 1, and the bank deduction service corresponds to decrementing the user's balance by 10 RMB. This preset consistency rule can adapt to different service requests.

[0058] In step S120, the consistency between the first data to be inspected and the second data to be inspected can be detected. If the first data to be inspected and the second data to be inspected do not meet the preset consistency rules, the first application service and the second application service can be processed to make their data consistent.

[0059] It is understood that the method provided in this embodiment can be used as an independent code module to proactively detect the consistency of data between application services in cross-server calls and process inconsistent data. This proactively identifies and promptly addresses data inconsistencies, ensuring data consistency between application services. This method does not require intrusion into the existing cross-server call code, reducing invasiveness and development costs, and is easy to maintain, allowing developers to have overall control over data consistency.

[0060] In addition, since the data consistency detection method 100 can detect independently and does not affect the cross-service call method used between existing application services, it is applicable to both the development of new application services and the improvement of old application services compared to the 2PC, 3PC and TCC methods in related technologies. It will not increase the difficulty for developers when developing new application services, and will also reduce the code intrusion and development cost when improving old application services.

[0061] In this embodiment, the data consistency detection method can be divided into detection of real-time data and / or detection of historical data. The following explanation will first use the detection of real-time data as an example.

[0062] In some embodiments, obtaining the data to be inspected in step S110 may include: if the time difference between the current time and the time when the service request was generated is greater than or equal to a first preset time, obtaining the data to be inspected.

[0063] The first preset time can be set according to the generation time of the service request. Usually, this value is small, such as a few minutes, and is not much different from the generation time of the service request. The purpose is to ensure that the data to be inspected is acquired after the service request is correctly generated. It can be understood that the data to be inspected in this embodiment is real-time data generated immediately after the service request.

[0064] For example, the first preset time can be 2 minutes, and the service request is generated at the moment the user places the order, that is, the data to be inspected begins to be acquired 2 minutes after the user places the order. Of course, the first preset time can also be 1 minute, 3 minutes, etc.

[0065] This embodiment can acquire real-time data to be inspected for consistency detection, thereby quickly identifying and promptly addressing data inconsistencies, thus ensuring real-time data consistency.

[0066] Furthermore, real-time acquisition of the data to be inspected can be achieved in various ways. For example, it can be obtained through an inspected log development kit (SDK), where the application service embeds the SDK to send inspected logs. The real-time link provides a high-performance inspected log reporting service in the form of an SDK, sending the logs to a message queue. Method 100 can report the corresponding inspected log data by calling the inspected log SDK.

[0067] The first data to be inspected is the first inspected log data of the first application service, which is obtained in real time using the inspected log development kit. The second data to be inspected is the second inspected log data of the second application service, which is obtained in real time using the inspected log development kit. The inspected log development kit allows for the rapid acquisition of real-time data to be inspected, facilitating timely consistency checks.

[0068] Figure 3 This is a schematic diagram of a real-time detection process for the data consistency detection method provided in this application embodiment; please refer to... Figure 3 In some embodiments, obtaining the data to be inspected in step S110 may include the following sub-steps one to three.

[0069] Sub-step one: Obtain the first confirmation data ack1 from the first data to be inspected. The first confirmation data ack1 is used to indicate that the first application service has sent a cross-service call request to the second application service.

[0070] Sub-step two: Obtain the second confirmation data ack2 from the second data to be inspected. The second confirmation data ack2 is used to indicate that the second application service has sent the first processing result for the cross-service call request to the first application service.

[0071] Sub-step three: Obtain the third confirmation data ack3 from the first data to be inspected. The third confirmation data ack3 is used to indicate that the first application service has received the first processing result.

[0072] In this embodiment, the first data to be inspected may include first confirmation data ack1 and third confirmation data ack3, and the second data to be inspected may include second confirmation data ack2.

[0073] like Figure 3 The data consistency detection method 100 can be executed by the inspection service. After the service request is generated, the first application service first executes step S11 to send a cross-service call request to the second application service, and then performs step S12 to send the first confirmation data ack1, which indicates that the first application service has sent a cross-service call request to the second application service.

[0074] After receiving the cross-server call request sent in step S11, the second application service processes the cross-server call request and generates a first processing result. Then, it returns the first processing result to the first application service through step S13 and sends the second confirmation data ack2, indicating that it has successfully received and processed the cross-server call request.

[0075] In step S15, after the first application service receives the first processing result sent in step S13, it sends the third confirmation data ack3, which indicates that the first application service has received the first processing result.

[0076] In step S16, the inspection service obtains ack1, ack2 and ack3 generated in steps S12, S14 and S15 through the inspection log development toolkit, and performs consistency checks, for example, using the Flink real-time computing engine for real-time checks.

[0077] Step S17: If the data to be inspected obtained in step S16 does not meet the preset consistency rules, the first processing can be performed.

[0078] It is understandable that the inspected log data of the above cross-service call are ack1, ack2 and ack3, which share a transaction ID (transid), indicating that ack1-3 are requests for the same service.

[0079] This embodiment uses first confirmation data, second confirmation data, and third confirmation data to detect in real time whether the cross-server call between the first application service and the second application service can be successfully completed. If it can be successfully completed, the communication between the services is in a normal state, indicating that the data consistency between the first application service and the second application service can be guaranteed, that is, the service request can be successfully completed. If the two cannot successfully complete the cross-server call request, it indicates that there is a problem with the data consistency between the first application service and the second application service, and the first step of processing is required.

[0080] In some embodiments, if the first data to be inspected and the second data to be inspected do not meet the preset consistency rule, the first processing in step S120 may include: if the first confirmation data, the second confirmation data, or the third confirmation data are not obtained within a preset delay time, the first processing may be performed; wherein, the preset delay time is the maximum time interval between obtaining two adjacent data.

[0081] Continue to refer to Figure 3The configuration service can include detection configuration, which can be used to configure preset consistency rules and preset delay times for consistency detection. Preset consistency rules consist of conditional expressions composed of fields and operators, such as source.ack1.data.name == target.ack2.data.name. The preset delay time represents the maximum acceptable matching time between two data pairs and configures the handling strategy for data that does not match.

[0082] In this embodiment, the preset consistency rule may include obtaining the first confirmation data ack1, the second confirmation data ack2, and the third confirmation data ack3 within a preset delay time. The configuration service may also include processing configuration, which can be used for the first processing.

[0083] It is understood that when the communication between the first application service and the second application service is normal, the inspection service can obtain ack1, ack2 and ack3 in sequence, and the time interval between two adjacent data will not exceed the preset delay time. If any of the above data is not obtained within the preset delay time, it indicates that the preset consistency rule is not met, and step S17 needs to be processed.

[0084] The preset consistency rules in this embodiment are simple in form and do not involve business data, making detection more convenient. They can detect inconsistencies in data caused by cross-application service calls in real time. By analyzing the inspected log data in real time, once inconsistencies or missing data are found between the inspected log data of the application services, it is determined that there are data inconsistencies between the application services, so that they can be dealt with in a timely manner.

[0085] It is understandable that, in the above Figure 3 In some embodiments, the data to be inspected includes data unrelated to business data, while in other embodiments, the first data to be inspected may include first business data related to the service request; the second data to be inspected includes second business data related to the service request.

[0086] If the service request is a user's order to purchase goods, then the first and second data to be inspected can be business data related to the order, such as inventory data, order data, and bank deduction data.

[0087] In this embodiment, the first data to be inspected and the second data to be inspected can also be business data. Through business data, it can be intuitively discovered whether the data involved in the service request is consistent.

[0088] In some embodiments, for business data, if the first data to be inspected and the second data to be inspected do not meet the preset consistency rules, the first processing may be performed, which may include: if the first business data and the second business data do not match, the first processing may be performed.

[0089] If the first business data is inventory data and the second business data is bank deduction data, the preset one-time rules can include the correspondence between inventory data and bank deduction data, which can be expressed using conditional statements. If a user purchases an item with a unit price of 10 RMB, the inventory service corresponds to deducting 1 from the inventory, and the bank deduction service corresponds to deducting 10 RMB from the user's balance.

[0090] In this embodiment, by configuring preset consistency rules through the correspondence between business data, data consistency can also be detected in real time.

[0091] It is understandable that for real-time data to be inspected, the preset consistency rules can include default rules, such as if ack1, ack2, and ack3 are not obtained within a preset delay time. They can also include custom rules, such as rules corresponding to business data. When inspecting real-time data, any one of the above rules can be used, or both can be used simultaneously.

[0092] The following explanation uses the data consistency detection method to examine historical data as an example.

[0093] Figure 4 This is a schematic diagram of a historical data detection process for the data consistency detection method provided in this application embodiment; please refer to... Figure 4 In some embodiments, obtaining the data to be inspected in step S110 may include: obtaining multiple sets of data to be inspected based on a first database and a second database, each set of data to be inspected including a first set of data to be inspected and a second set of data to be inspected corresponding to the first set of data to be inspected; wherein the first set of data to be inspected is stored in the first database and the second set of data to be inspected is stored in the second database.

[0094] In this context, it can be understood that the database is used to store historical data, i.e. offline data. This type of data can be collected in batches through offline links, and data consistency can be achieved through timed detection methods, such as performing statistics on turnover, total sales, etc. at 24:00 every day, or performing statistics once a week, etc.

[0095] Unlike real-time data, which performs consistency checks on a single set of data each time, historical data can generate multiple sets of data to be checked simultaneously through a first database and a second database. These multiple sets of data can then be checked separately. By utilizing persistent service data, inconsistencies in historical data can be identified and addressed, thereby ensuring offline data consistency.

[0096] In some embodiments, a first database is used to store historical data of a first application service, and a second database is used to store historical data of a second application service. Based on the first database and the second database, multiple sets of data to be inspected can be obtained, which may include: obtaining first historical data in the first database and second historical data in the second database within a preset time interval; filtering out multiple first data to be inspected from the first historical data, and filtering out multiple second data to be inspected corresponding to the multiple first data to be inspected from the second historical data, so as to generate multiple sets of data to be inspected.

[0097] The preset time interval can be a pre-defined time interval for performing consistency checks on historical data. For example, if the check is performed at 24:00 every day, the preset time interval can be 24 hours.

[0098] The acquisition of the first and second historical data within this time interval can be understood as including various types of data. It is necessary to filter out multiple first and second data to be tested for consistency detection. That is, after data collection, the non-test data is removed by data cleaning and then divided into first and second data to be tested, which serve as the input source of consistency detection data.

[0099] Furthermore, there is a one-to-one correspondence between multiple first data to be inspected and multiple second data to be inspected. Each first data to be inspected and its corresponding second data to be inspected can form a set of data to be inspected. For example, first data to be inspected and second data to be inspected with the same generation time can be grouped together, or a set of data to be inspected can be generated by using the same transaction ID as a distinguishing factor. Thus, data to be inspected can be obtained from historical data.

[0100] In some embodiments, if the first data to be inspected and the second data to be inspected do not meet the preset consistency rules in step S120, the first processing may include: detecting the consistency between the first data to be inspected and the second data to be inspected in each group of data to be inspected; if the first data to be inspected and the second data to be inspected do not match, the first processing is performed on the mismatched data to be inspected.

[0101] For example, the first and second data to be inspected can include inventory data and corresponding revenue data for a day, respectively. The preset consistency rules can include the correspondence between inventory data and revenue data. By comparing the changes in inventory data and revenue data one by one, it can be determined whether the first and second data to be inspected match.

[0102] In this embodiment, consistency detection can be performed on each of the multiple sets of data to be inspected. If the first and second sets of data to be inspected do not meet the preset consistency rules, the first processing can be performed on the data to be inspected that do not meet the rules, thereby ensuring the consistency of historical data.

[0103] You can refer to Figure 4 The source of the inspection service can be the first database produced by the first application service and the second database produced by the second application service.

[0104] The configuration service can include detection configuration and processing configuration. Detection configuration can set preset consistency rules and time periods, etc. Preset consistency rules can be composed of fields and operators to form conditional statements, such as source.data.name == target.data.name. The time period represents the time period during which two pieces of data exist. The processing configuration can be the configuration for the first data to be processed.

[0105] It's understandable that historical data consistency checks rely on custom rules, and the inspection service performs consistency checks according to these rules, primarily using conditional statements. Furthermore, historical data consistency checks differ from real-time data consistency checks; a single check produces a batch of data, rather than a single, real-time output. Offline data consistency checks can be performed using the offline computing engine Spark.

[0106] Furthermore, the aforementioned first and second databases can be of various types. For example, the first database could be a first business database used to store historical business data for the first application service, and the second database could be a second business database used to store historical business data for the second application service. In other words, the data used for consistency checks can be historical business data.

[0107] Alternatively, the first database can be a first inspected log database used to store historical inspected log data for the first application service, and the second database can be a second inspected log database used to store historical inspected log data for the second application service. In other words, the data used for consistency testing can be historical inspected log data.

[0108] Alternatively, the first database can be a first data warehouse used to analyze the first application service, and the second database can be a second data warehouse used to analyze the second application service. That is, the data used for consistency checks can be analytical data from the data warehouse. For example... Figure 4 The inspection service can obtain the first and second databases from the data warehouse to obtain the data to be inspected, and perform consistency checks based on the configuration information, and process the data to be inspected that does not meet the preset consistency rules.

[0109] All of the above types can be used to detect data consistency. This method, by analyzing historical data from business databases, inspected log data, data warehouses, etc., and comparing the data, can ensure data consistency between application services. Regardless of whether real-time or historical data is being processed, the initial processing method can be the same. Furthermore, there can be multiple methods for the initial processing.

[0110] In some embodiments, performing the first process in step S120 may include: invoking an external service with compensation function in a preset manner to perform compensation processing.

[0111] It is understandable that the inspection service may only have the function of detecting consistency, and the handling of inconsistent data may rely on external services, such as rollback functions.

[0112] The compensation process may include: rolling back the data of the first application service and the second application service, or rolling back the data of multiple application services involved in the service request.

[0113] The preset invocation method can include at least one of RPC or HTTP calls. By calling other external services for compensation processing, data consistency can be maintained.

[0114] In some embodiments, method 100 may further include: sending a warning message if an external service call fails and the number of attempts to call the external service is greater than or equal to a first threshold.

[0115] The first threshold is the maximum number of external service calls. It's understood that external service calls can have a retry mechanism. If multiple attempts fail, a warning message can be sent, such as via phone or email, to notify the developers and generate a warning ticket. This allows developers to handle the issue manually in a timely manner, effectively ensuring that data consistency problems are addressed.

[0116] In some embodiments, performing the first process in step S120 may include: executing a preset script; method 100 may further include: if the preset script fails to execute and the number of attempts to execute the preset script is greater than or equal to a second threshold, sending a warning message.

[0117] The preset script can be a script configured within the inspection service, such as SQL, Python, or shell scripts. It can quickly handle consistency issues. The second threshold is the maximum number of times the preset script can be executed.

[0118] It is understandable that the preset script attempts can have a retry mechanism. If multiple attempts fail, a warning message can be sent, such as by phone or email, to notify the developers and generate a warning ticket, so that the developers can handle it manually in a timely manner, thereby effectively ensuring that data consistency issues are resolved.

[0119] Of course, in some embodiments, performing the first process in step S120 may include sending a warning message. Upon discovering an inconsistency issue, developers can be notified via telephone or email, and a warning work order can be generated, enabling developers to handle the issue manually in a timely manner, thereby effectively ensuring that data consistency problems are resolved.

[0120] Understandable. Figure 3 and Figure 4 The first processing can adopt any of the above methods, that is, the processing configuration of the configuration service can include any of the above methods.

[0121] This embodiment provides a low-cost, non-intrusive, configurable, and highly reliable method for cross-application service data consistency detection. It achieves both non-disruptive operation of online application services and a rapid mechanism for discovering inconsistent application service data. Furthermore, the detection and processing configurations can be flexibly set through service configuration, making it highly versatile.

[0122] To facilitate better implementation of the data consistency detection method of this application embodiment, this application embodiment also provides a data consistency detection device, please refer to... Figure 5 , Figure 5 This is a schematic diagram of the structure of a data consistency detection device provided in an embodiment of this application. The data consistency detection device 200 may include the following units.

[0123] The acquisition unit 201 is used to acquire data to be inspected, which includes first data to be inspected from a first application service and second data to be inspected from a second application service, wherein the first application service and the second application service are any two of a plurality of application services used to execute the same service request;

[0124] The execution unit 202 is used to perform the first processing if the first data to be inspected and the second data to be inspected do not meet the preset consistency rules.

[0125] In some embodiments, when acquiring the data to be inspected, the acquisition unit 201 is further configured to: acquire the data to be inspected if the time difference between the current time and the time when the service request was generated is greater than or equal to a first preset time.

[0126] In some embodiments, the acquisition unit 201, in addition to acquiring the data to be inspected, is further configured to: acquire first confirmation data in the first data to be inspected, the first confirmation data being used to indicate that the first application service has sent a cross-service call request to the second application service; acquire second confirmation data in the second data to be inspected, the second confirmation data being used to indicate that the second application service has sent a first processing result for the cross-service call request to the first application service; and acquire third confirmation data in the first data to be inspected, the third confirmation data being used to indicate that the first application service has received the first processing result.

[0127] In some embodiments, when the execution unit 202 is used to perform the first processing if the first data to be inspected and the second data to be inspected do not meet the preset consistency rule, it is further used to: perform the first processing if the first confirmation data, the second confirmation data, or the third confirmation data is not obtained within the preset delay time; wherein, the preset delay time is the maximum time interval between obtaining two adjacent data.

[0128] In some embodiments, the first data to be inspected includes first business data related to the service request; the second data to be inspected includes second business data related to the service request.

[0129] In some embodiments, when the execution unit 202 is used to perform the first processing if the first data to be inspected and the second data to be inspected do not meet the preset consistency rules, it is further used to perform the first processing if the first business data and the second business data do not match.

[0130] In some embodiments, the first data to be inspected is the first log data of the first application service obtained in real time through the inspected log development kit, and the second data to be inspected is the second log data of the second application service obtained in real time through the inspected log development kit.

[0131] In some embodiments, the acquisition unit 201, in addition to acquiring the data to be inspected, is further configured to: acquire multiple sets of the data to be inspected based on a first database and a second database, each set of the data to be inspected including a first set of data to be inspected and a second set of data to be inspected corresponding to the first set of data to be inspected; wherein the first set of data to be inspected is stored in the first database and the second set of data to be inspected is stored in the second database.

[0132] In some embodiments, the first database is used to store historical data of the first application service, and the second database is used to store historical data of the second application service; when the acquisition unit 201 is used to acquire multiple sets of the data to be inspected based on the first database and the second database, it is further used to: acquire first historical data in the first database and second historical data in the second database within a preset time interval; filter out multiple sets of the first data to be inspected from the first historical data, and filter out multiple sets of the second data to be inspected corresponding to the multiple sets of the first data to be inspected from the second historical data, so as to generate multiple sets of the data to be inspected.

[0133] In some embodiments, when the execution unit 202 is used to perform the first processing if the first data to be inspected and the second data to be inspected do not meet the preset consistency rules, it is further used to: detect the consistency between the first data to be inspected and the second data to be inspected in each group of data to be inspected; if the first data to be inspected and the second data to be inspected in the data to be inspected do not match, perform the first processing for the mismatched data to be inspected.

[0134] In some embodiments, the first database is a first business database for storing historical business data of the first application service, and the second database is a second business database for storing historical business data of the second application service; or, the first database is a first inspection log database for storing historical inspection log data of the first application service, and the second database is a second inspection log database for storing historical inspection log data of the second application service; or, the first database is a first data warehouse for analyzing the first application service, and the second database is a second data warehouse for analyzing the second application service.

[0135] In some embodiments, when performing the first processing, the execution unit 202 is further configured to: invoke an external service with compensation function in a preset manner to perform compensation processing.

[0136] In some embodiments, the execution unit 202 is further configured to send a warning message if the external service call fails and the number of attempts to call the external service is greater than or equal to a first threshold.

[0137] In some embodiments, when performing the first processing, the execution unit 202 is further configured to: execute a preset script; and if the preset script fails to execute and the number of attempts to execute the preset script is greater than or equal to a second threshold, send a warning message.

[0138] In some embodiments, this application also provides an electronic device, including: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to perform the methods implementing any of the above embodiments by executing the executable instructions.

[0139] Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. The electronic device 300 may be... Figure 1 The terminal or server shown. For example... Figure 6 As shown, the electronic device 300 may include: a communication interface 301, a memory 302, a processor 303, and a communication bus 304. The communication interface 301, memory 302, and processor 303 communicate with each other via the communication bus 304. The communication interface 301 is used for data communication between the electronic device 300 and external devices. The memory 302 can be used to store software programs and modules, and the processor 303 runs the software programs and modules stored in the memory 302, such as the software programs for the corresponding operations in the above method embodiments.

[0140] In some embodiments, the processor 303 may invoke software programs and modules stored in the memory 302 to perform the following operations: acquire data to be inspected, the data to be inspected includes first data to be inspected from a first application service and second data to be inspected from a second application service, wherein the first application service and the second application service are any two of a plurality of application services used to execute the same service request; if the first data to be inspected and the second data to be inspected do not meet a preset consistency rule, perform a first process.

[0141] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the methods of any of the above embodiments. For brevity, further details are omitted here.

[0142] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the methods of any of the above embodiments. For brevity, further details are omitted here.

[0143] This application also provides a computer program that includes computer instructions stored in a computer-readable storage medium. The processor of an electronic device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the electronic device to perform the corresponding processes in the methods described in the embodiments of this application. For the sake of brevity, these details will not be elaborated further here.

[0144] It should be understood that the processor in the embodiments of this application may be an integrated circuit chip with signal processing capabilities. In implementation, the steps of the above method embodiments can be completed by integrated logic circuits in the processor's hardware or by instructions in software form. The processor described above can be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this application can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software modules can be located in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. The storage medium is located in memory, and the processor reads information from the memory and, in conjunction with its hardware, completes the steps of the above method.

[0145] It is understood that the memory in the embodiments of this application can be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDR SDRAM), Enhanced Synchronous DRAM (ESDRAM), Synchlink DRAM (SLDRAM), and Direct Rambus RAM (DR RAM). It should be noted that the memory used in the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.

[0146] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0147] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0148] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.

[0149] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0150] In addition, the functional units in the embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0151] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer or a server) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, ROM, RAM, magnetic disks, or optical disks.

[0152] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A data consistency detection method, characterized in that, include: Obtain the data to be inspected, which includes first data to be inspected from a first application service and second data to be inspected from a second application service, wherein the first application service and the second application service are any two of a plurality of application services used to execute the same service request; If the first data to be inspected and the second data to be inspected do not meet the preset consistency rules, the first processing is performed to ensure that the data generated by the first application service and the second application service that execute the same service request are consistent. The acquisition of the data to be inspected includes: If the time difference between the current time and the time when the service request was generated is greater than or equal to a first preset time, the data to be inspected is obtained; The step of obtaining the data to be inspected includes: obtaining first confirmation data from the first data to be inspected, wherein the first confirmation data is used to indicate that the first application service has sent a cross-service call request to the second application service; obtaining second confirmation data from the second data to be inspected, wherein the second confirmation data is used to indicate that the second application service has sent a first processing result for the cross-service call request to the first application service; and obtaining third confirmation data from the first data to be inspected, wherein the third confirmation data is used to indicate that the first application service has received the first processing result. If the first data to be inspected and the second data to be inspected do not meet the preset consistency rules, the first processing is performed, including: if the first confirmation data, the second confirmation data, or the third confirmation data are not obtained within a preset delay time, the first processing is performed; wherein, the preset delay time is the maximum time interval between obtaining two adjacent data.

2. The method according to claim 1, characterized in that, The first data to be inspected includes first business data related to the service request; the second data to be inspected includes second business data related to the service request.

3. The method according to claim 2, characterized in that, If the first data to be inspected and the second data to be inspected do not meet the preset consistency rules, the first process is executed, including: If the first business data and the second business data do not match, the first processing step is executed.

4. The method according to claim 1, characterized in that, The first data to be inspected is the first inspected log data of the first application service obtained in real time through the inspected log development kit, and the second data to be inspected is the second inspected log data of the second application service obtained in real time through the inspected log development kit.

5. The method according to claim 1, characterized in that, The acquisition of the data to be inspected includes: Based on the first database and the second database, multiple sets of data to be inspected are obtained, each set of data to be inspected including a first set of data to be inspected and a second set of data to be inspected corresponding to the first set of data to be inspected; The first data to be inspected is stored in the first database, and the second data to be inspected is stored in the second database.

6. The method according to claim 5, characterized in that, The first database is used to store historical data of the first application service, and the second database is used to store historical data of the second application service; the step of obtaining multiple sets of the data to be inspected based on the first and second databases includes: Obtain first historical data from the first database and second historical data from the second database within a preset time interval; Multiple sets of data to be inspected are generated by filtering multiple sets of data from the first set of historical data and selecting multiple sets of data to be inspected corresponding to the multiple sets of data to be inspected from the second set of historical data.

7. The method according to claim 6, characterized in that, If the first data to be inspected and the second data to be inspected do not meet the preset consistency rules, the first process is executed, including: Detect the consistency between the first data to be inspected and the second data to be inspected in each group of data to be inspected; If the first data to be inspected and the second data to be inspected do not match, the first processing is performed on the mismatched data to be inspected.

8. The method according to claim 5, characterized in that, The first database is a first business database used to store historical business data of the first application service, and the second database is a second business database used to store historical business data of the second application service; or, The first database is a first inspection log database used to store historical inspection log data of the first application service, and the second database is a second inspection log database used to store historical inspection log data of the second application service; or, The first database is a first data warehouse for analyzing the first application service, and the second database is a second data warehouse for analyzing the second application service.

9. The method according to any one of claims 1-8, characterized in that, The execution of the first process includes: The compensation process is performed by calling an external service with compensation functionality through a preset method.

10. The method according to claim 9, characterized in that, The method further includes: If the external service call fails and the number of attempts to call the external service is greater than or equal to the first threshold, a warning message is sent.

11. The method according to any one of claims 1-8, characterized in that, The execution of the first process includes: executing a preset script; the method further includes: If the preset script fails to execute and the number of attempts to execute the preset script is greater than or equal to the second threshold, a warning message is sent.

12. A data consistency detection device, characterized in that, include: An acquisition unit is used to acquire data to be inspected, the data to be inspected including first data to be inspected from a first application service and second data to be inspected from a second application service, wherein the first application service and the second application service are any two of a plurality of application services used to execute the same service request; The execution unit is configured to perform a first process if the first data to be inspected and the second data to be inspected do not meet a preset consistency rule. When acquiring the data to be inspected, the acquisition unit is further configured to: acquire the data to be inspected if the time difference between the current time and the time when the service request was generated is greater than or equal to a first preset time. The acquisition unit, in addition to acquiring the data to be inspected, is further configured to: acquire first confirmation data from the first data to be inspected, wherein the first confirmation data indicates that the first application service has sent a cross-service call request to the second application service; acquire second confirmation data from the second data to be inspected, wherein the second confirmation data indicates that the second application service has sent a first processing result for the cross-service call request to the first application service; and acquire third confirmation data from the first data to be inspected, wherein the third confirmation data indicates that the first application service has received the first processing result. When the execution unit is used to perform the first processing if the first data to be inspected and the second data to be inspected do not meet the preset consistency rule, it is further used to: perform the first processing if the first confirmation data, the second confirmation data, or the third confirmation data are not obtained within a preset delay time; wherein, the preset delay time is the maximum time interval between obtaining two adjacent data.

13. The apparatus according to claim 12, characterized in that, The first data to be inspected includes first business data related to the service request; the second data to be inspected includes second business data related to the service request.

14. The apparatus according to claim 13, characterized in that, When the execution unit is used to perform the first processing if the first data to be inspected and the second data to be inspected do not meet the preset consistency rules, it is further used to perform the first processing if the first business data and the second business data do not match.

15. The apparatus according to claim 12, characterized in that, The first data to be inspected is the first inspected log data of the first application service obtained in real time through the inspected log development kit, and the second data to be inspected is the second inspected log data of the second application service obtained in real time through the inspected log development kit.

16. The apparatus according to claim 12, characterized in that, The acquisition unit, in addition to acquiring the data to be inspected, is further used for: Based on the first database and the second database, multiple sets of data to be inspected are obtained, each set of data to be inspected including a first set of data to be inspected and a second set of data to be inspected corresponding to the first set of data to be inspected; The first data to be inspected is stored in the first database, and the second data to be inspected is stored in the second database.

17. The apparatus according to claim 16, characterized in that, The first database is used to store historical data of the first application service, and the second database is used to store historical data of the second application service; when the acquisition unit acquires multiple sets of the data to be inspected based on the first and second databases, it is further used to: Obtain first historical data from the first database and second historical data from the second database within a preset time interval; Multiple sets of data to be inspected are generated by filtering multiple sets of data from the first set of historical data and selecting multiple sets of data to be inspected corresponding to the multiple sets of data to be inspected from the second set of historical data.

18. The apparatus according to claim 17, characterized in that, When the execution unit performs the first processing if the first data to be inspected and the second data to be inspected do not meet the preset consistency rule, it is further configured to: Detect the consistency between the first data to be inspected and the second data to be inspected in each group of data to be inspected; If the first data to be inspected and the second data to be inspected do not match, the first processing is performed on the mismatched data to be inspected.

19. The apparatus according to claim 16, characterized in that, The first database is a first business database used to store historical business data of the first application service, and the second database is a second business database used to store historical business data of the second application service; or, The first database is a first inspection log database used to store historical inspection log data of the first application service, and the second database is a second inspection log database used to store historical inspection log data of the second application service; or, The first database is a first data warehouse for analyzing the first application service, and the second database is a second data warehouse for analyzing the second application service.

20. The apparatus according to any one of claims 12-19, characterized in that, When performing the first processing, the execution unit is further configured to: invoke an external service with compensation function through a preset method to perform compensation processing.

21. The apparatus according to claim 20, characterized in that, The execution unit is also configured to send a warning message if the external service call fails and the number of attempts to call the external service is greater than or equal to a first threshold.

22. The apparatus according to any one of claims 12-19, characterized in that, When performing the first processing, the execution unit is further configured to: execute a preset script; and if the preset script fails to execute and the number of attempts to execute the preset script is greater than or equal to a second threshold, send a warning message.

23. An electronic device, characterized in that, include: processor; as well as Memory for storing the executable instructions of the processor; The processor is configured to execute the method of any one of claims 1-11 by executing the executable instructions.

24. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the method according to any one of claims 1-11.

25. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the method described in any one of claims 1-11.