[go: up one dir, main page]

CN118778964A - Data verification method, device, equipment, storage medium and program product - Google Patents

Data verification method, device, equipment, storage medium and program product Download PDF

Info

Publication number
CN118778964A
CN118778964A CN202310376284.3A CN202310376284A CN118778964A CN 118778964 A CN118778964 A CN 118778964A CN 202310376284 A CN202310376284 A CN 202310376284A CN 118778964 A CN118778964 A CN 118778964A
Authority
CN
China
Prior art keywords
data
verification
target
business
rule
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310376284.3A
Other languages
Chinese (zh)
Inventor
毛谢阳
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Beijing Co Ltd
Original Assignee
Tencent Technology Beijing Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Beijing Co Ltd filed Critical Tencent Technology Beijing Co Ltd
Priority to CN202310376284.3A priority Critical patent/CN118778964A/en
Publication of CN118778964A publication Critical patent/CN118778964A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/43Checking; Contextual analysis
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/42Syntactic analysis
    • G06F8/427Parsing

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

本申请提供了一种数据校验方法、装置、设备、存储介质及程序产品;方法包括:当接收到目标业务的业务数据时,从至少一个数据结构中,确定所述业务数据的目标数据结构,其中,不同数据结构预定义有相应的数据校验规则;获取针对所述目标数据结构预定义的目标数据校验规则;对所述目标数据校验规则进行解析,得到解析后数据校验规则;采用所述解析后数据校验规则,对所述业务数据进行数据校验,得到所述业务数据的校验结果,以基于得到的所述校验结果,对所述业务数据执行所述目标业务的业务逻辑;通过本申请,能够简化数据校验的实现逻辑,提高数据校验规则的灵活性,便于数据校验规则的维护和复用,并能够提高数据校验的开发效率。

The present application provides a data verification method, apparatus, equipment, storage medium and program product; the method comprises: when receiving business data of a target business, determining a target data structure of the business data from at least one data structure, wherein different data structures are predefined with corresponding data verification rules; obtaining a target data verification rule predefined for the target data structure; parsing the target data verification rule to obtain parsed data verification rules; using the parsed data verification rules to perform data verification on the business data to obtain a verification result of the business data, so as to execute the business logic of the target business on the business data based on the obtained verification result; through the present application, the implementation logic of data verification can be simplified, the flexibility of data verification rules can be improved, the maintenance and reuse of data verification rules can be facilitated, and the development efficiency of data verification can be improved.

Description

数据校验方法、装置、设备、存储介质及程序产品Data verification method, device, equipment, storage medium and program product

技术领域Technical Field

本申请涉及信息处理技术领域,尤其涉及一种数据校验方法、装置、设备、存储介质及程序产品。The present application relates to the field of information processing technology, and in particular to a data verification method, device, equipment, storage medium and program product.

背景技术Background Art

随着计算机技术的不断发展,基于计算机的业务应用越来越广泛。而业务所涉及的业务数据在多方之间传输时,往往需要对业务数据进行数据校验。With the continuous development of computer technology, computer-based business applications are becoming more and more widespread. When the business data involved in the business is transmitted between multiple parties, it is often necessary to verify the business data.

相关技术中,业务数据的数据校验是这样实现的:开发人员预先将每种业务数据的数据校验规则编写成数据校验代码,然后将数据校验代码再硬编码至该业务数据的业务逻辑代码中,从而通过执行业务逻辑代码,在执行业务逻辑代码的同时,实现对业务数据的校验。但是,随着数据校验规则的复杂化,实现逻辑和代码也越来越复杂;且由于是硬编码于业务逻辑代码中,更导致了维护和复用的复杂。In the related art, data verification of business data is implemented as follows: developers pre-write the data verification rules for each type of business data into data verification code, and then hard-code the data verification code into the business logic code of the business data, so that by executing the business logic code, the business data is verified while executing the business logic code. However, as the data verification rules become more complicated, the implementation logic and code are also becoming more and more complicated; and because they are hard-coded in the business logic code, maintenance and reuse are more complicated.

发明内容Summary of the invention

本申请实施例提供一种数据校验方法、装置、电子设备、计算机可读存储介质及计算机程序产品,能够简化数据校验的实现逻辑,提高数据校验规则的灵活性,便于数据校验规则的维护和复用,并能够提高数据校验的开发效率。The embodiments of the present application provide a data verification method, device, electronic device, computer-readable storage medium and computer program product, which can simplify the implementation logic of data verification, improve the flexibility of data verification rules, facilitate the maintenance and reuse of data verification rules, and improve the development efficiency of data verification.

本申请实施例的技术方案是这样实现的:The technical solution of the embodiment of the present application is implemented as follows:

本申请实施例提供一种数据校验方法,包括:The present application provides a data verification method, including:

当接收到目标业务的业务数据时,从至少一个数据结构中,确定所述业务数据的目标数据结构,各所述数据结构分别预定义有相应的数据校验规则;When receiving the service data of the target service, determining the target data structure of the service data from at least one data structure, each of the data structures being predefined with a corresponding data verification rule;

获取针对所述目标数据结构预定义的目标数据校验规则;Obtaining a target data verification rule predefined for the target data structure;

对所述目标数据校验规则进行解析,得到解析后数据校验规则;Parsing the target data verification rule to obtain a parsed data verification rule;

采用所述解析后数据校验规则,对所述业务数据进行数据校验,得到所述业务数据的校验结果,以基于得到的所述校验结果,对所述业务数据执行所述目标业务的业务逻辑。The parsed data verification rule is used to perform data verification on the business data to obtain a verification result of the business data, so as to execute the business logic of the target business on the business data based on the obtained verification result.

本申请实施例还提供一种数据校验装置,包括:The present application also provides a data verification device, including:

确定模块,用于当接收到目标业务的业务数据时,从至少一个数据结构中,确定所述业务数据的目标数据结构,各所述数据结构分别预定义有相应的数据校验规则;A determination module, configured to determine, when receiving the service data of a target service, a target data structure of the service data from at least one data structure, each of the data structures being predefined with a corresponding data verification rule;

获取模块,用于获取针对所述目标数据结构预定义的目标数据校验规则;An acquisition module, used for acquiring a target data verification rule predefined for the target data structure;

解析模块,用于对所述目标数据校验规则进行解析,得到解析后数据校验规则;A parsing module, used to parse the target data verification rule to obtain the parsed data verification rule;

校验模块,用于采用所述解析后数据校验规则,对所述业务数据进行数据校验,得到所述业务数据的校验结果,以基于得到的所述校验结果,对所述业务数据执行所述目标业务的业务逻辑。The verification module is used to use the parsed data verification rule to perform data verification on the business data to obtain the verification result of the business data, so as to execute the business logic of the target business on the business data based on the obtained verification result.

在上述方案中,所述目标数据结构包括目标字段,所述目标字段用于定义所述目标数据结构的数据校验规则;所述获取模块,还用于对所述业务数据进行解析,确定所述目标字段的目标字段值;将所述目标字段值,作为针对所述目标数据结构预定义的目标数据校验规则。In the above scheme, the target data structure includes a target field, and the target field is used to define the data verification rules of the target data structure; the acquisition module is also used to parse the business data to determine the target field value of the target field; and the target field value is used as the target data verification rule predefined for the target data structure.

在上述方案中,所述目标数据结构包括目标字段,所述目标字段用于存储所述目标数据结构的数据校验规则的指示信息;所述获取模块,还用于对所述业务数据进行解析,确定所述目标字段的目标字段值,所述目标字段值为所述指示信息;获取所述指示信息所指示的数据校验规则;将所述指示信息所指示的数据校验规则,作为针对所述目标数据结构预定义的目标数据校验规则。In the above scheme, the target data structure includes a target field, and the target field is used to store the indication information of the data verification rule of the target data structure; the acquisition module is also used to parse the business data, determine the target field value of the target field, and the target field value is the indication information; obtain the data verification rule indicated by the indication information; use the data verification rule indicated by the indication information as the predefined target data verification rule for the target data structure.

在上述方案中,所述获取模块,还用于获取在定义所述目标数据结构时、针对所述目标数据结构编辑的注释信息;从所述注释信息中,提取针对所述目标数据结构编辑的注释数据校验规则;将所述注释数据校验规则,作为针对所述目标数据结构预定义的目标数据校验规则。In the above scheme, the acquisition module is also used to obtain annotation information edited for the target data structure when defining the target data structure; extract annotation data verification rules edited for the target data structure from the annotation information; and use the annotation data verification rules as predefined target data verification rules for the target data structure.

在上述方案中,所述获取模块,还用于获取数据结构和数据校验规则之间的对应关系;基于所述对应关系,从包括多种所述数据校验规则的数据校验规则库中,获取所述目标数据结构对应的数据校验规则;将所述目标数据结构对应的数据校验规则,作为针对所述目标数据结构预定义的目标数据校验规则。In the above scheme, the acquisition module is also used to obtain the correspondence between the data structure and the data verification rules; based on the correspondence, the data verification rules corresponding to the target data structure are obtained from a data verification rule library including a plurality of the data verification rules; and the data verification rules corresponding to the target data structure are used as predefined target data verification rules for the target data structure.

在上述方案中,当所述目标数据校验规则包括单条校验规则时,所述解析模块,还用于获取所述目标数据校验规则的校验规则语法;基于所述校验规则语法,对所述目标数据校验规则进行解析,得到所述目标数据校验规则的校验规则语法树,所述校验语法树包括符合所述目标数据校验规则的校验表达式和校验运算符;基于所述校验表达式和所述校验运算符,生成所述解析后数据校验规则。In the above scheme, when the target data verification rule includes a single verification rule, the parsing module is also used to obtain the verification rule syntax of the target data verification rule; based on the verification rule syntax, the target data verification rule is parsed to obtain the verification rule syntax tree of the target data verification rule, and the verification syntax tree includes a verification expression and a verification operator that conforms to the target data verification rule; based on the verification expression and the verification operator, the parsed data verification rule is generated.

在上述方案中,所述解析模块,还用于基于所述校验表达式和所述校验运算符,将所述校验语法树转换为目标形式的目标表达式,并将所述目标表达式作为所述解析后数据校验规则。In the above scheme, the parsing module is also used to convert the verification syntax tree into a target expression in a target form based on the verification expression and the verification operator, and use the target expression as the parsed data verification rule.

在上述方案中,当所述目标数据校验规则包括多条子校验规则时,所述解析模块,还用于对所述目标数据校验规则进行拆分,得到各条所述子校验规则,并针对各条所述子校验规则分别执行如下处理:获取所述子校验规则的校验规则语法;基于所述校验规则语法,对所述子校验规则进行解析,得到所述子校验规则的校验规则语法树,所述校验语法树包括符合所述子校验规则的校验表达式和校验运算符;基于所述校验表达式和所述校验运算符,生成所述子校验规则的解析后子校验规则;其中,各所述子校验规则的解析后子校验规则,组成所述解析后数据校验规则。In the above scheme, when the target data verification rule includes multiple sub-verification rules, the parsing module is also used to split the target data verification rule to obtain each of the sub-verification rules, and perform the following processing on each of the sub-verification rules: obtain the verification rule syntax of the sub-verification rule; based on the verification rule syntax, parse the sub-verification rule to obtain the verification rule syntax tree of the sub-verification rule, and the verification syntax tree includes a verification expression and a verification operator that conforms to the sub-verification rule; based on the verification expression and the verification operator, generate the parsed sub-verification rule of the sub-verification rule; wherein the parsed sub-verification rules of each of the sub-verification rules constitute the parsed data verification rule.

在上述方案中,所述校验模块,还用于对所述业务数据进行解析,确定所述业务数据中待校验字段的字段值;采用所述解析后数据校验规则,对所述待校验字段的字段值进行校验,得到所述业务数据的校验结果。In the above scheme, the verification module is also used to parse the business data to determine the field value of the field to be verified in the business data; use the parsed data verification rule to verify the field value of the field to be verified to obtain the verification result of the business data.

在上述方案中,所述校验模块,还用于对所述业务数据进行解析,得到所述业务数据包括的各个字段;获取各所述字段的字段名;根据各所述字段的字段名以及所述解析后数据校验规则,确定所述业务数据中的待校验字段,并获取所述待校验字段的字段值。In the above scheme, the verification module is also used to parse the business data to obtain the various fields included in the business data; obtain the field name of each field; determine the field to be checked in the business data according to the field name of each field and the parsed data verification rules, and obtain the field value of the field to be checked.

在上述方案中,当所述解析后数据校验规则包括多条解析后校验规则、且所述待校验字段的数量为多个时,所述校验模块,还用于针对各所述解析后校验规则,分别执行如下处理:确定所述解析后校验规则对应的待校验字段组,所述待校验字段组包括至少一个所述待校验字段;采用所述解析后校验规则,对所述待校验字段组中待校验字段的字段值进行校验,得到所述待校验字段组的字段组校验结果;基于各所述解析后校验规则对应的字段组校验结果,确定所述业务数据的校验结果。In the above scheme, when the post-parsed data verification rules include multiple post-parsed verification rules and the number of the fields to be checked is multiple, the verification module is also used to perform the following processing for each of the post-parsed verification rules: determine the field group to be checked corresponding to the post-parsed verification rule, and the field group to be checked includes at least one of the fields to be checked; use the post-parsed verification rule to verify the field value of the field to be checked in the field group to be checked to obtain the field group verification result of the field group to be checked; based on the field group verification results corresponding to each of the post-parsed verification rules, determine the verification result of the business data.

在上述方案中,所述校验模块,还用于在所述采用所述解析后数据校验规则,对所述业务数据进行数据校验,得到所述业务数据的校验结果之后,当所述校验结果表征所述业务数据校验未通过时,获取所述业务数据的校验告警策略;基于所述校验告警策略,对所述校验结果进行告警处理。In the above scheme, the verification module is also used to perform data verification on the business data using the parsed data verification rule, and after obtaining the verification result of the business data, when the verification result indicates that the business data verification fails, obtain the verification alarm strategy of the business data; based on the verification alarm strategy, perform alarm processing on the verification result.

本申请实施例还提供一种电子设备,包括:The present application also provides an electronic device, including:

存储器,用于存储计算机可执行指令;A memory for storing computer executable instructions;

处理器,用于执行所述存储器中存储的计算机可执行指令时,实现本申请实施例提供的数据校验方法。The processor is used to implement the data verification method provided in the embodiment of the present application when executing the computer executable instructions stored in the memory.

本申请实施例还提供一种计算机可读存储介质,存储有计算机可执行指令,所述计算机可执行指令被处理器执行时,实现本申请实施例提供的数据校验方法。The embodiment of the present application also provides a computer-readable storage medium storing computer-executable instructions. When the computer-executable instructions are executed by a processor, the data verification method provided by the embodiment of the present application is implemented.

本申请实施例还提供一种计算机程序产品,包括计算机可执行指令,所述计算机可执行指令被处理器执行时,实现本申请实施例提供的数据校验方法。The embodiment of the present application also provides a computer program product, including computer executable instructions, which, when executed by a processor, implement the data verification method provided in the embodiment of the present application.

本申请实施例具有以下有益效果:The embodiments of the present application have the following beneficial effects:

