Data verification method and system based on state machine and electronic equipment

By using a state machine model to build a data verification model in a distributed architecture, the problem of understanding data flow logic for operations and maintenance personnel is solved, achieving efficient data consistency verification and simplified code writing, thus improving data verification efficiency.

CN121579495APending Publication Date: 2026-02-27广域铭岛数字科技有限公司 +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511763430.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-27
Publication Date
2026-02-27

AI Technical Summary

Technical Problem

In a distributed architecture, operations and maintenance personnel may not be able to effectively understand the data flow logic and state transitions, resulting in low data verification efficiency, high code writing difficulty, and potential defects such as poor compatibility and response delays.

Method used

By obtaining the state machine model of the distributed architecture, establishing the correspondence between business interfaces and state nodes, configuring consistency verification rules, building a data verification model, responding to operation events to perform data consistency verification, and using message queues and interceptors to listen to operation events, non-intrusive data verification is achieved.

Benefits of technology

It reduces redundancy in data validation rules, improves data validation efficiency, simplifies the understanding and coding difficulty for operations and maintenance personnel, and ensures that data validation rules are consistent with business status flow.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121579495A_ABST
    Figure CN121579495A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of data verification, and provides a data verification method and system based on a state machine and electronic equipment. According to the method, the corresponding relation between the service interface and the state node is established through the obtained state machine model, and the consistency verification rule corresponding to at least one state node is configured to construct the data verification model, so that the data verification model is matched according to the service interface corresponding to the operation event; according to the matched data mapping relation, consistency verification is carried out on the source data entity and the target data entity, a data verification result is obtained, compared with a mode that a data verification rule is independently set for each service interface, the state machine model designed in the development stage is applied to the operation and maintenance stage, and the data verification efficiency is improved. Consistency verification rules are configured for state nodes in a state machine model, and by reutilization of state machine design, the code writing difficulty of consistency verification is reduced, and the data verification efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data verification technology, specifically to a data verification method, system, and electronic device based on a state machine. Background Technology

[0002] Throughout the complete lifecycle of a distributed architecture, complex business functions require collaborative work at different stages. For example, in the design phase, product managers build state machine models based on the data flow logic between and within business systems to accurately describe the state transitions of business entities. In the development phase, developers write core business code based on these state machine models. When the operation and maintenance phase begins, in order to ensure data consistency among multiple business systems under the distributed architecture, operation and maintenance personnel need to perform data consistency checks by configuring static verification scripts, performing periodic manual inspections, or deploying log monitoring systems.

[0003] However, due to their lack of involvement in the early design and development, operations and maintenance personnel cannot understand the data flow logic and state transitions in the distributed architecture. When performing data verification through application interfaces, they must write logic code for data comparison for each interface and its different call events. This is not only tedious and inefficient when written manually, but also requires maintaining adaptation interfaces between heterogeneous business systems, which can easily introduce defects such as poor compatibility and response delays. As a result, the existing data verification method places extremely high demands on the business understanding and technical experience of operations and maintenance personnel, and the code is difficult to write, resulting in low overall efficiency of data verification. Summary of the Invention

[0004] To provide a basic understanding of some aspects of the disclosed embodiments, a brief summary is given below. This summary is not intended as a general commentary, nor is it intended to identify key / important components or describe the scope of protection of these embodiments, but rather as a prelude to the detailed description that follows.

[0005] In view of the shortcomings of the prior art described above, this application provides a data verification method, system and electronic device based on a state machine to improve data verification efficiency.

[0006] This application provides a state machine-based data verification method for use in verification tools. The method includes: obtaining a state machine model corresponding to a distributed architecture, wherein the distributed architecture includes at least one business system containing business interfaces, and the state machine model includes multiple state nodes; establishing a correspondence between the business interfaces and the state nodes, and configuring consistency verification rules corresponding to at least one state node to construct a data verification model, wherein the consistency verification rules include a data mapping relationship between source data entities and target data entities; responding to an operation event of the distributed architecture, matching the data verification model according to the business interface corresponding to the operation event to obtain a target rule; and performing consistency verification on the source data entity and the target data entity according to the data mapping relationship in the target rule to obtain a data verification result.