应用本申请上述实施例,针对业务数据的每种数据结构,均预定义了相应的数据校验规则,当接收到目标业务的业务数据时,则获取针对该业务数据的目标数据结构预定义的目标数据校验规则,然后解析目标数据校验规则,以采用解析后数据校验规则实现业务数据的校验,从而在针对业务数据执行业务逻辑之前,即可实现业务数据的数据校验。如此,仅需要对每种数据结构预定义相应的数据校验规则,无需编写数据校验规则的校验代码、以及将校验代码硬编码至业务逻辑代码中,简化了数据校验的实现逻辑,提高了数据校验规则的灵活性,便于数据校验规则的维护和复用,并提高了数据校验的开发效率。By applying the above-mentioned embodiments of the present application, corresponding data verification rules are predefined for each data structure of the business data. When the business data of the target business is received, the target data verification rules predefined for the target data structure of the business data are obtained, and then the target data verification rules are parsed to implement the verification of the business data using the parsed data verification rules, so that the data verification of the business data can be implemented before the business logic is executed for the business data. In this way, it is only necessary to predefine the corresponding data verification rules for each data structure, and there is no need to write the verification code of the data verification rules and hard-code the verification code into the business logic code, which simplifies the implementation logic of the data verification, improves the flexibility of the data verification rules, facilitates the maintenance and reuse of the data verification rules, and improves the development efficiency of the data verification.

附图说明BRIEF DESCRIPTION OF THE DRAWINGS

图1是本申请实施例提供的数据校验系统100的架构示意图;FIG1 is a schematic diagram of the architecture of a data verification system 100 provided in an embodiment of the present application;

图2是本申请实施例提供的实施数据校验方法的电子设备500的结构示意图;FIG. 2 is a schematic diagram of the structure of an electronic device 500 for implementing a data verification method provided in an embodiment of the present application;

图3是本申请实施例提供的数据校验方法的流程示意图;FIG3 is a schematic diagram of a flow chart of a data verification method provided in an embodiment of the present application;

图4是本申请实施例提供的数据校验方法的流程示意图;FIG4 is a schematic diagram of a flow chart of a data verification method provided in an embodiment of the present application;

图5是本申请实施例提供的数据校验的应用系统的架构示意图;FIG5 is a schematic diagram of the architecture of a data verification application system provided in an embodiment of the present application;

图6是本申请实施例提供的数据校验方法的架构示意图;FIG6 is a schematic diagram of the architecture of a data verification method provided in an embodiment of the present application;

图7是本申请实施例提供的业务数据的字段值的获取流程示意图;7 is a schematic diagram of a process for obtaining field values of business data provided by an embodiment of the present application;

图8是本申请实施例提供的数据校验规则的获取示意图;FIG8 is a schematic diagram of obtaining data verification rules provided in an embodiment of the present application;

图9是本申请实施例提供的数据校验规则的获取示意图;FIG9 is a schematic diagram of obtaining data verification rules provided in an embodiment of the present application;

图10是本申请实施例提供的数据校验规则的处理示意图。FIG. 10 is a schematic diagram of processing of data verification rules provided in an embodiment of the present application.

具体实施方式DETAILED DESCRIPTION

为了使本申请的目的、技术方案和优点更加清楚,下面将结合附图对本申请作进一步地详细描述,所描述的实施例不应视为对本申请的限制,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其它实施例,都属于本申请保护的范围。In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings. The described embodiments should not be regarded as limiting the present application. All other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of this application.

在以下的描述中,涉及到“一些实施例”,其描述了所有可能实施例的子集,但是可以理解,“一些实施例”可以是所有可能实施例的相同子集或不同子集,并且可以在不冲突的情况下相互结合。In the following description, reference is made to “some embodiments”, which describe a subset of all possible embodiments, but it will be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.

在以下的描述中,所涉及的术语“第一\第二\第三”仅仅是是区别类似的对象,不代表针对对象的特定排序,可以理解地,“第一\第二\第三”在允许的情况下可以互换特定的顺序或先后次序,以使这里描述的本申请实施例能够以除了在这里图示或描述的以外的顺序实施。In the following description, the terms "first\second\third" involved are merely used to distinguish similar objects and do not represent a specific ordering of the objects. It can be understood that "first\second\third" can be interchanged with a specific order or sequence where permitted, so that the embodiments of the present application described here can be implemented in an order other than that illustrated or described here.

除非另有定义,本申请实施例所使用的所有的技术和科学术语与所属技术领域的技术人员通常理解的含义相同。本申请实施例中所使用的术语只是为了描述本申请实施例的目的,不是旨在限制本申请。Unless otherwise defined, all technical and scientific terms used in the embodiments of the present application have the same meanings as those commonly understood by those skilled in the art. The terms used in the embodiments of the present application are only for the purpose of describing the embodiments of the present application and are not intended to limit the present application.

对本申请实施例进行进一步详细说明之前,对本申请实施例中涉及的名词和术语进行说明,本申请实施例中涉及的名词和术语适用于如下的解释。Before further describing the embodiments of the present application in detail, the nouns and terms involved in the embodiments of the present application are explained. The nouns and terms involved in the embodiments of the present application are subject to the following interpretations.

1)客户端,终端中运行的用于提供各种服务的应用程序,例如支持目标业务(如即时通信、视频)的客户端等。1) Client: an application running in a terminal to provide various services, such as a client that supports target services (such as instant messaging, video, etc.).

2)响应于,用于表示所执行的操作所依赖的条件或状态,当满足所依赖的条件或状态时,所执行的一个或多个操作可以是实时的,也可以具有设定的延迟;在没有特别说明的情况下,所执行的多个操作不存在执行先后顺序的限制。2) In response, it is used to indicate the conditions or states on which the executed operations depend. When the dependent conditions or states are met, one or more operations executed may be in real time or have a set delay. Unless otherwise specified, there is no restriction on the order of execution of the multiple operations executed.

3)数据结构,是存储、传输、组织数据的方式。数据结构是指相互之间存在一种或多种特定关系的数据元素的集合。数据结构包括一个或者多个字段,可以根据需要定义数据结构。3) Data structure is a way to store, transmit and organize data. Data structure refers to a collection of data elements that have one or more specific relationships with each other. Data structure includes one or more fields, and data structure can be defined as needed.

4)协议缓冲区(Protocol buffers协议,简称Pb协议):是一种开源跨平台的序列化资料结构的协议,能够将结构化数据序列化,可用于数据存储、通信协议等方面。Pb协议包含一个接口描述语言,用于描述一些数据结构,并提供程式工具来根据这些描述产生程式码,这些程式码将用来生成或解析代表这些数据结构的数据流。如此,通过Pb协议可以定义数据的数据结构,并生成基于各种语言的代码。这些定义的数据流可以进行传递且不破坏已有程序,并且也可以更新这些数据流而已有程序也不会受到影响。4) Protocol buffers (Pb protocol for short): It is an open source, cross-platform protocol for serialized data structures that can serialize structured data and can be used for data storage, communication protocols, etc. The Pb protocol contains an interface description language that is used to describe some data structures and provides programming tools to generate program codes based on these descriptions. These program codes will be used to generate or parse data streams representing these data structures. In this way, the data structure of the data can be defined through the Pb protocol, and code based on various languages can be generated. These defined data streams can be transmitted without destroying existing programs, and these data streams can also be updated without affecting existing programs.

5)Message:即Pb协议定义的数据结构,定义在Protobuf文件中。在一个Protobuf文件中可以包含定义的多个Message,Message之间可以互相引用,Message还可以嵌套其他Message和枚举类。一个Message通常包含一至多个字段,每个字段可以包含以下几个部分:字段描述符(可选)、字段类型、字段名称和字段对应的Tag。其中,1)字段描述符用于描述字段出现的频率,有以下两个可选值:(a)singular:表示出现0次或1次;如果没有声明描述符,默认为singular;(b)repeated:表示出现0次或多次;2)字段类型。例如double、float、bool、string、bytes、int32、int64、uint32、uint64、sint32、sint64、fixed32、fixed64、sfixed32、sfixed64;引用其他Message类型;3)枚举类型:对于枚举类型,Protobuf有个约束,枚举的第一项对应的值必须为0。5) Message: The data structure defined by the Pb protocol, which is defined in the Protobuf file. A Protobuf file can contain multiple defined Messages, which can reference each other, and can also nest other Messages and enumeration classes. A Message usually contains one or more fields, and each field can contain the following parts: field descriptor (optional), field type, field name, and tag corresponding to the field. Among them, 1) The field descriptor is used to describe the frequency of occurrence of the field, with the following two optional values: (a) singular: indicates 0 or 1 occurrence; if the descriptor is not declared, the default is singular; (b) repeated: indicates 0 or more occurrences; 2) Field type. For example, double, float, bool, string, bytes, int32, int64, uint32, uint64, sint32, sint64, fixed32, fixed64, sfixed32, sfixed64; reference other Message types; 3) Enumeration type: For enumeration types, Protobuf has a constraint that the value corresponding to the first item of the enumeration must be 0.

本申请实施例提供一种数据校验方法、装置、电子设备、计算机可读存储介质及计算机程序产品,能够简化数据校验的实现逻辑,提高数据校验规则的灵活性,便于数据校验规则的维护和复用,并能够提高数据校验的开发效率。接下来分别进行说明。The embodiments of the present application provide a data verification method, device, electronic device, computer-readable storage medium, and computer program product, which can simplify the implementation logic of data verification, improve the flexibility of data verification rules, facilitate the maintenance and reuse of data verification rules, and improve the development efficiency of data verification. The following will be described separately.

需要说明的是,当本申请实施例运用到具体产品或技术中时,需要获得用户许可或者同意,且相关数据的收集、使用和处理需要遵守相关国家和地区的相关法律法规和标准。It should be noted that when the embodiments of the present application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions.

下面说明本申请实施例提供的数据校验系统。参见图1,图1是本申请实施例提供的数据校验系统100的架构示意图,为实现支撑一个示例性应用,终端(示例性示出了终端400-1)通过网络300连接服务器200,网络300可以是广域网或者局域网,又或者是二者的组合,使用无线或有线链路实现数据传输。The data verification system provided by the embodiment of the present application is described below. Referring to Figure 1, Figure 1 is a schematic diagram of the architecture of the data verification system 100 provided by the embodiment of the present application. To support an exemplary application, a terminal (terminal 400-1 is shown as an example) is connected to a server 200 via a network 300. The network 300 can be a wide area network or a local area network, or a combination of the two, and a wireless or wired link is used to realize data transmission.

终端(例如400-1),用于响应于针对目标业务的数据发送指令,发送目标业务的业务数据至服务器200;示例性地,该业务数据可以是业务请求,比如视频数据的获取请求,也可以是终端上传的数据,比如图像数据、视频数据等。The terminal (e.g., 400-1) is used to send business data of the target business to the server 200 in response to a data sending instruction for the target business; illustratively, the business data can be a business request, such as a request to obtain video data, or data uploaded by the terminal, such as image data, video data, etc.

服务器200,用于接收终端发送的目标业务的业务数据;从至少一个数据结构中,确定业务数据的目标数据结构,其中,各数据结构分别预定义有相应的数据校验规则;获取针对目标数据结构预定义的目标数据校验规则;对目标数据校验规则进行解析,得到解析后数据校验规则;采用解析后数据校验规则,对业务数据进行数据校验,得到业务数据的校验结果;当校验结果表征业务数据校验未通过时,返回告警信息至终端;当校验结果表征业务数据校验通过时,对业务数据执行目标业务的业务逻辑,并返回业务逻辑的执行结果至终端;The server 200 is used to receive the business data of the target business sent by the terminal; determine the target data structure of the business data from at least one data structure, wherein each data structure is predefined with a corresponding data verification rule; obtain the target data verification rule predefined for the target data structure; parse the target data verification rule to obtain the parsed data verification rule; use the parsed data verification rule to perform data verification on the business data to obtain the verification result of the business data; when the verification result indicates that the business data verification fails, return an alarm message to the terminal; when the verification result indicates that the business data verification passes, execute the business logic of the target business on the business data, and return the execution result of the business logic to the terminal;

终端(例如400-1),还用于当接收到服务器200返回的告警信息时,输出告警信息;当接收到服务器200返回的业务逻辑的执行结果时,输出执行结果。The terminal (eg, 400 - 1 ) is further configured to output alarm information when receiving alarm information returned by the server 200 ; and output the execution result when receiving the execution result of the business logic returned by the server 200 .

在一些实施例中,本申请实施例提供的数据校验方法可以由各种电子设备实施,例如,可以由终端单独实施,也可以由服务器单独实施,也可以由终端和服务器协同实施。本申请实施例提供的数据校验方法可应用于各种场景,包括但不限于云技术、人工智能、智慧交通、辅助驾驶、游戏、音视频等。In some embodiments, the data verification method provided in the embodiments of the present application can be implemented by various electronic devices, for example, it can be implemented by a terminal alone, it can also be implemented by a server alone, or it can be implemented by a terminal and a server in collaboration. The data verification method provided in the embodiments of the present application can be applied to various scenarios, including but not limited to cloud technology, artificial intelligence, smart transportation, assisted driving, games, audio and video, etc.

在一些实施例中,本申请实施例提供的实施数据校验方法的电子设备可以是各种类型的终端或服务器。其中,服务器(例如服务器200)可以是独立的物理服务器,也可以是多个物理服务器构成的服务器集群或者分布式系统。终端(例如终端400-1)可以是笔记本电脑、平板电脑、台式计算机、智能手机、智能语音交互设备(例如智能音箱)、智能家电(例如智能电视)、智能手表、车载终端、可穿戴设备、虚拟现实(Virtual Reality,VR)设备等,但并不局限于此。终端和服务器可以通过有线或无线通信方式进行直接或间接地连接,本申请实施例对此不做限制。In some embodiments, the electronic device for implementing the data verification method provided in the embodiments of the present application may be various types of terminals or servers. Among them, the server (e.g., server 200) may be an independent physical server, or a server cluster or distributed system composed of multiple physical servers. The terminal (e.g., terminal 400-1) may be a laptop, a tablet computer, a desktop computer, a smart phone, an intelligent voice interaction device (e.g., an intelligent speaker), a smart home appliance (e.g., a smart TV), a smart watch, a vehicle-mounted terminal, a wearable device, a virtual reality (VR) device, etc., but is not limited thereto. The terminal and the server may be directly or indirectly connected via wired or wireless communication, and the embodiments of the present application do not limit this.

在一些实施例中,本申请实施例提供的数据校验方法可以借助于云技术(CloudTechnology)实现。云技术是指在广域网或局域网内将硬件、软件、网络等系列资源统一起来,实现数据的计算、储存、处理和共享的一种托管技术。云技术是基于云计算商业模式应用的网络技术、信息技术、整合技术、管理平台技术、以及应用技术等的总称,可以组成资源池,按需所用,灵活便利。云计算技术将变成重要支撑。技术网络系统的后台服务需要大量的计算资源和存储资源。作为示例,服务器(例如服务器200)还可以是提供云服务、云数据库、云计算、云函数、云存储、网络服务、云通信、中间件服务、域名服务、安全服务、内容分发网络(Content Delivery Network,CDN)、以及大数据和人工智能平台等基础云计算服务的云服务器。In some embodiments, the data verification method provided in the embodiment of the present application can be implemented with the aid of cloud technology (Cloud Technology). Cloud technology refers to a hosting technology that unifies a series of resources such as hardware, software, and network in a wide area network or a local area network to realize the calculation, storage, processing, and sharing of data. Cloud technology is a general term for network technology, information technology, integration technology, management platform technology, and application technology based on the application of cloud computing business model, which can form a resource pool, which is used on demand and is flexible and convenient. Cloud computing technology will become an important support. The background services of the technical network system require a large amount of computing resources and storage resources. As an example, a server (such as server 200) can also be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content distribution networks (Content Delivery Network, CDN), and big data and artificial intelligence platforms.

在一些实施例中,多个服务器可组成为一区块链,而服务器为区块链上的节点,区块链中的每个节点之间可以存在信息连接,节点之间可以通过信息连接进行信息传输。其中,本申请实施例提供的数据校验方法所相关的数据(例如数据校验规则、数据结构和数据校验规则之间的对应关系、数据校验规则库、校验结果等)可保存于区块链上。In some embodiments, multiple servers may form a blockchain, and the servers are nodes on the blockchain. Information connections may exist between each node in the blockchain, and information may be transmitted between nodes through information connections. Among them, data related to the data verification method provided in the embodiment of the present application (such as data verification rules, the correspondence between data structures and data verification rules, data verification rule bases, verification results, etc.) may be stored on the blockchain.

在一些实施例中,终端或服务器可以通过运行各种计算机可执行指令或计算机程序来实现本申请实施例提供的数据校验方法。举例来说,计算机可执行指令可以是微程序级的命令、机器指令或软件指令。计算机程序可以是操作系统中的原生程序或软件模块;可以是本地(Native)应用程序(Application,APP),即需要在操作系统中安装才能运行的程序;也可以是小程序,即只需要下载到浏览器环境中就可以运行的程序;还可以是能够嵌入至任意APP中的小程序。总而言之,上述的计算机可执行指令可以是任意形式的指令,上述计算机程序可以是任意形式的应用程序、模块或插件。In some embodiments, the terminal or server can implement the data verification method provided by the embodiment of the present application by running various computer executable instructions or computer programs. For example, computer executable instructions can be commands, machine instructions or software instructions at the microprogram level. The computer program can be a native program or software module in the operating system; it can be a local (Native) application (Application, APP), that is, a program that needs to be installed in the operating system to run; it can also be a small program, that is, a program that can be run only by downloading it to a browser environment; it can also be a small program that can be embedded in any APP. In short, the above-mentioned computer executable instructions can be instructions in any form, and the above-mentioned computer program can be an application, module or plug-in in any form.

下面说明本申请实施例提供的实施数据校验方法的电子设备。参见图2,图2是本申请实施例提供的实施数据校验方法的电子设备500的结构示意图。本申请实施例提供的电子设备500可以是终端,也可以是服务器。本申请实施例提供的电子设备500包括:至少一个处理器510、存储器550、至少一个网络接口520和用户接口530。电子设备500中的各个组件通过总线系统540耦合在一起。可理解,总线系统540用于实现这些组件之间的连接通信。总线系统540除包括数据总线之外,还包括电源总线、控制总线和状态信号总线。但是为了清楚说明起见,在图2中将各种总线都标为总线系统540。The electronic device for implementing the data verification method provided by the embodiment of the present application is described below. Referring to Figure 2, Figure 2 is a structural diagram of an electronic device 500 for implementing the data verification method provided by the embodiment of the present application. The electronic device 500 provided by the embodiment of the present application can be a terminal or a server. The electronic device 500 provided by the embodiment of the present application includes: at least one processor 510, a memory 550, at least one network interface 520 and a user interface 530. The various components in the electronic device 500 are coupled together through a bus system 540. It can be understood that the bus system 540 is used to realize the connection and communication between these components. In addition to the data bus, the bus system 540 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, various buses are marked as bus systems 540 in Figure 2.

处理器510可以是一种集成电路芯片,具有信号的处理能力,例如通用处理器、数字信号处理器(Digital Signal Processor,DSP),或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等,其中,通用处理器可以是微处理器或者任何常规的处理器等。The processor 510 can be an integrated circuit chip with signal processing capabilities, such as a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc., where the general-purpose processor can be a microprocessor or any conventional processor, etc.

用户接口530包括使得能够呈现媒体内容的一个或多个输出装置531,包括一个或多个扬声器和/或一个或多个视觉显示屏。用户接口530还包括一个或多个输入装置532,包括有助于用户输入的用户接口部件,比如键盘、鼠标、麦克风、触屏显示屏、摄像头、其他输入按钮和控件。The user interface 530 includes one or more output devices 531 that enable presentation of media content, including one or more speakers and/or one or more visual display screens. The user interface 530 also includes one or more input devices 532, including user interface components that facilitate user input, such as a keyboard, mouse, microphone, touch screen display, camera, other input buttons and controls.

存储器550可以是可移除的,不可移除的或其组合。存储器550可以包括在物理位置上远离处理器510的一个或多个存储设备。存储器550包括易失性存储器或非易失性存储器,也可包括易失性存储器和非易失性存储器两者。非易失性存储器可以是只读存储器(Read Only Memory,ROM),易失性存储器可以是随机存取存储器(Random Access Memory,RAM)。本申请实施例描述的存储器550旨在包括任意适合类型的存储器。The memory 550 may be removable, non-removable, or a combination thereof. The memory 550 may include one or more storage devices physically located away from the processor 510. The memory 550 includes a volatile memory or a non-volatile memory, and may also include both a volatile memory and a non-volatile memory. The non-volatile memory may be a read-only memory (ROM), and the volatile memory may be a random access memory (RAM). The memory 550 described in the embodiments of the present application is intended to include any suitable type of memory.

在一些实施例中,存储器550能够存储数据以支持各种操作,这些数据的示例包括程序、模块和数据结构或者其子集或超集,下面示例性说明。In some embodiments, the memory 550 can store data to support various operations, examples of which include programs, modules, and data structures, or a subset or superset thereof, as exemplarily described below.

操作系统551,包括用于处理各种基本系统服务和执行硬件相关任务的系统程序,例如框架层、核心库层、驱动层等,用于实现各种基础业务以及处理基于硬件的任务;Operating system 551, including system programs for processing various basic system services and performing hardware-related tasks, such as framework layer, core library layer, driver layer, etc., for implementing various basic services and processing hardware-based tasks;

网络通信模块552,用于经由一个或多个(有线或无线)网络接口520到达其他电子设备,示例性的网络接口520包括:蓝牙、无线相容性认证(WiFi)、和通用串行总线(Universal Serial Bus,USB)等;A network communication module 552, used to reach other electronic devices via one or more (wired or wireless) network interfaces 520, exemplary network interfaces 520 include: Bluetooth, Wireless Compatibility Certification (WiFi), and Universal Serial Bus (USB), etc.;

呈现模块553,用于经由一个或多个与用户接口530相关联的输出装置531(例如,显示屏、扬声器等)使得能够呈现信息(例如,用于操作外围设备和显示内容和信息的用户接口);a presentation module 553 for enabling presentation of information via one or more output devices 531 (e.g., display screen, speaker, etc.) associated with the user interface 530 (e.g., a user interface for operating peripherals and displaying content and information);

输入处理模块554,用于对一个或多个来自一个或多个输入装置532之一的一个或多个用户输入或互动进行检测以及翻译所检测的输入或互动。The input processing module 554 is used to detect one or more user inputs or interactions from one of the one or more input devices 532 and translate the detected inputs or interactions.

在一些实施例中,本申请实施例提供的数据校验装置可以采用软件方式实现,图2示出了存储在存储器550中的数据校验装置555,其可以是程序和插件等形式的软件,包括以下软件模块:确定模块5551、获取模块5552、解析模块5553和校验模块5554,这些模块是逻辑上的,因此根据所实现的功能可以进行任意的组合或进一步拆分,将在下文中说明各个模块的功能。In some embodiments, the data verification device provided in the embodiments of the present application can be implemented in software. Figure 2 shows a data verification device 555 stored in the memory 550, which can be software in the form of programs and plug-ins, including the following software modules: a determination module 5551, an acquisition module 5552, a parsing module 5553 and a verification module 5554. These modules are logical, and therefore can be arbitrarily combined or further split according to the functions implemented. The functions of each module will be explained below.

下面说明本申请实施例提供的数据校验方法。在一些实施例中,本申请实施例提供的数据校验方法可以由各种电子设备实施,例如,可以由终端单独实施,也可以由服务器单独实施,也可以由终端和服务器协同实施。以服务器实施为例,参见图3,图3是本申请实施例提供的数据校验方法的流程示意图,本申请实施例提供的数据校验方法包括:The following describes the data verification method provided by the embodiment of the present application. In some embodiments, the data verification method provided by the embodiment of the present application can be implemented by various electronic devices, for example, it can be implemented by a terminal alone, it can also be implemented by a server alone, or it can be implemented by a terminal and a server in collaboration. Taking the server implementation as an example, see Figure 3, which is a flow chart of the data verification method provided by the embodiment of the present application. The data verification method provided by the embodiment of the present application includes:

步骤101:当服务器接收到目标业务的业务数据时,从至少一个数据结构中,确定业务数据的目标数据结构。Step 101: When the server receives service data of a target service, it determines a target data structure of the service data from at least one data structure.

其中,各数据结构分别预定义有相应的数据校验规则。该至少一个数据结构也是预定义的,该数据结构规定了业务数据按照怎样的格式进行传输。Each data structure is predefined with a corresponding data verification rule. The at least one data structure is also predefined, and the data structure specifies the format in which the business data is transmitted.

在步骤101中,该服务器可以是提供目标业务的服务器。在实际应用中,用户所持终端可以设置有支持目标业务的客户端,用户在该终端上通过客户端进行操作,以触发针对业务数据的发送指令。这里,终端发送给服务器的、与目标业务相关的数据均可以称为业务数据。示例性地,该业务数据可以是业务请求,比如视频数据的获取请求,也可以是终端上传的数据,比如图像数据、视频数据等。该目标业务可以是即时通信业务、视频播放业务、音乐播放业务等,在此不作限定。当服务器接收到目标业务的业务数据时,需要对接收的业务数据进行数据校验,以在数据校验通过后,针对业务数据,执行目标业务的业务逻辑。In step 101, the server may be a server that provides a target service. In actual applications, the terminal held by the user may be provided with a client that supports the target service, and the user operates on the terminal through the client to trigger a sending instruction for service data. Here, the data related to the target service sent by the terminal to the server may be referred to as service data. Exemplarily, the service data may be a service request, such as a request to obtain video data, or data uploaded by the terminal, such as image data, video data, etc. The target service may be an instant messaging service, a video playback service, a music playback service, etc., which are not limited here. When the server receives the service data of the target service, it is necessary to perform data verification on the received service data, so that after the data verification passes, the service logic of the target service is executed for the service data.

在本申请实施例中,当接收到业务数据时,在针对业务数据执行目标业务的业务逻辑之前,对业务数据进行数据校验。具体地,在接收到业务数据时,可以调用预先构建的、多个业务共用的数据校验模块(设置有数据校验逻辑),执行本申请实施例提供的数据校验方法,以对业务数据进行校验。如此,将数据校验逻辑独立于业务逻辑,无需将数据校验规则硬编码至业务逻辑代码中,提高了数据校验规则的灵活性以及数据校验规则的可复用性,并提高了开发效率。在实际实施时,当服务器接收到目标业务的业务数据时,首先从预定义的至少一个数据结构中,确定业务数据的目标数据结构。In an embodiment of the present application, when business data is received, before the business logic of the target business is executed for the business data, data verification is performed on the business data. Specifically, when business data is received, a pre-built data verification module (provided with data verification logic) shared by multiple businesses can be called, and the data verification method provided by the embodiment of the present application is executed to verify the business data. In this way, the data verification logic is independent of the business logic, and there is no need to hard-code the data verification rules into the business logic code, which improves the flexibility of the data verification rules and the reusability of the data verification rules, and improves development efficiency. In actual implementation, when the server receives the business data of the target business, first from at least one predefined data structure, the target data structure of the business data is determined.

步骤102:获取针对目标数据结构预定义的目标数据校验规则。Step 102: Obtain target data verification rules predefined for the target data structure.

在步骤102中,由于针对不同的数据结构,预定义有相应的数据校验规则,因此,当确定业务数据的目标数据结构之后,获取针对该目标数据结构预定义的目标数据校验规则。示例性地,业务数据的数据结构为字段a、字段b和字段c,相应的数据校验规则可以为:In step 102, since corresponding data verification rules are predefined for different data structures, after determining the target data structure of the business data, the target data verification rules predefined for the target data structure are obtained. Exemplarily, the data structure of the business data is field a, field b and field c, and the corresponding data verification rules may be:

关于a字段:[(validation.rules).int32={not_in:[0]}],a字段不能为0;Regarding the a field: [(validation.rules).int32 = {not_in: [0]}], the a field cannot be 0;

关于b字段:[(validation.rules).int32.gte=10],b字段不能小于10;Regarding the b field: [(validation.rules).int32.gte=10], the b field cannot be less than 10;

关于c字段:[(validation.rules).int32={gte:1,lte:3}],c字段介于1到3。Regarding the c field: [(validation.rules).int32 = {gte:1,lte:3}], the c field is between 1 and 3.

在一些实施例,该目标数据结构包括目标字段,该目标字段用于定义目标数据结构的数据校验规则;服务器可通过如下方式获取针对目标数据结构预定义的目标数据校验规则:对业务数据进行解析,确定目标字段的目标字段值;将目标字段值,作为针对目标数据结构预定义的目标数据校验规则。In some embodiments, the target data structure includes a target field, which is used to define data verification rules for the target data structure; the server can obtain the target data verification rules predefined for the target data structure in the following manner: parsing the business data to determine the target field value of the target field; using the target field value as the target data verification rules predefined for the target data structure.

这里,在对数据结构预定义相应的数据校验规则时,可以在定义该业务数据的数据结构时实现,即在定义该业务数据的数据结构时,在数据结构中设置一个目标字段,以在该目标字段预定义该业务数据(或业务数据的数据结构)的数据校验规则。如此,将数据结构的定义和数据校验规则的定义统一在一处,有利于后期针对该业务数据的数据校验规则的理解和维护,提升开发效率。Here, when predefining the corresponding data verification rules for the data structure, it can be implemented when defining the data structure of the business data, that is, when defining the data structure of the business data, a target field is set in the data structure to predefine the data verification rules of the business data (or the data structure of the business data) in the target field. In this way, the definition of the data structure and the definition of the data verification rules are unified in one place, which is conducive to the understanding and maintenance of the data verification rules for the business data in the later stage, and improves the development efficiency.

基于此,当获取针对目标数据结构预定义的目标数据校验规则时,则可以对业务数据进行解析,确定业务数据中的目标字段,然后获取目标字段的目标字段值。该目标字段的目标字段值,即为针对目标数据结构预定义的目标数据校验规则。Based on this, when the target data verification rule predefined for the target data structure is obtained, the business data can be parsed to determine the target field in the business data, and then the target field value of the target field is obtained. The target field value of the target field is the target data verification rule predefined for the target data structure.

在一些实施例,该目标数据结构包括目标字段,该目标字段用于存储目标数据结构的数据校验规则的指示信息;服务器可通过如下方式获取针对目标数据结构预定义的目标数据校验规则:对业务数据进行解析,确定目标字段的目标字段值,该目标字段值为指示信息;获取指示信息所指示的数据校验规则;将指示信息所指示的数据校验规则,作为针对目标数据结构预定义的目标数据校验规则。In some embodiments, the target data structure includes a target field, which is used to store indication information of data verification rules of the target data structure; the server can obtain the target data verification rules predefined for the target data structure in the following manner: parse the business data, determine the target field value of the target field, and the target field value is the indication information; obtain the data verification rules indicated by the indication information; use the data verification rules indicated by the indication information as the target data verification rules predefined for the target data structure.