[0007] In one embodiment of this application, in response to an operation event in the distributed architecture, the data verification model is matched according to the business interface corresponding to the operation event to obtain a target rule, including: configuring a message topic corresponding to a message queue, wherein the message queue is used to store the operation event, and the operation event is captured from the business system using a preset interceptor; listening for operation events from the message queue through the message topic; if the operation event is detected, the data verification model is matched according to the interface context of the business interface corresponding to the operation event to obtain a target rule.

[0008] In one embodiment of this application, establishing the correspondence between the business interface and the state node includes: constructing a verification rule item based on at least a portion of the business interfaces; importing the state machine model into the verification rule item; and configuring the business interface corresponding to each of the state nodes according to the verification rule item.

[0009] In one embodiment of this application, before performing consistency verification on the source data entity and the target data entity according to the data mapping relationship in the target rule to obtain the data verification result, the method further includes: the consistency verification rule further includes data query conditions, wherein the data query conditions include placeholders and / or static conditions; if the data query conditions include placeholders, then dynamic business parameters are obtained by extracting data from the business system, and the placeholders are replaced according to the dynamic business parameters; a structured query statement is constructed according to the data query conditions, and the database corresponding to the distributed architecture is queried according to the structured query statement to obtain the source data entity and the target data entity.

[0010] In one embodiment of this application, according to the data mapping relationship in the target rule, a consistency check is performed on the source data entity and the target data entity to obtain a data check result, including: if the data mapping relationship includes an existence relationship, then it is determined whether the source data entity and the target data entity have fields, and the field existence parameters are obtained; the field existence parameters are checked according to the existence relationship to obtain an existence check result; if the data mapping relationship includes a consistency relationship, then it is determined whether the fields corresponding to the source data entity and the target data entity respectively satisfy the consistency relationship to obtain a consistency check result; and a data check result is generated based on the existence check result and the consistency check result.

[0011] In one embodiment of this application, after performing consistency verification on the source data entity and the target data entity according to the data mapping relationship in the target rule and obtaining the data verification result, the method further includes: if the data verification result includes a data verification anomaly, then determining the abnormal field from the source data entity and the target data entity; and generating a data repair instruction corresponding to the abnormal field according to the data mapping relationship.

[0012] In one embodiment of this application, after generating the data repair instruction corresponding to the abnormal field according to the data mapping relationship, the method further includes: sending an abnormal field notification to a preset user terminal, and checking the consistency verification rules of the data verification model to obtain a rule check result, wherein the abnormal field notification includes the data verification result and / or the abnormal field; if the rule check result includes rules that are normal, then executing the data repair instruction; if the rule check result includes rules that are abnormal, then modifying the data verification model according to the rule modification instruction sent by the user terminal, and re-performing consistency verification on the source data entity and the target data entity according to the modified data verification model.

[0013] In one embodiment of this application, executing the data repair instruction includes: obtaining a pre-repair verification result by re-performing a consistency check on the source data entity and the target data entity; if the pre-repair verification result is consistent with the data verification result, backing up the abnormal field to obtain a backup field, and executing the data repair instruction to repair the abnormal field according to the data mapping relationship; and in response to a rollback instruction sent by the user terminal, performing a rollback operation on the abnormal field after data repair based on the backup field.

[0014] This application also provides a state machine-based data verification system, comprising: a distributed architecture including at least one business system and business interfaces within the business systems; a verification tool for obtaining a state machine model corresponding to the distributed architecture, wherein the state machine model includes multiple state nodes; establishing a correspondence between the business interfaces and the state nodes, and configuring consistency verification rules corresponding to at least one state node to construct a data verification model, wherein the consistency verification rules include a data mapping relationship between source data entities and target data entities; responding to an operation event of the distributed architecture, matching the data verification model according to the business interface corresponding to the operation event to obtain a target rule; and performing consistency verification on the source data entity and the target data entity according to the data mapping relationship in the target rule to obtain a data verification result.

[0015] This application also provides an electronic device, including: a processor and a memory; the memory is used to store a computer program, and the processor is used to execute the computer program stored in the memory to cause the electronic device to perform the method described above.