这里,在对数据结构预定义相应的数据校验规则时,可以在定义该业务数据的数据结构时实现,即在定义该业务数据的数据结构时,在数据结构中设置一个目标字段,以在该目标字段存储该业务数据(或业务数据的数据结构)的数据校验规则的指示信息;同时针对该指示信息,预定义该业务数据的数据结构的数据校验规则。如此,在业务数据本身无需携带数据校验规则,能够减少业务数据的数据量,提高网络传输资源的利用率以及数据传输效率;同时,基于指示信息也可以快速地获取到不同数据结构的数据校验规则,同样有利于后期针对该业务数据的数据校验规则的理解和维护,提升开发效率。Here, when predefining the corresponding data verification rules for the data structure, it can be implemented when defining the data structure of the business data, that is, when defining the data structure of the business data, a target field is set in the data structure to store the indication information of the data verification rules of the business data (or the data structure of the business data) in the target field; at the same time, the data verification rules of the data structure of the business data are predefined for the indication information. In this way, the business data itself does not need to carry the data verification rules, which can reduce the amount of business data, improve the utilization rate of network transmission resources and data transmission efficiency; at the same time, based on the indication information, the data verification rules of different data structures can also be quickly obtained, which is also conducive to the understanding and maintenance of the data verification rules for the business data in the later stage, and improve the development efficiency.

基于此,当获取针对目标数据结构预定义的目标数据校验规则时,则可以对业务数据进行解析,确定业务数据中的目标字段,然后获取目标字段的目标字段值,该目标字段值即为该业务数据(或业务数据的数据结构)的数据校验规则的指示信息。如此,将指示信息所指示的数据校验规则,作为针对目标数据结构预定义的目标数据校验规则。Based on this, when the target data verification rule predefined for the target data structure is obtained, the business data can be parsed to determine the target field in the business data, and then the target field value of the target field can be obtained, and the target field value is the indication information of the data verification rule of the business data (or the data structure of the business data). In this way, the data verification rule indicated by the indication information is used as the target data verification rule predefined for the target data structure.

上述两种数据校验规则的预定义方式,均为在定义业务数据的数据结构时实现,即在定义该业务数据的数据结构时,在数据结构中设置一个目标字段,以通过该目标字段存储预定义的数据校验规则的相关信息,该相关信息可以是预定义的数据校验规则本身,也可以是预定义的数据校验规则的指示信息。如此,当获取针对目标数据结构预定义的目标数据校验规则时,则可以对业务数据进行解析,确定业务数据中的目标字段,然后根据目标字段的目标字段值,来获取目标数据校验规则。The above two methods of predefining data verification rules are both implemented when defining the data structure of business data, that is, when defining the data structure of the business data, a target field is set in the data structure to store the relevant information of the predefined data verification rule through the target field. The relevant information can be the predefined data verification rule itself or the indication information of the predefined data verification rule. In this way, when the target data verification rule predefined for the target data structure is obtained, the business data can be parsed to determine the target field in the business data, and then the target data verification rule can be obtained according to the target field value of the target field.

在一些实施例,服务器可通过如下方式获取针对目标数据结构预定义的目标数据校验规则:获取在定义目标数据结构时、针对目标数据结构编辑的注释信息;从注释信息中,提取针对目标数据结构编辑的注释数据校验规则;将注释数据校验规则,作为针对目标数据结构预定义的目标数据校验规则。In some embodiments, the server may obtain the target data verification rules predefined for the target data structure in the following manner: obtaining annotation information edited for the target data structure when defining the target data structure; extracting the annotation data verification rules edited for the target data structure from the annotation information; and using the annotation data verification rules as the target data verification rules predefined for the target data structure.

这里,在对数据结构预定义相应的数据校验规则时,还可以在定义目标数据结构时,在针对目标数据结构编辑的注释中实现,即在定义该业务数据的数据结构时,在编辑的注释信息中,注释该数据结构的数据校验规则。如此,也可以将数据结构的定义和数据校验规则的定义统一在一处,有利于后期针对该业务数据的数据校验规则的理解和维护,提升开发效率。Here, when predefining the corresponding data verification rules for the data structure, it can also be implemented in the annotations edited for the target data structure when defining the target data structure, that is, when defining the data structure of the business data, the data verification rules of the data structure are annotated in the edited annotation information. In this way, the definition of the data structure and the definition of the data verification rules can also be unified in one place, which is conducive to the understanding and maintenance of the data verification rules for the business data in the later stage, and improves the development efficiency.

基于此,当获取针对目标数据结构预定义的目标数据校验规则时,则可以获取在定义目标数据结构时、针对目标数据结构编辑的注释信息,然后从注释信息中,提取针对目标数据结构编辑的注释数据校验规则。该注释数据校验规则,即为针对目标数据结构预定义的目标数据校验规则。Based on this, when obtaining the target data verification rule predefined for the target data structure, the annotation information edited for the target data structure when defining the target data structure can be obtained, and then the annotation data verification rule edited for the target data structure can be extracted from the annotation information. The annotation data verification rule is the target data verification rule predefined for the target data structure.

在一些实施例,服务器可通过如下方式获取针对目标数据结构预定义的目标数据校验规则:获取数据结构和数据校验规则之间的对应关系;基于对应关系,从包括多种数据校验规则的数据校验规则库中,获取目标数据结构对应的数据校验规则;将目标数据结构对应的数据校验规则,作为针对目标数据结构预定义的目标数据校验规则。In some embodiments, the server may obtain target data verification rules predefined for the target data structure in the following manner: obtain the correspondence between the data structure and the data verification rules; based on the correspondence, obtain the data verification rules corresponding to the target data structure from a data verification rule library including multiple data verification rules; and use the data verification rules corresponding to the target data structure as the target data verification rules predefined for the target data structure.

这里,在对数据结构预定义相应的数据校验规则时,可以针对每种数据结构,分别预定义相应的数据校验规则,然后将预定义的数据校验规则存储于数据校验规则库中。具体地,可以在数据校验规则库中,存储多种数据结构的数据校验规则,同时,还可以在数据校验规则库中,存储数据结构和数据校验规则之间的对应关系。Here, when predefining corresponding data verification rules for data structures, corresponding data verification rules can be predefined for each data structure, and then the predefined data verification rules can be stored in a data verification rule library. Specifically, data verification rules for multiple data structures can be stored in the data verification rule library, and at the same time, the corresponding relationship between the data structure and the data verification rule can also be stored in the data verification rule library.

基于此,当获取针对目标数据结构预定义的目标数据校验规则时,可以首先获取数据结构和数据校验规则之间的对应关系,然后基于该对应关系,从数据校验规则库中,获取目标数据结构对应的数据校验规则。该数据校验规则库中目标数据结构对应的数据校验规则,即为针对目标数据结构预定义的目标数据校验规则。Based on this, when obtaining the target data verification rules predefined for the target data structure, the correspondence between the data structure and the data verification rules can be first obtained, and then based on the correspondence, the data verification rules corresponding to the target data structure can be obtained from the data verification rule library. The data verification rules corresponding to the target data structure in the data verification rule library are the target data verification rules predefined for the target data structure.

步骤103:对目标数据校验规则进行解析,得到解析后数据校验规则。Step 103: Parse the target data verification rule to obtain the parsed data verification rule.

在步骤103中,当获取到针对目标数据结构预定义的数据校验规则之后,需要对目标数据校验规则进行解析,得到数据校验逻辑可以理解的数据校验规则,即解析后数据校验规则。In step 103, after the data verification rules predefined for the target data structure are obtained, the target data verification rules need to be parsed to obtain data verification rules that can be understood by the data verification logic, that is, the parsed data verification rules.

在一些实施例,参见图4,图4是本申请实施例提供的数据校验方法的流程示意图。这里,图4示出了当目标数据校验规则包括单条校验规则时,图3中的步骤103可通过如下步骤实现:步骤201,获取目标数据校验规则的校验规则语法;步骤202,基于校验规则语法,对目标数据校验规则进行解析,得到目标数据校验规则的校验规则语法树,校验语法树包括符合目标数据校验规则的校验表达式和校验运算符;步骤203,基于校验表达式和校验运算符,生成解析后数据校验规则。In some embodiments, see Figure 4, which is a flow chart of the data verification method provided by the embodiment of the present application. Here, Figure 4 shows that when the target data verification rule includes a single verification rule, step 103 in Figure 3 can be implemented by the following steps: Step 201, obtaining the verification rule syntax of the target data verification rule; Step 202, based on the verification rule syntax, parsing the target data verification rule to obtain the verification rule syntax tree of the target data verification rule, the verification syntax tree includes the verification expression and the verification operator that conforms to the target data verification rule; Step 203, based on the verification expression and the verification operator, generating the parsed data verification rule.

这里,如果目标数据校验规则仅包括单条校验规则,那么则可以直接获取该目标数据校验规则的校验规则语法,该校验规则语法为在定义目标数据校验规则时设置的。然后基于校验规则语法,分析目标数据校验规则的构成,得到目标数据校验规则的校验规则语法树,该校验规则语法树包括符合目标数据校验规则的校验表达式和校验运算符。其中,校验表达式包括根据字段名对字段值的引用、常量;校验运算符包括算数运算符、逻辑运算符和函数调用等。最后,根据该校验表达式和校验运算符,生成解析后数据校验规则。Here, if the target data verification rule only includes a single verification rule, then the verification rule syntax of the target data verification rule can be directly obtained, and the verification rule syntax is set when defining the target data verification rule. Then, based on the verification rule syntax, the composition of the target data verification rule is analyzed to obtain the verification rule syntax tree of the target data verification rule, which includes a verification expression and a verification operator that conforms to the target data verification rule. Among them, the verification expression includes references and constants to the field value according to the field name; the verification operator includes arithmetic operators, logical operators, and function calls, etc. Finally, based on the verification expression and the verification operator, the parsed data verification rule is generated.

在一些实施例,服务器可通过如下方式基于校验表达式和校验运算符,生成解析后数据校验规则:基于校验表达式和校验运算符,将校验语法树转换为目标形式的目标表达式,并将目标表达式作为解析后数据校验规则。在实际应用中,该目标形式的目标表达式,可以是逆波兰表达式,通过将校验语法树转换为目标形式的目标表达式,能够把复杂表达式转换为简单表达式,降低计算难度,提高计算速度,从而提高数据校验的校验效率。In some embodiments, the server can generate the parsed data validation rule based on the validation expression and the validation operator in the following manner: based on the validation expression and the validation operator, the validation syntax tree is converted into a target expression in a target form, and the target expression is used as the parsed data validation rule. In practical applications, the target expression in the target form can be a reverse Polish notation. By converting the validation syntax tree into a target expression in the target form, a complex expression can be converted into a simple expression, reducing the difficulty of calculation and increasing the calculation speed, thereby improving the validation efficiency of data validation.

在一些实施例,当目标数据校验规则包括多条子校验规则时,服务器可通过如下方式对目标数据校验规则进行解析,得到解析后数据校验规则:对目标数据校验规则进行拆分,得到各条子校验规则,并针对各条子校验规则分别执行如下处理:获取子校验规则的校验规则语法;基于校验规则语法,对子校验规则进行解析,得到子校验规则的校验规则语法树,校验语法树包括符合子校验规则的校验表达式和校验运算符;基于校验表达式和校验运算符,生成子校验规则的解析后子校验规则;其中,各子校验规则的解析后子校验规则,组成解析后数据校验规则。In some embodiments, when the target data verification rule includes multiple sub-verification rules, the server may parse the target data verification rule in the following manner to obtain the parsed data verification rule: split the target data verification rule to obtain each sub-verification rule, and perform the following processing on each sub-verification rule: obtain the verification rule syntax of the sub-verification rule; based on the verification rule syntax, parse the sub-verification rule to obtain the verification rule syntax tree of the sub-verification rule, the verification syntax tree includes the verification expression and the verification operator that conforms to the sub-verification rule; based on the verification expression and the verification operator, generate the parsed sub-verification rule of the sub-verification rule; wherein the parsed sub-verification rules of each sub-verification rule constitute the parsed data verification rule.

这里,如果目标数据校验规则包括多条子校验规则,那么在解析目标数据校验规则时,首先需要对目标数据校验规则进行拆分,得到各条子校验规则,然后分别针对各条子校验规则进行解析。具体地,针对每条子校验规则,分别执行如下处理:获取该子校验规则的校验规则语法;然后基于校验规则语法,分析子校验规则的构成,得到子校验规则的校验规则语法树,该校验规则语法树包括符合子校验规则的校验表达式和校验运算符。其中,校验表达式包括根据字段名对字段值的引用、常量;校验运算符包括算数运算符、逻辑运算符和函数调用等。最后,根据该校验表达式和校验运算符,生成解析后子校验规则。如此,得到各子校验规则的解析后子校验规则,该各子校验规则的解析后子校验规则,组成解析后数据校验规则。Here, if the target data verification rule includes multiple sub-verification rules, then when parsing the target data verification rule, it is necessary to first split the target data verification rule to obtain each sub-verification rule, and then parse each sub-verification rule separately. Specifically, for each sub-verification rule, perform the following processing respectively: obtain the verification rule syntax of the sub-verification rule; then analyze the composition of the sub-verification rule based on the verification rule syntax, and obtain the verification rule syntax tree of the sub-verification rule, which includes the verification expression and verification operator that conforms to the sub-verification rule. Among them, the verification expression includes references and constants to the field value according to the field name; the verification operator includes arithmetic operators, logical operators and function calls, etc. Finally, according to the verification expression and the verification operator, generate the parsed sub-verification rule. In this way, the parsed sub-verification rule of each sub-verification rule is obtained, and the parsed sub-verification rule of each sub-verification rule constitutes the parsed data verification rule.

步骤104:采用解析后数据校验规则,对业务数据进行数据校验,得到业务数据的校验结果,以基于得到的校验结果,对业务数据执行目标业务的业务逻辑。Step 104: Use the parsed data verification rules to perform data verification on the business data to obtain a verification result of the business data, and execute the business logic of the target business on the business data based on the obtained verification result.

在步骤104中,当得到解析后数据校验规则之后,则采用解析后数据校验规则,对业务数据进行数据校验,得到业务数据的校验结果。如此,当得到业务数据的校验结果之后,则可以基于校验结果,对业务数据执行目标业务的业务逻辑。具体地,当校验结果表征业务数据校验通过时,则对业务数据执行目标业务的业务逻辑。In step 104, after obtaining the parsed data verification rule, the parsed data verification rule is used to perform data verification on the business data to obtain the verification result of the business data. In this way, after obtaining the verification result of the business data, the business logic of the target business can be executed on the business data based on the verification result. Specifically, when the verification result indicates that the business data verification has passed, the business logic of the target business is executed on the business data.

在一些实施例,采用解析后数据校验规则,服务器可通过如下方式对业务数据进行数据校验,得到业务数据的校验结果:对业务数据进行解析,确定业务数据中待校验字段的字段值;采用解析后数据校验规则,对待校验字段的字段值进行校验,得到业务数据的校验结果。In some embodiments, by adopting the post-parsed data verification rules, the server can perform data verification on the business data in the following manner to obtain the verification results of the business data: parse the business data to determine the field values of the fields to be verified in the business data; adopt the post-parsed data verification rules to verify the field values of the fields to be verified to obtain the verification results of the business data.

在一些实施例,服务器可通过如下方式对业务数据进行解析,确定业务数据中待校验字段的字段值:对业务数据进行解析,得到业务数据包括的各个字段;获取各字段的字段名;根据各字段的字段名以及解析后数据校验规则,确定业务数据中的待校验字段,并获取待校验字段的字段值。这里,在定义数据结构时,每个字段均定义有相应的字段名。通过将业务数据中各字段的字段名、与解析后数据校验规则所涉及的字段名进行匹配,确定业务数据中的待校验字段,即,将将业务数据中各字段的字段名中、与解析后数据校验规则所涉及的字段名相同的字段名,作为该待校验字段。当确定待校验字段后,同时获取待校验字段的字段值。In some embodiments, the server may parse the business data in the following manner to determine the field value of the field to be checked in the business data: parse the business data to obtain the various fields included in the business data; obtain the field name of each field; determine the field to be checked in the business data according to the field name of each field and the parsed data verification rule, and obtain the field value of the field to be checked. Here, when defining the data structure, each field is defined with a corresponding field name. The field to be checked in the business data is determined by matching the field name of each field in the business data with the field name involved in the parsed data verification rule, that is, the field name of each field in the business data that is the same as the field name involved in the parsed data verification rule is used as the field to be checked. After the field to be checked is determined, the field value of the field to be checked is obtained at the same time.

在一些实施例,当解析后数据校验规则包括多条解析后校验规则、且待校验字段的数量为多个时,采用解析后数据校验规则,服务器可通过如下方式对待校验字段的字段值进行校验,得到业务数据的校验结果:针对各解析后校验规则,分别执行如下处理:确定解析后校验规则对应的待校验字段组,待校验字段组包括至少一个待校验字段;采用解析后校验规则,对待校验字段组中待校验字段的字段值进行校验,得到待校验字段组的字段组校验结果;基于各解析后校验规则对应的字段组校验结果,确定业务数据的校验结果。In some embodiments, when the post-parsed data verification rules include multiple post-parsed verification rules and the number of fields to be checked is multiple, the post-parsed data verification rules are adopted, and the server can verify the field value of the field to be checked in the following manner to obtain the verification result of the business data: for each post-parsed verification rule, the following processing is performed respectively: determine the field group to be checked corresponding to the post-parsed verification rule, the field group to be checked includes at least one field to be checked; adopt the post-parsed verification rules to verify the field value of the field to be checked in the field group to be checked, and obtain the field group verification result of the field group to be checked; based on the field group verification results corresponding to each post-parsed verification rule, determine the verification result of the business data.

这里,如果解析后数据校验规则包括多条解析后校验规则、且待校验字段的数量为多个,那么可以将解析后数据校验规则进行拆分,得到各条解析后校验规则,然后针对各条解析后校验规则,分别执行如下处理:从多个待校验字段中,确定该解析后校验规则对应的待校验字段组,该待校验字段组包括至少一个待校验字段,如此,既可以实现对单字段的数据校验,也可以实现对关联的多字段的数据校验,从而支持更为复杂的数据校验逻辑。然后,采用解析后校验规则,对待校验字段组中待校验字段的字段值进行校验,得到待校验字段组的字段组校验结果。最后,则可以基于各解析后校验规则对应的字段组校验结果,确定业务数据的校验结果。具体地,可以设置各字段组校验结果与业务数据的校验结果之间的映射关系,比如,各字段组校验结果中全部字段组校验结果为校验通过时,校验结果为校验通过;或者,各字段组校验结果中特定字段组校验结果为校验通过时,校验结果为校验通过;或者,各字段组校验结果中部分字段组校验结果为校验通过时,校验结果为校验通过;等等。Here, if the post-parsed data verification rules include multiple post-parsed verification rules and the number of fields to be verified is multiple, then the post-parsed data verification rules can be split to obtain individual post-parsed verification rules, and then the following processing is performed for each post-parsed verification rule: from multiple fields to be verified, determine the field group to be verified corresponding to the post-parsed verification rule, and the field group to be verified includes at least one field to be verified. In this way, data verification of a single field can be achieved, and data verification of associated multiple fields can also be achieved, thereby supporting more complex data verification logic. Then, the post-parsed verification rules are used to verify the field values of the fields to be verified in the field group to be verified, and the field group verification results of the field group to be verified are obtained. Finally, the verification results of the business data can be determined based on the field group verification results corresponding to each post-parsed verification rule. Specifically, a mapping relationship between the verification results of each field group and the verification results of the business data can be set. For example, when the verification results of all field groups in the verification results of each field group are verification passed, the verification result is verification passed; or, when the verification results of a specific field group in the verification results of each field group are verification passed, the verification result is verification passed; or, when the verification results of some field groups in the verification results of each field group are verification passed, the verification result is verification passed; and so on.

在一些实施例,当解析后数据校验规则包括单条解析后校验规则、且待校验字段的数量为多个时,那么该解析后数据校验规则所对应的待校验字段组即为该多个待校验字段组成的。此时,则直接采用解析后校验规则,对多个待校验字段的字段值进行校验,得到业务数据的校验结果。In some embodiments, when the post-parsed data verification rule includes a single post-parsed verification rule and the number of fields to be verified is multiple, then the field group to be verified corresponding to the post-parsed data verification rule is composed of the multiple fields to be verified. In this case, the post-parsed verification rule is directly used to verify the field values of the multiple fields to be verified to obtain the verification result of the business data.

在一些实施例,如果解析后数据校验规则包括至少一条解析后校验规则,且每条解析后校验规则均用于单字段的数据校验时,那么则直接采用各条解析后校验规则,对该条解析后校验规则对应的待校验字段的字段值进行校验即可。In some embodiments, if the post-parsed data verification rules include at least one post-parsed verification rule, and each post-parsed verification rule is used for data verification of a single field, then each post-parsed verification rule is directly adopted to verify the field value of the field to be verified corresponding to the post-parsed verification rule.

在一些实施例,当采用解析后数据校验规则,对业务数据进行数据校验,得到业务数据的校验结果之后,服务器还可执行如下处理:当校验结果表征业务数据校验未通过时,获取业务数据的校验告警策略;基于校验告警策略,对校验结果进行告警处理。In some embodiments, when the parsed data verification rules are used to perform data verification on the business data and the verification results of the business data are obtained, the server can also perform the following processing: when the verification result indicates that the business data verification has failed, obtain the verification alarm strategy of the business data; based on the verification alarm strategy, perform alarm processing on the verification result.

这里,如果针对业务数据的校验未通过时,则获取预设的业务数据的校验告警策略,该交校验告警策略可以是根据业务数据的实际内容设置的,比如业务数据为验证码时,那么该校验告警策略可以是返回告警信息(例如验证码错误、验证码失效等等)、输出告警音等。从而基于获取的校验告警策略,对校验结果进行告警处理,以表征该业务数据校验未通过。Here, if the verification of the business data fails, the preset verification alarm strategy of the business data is obtained. The verification alarm strategy can be set according to the actual content of the business data. For example, when the business data is a verification code, the verification alarm strategy can be to return an alarm message (such as a verification code error, a verification code failure, etc.), output an alarm tone, etc. Thus, based on the obtained verification alarm strategy, the verification result is processed with an alarm to indicate that the business data verification has failed.

应用本申请上述实施例,针对业务数据的每种数据结构,均预定义了相应的数据校验规则,当接收到目标业务的业务数据时,则获取针对该业务数据的目标数据结构预定义的目标数据校验规则,然后解析目标数据校验规则,以采用解析后数据校验规则实现业务数据的校验,从而在针对业务数据执行业务逻辑之前,即可实现业务数据的数据校验。如此,仅需要对每种数据结构预定义相应的数据校验规则,无需编写数据校验规则的校验代码、以及将校验代码硬编码至业务逻辑代码中,简化了数据校验的实现逻辑,提高了数据校验规则的灵活性,便于数据校验规则的维护和复用,并提高了数据校验的开发效率。By applying the above-mentioned embodiments of the present application, corresponding data verification rules are predefined for each data structure of the business data. When the business data of the target business is received, the target data verification rules predefined for the target data structure of the business data are obtained, and then the target data verification rules are parsed to implement the verification of the business data using the parsed data verification rules, so that the data verification of the business data can be implemented before the business logic is executed for the business data. In this way, it is only necessary to predefine the corresponding data verification rules for each data structure, and there is no need to write the verification code of the data verification rules and hard-code the verification code into the business logic code, which simplifies the implementation logic of the data verification, improves the flexibility of the data verification rules, facilitates the maintenance and reuse of the data verification rules, and improves the development efficiency of the data verification.

下面将以业务数据采用Pb协议传输为例,说明本申请实施例在一个实际的应用场景中的示例性应用。The following will take the transmission of business data using the Pb protocol as an example to illustrate an exemplary application of an embodiment of the present application in an actual application scenario.

本申请实施例提供的数据校验方法可应用于目标业务的后台服务系统的接入层,即后台服务系统接收到目标业务的业务请求之后的预处理环节,该业务请求携带业务数据。在预处理环节中,后台服务系统首先需要对业务请求(即业务请求携带的业务数据)进行合法性校验。在实际应用中,由于接收业务请求的后台系统都有校验业务请求的逻辑,因此,无论是和前端交互的后台服务系统,还是更加下游的后台服务系统,只要是接收业务请求并校验业务请求的后台服务系统,都可以应用本申请实施例提供的数据校验方法。The data verification method provided in the embodiment of the present application can be applied to the access layer of the background service system of the target business, that is, the pre-processing link after the background service system receives the business request of the target business, and the business request carries business data. In the pre-processing link, the background service system first needs to perform a legitimacy check on the business request (that is, the business data carried by the business request). In practical applications, since the background system that receives the business request has the logic of verifying the business request, therefore, whether it is a background service system that interacts with the front end, or a more downstream background service system, as long as it is a background service system that receives the business request and verifies the business request, the data verification method provided in the embodiment of the present application can be applied.

作为示例,参见图5,图5是本申请实施例提供的数据校验的应用系统的架构示意图。这里,数据校验的应用系统包括:用户表示层(提供用户访问界面,如客户端、小程序、网页端、电脑端等)、通用网关层(如提供负载均衡、协议转换、流量管理等功能)、数据校验层、业务网关层(如提供路由管理、权限校验、数据转换等功能)、业务逻辑层(如提供业务逻辑封装、业务中台服务等功能)、数据访问层(如提供数据封装以及数据访问等功能)和基础设施层(如提供数据存储、消息队列、基础服务、中间件服务等功能)。其中,用户表示层可由前端实现,通用网关层可由公司级的服务实现,基础设施层可使用通用设施的实现,后台服务系统主要实现业务网关层、业务逻辑层、数据访问层和数据校验层。As an example, see Figure 5, Figure 5 is a schematic diagram of the architecture of the application system of data verification provided by the embodiment of the present application. Here, the application system of data verification includes: user presentation layer (providing user access interface, such as client, applet, web page, computer, etc.), general gateway layer (such as providing load balancing, protocol conversion, traffic management and other functions), data verification layer, business gateway layer (such as providing routing management, permission verification, data conversion and other functions), business logic layer (such as providing business logic encapsulation, business middle platform services and other functions), data access layer (such as providing data encapsulation and data access and other functions) and infrastructure layer (such as providing data storage, message queues, basic services, middleware services and other functions). Among them, the user presentation layer can be implemented by the front end, the general gateway layer can be implemented by company-level services, the infrastructure layer can use the implementation of general facilities, and the background service system mainly implements the business gateway layer, business logic layer, data access layer and data verification layer.

而实际在相关技术中,数据校验是在业务网关层实现的。主要原因是,相关技术中的数据校验通常采用硬编码实现方法,即,将根据数据校验规则编码得到的数据校验代码,硬编码至业务代码中,从而在业务代码运行时实现数据校验。但是,硬编码实现方法存在以下问题:1)实现复杂。复杂的业务数据带来复杂的数据校验代码实现,而且业务数据往往存在多层嵌套,不同业务数据之间存在若干依赖与指向关系,更加增加了数据校验代码实现的复杂性。2)维护复杂。随着业务的发展,业务数据会发生诸多变化与迭代,随之而来的数据校验代码也必须进行相应迭代。在数据变化的情况下,很容易因为数据校验代码的复杂性导致迭代存在故障bug而影响正常运行。3)复用复杂。不同业务之间可能存在使用相同业务数据的情况,但是硬编码在业务网关层的数据校验代码无法直接复用,减少了代码的可复用性,提高了重复编码的工作量,降低了效率。In fact, in the relevant technology, data verification is implemented at the business gateway layer. The main reason is that data verification in the relevant technology usually adopts a hard-coded implementation method, that is, the data verification code encoded according to the data verification rules is hard-coded into the business code, so as to implement data verification when the business code is running. However, the hard-coded implementation method has the following problems: 1) Complex implementation. Complex business data brings complex data verification code implementation, and business data often has multiple layers of nesting, and there are several dependencies and pointing relationships between different business data, which further increases the complexity of data verification code implementation. 2) Complex maintenance. With the development of business, business data will undergo many changes and iterations, and the resulting data verification code must also be iterated accordingly. In the case of data changes, it is easy to cause iteration failures and bugs due to the complexity of the data verification code, which will affect normal operation. 3) Complex reuse. There may be situations where the same business data is used between different businesses, but the data verification code hard-coded in the business gateway layer cannot be directly reused, which reduces the reusability of the code, increases the workload of repeated coding, and reduces efficiency.

基于此,在本申请实施例中,数据校验方法可如此实现:在Pb协议中对数据的每个字段添加tag,并在tag中规定该字段的数据校验规则。例如,一个数据结构data有三个整数字段a、b、c,如果a字段不能为0,b字段不能小于10,c字段介于1到3,则在Pb协议中可以分别给三个字段增加tag,并在tag中规定如下数据校验规则:Based on this, in the embodiment of the present application, the data verification method can be implemented as follows: add a tag to each field of the data in the Pb protocol, and specify the data verification rules of the field in the tag. For example, a data structure data has three integer fields a, b, and c. If the a field cannot be 0, the b field cannot be less than 10, and the c field is between 1 and 3, then in the Pb protocol, you can add tags to the three fields respectively, and specify the following data verification rules in the tag:

关于a字段:[(validation.rules).int32={not_in:[0]}];Regarding field a: [(validation.rules).int32 = {not_in: [0]}];

关于b字段:[(validation.rules).int32.gte=10];Regarding the b field: [(validation.rules).int32.gte=10];

关于c字段:[(validation.rules).int32={gte:1,lte:3}];Regarding the c field: [(validation.rules).int32 = {gte:1,lte:3}];

这里,Pb协议分别对三个字段规定了数据校验规则,通过protoc-gen-validate插件可以生成实现相关数据校验规则的桩代码,在桩代码中实现了对三个字段的数据校验,桩代码的业务逻辑如下:Here, the Pb protocol specifies data validation rules for the three fields respectively. The protoc-gen-validate plug-in can generate stub codes that implement the relevant data validation rules. The data validation of the three fields is implemented in the stub code. The business logic of the stub code is as follows:

如果a字段不是不处于[0]的范围内,则返回报错;If the a field is not in the range of [0], an error is returned;

如果b字段不是大于等于10,则返回报错;If the b field is not greater than or equal to 10, an error is returned;

如果c字段不是大于等于1或者不是小于等于3,则返回报错;If the c field is not greater than or equal to 1 or less than or equal to 3, an error is returned;

如此,可以通过Pb协议中对字段的tag生成相关的桩代码,然后通过调用桩代码中的逻辑,实现对三个字段分别的校验。但是,该方案却只能实现对单字段的数据校验,而这种数据校验只占业务数据校验的一小部分,对于很多业务场景,都无法满足数据校验的要求。In this way, the relevant stub code can be generated by the tag of the field in the Pb protocol, and then the logic in the stub code can be called to implement the verification of the three fields separately. However, this solution can only implement data verification of a single field, and this data verification only accounts for a small part of business data verification. For many business scenarios, it cannot meet the data verification requirements.