[0016] The beneficial effects of this application are: By establishing a correspondence between business interfaces and state nodes using the acquired state machine model, and configuring at least one consistency verification rule for each state node, a data verification model is constructed. This model is then matched against the business interface corresponding to the operation event. Based on the matched data mapping relationship, consistency verification is performed on the source and target data entities to obtain the data verification result. In this way, compared to setting separate data verification rules for each business interface, the state machine model designed in the development phase is applied to the operation and maintenance phase. Configuring consistency verification rules for the state nodes in the state machine model not only reduces redundancy in data verification rules but also ensures that the data verification rules are consistent with the business state flow, making it easier for operation and maintenance personnel to understand. Therefore, by reusing the state machine design, the difficulty of writing consistency verification code is reduced, and data verification efficiency is improved. Attached Figure Description

[0017] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application. It is obvious that the drawings described below are merely some embodiments of this application, and those skilled in the art can obtain other drawings based on these drawings without any inventive effort.

[0018] In the attached diagram: Figure 1 This is a flowchart illustrating a state machine-based data verification method in an embodiment of this application. Figure 2 This is a schematic diagram of the structure of a state machine model in an embodiment of this application; Figure 3 This is a schematic diagram illustrating the relationship between a state node and a data mapping relationship in an embodiment of this application; Figure 4 This is a flowchart illustrating a pre-parameter configuration method for data verification in an embodiment of this application. Figure 5 This is a flowchart illustrating a data verification method in an embodiment of this application; Figure 6 This is a flowchart illustrating an abnormal data repair method in an embodiment of this application; Figure 7 This is a schematic diagram of the structure of a state machine-based data verification system in an embodiment of this application; Figure 8 This is a schematic diagram of the structure of an electronic device in an embodiment of this application. Detailed Implementation

[0019] The following specific examples illustrate the implementation of this application. Those skilled in the art can easily understand other advantages and effects of this application from the content disclosed in this specification. This application can also be implemented or applied through other different specific embodiments. Various details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of this application. In the absence of conflict, the following embodiments and features in the embodiments can be combined with each other.

[0020] It should be noted that the illustrations provided in the following embodiments are only schematic representations of the basic concept of this application. The drawings only show the components related to this application and are not drawn according to the actual number, shape and size of the components in the actual implementation. In the actual implementation, the form, quantity and proportion of each component can be arbitrarily changed, and the layout of the components may also be more complex.

[0021] In the following description, numerous details are explored to provide a more thorough explanation of embodiments of the present application. However, it will be apparent to those skilled in the art that embodiments of the present application may be practiced without these specific details. In other embodiments, well-known structures and devices are shown in block diagram form rather than in detail to avoid obscuring embodiments of the present application.

[0022] The terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate for the embodiments of this application described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion.

[0023] Unless otherwise stated, the term "multiple" means two or more.

[0024] In this application, the character " / " indicates that the objects before and after it are in an "or" relationship. For example, A / B means: A or B.

[0025] The term "and / or" describes an association between objects, indicating that three relationships can exist. For example, A and / or B means: A or B, or A and B.

[0026] Combination Figure 1 As shown, this application provides a state machine-based data verification method for use in verification tools. The method includes: Step S101: Obtain the state machine model corresponding to the distributed architecture; The distributed architecture includes at least one business system containing business interfaces; The state machine model includes multiple state nodes; Step S102: Establish the correspondence between business interfaces and status nodes, and configure at least one consistency verification rule corresponding to a status node to build a data verification model. Among them, the consistency verification rules include the data mapping relationship between the source data entity and the target data entity; Step S103: In response to the operation event of the distributed architecture, the data verification model is matched according to the business interface corresponding to the operation event to obtain the target rule; Step S104: According to the data mapping relationship in the target rule, perform consistency verification on the source data entity and the target data entity to obtain the data verification result.

[0027] The state machine-based data verification method provided in this application establishes a correspondence between business interfaces and state nodes using the acquired state machine model, and configures at least one consistency verification rule for each state node to construct a data verification model. This model is then matched against the business interface corresponding to the operation event, and consistency verification is performed on the source and target data entities according to the matched data mapping relationship to obtain the data verification result. Compared to setting separate data verification rules for each business interface, this method applies the state machine model designed during the development phase to the operation and maintenance phase. Configuring consistency verification rules for the state nodes in the state machine model not only reduces redundancy in data verification rules but also ensures that the data verification rules are consistent with the business state flow, making it easier for operation and maintenance personnel to understand. Thus, by reusing the state machine design, the difficulty of writing consistency verification code is reduced, and data verification efficiency is improved.