基于此,本申请实施例还提供一种数据校验方法,以至少解决上述存在的问题。接下来继续参见图5进行详细说明。在本申请实施例中,在通用网关层和业务网关层之间增加了数据校验层,从而可以在通用网关层向业务网关层传输业务数据时,通过配置化(即针对Message数据结构定义相应的数据校验规则、在第三方配置数据校验规则)的方式进行数据的整体校验。如此,1)将通用网关层传往业务网关层的数据,和业务网关层的数据关联到了一起,有利于提高业务数据校验的可复用性,将数据与数据校验在设计上合并也有助于后续维护;2)针对数据校验层本身,将数据校验的功能从业务网关层相对地抽离出来,不再通过硬编码的方式实现,减少了实现和维护的复杂度。Based on this, the embodiment of the present application also provides a data verification method to at least solve the above-mentioned problems. Next, refer to Figure 5 for detailed description. In the embodiment of the present application, a data verification layer is added between the general gateway layer and the business gateway layer, so that when the general gateway layer transmits business data to the business gateway layer, the overall data verification can be performed by configuration (i.e., defining corresponding data verification rules for the Message data structure and configuring data verification rules in a third party). In this way, 1) the data transmitted from the general gateway layer to the business gateway layer is associated with the data of the business gateway layer, which is conducive to improving the reusability of business data verification. The merging of data and data verification in design also helps subsequent maintenance; 2) for the data verification layer itself, the function of data verification is relatively extracted from the business gateway layer, and is no longer implemented by hard coding, which reduces the complexity of implementation and maintenance.

在本申请实施例中,可以在业务使用的Pb协议中引用本申请实施例提供的共用Pb协议。该共用Pb协议,相当于为业务使用的Pb协议中的Message增加了一个自定义字段。如此,针对业务使用的Pb协议中的特定Message,可以在该Message对应的自定义字段中定义该Message的数据校验规则。如此,实现针对Message数据结构定义相应的数据校验规则。基于此,在代码逻辑中,可以引用本申请实施例提供的共用包(即共用Pb协议),在接入层获取到业务请求中业务数据的数据结构之后,调用共用包的数据校验规则进行数据校验。具体地,共用包将完成以下逻辑:1)确定传入的业务数据的Message数据结构(即具体是Pb协议的哪个类型的Message),并获取针对该Message数据结构预先定义的数据校验规则;2)根据预定义的数据校验语法对该数据校验规则进行解析,得到解析后的数据校验规则;3)根据解析后的数据校验规则,对业务数据进行校验,得到校验结果。In an embodiment of the present application, the shared Pb protocol provided in the embodiment of the present application can be referenced in the Pb protocol used by the business. The shared Pb protocol is equivalent to adding a custom field to the Message in the Pb protocol used by the business. In this way, for a specific Message in the Pb protocol used by the business, the data verification rule of the Message can be defined in the custom field corresponding to the Message. In this way, the corresponding data verification rules are defined for the Message data structure. Based on this, in the code logic, the shared package (i.e., shared Pb protocol) provided in the embodiment of the present application can be referenced, and after the access layer obtains the data structure of the business data in the business request, the data verification rules of the shared package are called to perform data verification. Specifically, the shared package will complete the following logic: 1) Determine the Message data structure of the incoming business data (i.e., which type of Message of the Pb protocol is specific), and obtain the data verification rules predefined for the Message data structure; 2) Parse the data verification rules according to the predefined data verification syntax to obtain the parsed data verification rules; 3) Verify the business data according to the parsed data verification rules to obtain the verification results.

在实际实施中,校验结果分为两类,如果定义的所有数据校验规则均通过,则不报错,如果有未通过的数据校验规则,将返回部分或所有未通过的数据校验规则所对应的报错信息。基于此,无需在业务代码中硬编码数据校验规则,而是采取上述调用公用包的数据校验规则的方式进行数据校验。在数据校验完成之后,业务代码根据校验结果(即是否需要返回报错信息),决定下一步是返回报错还是继续执行,或者采取警告等一系列措施。In actual implementation, the verification results are divided into two categories. If all defined data verification rules are passed, no error will be reported. If there are data verification rules that fail, the error information corresponding to some or all of the failed data verification rules will be returned. Based on this, there is no need to hard-code data verification rules in the business code, but the above-mentioned method of calling the data verification rules of the public package is adopted to perform data verification. After the data verification is completed, the business code decides whether to return an error or continue execution, or take a series of measures such as warnings, based on the verification results (i.e., whether error information needs to be returned).

下面对本申请实施例中的数据校验层进行详细说明。The data verification layer in the embodiment of the present application is described in detail below.

(1)使用方式。参见图6,图6是本申请实施例提供的数据校验方法的架构示意图。如图6所示,该数据校验层包括数据校验规则部分与数据校验逻辑部分。业务网关层从上层获取到业务数据后,将业务数据传入数据校验逻辑部分;数据校验规则部分则将数据校验规则传入数据校验逻辑部分;如此,数据校验逻辑部分则可以基于数据校验规则对业务数据进行数据校验。(1) Usage. See Figure 6, which is a schematic diagram of the architecture of the data verification method provided in an embodiment of the present application. As shown in Figure 6, the data verification layer includes a data verification rule part and a data verification logic part. After the business gateway layer obtains the business data from the upper layer, it passes the business data to the data verification logic part; the data verification rule part passes the data verification rules to the data verification logic part; in this way, the data verification logic part can perform data verification on the business data based on the data verification rules.

这里,数据校验规则可以来自数据结构的定义,能够使数据结构的定义和数据校验规则实现相对整合;该数据校验规则也可以来自于第三方配置源,实现数据校验规则的配置化更改。Here, the data verification rules may come from the definition of the data structure, so that the definition of the data structure and the data verification rules can be relatively integrated; the data verification rules may also come from a third-party configuration source to achieve configuration-based changes to the data verification rules.

(2)数据校验逻辑的实现。数据校验逻辑的实现包括:步骤1)获取业务数据中每个字段的字段值;步骤2)针对每个字段,执行该字段的字段值是否合法的逻辑。(2) Implementation of data verification logic. The implementation of data verification logic includes: step 1) obtaining the field value of each field in the business data; step 2) for each field, executing the logic of whether the field value of the field is legal.

步骤1)参见图7,图7是本申请实施例提供的业务数据的字段值的获取流程示意图。这里,获取业务数据中每个字段的字段值时,使用的是Pb协议提供的反射能力。使用Pb协议的反射能力,可以根据业务数据中每个字段的字段名获取到字段值。具体的,1.将业务数据进行反序列化,得到Pb协议的protobuf.message数据结构;2.使用Pb协议提供的反射接口,将protobuf.message数据结构转化为protoreflect.message数据结构;3.通过protoreflect.message提供的MessageDescriptor接口,结合业务数据中每个字段的字段名获取到相应的字段值。Step 1) See Figure 7, which is a schematic diagram of the process of obtaining the field value of the business data provided in the embodiment of the present application. Here, when obtaining the field value of each field in the business data, the reflection capability provided by the Pb protocol is used. Using the reflection capability of the Pb protocol, the field value can be obtained according to the field name of each field in the business data. Specifically, 1. Deserialize the business data to obtain the protobuf.message data structure of the Pb protocol; 2. Use the reflection interface provided by the Pb protocol to convert the protobuf.message data structure into a protoreflect.message data structure; 3. Use the MessageDescriptor interface provided by protoreflect.message to obtain the corresponding field value in combination with the field name of each field in the business data.

步骤2)分为两个阶段。1、解析阶段:对传入的数据校验规则的字符串进行解析,该解析后的数据校验规则是逻辑可以理解的,且具有预设的校验规则数据结构的。2、执行阶段:将解析后的数据校验规则使用校验执行器进行执行。Step 2) is divided into two stages. 1. Parsing stage: Parse the string of the incoming data verification rule. The parsed data verification rule is logically understandable and has a preset verification rule data structure. 2. Execution stage: Execute the parsed data verification rule using the verification executor.

(3)数据校验规则的传入。(3) Input of data verification rules.

第一,参见图8,图8是本申请实施例提供的数据校验规则的获取示意图。这里,在Protobuf文件中,将数据校验规则与Message数据结构定义编写在一起,从而在通过Protobuf提供的custom option功能可以在Protobuf中定义Message数据结构的同时,在Message数据结构的custom option定义数据校验规则。在实际应用中,在Protobuf文件中同时定义数据结构和数据校验规则,能够实现数据结构定义和数据校验规则定义的整合。First, refer to Figure 8, which is a schematic diagram of obtaining data verification rules provided by an embodiment of the present application. Here, in the Protobuf file, the data verification rules are written together with the Message data structure definition, so that while the Message data structure can be defined in Protobuf through the custom option function provided by Protobuf, the data verification rules can be defined in the custom option of the Message data structure. In practical applications, defining the data structure and the data verification rules in the Protobuf file at the same time can achieve the integration of the data structure definition and the data verification rule definition.

其中,在业务使用的Pb协议中增加数据校验规则的方式如下:1)在业务使用的Pb协议中引用本申请实施例提供的共用Pb协议,在共用Pb协议中定义了Message的扩展字段,名为check;2)引用共用Pb协议后,可以在Mmessage定义名为check的扩展字段,如此,根据此Message所构建的数据结构可以获取到该扩展字段。Among them, the method of adding data verification rules in the Pb protocol used by the business is as follows: 1) Reference the common Pb protocol provided in the embodiment of the present application in the Pb protocol used by the business, and define an extension field of Message named check in the common Pb protocol; 2) After referencing the common Pb protocol, an extension field named check can be defined in Mmessage, so that the data structure constructed according to this Message can obtain the extension field.

在另外一些实施例中,关于在Pb协议定义数据校验规则,也可以使用Pb协议的注释实现,即在Pb协议的注释中定义数据校验规则。In some other embodiments, the data verification rules defined in the Pb protocol may also be implemented using the annotations of the Pb protocol, that is, the data verification rules are defined in the annotations of the Pb protocol.

第二,参见图9,图9是本申请实施例提供的数据校验规则的获取示意图。这里,在Protobuf文件中,仅定义Message数据结构。可以在第三方配置数据校验规则,得到一个数据校验规则库,从而可以从数据校验规则库中来获取需要的数据校验规则。如此,可以根据需要灵活修改数据校验规则,业务可以根据适用场景合理选择。Second, referring to FIG. 9 , FIG. 9 is a schematic diagram of obtaining data verification rules provided in an embodiment of the present application. Here, in the Protobuf file, only the Message data structure is defined. Data verification rules can be configured on a third party to obtain a data verification rule library, so that the required data verification rules can be obtained from the data verification rule library. In this way, the data verification rules can be flexibly modified as needed, and the business can be reasonably selected according to the applicable scenario.

4)数据校验规则的设计。在一些示例中,本申请实施例提供的定义数据校验规则的校验规则语法可以如下:4) Design of data verification rules. In some examples, the verification rule syntax for defining data verification rules provided in the embodiments of the present application may be as follows:

1)每条数据校验规则的基本语法为:[数据校验规则]:[数据校验规则命中后所返回的报错信息]。这里,当数据校验规则命中后,表征针对业务数据校验未通过,则返回相应的报错信息;1) The basic syntax of each data verification rule is: [data verification rule]: [error information returned after the data verification rule is hit]. Here, when the data verification rule is hit, it means that the business data verification fails, and the corresponding error information is returned;

2)数据校验规则中使用“$字段名.子字段名”的方式获取待校验字段;2) In the data verification rule, use the method of "$field name.subfield name" to obtain the field to be verified;

3)四则运算及比较运算,例如:+、-、*、/、==、!=、>、<;3) Four arithmetic operations and comparison operations, such as: +, -, *, /, ==, !=, >, <;

4)预定义函数。这里,使用预定义函数时需要使用@前缀,如:@is_empty($firstSub),该函数表示取出firstSub字段,若为空则返回true;4) Predefined functions. Here, you need to use the @ prefix when using a predefined function, such as: @is_empty($firstSub), which means taking out the firstSub field and returning true if it is empty;

5)且、或、非逻辑组合功能;5) AND, OR, NOT logical combination functions;

6)数组遍历功能。比如取出数组中的特定元素,可以使用[序号]的方式;此外还需要遍历数组,采用for…range类似的方式进行定义;6) Array traversal function. For example, to retrieve a specific element from an array, you can use the [serial number] method; in addition, if you need to traverse the array, you can define it in a similar way as for...range;

7)反序列化功能。这里,反序列化校验函数接收两个参数,一个是需要反序列化的字符串,另一个是需要反序列化的Message全名,该函数将根据Message全名获取Message类型,将字符串反序列化为该Message,并从该Message中获取数据校验规则进行校验。7) Deserialization function. Here, the deserialization verification function receives two parameters, one is the string to be deserialized, and the other is the full name of the Message to be deserialized. The function will obtain the Message type according to the full name of the Message, deserialize the string into the Message, and obtain the data verification rules from the Message for verification.

8)抽取校验函数功能。这里,可以支持在数据校验规则中定义数据校验函数,确定函数的入参和校验规则。其中,使用#开头表示使用的是自定义的数据校验函数。数据校验函数中的具体校验规则与前述其他校验规则相同,区别在于其可以使用$入参的方式获取到入参,并进一步进行校验。8) Extract verification function. Here, it is possible to support defining a data verification function in a data verification rule, and determining the function's input parameters and verification rules. The use of # at the beginning indicates that a custom data verification function is used. The specific verification rules in the data verification function are the same as the other verification rules mentioned above, except that it can use the $input parameter method to obtain the input parameters and further perform verification.

在实际应用中,关于数据校验规则的定义,形式上可以包括数据校验规则和报错信息等,内容上可以包括四则运算比较、逻辑运算、复合逻辑抽取、数组处理、反序列化处理等功能,在设计上可以采取不同的设计方式。形式、内容、以及设计方式在此不作限定。In practical applications, the definition of data validation rules may include data validation rules and error messages in form, and may include arithmetic comparison, logical operations, compound logic extraction, array processing, deserialization processing and other functions in content. Different design methods may be adopted in design. The form, content, and design method are not limited here.

(5)数据校验规则的解析与执行。(5) Analysis and execution of data verification rules.

参见图10,图10是本申请实施例提供的数据校验规则的处理示意图。这里,数据校验规则的解析与执行包括三步。其中,第一步是:将读入的多条校验规则,解析为单条校验规则,此后进一步解析和执行单条校验规则。第二步是:根据校验规则的语法设计,分析单条校验规则的构成,将单条校验规则解析为语法树。具体地,可以将该校验规则拆分为符合校验规则的表达式和运算符,以组成语法树。其中,表达式包括根据字段名对字段值的引用、常量;运算符包括算数运算符、逻辑运算符和函数调用。第三步是:将语法树组织成逆波兰表达式,由执行器读入运算符和相应数量的表达式进行计算。其中,算术运算符和逻辑运算符按照算术运算和逻辑运算的逻辑执行即可,函数调用运算需要根据函数名获取到需要执行的函数,并通过函数调用进行执行。Referring to FIG. 10 , FIG. 10 is a processing diagram of the data verification rules provided in an embodiment of the present application. Here, the parsing and execution of the data verification rules include three steps. Among them, the first step is: parsing the multiple verification rules read in into a single verification rule, and then further parsing and executing the single verification rule. The second step is: according to the grammatical design of the verification rule, analyzing the composition of the single verification rule, and parsing the single verification rule into a syntax tree. Specifically, the verification rule can be split into expressions and operators that conform to the verification rule to form a syntax tree. Among them, the expression includes references to field values and constants according to the field name; the operator includes arithmetic operators, logical operators and function calls. The third step is: organizing the syntax tree into a reverse Polish notation, and the executor reads in the operator and the corresponding number of expressions for calculation. Among them, the arithmetic operator and the logical operator can be executed according to the logic of the arithmetic operation and the logical operation, and the function call operation needs to obtain the function to be executed according to the function name, and execute it through the function call.