[0028] Combination Figure 2 As shown, this application provides a state machine model to represent at least a portion of the state transition logic in a distributed architecture. The state nodes include order placement nodes, order start nodes, order processing nodes, order completion nodes, and order shipment nodes. The state nodes transition between each other through the call events of the business interface. For example, in response to the order cancellation interface, the state node jumps from the order processing node to the order placement node.

[0029] In some embodiments, the state machine model supports not only image formats, but also XML, JSON, or code formats.

[0030] Optionally, establishing a correspondence between business interfaces and state nodes includes: constructing verification rule items based on at least a portion of the business interfaces; importing the state machine model into the verification rule items; and configuring the business interfaces corresponding to each state node according to the verification rule items.

[0031] Combination Figure 3 As shown, by expanding the application scope of the state machine model from requirements analysis and development assistance to operation and maintenance monitoring, a proactive monitoring system is formed. In this system, one verification rule item corresponds to one state machine model, one state machine model corresponds to one or more state nodes, one state node corresponds to one or more consistency verification rules, and one consistency verification rule includes one or more data mapping relationships. Therefore, by configuring the rules once at the state node level, the previous method of repeatedly configuring each related business interface is replaced, thereby reducing the amount of repetitive work.

[0032] In some embodiments, a validation rule item is created through the configuration interface corresponding to the validation tool, and the business interface corresponding to the validation rule item is configured. The configuration of the business interface supports regular expression matching and / or arrays. For example, the regular expression " / api / order / *" can be used to match all business interfaces that start with " / api / order / ", or the array {" / api / order / create", " / api / order / pay", " / api / order / cancel"} can be used to precisely match all business interfaces in the array.

[0033] In some embodiments, the state machine model is imported into the verification rule item through the configuration interface corresponding to the verification tool, and consistency verification rules are configured for the state nodes in the state machine model; the user is guided to fill in the logical table corresponding to the consistency verification rule. A set of logical tables supports multiple sets of data mapping relationships between a source data entity and multiple target data entities. The logical tables are shown in Table 1. Among them, the data table A corresponding to the source data entity, the data table B corresponding to the target data entity, the field I corresponding to the source data entity, and the mapping field I corresponding to the target data entity are required fields, and a complete data mapping relationship is formed based on the source data table A, the target data table B, the field I, and the mapping field I.

[0034] Table 1

[0035] In some embodiments, the verification rule item is "consistency verification of order data". The business interfaces corresponding to this verification rule item include "order issuance interface", "order withdrawal interface" and "manager withdrawal interface". Configure the logical table corresponding to "order issuance node" and fill in the consistency verification rules. At least a part of the consistency verification rules are shown in Table 2.

[0036] Table 2

[0037] Optionally, in response to operation events in a distributed architecture, the data validation model is matched against the business interface corresponding to the operation event to obtain target rules. This includes: configuring a message topic corresponding to a message queue, wherein the message queue is used to store operation events, and the operation events are captured from the business system using a preset interceptor; listening for operation events from the message queue through the message topic; and if an operation event is detected, matching the data validation model against the interface context of the business interface corresponding to the operation event to obtain target rules.

[0038] In some embodiments, the business interface requiring data verification is selected through the configuration interface corresponding to the verification tool to obtain the interface interception rules. The interceptor in the JAR package is then used to intercept the call events corresponding to the interface interception rules to obtain the operation events. The interface interception rules support regular expression matching or array matching. According to the preset message queue configuration, the intercepted operation events are pushed to the message topic of the Kafka middleware. This allows for non-intrusive event interception and data verification using an external verification tool. Furthermore, compared to data verification through log analysis, this application uses non-intrusive listening to operation events to achieve proactive data verification without waiting for log generation, thereby improving the timeliness of data verification results.

[0039] In some embodiments, the configuration interface corresponding to the verification tool can be used to configure the Kafka middleware address, message topic, database address corresponding to the distributed architecture, database permissions corresponding to the distributed architecture, etc.

[0040] In some embodiments, if the business interface called in the distributed architecture meets the interface interception rules, the operation event is sent to the Kafka middleware; if the verification tool receives the operation event through the Kafka middleware, it matches it with the consistency verification rules according to the interface context corresponding to the operation event to obtain the target rule, and triggers the verification process corresponding to the target rule.

[0041] Combination Figure 4 As shown, this application provides a method for configuring pre-parameters for data verification, including: Step S401: Deploy the verification tool; Step S402: Configure the JAR file and Kafka middleware to achieve non-intrusive event interception; Step S403: Configure the database address, database permissions, etc. for the distributed architecture; Step S404: Construct validation rule items based on at least a portion of the business interfaces; Step S405: Import the state machine model into the verification rule items, and configure the business interfaces corresponding to each state node according to the verification rule items. Step S406: Configure at least one consistency verification rule for a state node; Step S407: After the prerequisite parameter configuration is completed, start listening to the business interfaces in the distributed architecture.

[0042] Optionally, before obtaining the data verification result, the method further includes: the consistency verification rule also includes data query conditions, wherein the data query conditions include placeholders and / or static conditions; if the data query conditions include placeholders, then dynamic business parameters are obtained by extracting data from the business system, and the placeholders are replaced according to the dynamic business parameters; a structured query statement is constructed according to the data query conditions, and the database corresponding to the distributed architecture is queried according to the structured query statement to obtain the source data entity and the target data entity.

[0043] In some embodiments, the data query conditions corresponding to the source data entity include placeholder "{Product ID}", static conditions "Order status = Customer order completed", and static conditions "Payment status = Customer has paid". In this case, after the business interface is called, the dynamic business parameters corresponding to the placeholder "{Product ID}" need to be retrieved, i.e., the real-time product ID. If the real-time product ID is found to be 2, a structured query statement is generated based on product ID = 2, order status = Customer order completed, and payment status = Customer has paid.

[0044] Optionally, according to the data mapping relationship in the target rule, a consistency check is performed on the source data entity and the target data entity to obtain a data check result, including: if the data mapping relationship includes an existence relationship, then it is determined whether the source data entity and the target data entity have fields, the field existence parameters are obtained, and the field existence parameters are checked according to the existence relationship to obtain an existence check result; if the data mapping relationship includes a consistency relationship, then it is determined whether the fields corresponding to the source data entity and the target data entity satisfy the consistency relationship to obtain a consistency check result; and a data check result is generated based on the existence check result and the consistency check result.

[0045] In some embodiments, the source data entity and each target data entity are respectively used as the current data entity.

[0046] In some embodiments, the existence relation is a Boolean value. The cardinality consistency rule between the source and target data entities is established through the existence relation. Specifically, the existence relation is used to verify the ratio of the number of fields between the source and target data entities. A data entity with an existence relation of 1 must have fields, while a data entity with an existence relation of 0 may not have fields. If the existence relation corresponding to the current data entity is 1 and the current data entity has no fields, the existence verification result is determined to be an anomaly. If the existence relation corresponding to the current data entity is 1 and the current data entity has fields, the existence verification result is determined to be normal. If the existence relation corresponding to the current data entity is 0, the existence verification result is determined to be normal regardless of whether the current data entity has fields.

[0047] In some embodiments, if the field of the current data entity in the consistency relation is the same as the real-time field of the current data entity, the existence check result is determined to be a normal consistency check; otherwise, the existence check result is determined to be an abnormal consistency check.

[0048] Optionally, after performing consistency verification on the source data entity and the target data entity according to the data mapping relationship in the target rule and obtaining the data verification result, the method further includes: if the data verification result includes data verification anomalies, then determining the abnormal fields from the source data entity and the target data entity; and generating data repair instructions corresponding to the abnormal fields according to the data mapping relationship.

[0049] In some embodiments, if the data validation result includes a data validation exception, the data validation result and the exception field are used as the rule validation result and pushed to the ledger platform.

[0050] Optionally, after generating the data repair instruction corresponding to the abnormal field based on the data mapping relationship, the method further includes: sending an abnormal field notification to a preset user terminal, and checking the consistency verification rules of the data verification model to obtain the rule check result, wherein the abnormal field notification includes the data verification result and / or the abnormal field; if the rule check result includes that the rule is normal, then the data repair instruction is executed; if the rule check result includes that the rule is abnormal, then the data verification model is modified according to the rule modification instruction sent by the user terminal, and the consistency verification of the source data entity and the target data entity is re-performed according to the modified data verification model.

[0051] In some embodiments, if the target data entity 1 of the work order status does not satisfy the data mapping relationship, an exception field notification is generated. For example, the exception field notification includes "update work order table set work order status = work order has been issued, estimated working hours = (select working hours from product working hours table where id={product ID} and delflag=0) where product ID=2".