应用本申请上述实施例,1)本申请实施例将数据结构的定义和数据校验规则都放在Pb协议中,减少了对Pb数据结构的理解难度,使得Pb协议的其他使用方可以一目了然地理解数据结构的定义,以及数据结构的合法形式。2)本申请实施例将业务数据的数据校验规则都维护在Pb协议中,相较于硬编码数据校验规则至业务代码中的方案,如果数据校验规则有变化或业务内容有所增加等,需要修改数据校验规则,此时只需要更新Pb协议中定义的数据校验规则即可。如此,减少了校验逻辑的分散性,增强了校验逻辑的可维护性,很好地提升了开发效率,节约开发时间,也减少了业务代码变更导致的线上运行bug等问题。3)本申请实施例基于Pb协议的Message数据结构,定义整体校验规则,不局限于单字段校验,可以实现对数据结构内关联字段的校验逻辑,例如:且、或、非逻辑组合功能,交并差校验逻辑,定义校验函数和反序列化后校验等能力(详见上述4)数据校验规则的设计)。如此,通过对Message数据结构进行整体校验,能够支持复杂校验逻辑,极大地扩展了数据校验规则可以涵盖的范围,可以实现多字段校验的校验逻辑。Applying the above embodiments of the present application, 1) the embodiment of the present application puts the definition of the data structure and the data verification rules in the Pb protocol, which reduces the difficulty of understanding the Pb data structure, so that other users of the Pb protocol can understand the definition of the data structure and the legal form of the data structure at a glance. 2) The embodiment of the present application maintains the data verification rules of the business data in the Pb protocol. Compared with the solution of hard-coding the data verification rules into the business code, if the data verification rules change or the business content increases, etc., the data verification rules need to be modified. At this time, only the data verification rules defined in the Pb protocol need to be updated. In this way, the dispersion of the verification logic is reduced, the maintainability of the verification logic is enhanced, the development efficiency is greatly improved, the development time is saved, and the problems such as online operation bugs caused by business code changes are reduced. 3) The embodiment of the present application is based on the Message data structure of the Pb protocol, and defines the overall verification rules, which are not limited to single-field verification, and can implement the verification logic of the associated fields in the data structure, such as: and, or, non-logical combination functions, intersection and difference verification logic, definition of verification functions and verification after deserialization, etc. (see the above 4) Design of data verification rules for details). In this way, by performing overall verification on the Message data structure, complex verification logic can be supported, which greatly expands the scope of data verification rules and can implement verification logic for multi-field verification.

下面继续说明本申请实施例提供的数据校验装置555的实施为软件模块的示例性结构,在一些实施例中,如图2所示,存储在存储器550的数据校验装置555中的软件模块可以包括:确定模块5551,用于当接收到目标业务的业务数据时,从至少一个数据结构中,确定所述业务数据的目标数据结构,其中,不同数据结构预定义有相应的数据校验规则;获取模块5552,用于获取针对所述目标数据结构预定义的目标数据校验规则;解析模块5553,用于对所述目标数据校验规则进行解析,得到解析后数据校验规则;校验模块5554,用于采用所述解析后数据校验规则,对所述业务数据进行数据校验,得到所述业务数据的校验结果;其中,所述校验结果,用于供基于所述校验结果,对所述业务数据执行所述目标业务的业务逻辑。The following continues to describe an exemplary structure of the data verification device 555 provided in the embodiment of the present application implemented as a software module. In some embodiments, as shown in Figure 2, the software module stored in the data verification device 555 of the memory 550 may include: a determination module 5551, which is used to determine the target data structure of the business data from at least one data structure when receiving the business data of the target business, wherein different data structures are predefined with corresponding data verification rules; an acquisition module 5552, which is used to obtain the target data verification rules predefined for the target data structure; a parsing module 5553, which is used to parse the target data verification rules to obtain the parsed data verification rules; a verification module 5554, which is used to use the parsed data verification rules to perform data verification on the business data to obtain the verification result of the business data; wherein the verification result is used to execute the business logic of the target business on the business data based on the verification result.

在一些实施例中,所述目标数据结构包括目标字段,所述目标字段用于定义所述目标数据结构的数据校验规则;所述获取模块5552,还用于对所述业务数据进行解析,确定所述目标字段的目标字段值;将所述目标字段值,作为针对所述目标数据结构预定义的目标数据校验规则。In some embodiments, the target data structure includes a target field, which is used to define data verification rules for the target data structure; the acquisition module 5552 is also used to parse the business data to determine the target field value of the target field; and use the target field value as a target data verification rule predefined for the target data structure.

在一些实施例中,所述目标数据结构包括目标字段,所述目标字段用于存储所述目标数据结构的数据校验规则的指示信息;所述获取模块5552,还用于对所述业务数据进行解析,确定所述目标字段的目标字段值,所述目标字段值为所述指示信息;获取所述指示信息所指示的数据校验规则;将所述指示信息所指示的数据校验规则,作为针对所述目标数据结构预定义的目标数据校验规则。In some embodiments, the target data structure includes a target field, which is used to store indication information of the data verification rules of the target data structure; the acquisition module 5552 is also used to parse the business data, determine the target field value of the target field, and the target field value is the indication information; obtain the data verification rules indicated by the indication information; and use the data verification rules indicated by the indication information as predefined target data verification rules for the target data structure.

在一些实施例中,所述获取模块5552,还用于获取在定义所述目标数据结构时、针对所述目标数据结构编辑的注释信息;从所述注释信息中,提取针对所述目标数据结构编辑的注释数据校验规则;将所述注释数据校验规则,作为针对所述目标数据结构预定义的目标数据校验规则。In some embodiments, the acquisition module 5552 is also used to obtain annotation information edited for the target data structure when defining the target data structure; extract annotation data verification rules edited for the target data structure from the annotation information; and use the annotation data verification rules as predefined target data verification rules for the target data structure.

在一些实施例中,所述获取模块5552,还用于获取数据结构和数据校验规则之间的对应关系;基于所述对应关系,从包括多种所述数据校验规则的数据校验规则库中,获取所述目标数据结构对应的数据校验规则;将所述目标数据结构对应的数据校验规则,作为针对所述目标数据结构预定义的目标数据校验规则。In some embodiments, the acquisition module 5552 is also used to obtain the correspondence between the data structure and the data verification rule; based on the correspondence, the data verification rule corresponding to the target data structure is obtained from a data verification rule library including a plurality of the data verification rules; and the data verification rule corresponding to the target data structure is used as a predefined target data verification rule for the target data structure.

在一些实施例中,当所述目标数据校验规则包括单条校验规则时,所述解析模块5553,还用于获取所述目标数据校验规则的校验规则语法;基于所述校验规则语法,对所述目标数据校验规则进行解析,得到所述目标数据校验规则的校验规则语法树,所述校验语法树包括符合所述目标数据校验规则的校验表达式和校验运算符;基于所述校验表达式和所述校验运算符,生成所述解析后数据校验规则。In some embodiments, when the target data verification rule includes a single verification rule, the parsing module 5553 is also used to obtain the verification rule syntax of the target data verification rule; based on the verification rule syntax, the target data verification rule is parsed to obtain a verification rule syntax tree of the target data verification rule, and the verification syntax tree includes a verification expression and a verification operator that conforms to the target data verification rule; based on the verification expression and the verification operator, the parsed data verification rule is generated.

在一些实施例中,所述解析模块5553,还用于基于所述校验表达式和所述校验运算符,将所述校验语法树转换为目标形式的目标表达式,并将所述目标表达式作为所述解析后数据校验规则。In some embodiments, the parsing module 5553 is also used to convert the verification syntax tree into a target expression in a target form based on the verification expression and the verification operator, and use the target expression as the parsed data verification rule.

在一些实施例中,当所述目标数据校验规则包括多条子校验规则时,所述解析模块5553,还用于对所述目标数据校验规则进行拆分,得到各条所述子校验规则,并针对各条所述子校验规则分别执行如下处理:获取所述子校验规则的校验规则语法;基于所述校验规则语法,对所述子校验规则进行解析,得到所述子校验规则的校验规则语法树,所述校验语法树包括符合所述子校验规则的校验表达式和校验运算符;基于所述校验表达式和所述校验运算符,生成所述子校验规则的解析后子校验规则;其中,各所述子校验规则的解析后子校验规则,组成所述解析后数据校验规则。In some embodiments, when the target data verification rule includes multiple sub-verification rules, the parsing module 5553 is also used to split the target data verification rule to obtain each of the sub-verification rules, and perform the following processing on each of the sub-verification rules: obtain the verification rule syntax of the sub-verification rule; based on the verification rule syntax, parse the sub-verification rule to obtain the verification rule syntax tree of the sub-verification rule, and the verification syntax tree includes a verification expression and a verification operator that conforms to the sub-verification rule; based on the verification expression and the verification operator, generate the parsed sub-verification rule of the sub-verification rule; wherein the parsed sub-verification rules of each of the sub-verification rules constitute the parsed data verification rule.

在一些实施例中,所述校验模块5554,还用于对所述业务数据进行解析,确定所述业务数据中待校验字段的字段值;采用所述解析后数据校验规则,对所述待校验字段的字段值进行校验,得到所述业务数据的校验结果。In some embodiments, the verification module 5554 is also used to parse the business data to determine the field value of the field to be verified in the business data; use the parsed data verification rule to verify the field value of the field to be verified to obtain the verification result of the business data.

在一些实施例中,所述校验模块5554,还用于对所述业务数据进行解析,得到所述业务数据包括的各个字段;获取各所述字段的字段名;根据各所述字段的字段名以及所述解析后数据校验规则,确定所述业务数据中的待校验字段,并获取所述待校验字段的字段值。In some embodiments, the verification module 5554 is also used to parse the business data to obtain the various fields included in the business data; obtain the field name of each field; determine the field to be checked in the business data according to the field name of each field and the parsed data verification rules, and obtain the field value of the field to be checked.

在一些实施例中,当所述解析后数据校验规则包括多条解析后校验规则、且所述待校验字段的数量为多个时,所述校验模块5554,还用于针对各所述解析后校验规则,分别执行如下处理:确定所述解析后校验规则对应的待校验字段组,所述待校验字段组包括至少一个所述待校验字段;采用所述解析后校验规则,对所述待校验字段组中待校验字段的字段值进行校验,得到所述待校验字段组的字段组校验结果;基于各所述解析后校验规则对应的字段组校验结果,确定所述业务数据的校验结果。In some embodiments, when the post-parsed data verification rules include multiple post-parsed verification rules and the number of the fields to be checked is multiple, the verification module 5554 is also used to perform the following processing for each of the post-parsed verification rules: determine the field group to be checked corresponding to the post-parsed verification rule, and the field group to be checked includes at least one of the fields to be checked; use the post-parsed verification rule to verify the field value of the field to be checked in the field group to be checked to obtain the field group verification result of the field group to be checked; based on the field group verification results corresponding to each of the post-parsed verification rules, determine the verification result of the business data.

在一些实施例中,所述校验模块5554,还用于在所述采用所述解析后数据校验规则,对所述业务数据进行数据校验,得到所述业务数据的校验结果之后,当所述校验结果表征所述业务数据校验未通过时,获取所述业务数据的校验告警策略;基于所述校验告警策略,对所述校验结果进行告警处理。In some embodiments, the verification module 5554 is also used to perform data verification on the business data using the post-parsed data verification rule, and after obtaining the verification result of the business data, when the verification result indicates that the business data verification has failed, obtain the verification alarm strategy of the business data; and perform alarm processing on the verification result based on the verification alarm strategy.

应用本申请上述实施例,针对业务数据的每种数据结构,均预定义了相应的数据校验规则,当接收到目标业务的业务数据时,则获取针对该业务数据的目标数据结构预定义的目标数据校验规则,然后解析目标数据校验规则,以采用解析后数据校验规则实现业务数据的校验,从而在针对业务数据执行业务逻辑之前,即可实现业务数据的数据校验。如此,仅需要对每种数据结构预定义相应的数据校验规则,无需编写数据校验规则的校验代码、以及将校验代码硬编码至业务逻辑代码中,简化了数据校验的实现逻辑,提高了数据校验规则的灵活性,便于数据校验规则的维护和复用,并提高了数据校验的开发效率。By applying the above-mentioned embodiments of the present application, corresponding data verification rules are predefined for each data structure of the business data. When the business data of the target business is received, the target data verification rules predefined for the target data structure of the business data are obtained, and then the target data verification rules are parsed to implement the verification of the business data using the parsed data verification rules, so that the data verification of the business data can be implemented before the business logic is executed for the business data. In this way, it is only necessary to predefine the corresponding data verification rules for each data structure, and there is no need to write the verification code of the data verification rules and hard-code the verification code into the business logic code, which simplifies the implementation logic of the data verification, improves the flexibility of the data verification rules, facilitates the maintenance and reuse of the data verification rules, and improves the development efficiency of the data verification.

本申请实施例还提供一种计算机程序产品,该计算机程序产品包括计算机可执行指令,该计算机可执行指令存储在计算机可读存储介质中。电子设备的处理器从计算机可读存储介质读取该计算机可执行指令,处理器执行该计算机可执行指令,使得该电子设备执行本申请实施例提供的数据校验方法。The embodiment of the present application also provides a computer program product, which includes computer executable instructions, and the computer executable instructions are stored in a computer readable storage medium. The processor of the electronic device reads the computer executable instructions from the computer readable storage medium, and the processor executes the computer executable instructions, so that the electronic device executes the data verification method provided in the embodiment of the present application.

本申请实施例还提供一种计算机可读存储介质,该计算机可读存储介质中存储有计算机可执行指令,当该计算机可执行指令被处理器执行时,将引起处理器执行本申请实施例提供的数据校验方法。An embodiment of the present application also provides a computer-readable storage medium, which stores computer-executable instructions. When the computer-executable instructions are executed by a processor, the processor will execute the data verification method provided by the embodiment of the present application.

在一些实施例中,计算机可读存储介质可以是RAM、ROM、闪存、磁表面存储器、光盘、或CD-ROM等存储器;也可以是包括上述存储器之一或任意组合的各种设备。In some embodiments, the computer-readable storage medium may be a memory such as RAM, ROM, flash memory, magnetic surface memory, optical disk, or CD-ROM; or may be various devices including one or any combination of the above memories.

在一些实施例中,计算机可执行指令可以采用程序、软件、软件模块、脚本或代码的形式,按任意形式的编程语言(包括编译或解释语言,或者声明性或过程性语言)来编写,并且其可按任意形式部署,包括被部署为独立的程序或者被部署为模块、组件、子例程或者适合在计算环境中使用的其它单元。In some embodiments, computer executable instructions may be in the form of a program, software, software module, script or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as a stand-alone program or as a module, component, subroutine or other unit suitable for use in a computing environment.

作为示例,计算机可执行指令可以但不一定对应于文件系统中的文件,可以可被存储在保存其它程序或数据的文件的一部分,例如,存储在超文本标记语言(Hyper TextMarkup Language,HTML)文档中的一个或多个脚本中,存储在专用于所讨论的程序的单个文件中,或者,存储在多个协同文件(例如,存储一个或多个模块、子程序或代码部分的文件)中。As an example, computer-executable instructions may, but need not, correspond to a file in a file system, may be stored as part of a file that stores other programs or data, such as in one or more scripts in a HyperText Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple coordinated files (e.g., files storing one or more modules, subroutines, or code portions).