[0052] In some embodiments, the operation and maintenance personnel are notified to check the rule verification results. The operation and maintenance personnel check the consistency verification rules of the data verification model and obtain the rule check results. If the operation and maintenance personnel confirm that the data is abnormal, the data repair instruction is executed. If the operation and maintenance personnel confirm that the rule is abnormal, the consistency verification rule is modified, and the data verification process is re-executed through the modified data verification model to verify the correctness of the data.

[0053] Combination Figure 5 As shown, this application provides a data verification method, including: Step S501: In response to an operation event in the distributed architecture, obtain the interface context corresponding to the operation event; Step S502: Match the consistency verification rules according to the interface context to obtain the target rule; Step S503: Construct a structured query statement according to the data query conditions in the target rule, so as to query the source data entity and the target data entity through the structured query statement; Step S504: Perform data verification on the source data entity and the target data entity according to the consistency verification rules in the target rules; Step S505: Determine whether the existence check result is normal. If yes, proceed to step S506; otherwise, proceed to step S508. Step S506: Determine whether the consistency check result is normal. If yes, proceed to step S507; otherwise, proceed to step S508. Step S507: The data verification result is that the data verification is normal.

[0054] Step S508: The data verification result is a data verification error; Step S509: Check the consistency verification rules of the data verification model and obtain the rule check results; Step S510: Determine whether the rule check result is normal. If yes, proceed to step S511; otherwise, proceed to step S512. Step S511: Execute the data repair instruction for the abnormal field.

[0055] Step S512: Modify the data validation model.

[0056] Optionally, executing a data repair instruction includes: obtaining a pre-repair verification result by re-performing a consistency check on the source data entity and the target data entity; if the pre-repair verification result is consistent with the data verification result, backing up the abnormal field to obtain the backup field, and executing a data repair instruction to repair the abnormal field according to the data mapping relationship; and in response to a rollback instruction sent by the user terminal, performing a rollback operation on the abnormal field after data repair based on the backup field.

[0057] Combination Figure 6 As shown, this application provides a method for repairing abnormal data, including: Step S601: By performing pre-repair condition verification on the source data entity and the target data entity, the pre-repair verification result is obtained; Among them, the precondition verification for repair includes re-performing consistency verification on the source data entity and the target data entity; Step S602: Determine whether the result of the pre-repair verification is consistent with the result of the data verification. If yes, proceed to step S603; otherwise, proceed to step S607. Step S603: Back up the abnormal fields to obtain the backup fields; Step S604: Execute the data repair instruction corresponding to the abnormal field to repair the abnormal field according to the data mapping relationship; Step S605: Determine whether the abnormal field has been successfully repaired. If yes, proceed to step S607; otherwise, proceed to step S606. Step S606: In response to the rollback command sent by the user terminal, perform a rollback operation on the abnormal fields after data repair based on the backup fields.

[0058] Step S607: End the data repair process.

[0059] Combination Figure 7 As shown, this application provides a state machine-based data verification system, including a distributed architecture 701 and a verification tool 702.

[0060] The distributed architecture 701 includes at least one business system and business interfaces within the business system.

[0061] Verification tool 702 is used to obtain the state machine model corresponding to the distributed architecture, wherein the state machine model includes multiple state nodes; establish the correspondence between business interfaces and state nodes, and configure at least one consistency verification rule corresponding to a state node to construct a data verification model, wherein the consistency verification rule includes the data mapping relationship between the source data entity and the target data entity; respond to the operation event of the distributed architecture, match the data verification model according to the business interface corresponding to the operation event to obtain the target rule; perform consistency verification on the source data entity and the target data entity according to the data mapping relationship in the target rule to obtain the data verification result.

[0062] The state machine-based data verification system provided in this application establishes a correspondence between business interfaces and state nodes through the acquired state machine model, and configures at least one consistency verification rule for each state node to construct a data verification model. The system then matches the data verification model with the business interface corresponding to the operation event, and performs consistency verification on the source and target data entities according to the matched data mapping relationship to obtain the data verification result. Compared to setting separate data verification rules for each business interface, this approach applies the state machine model designed during the development phase to the operation and maintenance phase. Configuring consistency verification rules for the state nodes in the state machine model not only reduces redundancy in data verification rules but also ensures that the data verification rules are consistent with the business state flow, making it easier for operation and maintenance personnel to understand. Thus, by reusing the state machine design, the difficulty of writing consistency verification code is reduced, and data verification efficiency is improved.

[0063] This application also provides an electronic device, including: a processor and a memory; the memory is used to store a computer program, and the processor is used to execute the computer program stored in the memory, so that the electronic device performs the above-described method.

[0064] Figure 8 A schematic diagram of a computer system suitable for implementing the embodiments of this application is shown. It should be noted that... Figure 8 The computer system 800 of the electronic device shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of this application.

[0065] like Figure 8As shown, the computer system 800 includes a Central Processing Unit (CPU) 801, which can perform various appropriate actions and processes, such as executing the methods described in the above embodiments, based on a program stored in Read-Only Memory (ROM) 802 or a program loaded from storage portion 808 into Random Access Memory (RAM) 803. The RAM 803 also stores various programs and data required for system operation. The CPU 801, ROM 802, and RAM 803 are interconnected via a bus 804. An Input / Output (I / O) interface 805 is also connected to the bus 804.

[0066] The following components are connected to I / O interface 805: an input section 806 including a keyboard, mouse, etc.; an output section 807 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; a storage section 808 including a hard disk, etc.; and a communication section 809 including a network interface card such as a LAN (Local Area Network) card, modem, etc. The communication section 809 performs communication processing via a network such as the Internet. A drive 810 is also connected to I / O interface 805 as needed. A removable medium 811, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on drive 810 as needed so that computer programs read from it can be installed into storage section 808 as needed.

[0067] The electronic device disclosed in this embodiment includes a processor, a memory, a transceiver, and a communication interface. The memory and the communication interface are connected to the processor and the transceiver and enable communication between them. The memory is used to store computer programs, the communication interface is used for communication, and the processor and transceiver are used to run the computer programs, causing the electronic device to perform the various steps of the above method. The above description and drawings fully illustrate the embodiments of this disclosure to enable those skilled in the art to practice them. Other embodiments may include structural, logical, electrical, procedural, and other changes. The embodiments represent only possible variations. Unless explicitly required, individual components and functions are optional, and the order of operation may vary. Parts and subsamples of some embodiments may be included in or replace parts and subsamples of other embodiments. Moreover, the terminology used in this application is only for describing embodiments and is not intended to limit the claims. As used in the description of embodiments and claims, the singular forms “a,” “an,” and “the” are intended to equally include the plural forms unless the context clearly indicates otherwise. Similarly, the term “and / or” as used in this application means including one or more of the associated listed items and all possible combinations thereof. Additionally, when used in this application, the term "comprise" and its variations "comprises" and / or "comprising" refer to the presence of stated subsamples, wholes, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other subsamples, wholes, steps, operations, elements, components, and / or groups thereof. Without further limitations, an element defined by the phrase "comprising a..." does not exclude the presence of other identical elements in the process, method, or apparatus that includes the element. In this document, each embodiment may focus on the differences from other embodiments, and similar or identical parts between embodiments can be referred to mutually. For methods, products, etc., disclosed in the embodiments, if they correspond to the method section disclosed in the embodiments, the relevant parts can be referred to the description of the method section.

[0068] 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. Those skilled in the art will clearly 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.

[0069] The methods and products (including but not limited to devices and equipment) disclosed in the embodiments herein can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For instance, the division of units may be merely 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 sub-samples may be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces, and the indirect coupling or communication connection of devices or units may be electrical, mechanical, or other forms. Units described as separate components may or may not be physically separate, and 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 implement this embodiment according to actual needs. Furthermore, the functional units in this application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0070] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of the systems, methods, and computer program products according to this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing the specified logical function. In some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. In the descriptions corresponding to the flowcharts and block diagrams in the accompanying drawings, the operations or steps corresponding to different blocks may also occur in a different order than those disclosed in the description; sometimes there is no specific order between different operations or steps. For example, two consecutive operations or steps may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. Each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.

Claims

1. A state machine based data checking method, characterized in that, The method applied to a verification tool comprises: acquiring a state machine model corresponding to a distributed architecture, wherein the distributed architecture comprises at least one business system comprising a business interface, and the state machine model comprises a plurality of state nodes; establishing a corresponding relationship between the business interface and the state node, and configuring a consistency verification rule corresponding to at least one state node to construct a data verification model, wherein the consistency verification rule comprises a data mapping relationship between a source data entity and a target data entity; in response to an operation event of the distributed architecture, matching the data verification model according to a business interface corresponding to the operation event to obtain a target rule; performing consistency verification on the source data entity and the target data entity according to the data mapping relationship in the target rule to obtain a data verification result.

2. The method of claim 1, wherein, In response to an operation event of the distributed architecture, matching the data verification model according to a business interface corresponding to the operation event to obtain a target rule, comprising: configuring a message topic corresponding to a message queue, wherein the message queue is used to store the operation event, and the operation event is captured from the business system by using a preset interceptor; listening to the operation event from the message queue through the message topic; if the operation event is listened to, matching the data verification model according to an interface context of the business interface corresponding to the operation event to obtain a target rule.

3. The method of claim 1, wherein, Establishing a corresponding relationship between the business interface and the state node comprises: constructing a verification rule item according to at least a part of the business interface; importing the state machine model into the verification rule item, and configuring the business interface corresponding to each state node according to the verification rule item.

4. The method of claim 1, wherein, Before performing consistency verification on the source data entity and the target data entity according to the data mapping relationship in the target rule to obtain a data verification result, the method further comprises: the consistency verification rule further comprises a data query condition, wherein the data query condition comprises a placeholder and / or a static condition; if the data query condition comprises a placeholder, obtaining a dynamic business parameter by performing data extraction on the business system, and replacing the placeholder according to the dynamic business parameter; constructing a structured query statement according to the data query condition, and querying a database corresponding to the distributed architecture according to the structured query statement to obtain a source data entity and a target data entity.

5. The method of claim 1, wherein, Performing consistency verification on the source data entity and the target data entity according to the data mapping relationship in the target rule to obtain a data verification result, comprising: if the data mapping relationship comprises an existence relationship, judging whether fields of the source data entity and the target data entity exist to obtain a field existence parameter, and verifying the field existence parameter according to the existence relationship to obtain an existence verification result; if the data mapping relationship comprises a consistency relationship, judging whether fields corresponding to the source data entity and the target data entity respectively satisfy the consistency relationship to obtain a consistency verification result; According to the existence check result and the consistency check result, a data check result is generated.

6. The method according to any one of claims 1 to 5, characterized in that, After the consistency check of the source data entity and the target data entity according to the data mapping relationship in the target rule and the data check result is obtained, the method further comprises: If the data check result includes data check abnormalities, abnormal fields are determined from the source data entity and the target data entity; According to the data mapping relationship, a data repair instruction corresponding to the abnormal field is generated.

7. The method of claim 6, wherein, After the data repair instruction corresponding to the abnormal field is generated according to the data mapping relationship, the method further comprises: An abnormal field notification including the data check result and / or the abnormal field is sent to a preset user terminal, and a consistency check rule of the data check model is checked to obtain a rule check result; If the rule check result includes a rule normal, the data repair instruction is executed; If the rule check result includes a rule abnormal, the data check model is modified according to a rule modification instruction sent by the user terminal, and the source data entity and the target data entity are re-consistently checked according to the modified data check model.

8. The method of claim 7, wherein, The data repair instruction is executed, including: A pre-repair check result is obtained by re-consistently checking the source data entity and the target data entity; If the pre-repair check result is consistent with the data check result, a backup field is obtained by backing up the abnormal field, and the data repair instruction is executed to repair the abnormal field according to the data mapping relationship; In response to a rollback instruction sent by the user terminal, a rollback operation is performed on the abnormal field after data repair according to the backup field.

9. A state machine based data verification system, characterized by, Comprise: A distributed architecture comprising at least one business system and a business interface in the business system; A check tool for obtaining a state machine model corresponding to the distributed architecture, wherein the state machine model comprises a plurality of state nodes; a corresponding relationship between the business interface and the state node is established, and a consistency check rule corresponding to at least one state node is configured to build a data check model, wherein the consistency check rule comprises a data mapping relationship between a source data entity and a target data entity; in response to an operation event of the distributed architecture, the data check model is matched according to the business interface corresponding to the operation event to obtain a target rule; the source data entity and the target data entity are consistently checked according to the data mapping relationship in the target rule to obtain a data check result.

10. An electronic device, comprising: Comprise: A processor and a memory; The memory is used to store a computer program, and the processor is used to execute the computer program stored in the memory to make the electronic device execute the method of any one of claims 1-8.