作为示例,计算机可执行指令可被部署为在一个电子设备上执行,或者在位于一个地点的多个电子设备上执行,又或者,在分布在多个地点且通过通信网络互连的多个电子设备上执行。As an example, computer executable instructions may be deployed to be executed on one electronic device, or on multiple electronic devices located at one site, or on multiple electronic devices distributed at multiple sites and interconnected by a communication network.

以上所述,仅为本申请的实施例而已,并非用于限定本申请的保护范围。凡在本申请的精神和范围之内所作的任何修改、等同替换和改进等,均包含在本申请的保护范围之内。The above is only an embodiment of the present application and is not intended to limit the protection scope of the present application. Any modifications, equivalent substitutions and improvements made within the spirit and scope of the present application are included in the protection scope of the present application.

Claims (16)

1.一种数据校验方法,其特征在于,所述方法包括:1. A data verification method, characterized in that the method comprises: 当接收到目标业务的业务数据时,从至少一个数据结构中,确定所述业务数据的目标数据结构,各所述数据结构分别预定义有相应的数据校验规则;When receiving the service data of the target service, determining the target data structure of the service data from at least one data structure, each of the data structures being predefined with a corresponding data verification rule; 获取针对所述目标数据结构预定义的目标数据校验规则;Obtaining a target data verification rule predefined for the target data structure; 对所述目标数据校验规则进行解析,得到解析后数据校验规则;Parsing the target data verification rule to obtain a parsed data verification rule; 采用所述解析后数据校验规则,对所述业务数据进行数据校验,得到所述业务数据的校验结果,以基于得到的所述校验结果,对所述业务数据执行所述目标业务的业务逻辑。The parsed data verification rule is used to perform data verification on the business data to obtain a verification result of the business data, so as to execute the business logic of the target business on the business data based on the obtained verification result. 2.如权利要求1所述的方法,其特征在于,所述目标数据结构包括目标字段,所述目标字段用于定义所述目标数据结构的数据校验规则;所述获取针对所述目标数据结构预定义的目标数据校验规则,包括:2. The method according to claim 1, wherein the target data structure comprises a target field, and the target field is used to define a data verification rule for the target data structure; and the step of obtaining a target data verification rule predefined for the target data structure comprises: 对所述业务数据进行解析,确定所述目标字段的目标字段值;Parsing the business data to determine a target field value of the target field; 将所述目标字段值,作为针对所述目标数据结构预定义的目标数据校验规则。The target field value is used as a target data verification rule predefined for the target data structure. 3.如权利要求1所述的方法,其特征在于,所述目标数据结构包括目标字段,所述目标字段用于存储所述目标数据结构的数据校验规则的指示信息;所述获取针对所述目标数据结构预定义的目标数据校验规则,包括:3. The method according to claim 1, wherein the target data structure comprises a target field, and the target field is used to store indication information of a data verification rule of the target data structure; and the step of obtaining a target data verification rule predefined for the target data structure comprises: 对所述业务数据进行解析,确定所述目标字段的目标字段值,所述目标字段值为所述指示信息;Parse the business data to determine a target field value of the target field, wherein the target field value is the indication information; 获取所述指示信息所指示的数据校验规则;Obtaining the data verification rule indicated by the instruction information; 将所述指示信息所指示的数据校验规则,作为针对所述目标数据结构预定义的目标数据校验规则。The data verification rule indicated by the indication information is used as a target data verification rule predefined for the target data structure. 4.如权利要求1所述的方法,其特征在于,所述获取针对所述目标数据结构预定义的目标数据校验规则,包括:4. The method according to claim 1, wherein obtaining a target data verification rule predefined for the target data structure comprises: 获取在定义所述目标数据结构时、针对所述目标数据结构编辑的注释信息;Acquire annotation information edited for the target data structure when defining the target data structure; 从所述注释信息中,提取针对所述目标数据结构编辑的注释数据校验规则;Extracting annotation data verification rules edited for the target data structure from the annotation information; 将所述注释数据校验规则,作为针对所述目标数据结构预定义的目标数据校验规则。The annotation data verification rule is used as a target data verification rule predefined for the target data structure. 5.如权利要求1所述的方法,其特征在于,所述获取针对所述目标数据结构预定义的目标数据校验规则,包括:5. The method according to claim 1, wherein the step of obtaining a target data verification rule predefined for the target data structure comprises: 获取数据结构和数据校验规则之间的对应关系;Obtain the correspondence between data structure and data verification rules; 基于所述对应关系,从包括多种所述数据校验规则的数据校验规则库中,获取所述目标数据结构对应的数据校验规则;Based on the corresponding relationship, obtaining a data verification rule corresponding to the target data structure from a data verification rule library including a plurality of the data verification rules; 将所述目标数据结构对应的数据校验规则,作为针对所述目标数据结构预定义的目标数据校验规则。The data verification rule corresponding to the target data structure is used as a target data verification rule predefined for the target data structure. 6.如权利要求1所述的方法,其特征在于,当所述目标数据校验规则包括单条校验规则时,所述对所述目标数据校验规则进行解析,得到解析后数据校验规则,包括:6. The method according to claim 1, wherein when the target data verification rule includes a single verification rule, parsing the target data verification rule to obtain the parsed data verification rule comprises: 获取所述目标数据校验规则的校验规则语法;Obtaining the verification rule syntax of the target data verification rule; 基于所述校验规则语法,对所述目标数据校验规则进行解析,得到所述目标数据校验规则的校验规则语法树,所述校验语法树包括符合所述目标数据校验规则的校验表达式和校验运算符;Based on the verification rule syntax, the target data verification rule is parsed to obtain a verification rule syntax tree of the target data verification rule, wherein the verification syntax tree includes a verification expression and a verification operator that conforms to the target data verification rule; 基于所述校验表达式和所述校验运算符,生成所述解析后数据校验规则。The parsed data verification rule is generated based on the verification expression and the verification operator. 7.如权利要求6所述的方法,其特征在于,所述基于所述校验表达式和所述校验运算符,生成所述解析后数据校验规则,包括:7. The method according to claim 6, wherein generating the parsed data verification rule based on the verification expression and the verification operator comprises: 基于所述校验表达式和所述校验运算符,将所述校验语法树转换为目标形式的目标表达式,并将所述目标表达式作为所述解析后数据校验规则。Based on the verification expression and the verification operator, the verification syntax tree is converted into a target expression in a target form, and the target expression is used as the parsed data verification rule. 8.如权利要求1所述的方法,其特征在于,当所述目标数据校验规则包括多条子校验规则时,所述对所述目标数据校验规则进行解析,得到解析后数据校验规则,包括:8. The method according to claim 1, wherein when the target data verification rule includes multiple sub-verification rules, parsing the target data verification rule to obtain the parsed data verification rule comprises: 对所述目标数据校验规则进行拆分,得到各条所述子校验规则,并针对各条所述子校验规则分别执行如下处理:The target data verification rule is split to obtain each of the sub-verification rules, and the following processing is performed on each of the sub-verification rules: 获取所述子校验规则的校验规则语法;Obtaining the verification rule syntax of the sub-verification rule; 基于所述校验规则语法,对所述子校验规则进行解析,得到所述子校验规则的校验规则语法树,所述校验语法树包括符合所述子校验规则的校验表达式和校验运算符;Based on the verification rule syntax, the sub-verification rule is parsed to obtain a verification rule syntax tree of the sub-verification rule, wherein the verification syntax tree includes a verification expression and a verification operator that conforms to the sub-verification rule; 基于所述校验表达式和所述校验运算符,生成所述子校验规则的解析后子校验规则;其中,各所述子校验规则的解析后子校验规则,组成所述解析后数据校验规则。Based on the verification expression and the verification operator, the parsed sub-verification rules of the sub-verification rules are generated; wherein the parsed sub-verification rules of each of the sub-verification rules constitute the parsed data verification rule. 9.如权利要求1所述的方法,其特征在于,所述采用所述解析后数据校验规则,对所述业务数据进行数据校验,得到所述业务数据的校验结果,包括:9. The method according to claim 1, wherein the adopting the parsed data verification rule to perform data verification on the business data to obtain the verification result of the business data comprises: 对所述业务数据进行解析,确定所述业务数据中待校验字段的字段值;Parsing the business data to determine the field value of the field to be checked in the business data; 采用所述解析后数据校验规则,对所述待校验字段的字段值进行校验,得到所述业务数据的校验结果。The parsed data verification rule is adopted to verify the field value of the field to be verified to obtain the verification result of the business data. 10.如权利要求9所述的方法,其特征在于,所述对所述业务数据进行解析,确定所述业务数据中待校验字段的字段值,包括:10. The method according to claim 9, wherein parsing the business data to determine the field value of the field to be checked in the business data comprises: 对所述业务数据进行解析,得到所述业务数据包括的各个字段;Parsing the business data to obtain various fields included in the business data; 获取各所述字段的字段名;Get the field name of each of the fields; 根据各所述字段的字段名以及所述解析后数据校验规则,确定所述业务数据中的待校验字段,并获取所述待校验字段的字段值。According to the field name of each field and the parsed data verification rule, the field to be verified in the business data is determined, and the field value of the field to be verified is obtained. 11.如权利要求9所述的方法,其特征在于,当所述解析后数据校验规则包括多条解析后校验规则、且所述待校验字段的数量为多个时,所述采用所述解析后数据校验规则,对所述待校验字段的字段值进行校验,得到所述业务数据的校验结果,包括:11. The method according to claim 9, wherein when the parsed data verification rule includes multiple parsed verification rules and the number of the to-be-verified fields is multiple, the adopting the parsed data verification rule to verify the field value of the to-be-verified field to obtain the verification result of the business data comprises: 针对各所述解析后校验规则,分别执行如下处理:确定所述解析后校验规则对应的待校验字段组,所述待校验字段组包括至少一个所述待校验字段;采用所述解析后校验规则,对所述待校验字段组中待校验字段的字段值进行校验,得到所述待校验字段组的字段组校验结果;For each of the post-parsed verification rules, the following processing is performed respectively: determining a field group to be verified corresponding to the post-parsed verification rule, the field group to be verified includes at least one field to be verified; using the post-parsed verification rule, verifying the field value of the field to be verified in the field group to be verified, and obtaining a field group verification result of the field group to be verified; 基于各所述解析后校验规则对应的字段组校验结果,确定所述业务数据的校验结果。Based on the field group verification results corresponding to each of the parsed verification rules, the verification results of the business data are determined. 12.如权利要求1所述的方法,其特征在于,所述采用所述解析后数据校验规则,对所述业务数据进行数据校验,得到所述业务数据的校验结果之后,所述方法还包括:12. The method according to claim 1, characterized in that after the parsed data verification rule is used to perform data verification on the business data and the verification result of the business data is obtained, the method further comprises: 当所述校验结果表征所述业务数据校验未通过时,获取所述业务数据的校验告警策略;When the verification result indicates that the business data verification fails, obtaining a verification alarm strategy for the business data; 基于所述校验告警策略,对所述校验结果进行告警处理。Based on the verification alarm strategy, an alarm process is performed on the verification result. 13.一种数据校验装置,其特征在于,所述装置包括:13. A data verification device, characterized in that the device comprises: 确定模块,用于当接收到目标业务的业务数据时,从至少一个数据结构中,确定所述业务数据的目标数据结构,其中,不同数据结构预定义有相应的数据校验规则;A determination module, configured to determine, when receiving the business data of a target business, a target data structure of the business data from at least one data structure, wherein different data structures are predefined with corresponding data verification rules; 获取模块,用于获取针对所述目标数据结构预定义的目标数据校验规则;An acquisition module, used for acquiring a target data verification rule predefined for the target data structure; 解析模块,用于对所述目标数据校验规则进行解析,得到解析后数据校验规则;A parsing module, used to parse the target data verification rule to obtain the parsed data verification rule; 校验模块,用于采用所述解析后数据校验规则,对所述业务数据进行数据校验,得到所述业务数据的校验结果,以基于得到的所述校验结果,对所述业务数据执行所述目标业务的业务逻辑。The verification module is used to use the parsed data verification rule to perform data verification on the business data to obtain the verification result of the business data, so as to execute the business logic of the target business on the business data based on the obtained verification result. 14.一种电子设备,其特征在于,所述电子设备包括:14. An electronic device, characterized in that the electronic device comprises: 存储器,用于存储计算机可执行指令;A memory for storing computer executable instructions; 处理器,用于执行所述存储器中存储的计算机可执行指令时,实现权利要求1至12任一项所述的数据校验方法。A processor, configured to implement the data verification method according to any one of claims 1 to 12 when executing the computer executable instructions stored in the memory. 15.一种计算机可读存储介质,存储有计算机可执行指令,其特征在于,所述计算机可执行指令被处理器执行时,实现权利要求1至12任一项所述的数据校验方法。15. A computer-readable storage medium storing computer-executable instructions, wherein when the computer-executable instructions are executed by a processor, the data verification method according to any one of claims 1 to 12 is implemented. 16.一种计算机程序产品,包括计算机可执行指令,其特征在于,所述计算机可执行指令被处理器执行时,实现权利要求1至12任一项所述的数据校验方法。16. A computer program product, comprising computer executable instructions, characterized in that when the computer executable instructions are executed by a processor, the data verification method according to any one of claims 1 to 12 is implemented.
CN202310376284.3A 2023-04-10 2023-04-10 Data verification method, device, equipment, storage medium and program product Pending CN118778964A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310376284.3A CN118778964A (en) 2023-04-10 2023-04-10 Data verification method, device, equipment, storage medium and program product

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310376284.3A CN118778964A (en) 2023-04-10 2023-04-10 Data verification method, device, equipment, storage medium and program product

Publications (1)

Publication Number Publication Date
CN118778964A true CN118778964A (en) 2024-10-15

Family

ID=92981329

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310376284.3A Pending CN118778964A (en) 2023-04-10 2023-04-10 Data verification method, device, equipment, storage medium and program product

Country Status (1)

Country Link
CN (1) CN118778964A (en)

Similar Documents

Publication Publication Date Title
US10839141B2 (en) System and method for provisioning a mobile software application to a mobile device
CN109885311B (en) Application program generation method and device
CN104317591B (en) A kind of web interface frame system and web method for processing business based on OSGi
WO2019072110A1 (en) Method for generating application program, apparatus, system, device, and medium
US10326864B2 (en) Dynamic orchestration of microservices
CN110347378A (en) The building method and device of item development environment
CN115113850B (en) Cross-platform application construction and operation method, server, terminal and system
WO2014138894A1 (en) Systems and methods for controlling branch latency within computing applications
EP1387262A1 (en) Method to generate synchronization contracts for software components and web services
US20210117313A1 (en) Language agnostic automation scripting tool
CN114217789A (en) Functional component expansion method, apparatus, device, storage medium and program product
CN103473034B (en) A kind of method and apparatus of dynamic publishing Web service
CN113778897A (en) Automatic test method, device, equipment and storage medium of interface
CN111723314B (en) Webpage display method and device, electronic equipment and computer readable storage medium
CN116414774A (en) File migration method, device, equipment and storage medium
CN112346774B (en) A method and device for generating an application installation package
CN114546434B (en) Application updating method, device, electronic device and storage medium
CN118656110A (en) Page configuration method and device
CN116088855B (en) Development method, device, electronic device and storage medium
US10244020B1 (en) System and method for auto-generating meta-proxies
CN119938033A (en) Methods for page rendering, execution engines, and page building methods
CN118778964A (en) Data verification method, device, equipment, storage medium and program product
CN116578281B (en) Web page development method, system, electronic device and storage medium based on code package
CN116828073A (en) Message conversion method, device, electronic equipment and computer readable storage medium
Dogan Transition from microservice architecture to a monolith to improve performance

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication