CN112269706B - Interface parameter verification method, device, electronic device and computer readable medium - Google Patents
Interface parameter verification method, device, electronic device and computer readable medium Download PDFInfo
- Publication number
- CN112269706B CN112269706B CN202011279136.2A CN202011279136A CN112269706B CN 112269706 B CN112269706 B CN 112269706B CN 202011279136 A CN202011279136 A CN 202011279136A CN 112269706 B CN112269706 B CN 112269706B
- Authority
- CN
- China
- Prior art keywords
- parameter
- interface
- verification
- name
- verified
- 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.)
- Active
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/22—Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
- G06F11/2205—Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing using arrangements specific to the hardware being tested
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/22—Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
- G06F11/2247—Verification or detection of system hardware configuration
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/22—Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
- G06F11/2273—Test methods
Landscapes
- Engineering & Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Hardware Design (AREA)
- Quality & Reliability (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Stored Programmes (AREA)
Abstract
Description
技术领域Technical Field
本申请涉及云计算技术领域,具体涉及数据测试、数据通信领域,尤其涉及一种接口参数校验方法、装置、电子设备以及计算机可读介质。The present application relates to the field of cloud computing technology, specifically to the field of data testing and data communication, and in particular to an interface parameter verification method, device, electronic device, and computer-readable medium.
背景技术Background technique
应用程序和应用程序之间,经常需要通过接口调用来实现特定的业务逻辑,如:“商品管理程序”调用“订单管理程序”提供的接口,获得单个商品的所有关联订单。在接口调用时,通过接口参数传递信息,如:上述场景中,商品ID就是“商品管理程序”传递给“订单管理程序”的一个接口参数。Applications often need to implement specific business logic through interface calls, such as the "product management program" calling the interface provided by the "order management program" to obtain all related orders for a single product. When calling the interface, information is passed through the interface parameters. For example, in the above scenario, the product ID is an interface parameter passed from the "product management program" to the "order management program".
接口调用时的每一个参数,均需要由开发人员编写对应的校验逻辑。若接口调用中参数较多或接口调用需要经常增减字段,则开发人员的工作量较大,开发成本较高。For each parameter in the interface call, the developer needs to write the corresponding verification logic. If there are many parameters in the interface call or the interface call needs to add or remove fields frequently, the developer's workload will be large and the development cost will be high.
发明内容Summary of the invention
提供了一种接口参数校验方法、装置、电子设备以及计算机可读介质。Provided are an interface parameter verification method, device, electronic device, and computer-readable medium.
根据第一方面,提供了一种接口参数校验方法,上述方法包括:加载参数校验规则,参数校验规则用于对至少一个接口的接口参数进行校验;接收网络中的接口校验请求消息;提取接口校验请求消息中的接口名称和待校验接口参数;基于接口名称对应的参数校验规则,对待校验接口参数进行校验,并返回校验结果。According to the first aspect, an interface parameter verification method is provided, which includes: loading parameter verification rules, the parameter verification rules are used to verify the interface parameters of at least one interface; receiving an interface verification request message in the network; extracting the interface name and the interface parameters to be verified in the interface verification request message; based on the parameter verification rules corresponding to the interface name, verifying the interface parameters to be verified, and returning the verification results.
根据第二方面,提供了一种接口参数校验装置,该装置包括:加载单元,被配置成加载参数校验规则,参数校验规则用于对至少一个接口的接口参数进行校验;接收单元,被配置成接收网络中的接口校验请求消息;提取单元,被配置成提取接口校验请求消息中的接口名称和待校验接口参数;校验单元,被配置成基于接口名称对应的参数校验规则,对待校验接口参数进行校验,并返回校验结果。According to the second aspect, an interface parameter verification device is provided, which includes: a loading unit, configured to load parameter verification rules, the parameter verification rules are used to verify the interface parameters of at least one interface; a receiving unit, configured to receive an interface verification request message in the network; an extraction unit, configured to extract the interface name and the interface parameters to be verified in the interface verification request message; a verification unit, configured to verify the interface parameters to be verified based on the parameter verification rules corresponding to the interface name, and return the verification result.
根据第三方面,提供了一种电子设备,该电子设备包括:至少一个处理器;以及与至少一个处理器通信连接的存储器,其中,存储器存储有可被至少一个处理器执行的指令,指令被至少一个处理器执行,以使至少一个处理器能够执行如第一方面任一实现方式描述的方法。According to a third aspect, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor, wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method described in any implementation manner of the first aspect.
根据第四方面,提供了一种存储有计算机指令的非瞬时计算机可读存储介质,计算机指令用于使计算机执行如第一方面任一实现方式描述的方法。According to a fourth aspect, a non-transitory computer-readable storage medium storing computer instructions is provided, where the computer instructions are used to cause a computer to execute the method described in any implementation of the first aspect.
本申请的实施例提供的接口参数校验方法和装置,首先加载对至少一个接口的接口参数进行校验的参数校验规则;其次,接收网络中的接口校验请求消息;然后,提取接口校验请求消息中的接口名称和待校验接口参数;最后,基于接口名称对应的参数校验规则,对待校验接口参数进行校验,并返回校验结果。由此,通过加载的参数校验规则,可以对接口校验消息中的所有待校验接口参数进行校验,提高了接口参数校验的自动化,节省了技术人员在对各个待校验接口参数进行校验时的开发成本。The interface parameter verification method and device provided by the embodiment of the present application first loads the parameter verification rules for verifying the interface parameters of at least one interface; secondly, receives the interface verification request message in the network; then, extracts the interface name and the interface parameters to be verified in the interface verification request message; finally, based on the parameter verification rules corresponding to the interface name, verifies the interface parameters to be verified, and returns the verification results. Thus, through the loaded parameter verification rules, all the interface parameters to be verified in the interface verification message can be verified, which improves the automation of interface parameter verification and saves the development cost of technicians in verifying each interface parameter to be verified.
应当理解,本部分所描述的内容并非旨在标识本公开的实施例的关键或重要特征,也不用于限制本公开的范围。本公开的其它特征将通过以下的说明书而变得容易理解。It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
附图用于更好地理解本方案,不构成对本申请的限定。其中:The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present application.
图1是根据本申请接口参数校验方法的一个实施例的流程图;FIG1 is a flow chart of an embodiment of an interface parameter verification method according to the present application;
图2是本申请提取接口校验请求消息中的待校验接口参数的方法的一种流程图;2 is a flow chart of a method for extracting interface parameters to be verified in an interface verification request message of the present application;
图3是本申请对待校验接口参数进行校验的一种流程图;FIG3 is a flow chart of the present application for verifying interface parameters to be verified;
图4是本申请接口参数校验方法的另一个实施例的流程图;FIG4 is a flow chart of another embodiment of the interface parameter verification method of the present application;
图5是根据本申请接口参数校验装置的实施例的结构示意图;FIG5 is a schematic diagram of the structure of an embodiment of an interface parameter verification device according to the present application;
图6是用来实现本申请实施例的接口参数校验方法的电子设备的框图。FIG6 is a block diagram of an electronic device for implementing the interface parameter verification method according to an embodiment of the present application.
具体实施方式Detailed ways
以下结合附图对本申请的示范性实施例做出说明,其中包括本申请实施例的各种细节以助于理解,应当将它们认为仅仅是示范性的。因此,本领域普通技术人员应当认识到,可以对这里描述的实施例做出各种改变和修改,而不会背离本申请的范围和精神。同样,为了清楚和简明,以下的描述中省略了对公知功能和结构的描述。The following is a description of exemplary embodiments of the present application in conjunction with the accompanying drawings, including various details of the embodiments of the present application to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present application. Similarly, for the sake of clarity and conciseness, the description of well-known functions and structures is omitted in the following description.
图1示出了根据本申请接口参数校验方法的一个实施例的流程100。上述接口参数校验方法包括以下步骤:FIG1 shows a process 100 of an embodiment of an interface parameter verification method according to the present application. The interface parameter verification method comprises the following steps:
步骤101,加载参数校验规则。Step 101, loading parameter verification rules.
其中,参数校验规则用于对至少一个接口的接口参数进行校验。The parameter verification rule is used to verify the interface parameters of at least one interface.
本实施例中,参数校验规则为预先确定的校验规则,可以对当前需要调用的接口的所有接口参数进行校验。参数校验规则对应至少一个接口名称,每个接口名称可以对应涉及多个接口参数校验的参数校验规则。In this embodiment, the parameter verification rule is a predetermined verification rule, which can verify all interface parameters of the interface currently required to be called. The parameter verification rule corresponds to at least one interface name, and each interface name can correspond to a parameter verification rule involving multiple interface parameter verifications.
其中,对接口参数进校验包括:判断接口参数是否符合其属性(参数所属类型、参数值的大小范围等)的要求,例如,校验的规则包括:接口参数是否为空、接口参数的类型是否满足预设的类型要求、接口参数的长度是否满足预设的长度等等。Among them, checking the interface parameters includes: judging whether the interface parameters meet the requirements of their attributes (parameter type, parameter value size range, etc.). For example, the checking rules include: whether the interface parameters are empty, whether the type of the interface parameters meets the preset type requirements, whether the length of the interface parameters meets the preset length, etc.
进一步地,由于含接口参数的接口调用请求在网络(例如局域网或互联网)传输过程需要满足网络传输协议的要求,因此,对接口参数进行校验规则,还可以包括校验含接口参数的接口调用请求是否满足接口参数的网络传输协议,当然对接口参数进行校验规则还可以是:在确定含接口参数的接口调用请求满足接口参数的网络传输协议之后,还可以校验接口参数是否符合其属性的要求。Furthermore, since the interface call request containing interface parameters needs to meet the requirements of the network transmission protocol during the transmission process on the network (such as a local area network or the Internet), the interface parameter verification rules can also include verifying whether the interface call request containing the interface parameters meets the network transmission protocol of the interface parameters. Of course, the interface parameter verification rules can also be: after determining that the interface call request containing the interface parameters meets the network transmission protocol of the interface parameters, it can also be verified whether the interface parameters meet the requirements of their attributes.
可选地,本实施例中,参数校验规则对接口参数进行校验还可以包括:先对获取到接口参数进行格式处理(例如,将接口参数转化为接口参数对应类型),然后判断实际格式处理后的接口参数是否满足接口参数对应类型的要求。Optionally, in this embodiment, the parameter verification rule for verifying the interface parameters may also include: first formatting the acquired interface parameters (for example, converting the interface parameters into a type corresponding to the interface parameters), and then determining whether the interface parameters after the actual format processing meet the requirements of the type corresponding to the interface parameters.
本实施例中,接口参数校验方法运行与其上的执行主体可以从终端实时获取或者从数据库获取参数校验规则,并在加载参数校验规则之后,基于参数校验规则的校验逻辑对接收到的检验请求消息中的接口参数进行校验。In this embodiment, the interface parameter verification method and the execution subject thereon can obtain parameter verification rules from the terminal in real time or from the database, and after loading the parameter verification rules, verify the interface parameters in the received verification request message based on the verification logic of the parameter verification rules.
步骤102,接收网络中的接口校验请求消息。Step 102: Receive an interface verification request message in the network.
本实施例中,上述网络可以是互联网,也可以是局域网。接口校验请求消息是一个应用程序为了实现特定业务逻辑调用另一个应用程序的接口过程中向另一个应用程序发送的关于待校验接口参数的消息。In this embodiment, the network can be the Internet or a local area network. The interface verification request message is a message about interface parameters to be verified sent by an application to another application during the process of calling the interface of another application in order to implement specific business logic.
具体地,接口校验请求消息包括待校验接口参数,基于不同的传输协议,待校验接口参数在接口校验请求消息中的位置不同。例如,基于HTTP(HyperText TransferProtocol,超文本传输协议)传输协议,待校验接口参数可以分别位于接口校验请求消息中对应协议的Query(请求行)、Header(请求头)、Body(请求体)三种位置。Specifically, the interface verification request message includes interface parameters to be verified, and the positions of the interface parameters to be verified in the interface verification request message are different based on different transmission protocols. For example, based on the HTTP (HyperText TransferProtocol, Hypertext Transfer Protocol) transmission protocol, the interface parameters to be verified can be located in the three positions of the corresponding protocol in the interface verification request message: Query (request line), Header (request header), and Body (request body).
步骤103,提取接口校验请求消息中的接口名称和待校验接口参数。Step 103: extract the interface name and interface parameters to be verified in the interface verification request message.
本实施例中,执行主体接收接口校验请求消息之后,可以通过拦截器(例如Interceptor工具)提取接口校验请求消息中的接口名称和待校验接口参数。In this embodiment, after the execution subject receives the interface verification request message, the interface name and the interface parameters to be verified in the interface verification request message can be extracted through an interceptor (such as an Interceptor tool).
可选地,在提取接口校验请求消息中的接口名称和待校验接口参数之前,还可以先对接口校验请求消息中的业务需求信息进行预校验,接口校验请求消息一般携带有自身的业务需求信息,例如“根据商品ID获得一个商品详情信息”,这个时候请求中会带有一个商品ID,商品ID即为自身业务需求信息,可以先对商品ID进行校验,校验通过,则预校验完成。Optionally, before extracting the interface name and interface parameters to be verified in the interface verification request message, you can also pre-verify the business requirement information in the interface verification request message. The interface verification request message generally carries its own business requirement information, such as "obtain product details information based on the product ID". At this time, the request will carry a product ID, and the product ID is its own business requirement information. You can first verify the product ID. If the verification passes, the pre-verification is completed.
步骤104,基于接口名称对应的参数校验规则,对待校验接口参数进行校验,并返回校验结果。Step 104: based on the parameter verification rule corresponding to the interface name, verify the interface parameters to be verified and return the verification result.
本实施例中,参数校验规则包括至少一个接口名称对应的参数校验规则,由于不同的接口名称具有不同的参数校验规则,可以以上述提取的接口名称为索引,搜索确定参数校验规则中接口名称对应的参数校验规则。In this embodiment, the parameter verification rules include at least one parameter verification rule corresponding to an interface name. Since different interface names have different parameter verification rules, the parameter verification rule corresponding to the interface name in the parameter verification rules can be searched and determined using the above-extracted interface name as an index.
进一步,接口名称对应的参数校验规则又包括至少一个接口参数对应的参数校验规则,接口参数包括:接口参数名称以及接口参数名称对应的参数值,可以以接口参数名称为索引,搜索确定接口名称对应的参数校验规则中待校验接口参数对应的参数校验规则。Furthermore, the parameter verification rules corresponding to the interface name include at least one parameter verification rule corresponding to an interface parameter, and the interface parameters include: an interface parameter name and a parameter value corresponding to the interface parameter name. The interface parameter name can be used as an index to search and determine the parameter verification rules corresponding to the interface name and the parameter verification rules corresponding to the interface parameter to be verified.
本实施例中,待校验接口参数是至少一个接口参数中的一员,待校验接口参数包括:待校验接口参数名称以及待校验接口参数名称对应的参数值。如例一所示。In this embodiment, the interface parameter to be checked is a member of at least one interface parameter, and the interface parameter to be checked includes: a name of the interface parameter to be checked and a parameter value corresponding to the name of the interface parameter to be checked, as shown in Example 1.
例一:{Example 1:
"paramName":"emailAddress","paramName":"emailAddress",
"apiName":"submitEmailAddress","apiName":"submitEmailAddress",
"position":"Query","position":"Query",
"using":"ture","using":"ture",
"type":"string","type":"string",
"required":true,"required":true,
"maxLength":100,"maxLength":100,
"minLength":5,"minLength":5,
"pattern":"^[a-z0-9A-Z]+[-|a-z0-9A-Z._]+@([a-z0-9A-Z]+(-[a-z0-9A-Z]+)?\\.)+[a-z]{2,}$"}"pattern":"^[a-z0-9A-Z]+[-|a-z0-9A-Z._]+@([a-z0-9A-Z]+(-[a-z0-9A-Z]+)?\\.)+[a-z]{2,}$"}
例一所示的接口名称对应的参数校验规则表示:The parameter verification rules corresponding to the interface name shown in Example 1 are as follows:
对接口名称submitEmailAddress,位置Query的待校验参数名称emailAddress进行校验,该待校验参数名称最大长度为100,最小长度为5,待校验参数名称对应的参数值必需满足pattern部分的正则表达式。Verify the parameter name emailAddress of the interface name submitEmailAddress and the location Query. The maximum length of the parameter name is 100 and the minimum length is 5. The parameter value corresponding to the parameter name must satisfy the regular expression in the pattern part.
本实施例中,校验结果包括:通过校验和未通过校验,在校验结果为通过校验时,可以进行后续接口调取方式。在校验结果为未通过校验时,确定待校验接口参数不合法,并发出异常消息或/和警报。In this embodiment, the verification results include: passing the verification and failing the verification. When the verification result is passing the verification, the subsequent interface call mode can be performed. When the verification result is failing the verification, it is determined that the interface parameters to be verified are illegal, and an abnormal message or/and an alarm are issued.
本申请的实施例提供的接口参数校验方法,首先加载对至少一个接口的接口参数进行校验的参数校验规则;其次,接收网络中的接口校验请求消息;然后,提取接口校验请求消息中的接口名称和待校验接口参数;最后,基于接口名称对应的参数校验规则,对待校验接口参数进行校验,并返回校验结果。由此,通过加载的参数校验规则,可以对接口校验消息中的所有待校验接口参数进行校验,提高了接口参数校验的自动化,节省了技术人员在对各个待校验接口参数进行校验时的开发成本。The interface parameter verification method provided by the embodiment of the present application first loads the parameter verification rules for verifying the interface parameters of at least one interface; secondly, receives the interface verification request message in the network; then, extracts the interface name and the interface parameters to be verified in the interface verification request message; finally, based on the parameter verification rules corresponding to the interface name, verifies the interface parameters to be verified, and returns the verification results. Thus, through the loaded parameter verification rules, all the interface parameters to be verified in the interface verification message can be verified, which improves the automation of interface parameter verification and saves the development cost of technicians in verifying each interface parameter to be verified.
本实施例中,待校验接口参数包括:待校验接口参数名称以及待校验接口参数名称对应的参数值,在本实施例的一些可选实现方式中,如图2所示,提取接口校验请求消息中的待校验接口参数的方法包括以下步骤:In this embodiment, the interface parameter to be verified includes: the interface parameter name to be verified and the parameter value corresponding to the interface parameter name to be verified. In some optional implementations of this embodiment, as shown in FIG. 2, the method for extracting the interface parameter to be verified in the interface verification request message includes the following steps:
步骤201,从接口校验请求消息中提取待校验接口参数名称。Step 201: extract the name of the interface parameter to be verified from the interface verification request message.
本可选实现方式中,执行主体接收接口校验请求消息之后,可以通过拦截器提取接口校验请求消息中的待校验接口参数名称。In this optional implementation, after the execution subject receives the interface verification request message, the name of the interface parameter to be verified in the interface verification request message can be extracted through the interceptor.
步骤202,基于接口名称对应的参数校验规则,对待校验接口参数名称进行校验。Step 202: Verify the interface parameter name to be verified based on the parameter verification rule corresponding to the interface name.
本可选实现方式中,接口名称对应的参数校验规则包括至少一个接口参数对应的参数校验规则,由于待校验接口参数名称已经确定,可以从至少一个接口参数对应的参数校验规则中确定待校验接口参数名称对应的参数校验规则,采用待校验接口参数名称对应的参数校验规则对待校验接口参数名称进行校验。对待校验接口参数名称进行校验的具体校验过程可以基于待校验接口参数名称的类型、长度进行校验等。In this optional implementation, the parameter verification rule corresponding to the interface name includes a parameter verification rule corresponding to at least one interface parameter. Since the interface parameter name to be verified has been determined, the parameter verification rule corresponding to the interface parameter name to be verified can be determined from the parameter verification rule corresponding to at least one interface parameter, and the interface parameter name to be verified is verified using the parameter verification rule corresponding to the interface parameter name to be verified. The specific verification process for verifying the interface parameter name to be verified can be based on the type and length of the interface parameter name to be verified.
当然,还可以基于待校验接口参数名称在接口校验请求消息中位置进行校验,在本实施例的一些可选实现方式中,上述基于接口名称对应的参数校验规则,对待校验接口参数名称进行校验,包括:确定待校验接口参数名称在接口校验请求消息中所处的位置;从接口名称对应的参数校验规则中确定待校验参数对应的参数校验规则;响应于待校验接口参数名称在接口校验请求消息中所处的位置与待校验参数对应的参数校验规则中记载的待校验接口参数名称的位置相匹配,确定待校验接口参数名称通过校验。Of course, verification can also be performed based on the position of the interface parameter name to be verified in the interface verification request message. In some optional implementation methods of the present embodiment, the interface parameter name to be verified is verified based on the parameter verification rules corresponding to the interface name, including: determining the position of the interface parameter name to be verified in the interface verification request message; determining the parameter verification rules corresponding to the parameter to be verified from the parameter verification rules corresponding to the interface name; in response to the position of the interface parameter name to be verified in the interface verification request message matching the position of the interface parameter name to be verified recorded in the parameter verification rules corresponding to the parameter to be verified, determining that the interface parameter name to be verified has passed the verification.
本可选实现方式中,基于HTTP传输协议的接口校验请求消息,可以使用拦截工具的提取编码数据的属性获得接口校验请求消息中的Query、Header、Body三部分的参数,并分别保存,从而确定了确定待校验接口参数名称在接口校验请求消息中所处的位置。进一步,待校验参数对应的参数校验规则中定义有当前接口的待校验参数名称的位置,如例二所示。In this optional implementation, based on the interface verification request message of the HTTP transmission protocol, the interception tool can be used to extract the properties of the encoded data to obtain the parameters of the three parts of Query, Header, and Body in the interface verification request message, and save them separately, thereby determining the position of the interface parameter name to be verified in the interface verification request message. Further, the parameter verification rule corresponding to the parameter to be verified defines the position of the parameter name to be verified of the current interface, as shown in Example 2.
例二:{Example 2:
"paramName":"products.specification.price","paramName":"products.specification.price",
"apiName":"batchSubmitProduct","apiName":"batchSubmitProduct",
"position":"Body","position":"Body",
"using":"true","using":"true",
"type":"Float","type":"Float",
"required":true,"required":true,
"maxDigital":5,"maxDigital":5,
"minDigital":1"minDigital":1
}}
例二所示的待校验参数对应的参数校验规则表示:The parameter verification rules corresponding to the parameters to be verified shown in Example 2 are expressed as follows:
对接口名称batchSubmitProduct,位置Body,待校验接口参数名称products.specification.price进行校验,待校验接口参数名称对应的参数值最大小数位数为5,最小小数位数为1。Verify the interface name batchSubmitProduct, location Body, and the interface parameter name products.specification.price to be verified. The maximum number of decimal places of the parameter value corresponding to the interface parameter name to be verified is 5, and the minimum number of decimal places is 1.
本可选实现方式中,通过判断待校验接口参数名称在接口校验请求消息中所处的位置与待校验参数对应的参数校验规则中记载的待校验接口参数名称的位置是否匹配验证待校验接口参数名称是否校验正确,对于一些基于网络传输协议,比如基于HTTP、RMI(Remote Method Invocation,远程方法调用协议)的接口校验请求消息,因各个接口参数的位置固定,可以得到有效的待校验接口参数名称的结果,保证了校验结果的可靠性。In this optional implementation, whether the interface parameter name to be checked is correctly checked is verified by judging whether the position of the interface parameter name to be checked in the interface verification request message matches the position of the interface parameter name to be checked recorded in the parameter verification rule corresponding to the parameter to be checked. For some interface verification request messages based on network transmission protocols, such as HTTP and RMI (Remote Method Invocation), since the position of each interface parameter is fixed, a valid result of the interface parameter name to be checked can be obtained, thereby ensuring the reliability of the verification result.
步骤203,响应于确定待校验接口参数名称通过校验,提取参数值。Step 203: In response to determining that the interface parameter name to be verified passes verification, extract the parameter value.
本可选实现方式中,可以通过拦截器提取接口校验请求消息中的待校验接口参数名称对应的参数值。In this optional implementation, the parameter value corresponding to the interface parameter name to be verified in the interface verification request message can be extracted through an interceptor.
本可选实现方式中,首先从接口校验请求消息中提取待校验接口参数名称,基于接口名称对应的参数校验规则,对待校验接口参数名称进行校验;最后在待校验接口参数名称通过校验之后,提取参数值,这种提取校验,再提取的方式,保证了待校验接口参数提取的可靠性。In this optional implementation method, the name of the interface parameter to be checked is first extracted from the interface verification request message, and the interface parameter name to be checked is verified based on the parameter verification rules corresponding to the interface name; finally, after the interface parameter name to be checked passes the verification, the parameter value is extracted. This method of extraction, verification, and then extraction ensures the reliability of the extraction of the interface parameter to be checked.
本实施例的另一个可选实现方式中,由于待校验接口参数包括:待校验接口参数名称以及待校验接口参数名称对应的参数值,还可以依次提取接口校验请求消息中的待校验接口参数名称以及待校验接口参数对应的参数值,再对依次分别对待校验接口参数名称以及待校验接口参数对应的参数值进行校验,在本实施例的一些可选实现方式中,如图3所示,对待校验接口参数进行校验的方法,包括以下步骤:In another optional implementation of the present embodiment, since the interface parameter to be verified includes: the interface parameter name to be verified and the parameter value corresponding to the interface parameter name to be verified, the interface parameter name to be verified and the parameter value corresponding to the interface parameter to be verified in the interface verification request message can also be extracted in sequence, and then the interface parameter name to be verified and the parameter value corresponding to the interface parameter to be verified are verified in sequence. In some optional implementations of the present embodiment, as shown in FIG3, the method for verifying the interface parameter to be verified includes the following steps:
步骤301,基于接口名称对应的参数校验规则,对待校验接口参数名称进行校验。Step 301: Verify the interface parameter name to be verified based on the parameter verification rule corresponding to the interface name.
本可选实现方式中,接口名称对应的参数校验规则包括至少一个接口参数对应的参数校验规则,由于待校验接口参数名称已经确定,可以至少一个接口参数对应的参数校验规则中确定待校验接口参数名称对应的参数校验规则,采用待校验接口参数名称对应的参数校验规则对待校验接口参数名称进行校验。对待校验接口参数名称进行校验的具体校验过程可以基于待校验接口参数名称的类型、长度进行校验等。In this optional implementation, the parameter verification rule corresponding to the interface name includes at least one parameter verification rule corresponding to the interface parameter. Since the interface parameter name to be verified has been determined, the parameter verification rule corresponding to the interface parameter name to be verified can be determined from the parameter verification rule corresponding to the at least one interface parameter, and the interface parameter name to be verified is verified using the parameter verification rule corresponding to the interface parameter name to be verified. The specific verification process for verifying the interface parameter name to be verified can be based on the type and length of the interface parameter name to be verified.
在本实施例的一些可选实现方式中,上述基于接口名称对应的参数校验规则,对待校验接口参数名称进行校验,包括:确定待校验接口参数名称在接口校验请求消息中所处的位置;从接口名称对应的参数校验规则中确定待校验参数对应的参数校验规则;响应于待校验接口参数名称在接口校验请求消息中所处的位置与待校验参数对应的参数校验规则中记载的待校验接口参数名称的位置相匹配,确定待校验接口参数名称通过校验。In some optional implementations of the present embodiment, the above-mentioned interface parameter name to be checked is checked based on the parameter verification rules corresponding to the interface name, including: determining the position of the interface parameter name to be checked in the interface verification request message; determining the parameter verification rules corresponding to the parameter to be checked from the parameter verification rules corresponding to the interface name; in response to the position of the interface parameter name to be checked in the interface verification request message matching the position of the interface parameter name to be checked recorded in the parameter verification rules corresponding to the parameter to be checked, determining that the interface parameter name to be checked passes the verification.
本可选实现方式中,通过判断待校验接口参数名称在接口校验请求消息中所处的位置与待校验参数对应的参数校验规则中记载的待校验接口参数名称的位置是否匹配验证待校验接口参数名称是否校验正确,对于一些基于网络传输协议,比如基于HTTP、RMI的接口校验请求消息,因各个接口参数的位置固定,可以得到有效的待校验接口参数名称的结果,保证了校验结果的可靠性。In this optional implementation method, whether the interface parameter name to be checked is correctly checked is verified by judging whether the position of the interface parameter name to be checked in the interface verification request message matches the position of the interface parameter name to be checked recorded in the parameter verification rule corresponding to the parameter to be checked. For some interface verification request messages based on network transmission protocols, such as HTTP and RMI, since the position of each interface parameter is fixed, a valid result of the interface parameter name to be checked can be obtained, thereby ensuring the reliability of the verification result.
步骤302,响应于确定待校验接口参数名称通过校验,对参数值进行校验。Step 302: In response to determining that the interface parameter name to be verified passes verification, verify the parameter value.
本实施例中,接口名称对应的参数校验规则包括待校验参数对应的参数校验规则,待校验参数对应的参数校验规则可以包括:待校验接口参数名称对应的参数值的数据类型,比如,字符串、整型、浮点型、布尔型、枚举、列表。该待校验接口参数名称对应的参数值的数据类型可以用于校验待校验接口参数名称对应的参数值。In this embodiment, the parameter verification rules corresponding to the interface name include the parameter verification rules corresponding to the parameter to be verified, and the parameter verification rules corresponding to the parameter to be verified may include: the data type of the parameter value corresponding to the interface parameter name to be verified, such as string, integer, floating point, Boolean, enumeration, list. The data type of the parameter value corresponding to the interface parameter name to be verified can be used to verify the parameter value corresponding to the interface parameter name to be verified.
在本实施例的一些可选实现方式中,待校验参数对应的参数校验规则可以包括:预设的数据类型以及用于对参数值进行数值校验的校验子规则,对参数值进行校验,包括:In some optional implementations of this embodiment, the parameter verification rule corresponding to the parameter to be verified may include: a preset data type and a verification sub-rule for performing numerical verification on the parameter value, and the parameter value is verified, including:
按预设的数据类型对参数值进行数据类型转化;响应于转换后的参数值的数据类型与预设的数据类型相同,检测转换后的参数值是否满足校验子规则;响应于检测结果为转换后的参数值满足校验子规则,确定参数值通过校验。The parameter value is converted into a data type according to a preset data type; in response to the data type of the converted parameter value being the same as the preset data type, whether the converted parameter value satisfies a check sub-rule is detected; in response to the detection result that the converted parameter value satisfies the check sub-rule, it is determined that the parameter value passes the check.
本可选实现方式中,由于提取的参数值一般都是字符串,不利于数据类型校验,因此首先按预设的数据类型对参数值进行数据类型转化一方面有利于数据类型校验,另一方面可以确认提取的参数值是否在接口校验请求消息中传输正确。In this optional implementation, since the extracted parameter values are generally strings, which are not conducive to data type verification, the parameter values are first converted according to the preset data type. On the one hand, this is conducive to data type verification, and on the other hand, it can confirm whether the extracted parameter values are transmitted correctly in the interface verification request message.
本可选实现方式中,校验子规则用于校验参数值的具体取值是否满足要求,如上述例一中的正则表达式和例二中最大小数位数、最小小数位数均属于校验子规则。In this optional implementation, the check sub-rule is used to check whether the specific value of the parameter value meets the requirements. For example, the regular expression in Example 1 and the maximum number of decimal places and the minimum number of decimal places in Example 2 are both check sub-rules.
本可选实现方式提供的对参数值进行校验的方法,首先将提取的参数值进行数据类型转化,变为参数校验规则中预设的数据类型,响应于转化后的参数值与预设的数据类型相同,校验转换后的参数值是否满足校验子规则,提高了对参数值进行校验的可靠性。The method for verifying parameter values provided by this optional implementation first converts the data type of the extracted parameter value into a data type preset in the parameter verification rule, and in response to the converted parameter value being the same as the preset data type, verifies whether the converted parameter value satisfies the verification sub-rule, thereby improving the reliability of the parameter value verification.
本可选实现方式提供的对待校验接口参数进行校验的方法,在提取了接口名称、待校验接口参数名称以及待校验接口参数名称对应的参数值之后,依次对接口名称、接口参数名称、参数值进行校验,提高了待校验接口参数校验的可靠性。The method for verifying the interface parameters to be verified provided by this optional implementation method, after extracting the interface name, the name of the interface parameter to be verified and the parameter value corresponding to the interface parameter name to be verified, verifies the interface name, interface parameter name and parameter value in turn, thereby improving the reliability of the verification of the interface parameters to be verified.
为了实现对参数校验规则的更新,针对上述所有实施例,还可以通过读取数据库的方式更新参数校验规则,参见图4,示出了本申请接口参数校验方法的另一个实施例的流程400,该接口参数校验方法包括以下步骤:In order to update the parameter verification rules, for all the above embodiments, the parameter verification rules can also be updated by reading the database. Referring to FIG. 4 , a process 400 of another embodiment of the interface parameter verification method of the present application is shown. The interface parameter verification method includes the following steps:
步骤401,加载预设的参数校验规则。Step 401, loading preset parameter verification rules.
其中,参数校验规则用于对至少一个接口的接口参数进行校验。The parameter verification rule is used to verify the interface parameters of at least one interface.
本实施例中,预设的参数校验规则是预先设置的参数校验规则,其可以预先放置某些应用或者数据库中,接口参数校验方法运行与其上的运行主体可以通过调用接口或者访问数据库得到该预设的参数校验规则。当然,预设的参数校验规则也可以是与图1所示实施例中的参数校验规则相同的参数校验规则。In this embodiment, the preset parameter verification rule is a preset parameter verification rule, which can be placed in some applications or databases in advance, and the interface parameter verification method and the running subject thereon can obtain the preset parameter verification rule by calling the interface or accessing the database. Of course, the preset parameter verification rule can also be the same parameter verification rule as the parameter verification rule in the embodiment shown in Figure 1.
步骤402,接收网络中的接口校验请求消息。Step 402: Receive an interface verification request message in the network.
步骤403,提取接口校验请求消息中的接口名称和待校验接口参数。Step 403: extract the interface name and interface parameters to be verified in the interface verification request message.
步骤404,基于接口名称对应的参数校验规则,对待校验接口参数进行校验,并返回校验结果。Step 404: based on the parameter verification rule corresponding to the interface name, verify the interface parameters to be verified and return the verification result.
应当理解,上述步骤401-步骤404中的操作和特征,分别与步骤101-104中的操作和特征相对应,因此,上述在步骤101-104中对于操作和特征的描述,同样适用于步骤401-步骤404,在此不再赘述。It should be understood that the operations and features in the above steps 401-404 correspond to the operations and features in steps 101-104, respectively. Therefore, the above descriptions of the operations and features in steps 101-104 are also applicable to steps 401-404 and will not be repeated here.
步骤405,定期读取数据库的参数校验规则。Step 405: Periodically read the parameter verification rules of the database.
本实施例中,定期读取数据库的参数校验规则的时间可以根据执行主体的需求而设置,所有涵盖数据库中参数校验规则更新时间的读取时间均在本实施例的保护范围之内。In this embodiment, the time for periodically reading the parameter verification rules of the database can be set according to the needs of the execution entity, and all reading times covering the update time of the parameter verification rules in the database are within the protection scope of this embodiment.
步骤406,响应于确定数据库的参数校验规则与预设的参数校验规则不相同,采用数据库的参数校验规则替换预设的参数校验规则,返回执行步骤401。Step 406 , in response to determining that the parameter verification rule of the database is different from the preset parameter verification rule, the preset parameter verification rule is replaced by the parameter verification rule of the database, and the process returns to step 401 .
本实施例中,在数据库的参数校验规则与预设的参数校验规则不相同时,说明数据库的参数校验规则已经是最新的参数校验规则,通过返回步骤401重新加载该最新的参数校验规则,可以保证参数校验方法所依据的规则的版本一直是最新的版本。In this embodiment, when the parameter verification rules of the database are different from the preset parameter verification rules, it means that the parameter verification rules of the database are already the latest parameter verification rules. By returning to step 401 to reload the latest parameter verification rules, it can be ensured that the version of the rules based on which the parameter verification method is based is always the latest version.
本实施例提供的接口参数校验方法,定期读取数据库中的参数校验规则,在数据库的参数校验规则与预设的参数校验规则不相同时,将数据库中的参数校验规则替换为预设的参数校验规则,从而达到了参数校验规则的定期更新,保证了接口参数校验的实时性。The interface parameter verification method provided in this embodiment periodically reads the parameter verification rules in the database. When the parameter verification rules in the database are different from the preset parameter verification rules, the parameter verification rules in the database are replaced with the preset parameter verification rules, thereby achieving regular updating of the parameter verification rules and ensuring the real-time performance of the interface parameter verification.
进一步参考图5,作为对上述各图所示方法的实现,本申请提供了接口参数校验装置的一个实施例,该装置实施例与图1所示的方法实施例相对应,该装置具体可应用于各种电子设备中。Further referring to FIG. 5 , as an implementation of the methods shown in the above figures, the present application provides an embodiment of an interface parameter verification device, which corresponds to the method embodiment shown in FIG. 1 , and can be specifically applied to various electronic devices.
如图5所示,本实施例提供的接口参数校验装置500包括:加载单元501,接收单元502,提取单元503,校验单元504。其中,上述加载单元501,可以被配置成加载参数校验规则,参数校验规则用于对至少一个接口的接口参数进行校验。上述接收单元502,可以被配置成接收网络中的接口校验请求消息。上述提取单元503,可以被配置成提取接口校验请求消息中的接口名称和待校验接口参数。上述校验单元504,可以被配置成基于接口名称对应的参数校验规则,对待校验接口参数进行校验,并返回校验结果。As shown in FIG5 , the interface parameter verification device 500 provided in this embodiment includes: a loading unit 501, a receiving unit 502, an extraction unit 503, and a verification unit 504. The loading unit 501 can be configured to load parameter verification rules, and the parameter verification rules are used to verify the interface parameters of at least one interface. The receiving unit 502 can be configured to receive an interface verification request message in the network. The extraction unit 503 can be configured to extract the interface name and the interface parameters to be verified in the interface verification request message. The verification unit 504 can be configured to verify the interface parameters to be verified based on the parameter verification rules corresponding to the interface name, and return the verification result.
在本实施例中,接口参数校验装置500中:加载单元501、接收单元502、提取单元503、校验单元504的具体处理及其所带来的技术效果可分别参考图1对应实施例中的步骤101、步骤102、步骤103、步骤104的相关说明,在此不再赘述。In this embodiment, in the interface parameter verification device 500: the specific processing of the loading unit 501, the receiving unit 502, the extraction unit 503, and the verification unit 504 and the technical effects brought about by them can be respectively referred to the relevant descriptions of step 101, step 102, step 103, and step 104 in the corresponding embodiment of Figure 1, and will not be repeated here.
在本实施例的一些可选的实现方式中,上述待校验接口参数包括:待校验接口参数名称以及待校验接口参数名称对应的参数值,提取单元503包括:参数提取模块(图中未示出),参数校验模块(图中未示出),值提取模块(图中未示出)。其中,上述参数提取模块,可以被配置成从接口校验请求消息中提取待校验接口参数名称。上述参数校验模块,可以被配置成基于接口名称对应的参数校验规则,对待校验接口参数名称进行校验。上述值提取模块,可以被配置成响应于确定待校验接口参数名称通过校验,提取参数值。In some optional implementations of this embodiment, the interface parameters to be checked include: the interface parameter name to be checked and the parameter value corresponding to the interface parameter name to be checked, and the extraction unit 503 includes: a parameter extraction module (not shown in the figure), a parameter verification module (not shown in the figure), and a value extraction module (not shown in the figure). Among them, the parameter extraction module can be configured to extract the interface parameter name to be checked from the interface verification request message. The parameter verification module can be configured to verify the interface parameter name to be checked based on the parameter verification rules corresponding to the interface name. The value extraction module can be configured to extract the parameter value in response to determining that the interface parameter name to be checked passes the verification.
在本实施例的一些可选的实现方式中,上述待校验接口参数包括:待校验接口参数名称以及待校验接口参数名称对应的参数值;校验单元504包括:参数校验模块(图中未示出),值校验模块(图中未示出)。其中,上述参数校验模块,可以被配置成基于接口名称对应的参数校验规则,对待校验接口参数名称进行校验。上述值校验模块,可以被配置成响应于确定待校验接口参数名称通过校验,对参数值进行校验。In some optional implementations of this embodiment, the interface parameter to be checked includes: the interface parameter name to be checked and the parameter value corresponding to the interface parameter name to be checked; the verification unit 504 includes: a parameter verification module (not shown in the figure), and a value verification module (not shown in the figure). The parameter verification module can be configured to verify the interface parameter name to be checked based on the parameter verification rule corresponding to the interface name. The value verification module can be configured to verify the parameter value in response to determining that the interface parameter name to be checked passes the verification.
在本实施例的一些可选的实现方式中,上述参数校验模块包括:定位子模块(图中未示出),确定子模块(图中未示出),验证子模块(图中未示出)。其中,上述定位子模块,确定待校验接口参数名称在接口校验请求消息中所处的位置。上述确定子模块,可以被配置成从接口名称对应的参数校验规则中确定待校验参数对应的参数校验规则。上述验证子模块,可以被配置成响应于待校验接口参数名称在接口校验请求消息中所处的位置与待校验参数对应的参数校验规则中记载的待校验接口参数名称的位置相匹配,确定待校验接口参数名称通过校验。In some optional implementations of the present embodiment, the parameter verification module includes: a positioning submodule (not shown in the figure), a determination submodule (not shown in the figure), and a verification submodule (not shown in the figure). Among them, the positioning submodule determines the position of the interface parameter name to be verified in the interface verification request message. The determination submodule can be configured to determine the parameter verification rule corresponding to the parameter to be verified from the parameter verification rule corresponding to the interface name. The verification submodule can be configured to determine that the interface parameter name to be verified passes the verification in response to the position of the interface parameter name to be verified in the interface verification request message matching the position of the interface parameter name to be verified recorded in the parameter verification rule corresponding to the parameter to be verified.
在本实施例的一些可选的实现方式中,上述待校验参数对应的参数校验规则包括:预设的数据类型以及用于对参数值进行数值校验的校验子规则,值校验模块包括:转换子模块(图中未示出),检测子模块(图中未示出),检验子模块(图中未示出)。其中,上述转换子模块,可以被配置成按预设的数据类型对参数值进行数据类型转化。上述检测子模块,可以被配置成响应于转换后的参数值的数据类型与预设的数据类型相同,检测转换后的参数值是否满足校验子规则。上述检验子模块,可以被配置成响应于检测结果为转换后的参数值满足校验子规则,确定参数值通过校验。In some optional implementations of this embodiment, the parameter verification rules corresponding to the above-mentioned parameters to be verified include: a preset data type and a verification sub-rule for performing numerical verification on the parameter value, and the value verification module includes: a conversion sub-module (not shown in the figure), a detection sub-module (not shown in the figure), and a verification sub-module (not shown in the figure). Among them, the above-mentioned conversion sub-module can be configured to perform data type conversion on the parameter value according to the preset data type. The above-mentioned detection sub-module can be configured to detect whether the converted parameter value satisfies the verification sub-rule in response to the data type of the converted parameter value being the same as the preset data type. The above-mentioned verification sub-module can be configured to determine that the parameter value passes the verification in response to the detection result that the converted parameter value satisfies the verification sub-rule.
在本实施例的一些可选的实现方式中,上述装置500还包括:读取单元(图中未示出),替换单元(图中未示出)。其中,上述读取单元,可以被配置成定期读取数据库的参数校验规则。上述替换单元,可以被配置成响应于确定数据库的参数校验规则与参数校验规则不相同,采用数据库的参数校验规则替换参数校验规则。In some optional implementations of this embodiment, the apparatus 500 further includes: a reading unit (not shown in the figure), and a replacement unit (not shown in the figure). The reading unit may be configured to periodically read the parameter verification rules of the database. The replacement unit may be configured to replace the parameter verification rules with the parameter verification rules of the database in response to determining that the parameter verification rules of the database are different from the parameter verification rules.
本申请的实施例提供的接口参数校验装置,首先加载单元501加载对至少一个接口的接口参数进行校验的参数校验规则;其次,接收单元502接收网络中的接口校验请求消息;然后,提取单元503提取接口校验请求消息中的接口名称和待校验接口参数;最后,校验单元504基于接口名称对应的参数校验规则,对待校验接口参数进行校验,并返回校验结果。由此,通过加载的参数校验规则,可以对接口校验消息中的所有待校验接口参数进行校验,提高了接口参数校验的自动化,节省了技术人员在对各个待校验接口参数进行校验时的开发成本。The interface parameter verification device provided by the embodiment of the present application firstly loads the parameter verification rules for verifying the interface parameters of at least one interface by the loading unit 501; secondly, the receiving unit 502 receives the interface verification request message in the network; then, the extraction unit 503 extracts the interface name and the interface parameters to be verified in the interface verification request message; finally, the verification unit 504 verifies the interface parameters to be verified based on the parameter verification rules corresponding to the interface name, and returns the verification result. Thus, through the loaded parameter verification rules, all the interface parameters to be verified in the interface verification message can be verified, which improves the automation of interface parameter verification and saves the development cost of technicians in verifying each interface parameter to be verified.
根据本申请的实施例,本申请还提供了一种电子设备和一种可读存储介质。According to an embodiment of the present application, the present application also provides an electronic device and a readable storage medium.
如图6所示,是根据本申请实施例的接口参数校验方法的电子设备的框图。电子设备旨在表示各种形式的数字计算机,诸如,膝上型计算机、台式计算机、工作台、个人数字助理、服务器、刀片式服务器、大型计算机、和其它适合的计算机。电子设备还可以表示各种形式的移动装置,诸如,个人数字处理、蜂窝电话、智能电话、可穿戴设备和其它类似的计算装置。本文所示的部件、它们的连接和关系、以及它们的功能仅仅作为示例,并且不意在限制本文中描述的和/或者要求的本申请的实现。As shown in Figure 6, it is a block diagram of an electronic device according to the interface parameter verification method of an embodiment of the present application. Electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workbenches, personal digital assistants, servers, blade servers, mainframe computers and other suitable computers. Electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices and other similar computing devices. The components shown in this article, their connection and relationship, and their functions are only used as examples, and are not intended to limit the realization of the application described herein and/or required.
如图6所示,该电子设备包括:一个或多个处理器601、存储器602,以及用于连接各部件的接口,包括高速接口和低速接口。各个部件利用不同的总线互相连接,并且可以被安装在公共主板上或者根据需要以其它方式安装。处理器可以对在电子设备内执行的指令进行处理,包括存储在存储器中或者存储器上以在外部输入/输出装置(诸如,耦合至接口的显示设备)上显示GUI的图形信息的指令。在其它实施方式中,若需要,可以将多个处理器和/或多条总线与多个存储器和多个存储器一起使用。同样,可以连接多个电子设备,各个设备提供部分必要的操作(例如,作为服务器阵列、一组刀片式服务器、或者多处理器系统)。图6中以一个处理器601为例。As shown in Figure 6, the electronic device includes: one or more processors 601, memory 602, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. The various components are connected to each other using different buses, and can be installed on a common mainboard or installed in other ways as needed. The processor can process instructions executed in the electronic device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input/output device (such as a display device coupled to the interface). In other embodiments, if necessary, multiple processors and/or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple electronic devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). In Figure 6, a processor 601 is taken as an example.
存储器602即为本申请所提供的非瞬时计算机可读存储介质。其中,存储器存储有可由至少一个处理器执行的指令,以使至少一个处理器执行本申请所提供的接口参数校验方法。本申请的非瞬时计算机可读存储介质存储计算机指令,该计算机指令用于使计算机执行本申请所提供的接口参数校验方法。The memory 602 is a non-transient computer-readable storage medium provided in the present application. The memory stores instructions executable by at least one processor to enable at least one processor to perform the interface parameter verification method provided in the present application. The non-transient computer-readable storage medium of the present application stores computer instructions, which are used to enable a computer to perform the interface parameter verification method provided in the present application.
存储器602作为一种非瞬时计算机可读存储介质,可用于存储非瞬时软件程序、非瞬时计算机可执行程序以及模块,如本申请实施例中的接口参数校验方法对应的程序指令/模块(例如,附图5所示的加载单元501、接收单元502、提取单元503和校验单元504)。处理器601通过运行存储在存储器602中的非瞬时软件程序、指令以及模块,从而执行服务器的各种功能应用以及数据处理,即实现上述方法实施例中的接口参数校验方法。The memory 602, as a non-transient computer-readable storage medium, can be used to store non-transient software programs, non-transient computer executable programs and modules, such as program instructions/modules corresponding to the interface parameter verification method in the embodiment of the present application (for example, the loading unit 501, the receiving unit 502, the extraction unit 503 and the verification unit 504 shown in FIG. 5). The processor 601 executes various functional applications and data processing of the server by running the non-transient software programs, instructions and modules stored in the memory 602, that is, implements the interface parameter verification method in the above method embodiment.
存储器602可以包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需要的应用程序;存储数据区可存储根据接口参数校验方法的电子设备的使用所创建的数据等。此外,存储器602可以包括高速随机存取存储器,还可以包括非瞬时存储器,例如至少一个磁盘存储器件、闪存器件、或其他非瞬时固态存储器件。在一些实施例中,存储器602可选包括相对于处理器601远程设置的存储器,这些远程存储器可以通过网络连接至接口参数校验方法的电子设备。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。The memory 602 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the electronic device of the interface parameter verification method, etc. In addition, the memory 602 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory 602 may optionally include a memory remotely arranged relative to the processor 601, and these remote memories may be connected to the electronic device of the interface parameter verification method via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
接口参数校验方法的电子设备还可以包括:输入装置603和输出装置604。处理器601、存储器602、输入装置603和输出装置604可以通过总线605或者其他方式连接,图6中以通过总线605连接为例。The electronic device of the interface parameter verification method may further include: an input device 603 and an output device 604. The processor 601, the memory 602, the input device 603 and the output device 604 may be connected via a bus 605 or other means, and FIG6 takes the connection via the bus 605 as an example.
输入装置603可接收输入的数字或字符信息,以及产生与接口参数校验方法的电子设备的用户设置以及功能控制有关的键信号输入,例如触摸屏、小键盘、鼠标、轨迹板、触摸板、指示杆、一个或者多个鼠标按钮、轨迹球、操纵杆等输入装置。输出装置604可以包括显示设备、辅助照明装置(例如,LED)和触觉反馈装置(例如,振动电机)等。该显示设备可以包括但不限于,液晶显示器(LCD)、发光二极管(LED)显示器和等离子体显示器。在一些实施方式中,显示设备可以是触摸屏。The input device 603 can receive input digital or character information, and generate key signal input related to user settings and function control of the electronic device of the interface parameter verification method, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, an indicator rod, one or more mouse buttons, a trackball, a joystick and other input devices. The output device 604 may include a display device, an auxiliary lighting device (e.g., an LED) and a tactile feedback device (e.g., a vibration motor), etc. The display device may include, but is not limited to, a liquid crystal display (LCD), a light emitting diode (LED) display and a plasma display. In some embodiments, the display device may be a touch screen.
此处描述的系统和技术的各种实施方式可以在数字电子电路系统、集成电路系统、专用ASIC(专用集成电路)、计算机硬件、固件、软件、和/或它们的组合中实现。这些各种实施方式可以包括:实施在一个或者多个计算机程序中,该一个或者多个计算机程序可在包括至少一个可编程处理器的可编程系统上执行和/或解释,该可编程处理器可以是专用或者通用可编程处理器,可以从存储系统、至少一个输入装置、和至少一个输出装置接收数据和指令,并且将数据和指令传输至该存储系统、该至少一个输入装置、和该至少一个输出装置。Various implementations of the systems and techniques described herein can be realized in digital electronic circuit systems, integrated circuit systems, dedicated ASICs (application specific integrated circuits), computer hardware, firmware, software, and/or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and/or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
这些计算程序(也称作程序、软件、软件应用、或者代码)包括可编程处理器的机器指令,并且可以利用高级过程和/或面向对象的编程语言、和/或汇编/机器语言来实施这些计算程序。如本文使用的,术语“机器可读介质”和“计算机可读介质”指的是用于将机器指令和/或数据提供给可编程处理器的任何计算机程序产品、设备、和/或装置(例如,磁盘、光盘、存储器、可编程逻辑装置(PLD)),包括,接收作为机器可读信号的机器指令的机器可读介质。术语“机器可读信号”指的是用于将机器指令和/或数据提供给可编程处理器的任何信号。These computer programs (also referred to as programs, software, software applications, or code) include machine instructions for programmable processors and can be implemented using high-level procedural and/or object-oriented programming languages, and/or assembly/machine languages. As used herein, the terms "machine-readable medium" and "computer-readable medium" refer to any computer program product, device, and/or means (e.g., disk, optical disk, memory, programmable logic device (PLD)) for providing machine instructions and/or data to a programmable processor, including a machine-readable medium that receives machine instructions as a machine-readable signal. The term "machine-readable signal" refers to any signal for providing machine instructions and/or data to a programmable processor.
为了提供与用户的交互,可以在计算机上实施此处描述的系统和技术,该计算机具有:用于向用户显示信息的显示装置(例如,CRT(阴极射线管)或者LCD(液晶显示器)监视器);以及键盘和指向装置(例如,鼠标或者轨迹球),用户可以通过该键盘和该指向装置来将输入提供给计算机。其它种类的装置还可以用于提供与用户的交互;例如,提供给用户的反馈可以是任何形式的传感反馈(例如,视觉反馈、听觉反馈、或者触觉反馈);并且可以用任何形式(包括声输入、语音输入或者、触觉输入)来接收来自用户的输入。To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
可以将此处描述的系统和技术实施在包括后台部件的计算系统(例如,作为数据服务器)、或者包括中间件部件的计算系统(例如,应用服务器)、或者包括前端部件的计算系统(例如,具有图形用户界面或者网络浏览器的用户计算机,用户可以通过该图形用户界面或者该网络浏览器来与此处描述的系统和技术的实施方式交互)、或者包括这种后台部件、中间件部件、或者前端部件的任何组合的计算系统中。可以通过任何形式或者介质的数字数据通信(例如,通信网络)来将系统的部件相互连接。通信网络的示例包括:局域网(LAN)、广域网(WAN)和互联网。The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communications network). Examples of communications networks include: a local area network (LAN), a wide area network (WAN), and the Internet.
计算机系统可以包括客户端和服务器。客户端和服务器一般远离彼此并且通常通过通信网络进行交互。通过在相应的计算机上运行并且彼此具有客户端-服务器关系的计算机程序来产生客户端和服务器的关系。服务器可以是云服务器,又称为云计算服务器或云主机,是云计算服务体系中的一项主机产品,以解决了传统物理主机与虚拟专用服务器(VPS,Virtual Private Server)服务中,存在的管理难度大,业务扩展性弱的缺陷。A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship between the client and the server is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and virtual private servers (VPS) services.
应该理解,可以使用上面所示的各种形式的流程,重新排序、增加或删除步骤。例如,本发申请中记载的各步骤可以并行地执行也可以顺序地执行也可以不同的次序执行,只要能够实现本申请公开的技术方案所期望的结果,本文在此不进行限制。It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this application can be executed in parallel, sequentially or in different orders, as long as the expected results of the technical solution disclosed in this application can be achieved, and this document is not limited here.
上述具体实施方式,并不构成对本申请保护范围的限制。本领域技术人员应该明白的是,根据设计要求和其他因素,可以进行各种修改、组合、子组合和替代。任何在本申请的精神和原则之内所作的修改、等同替换和改进等,均应包含在本申请保护范围之内。The above specific implementations do not constitute a limitation on the protection scope of this application. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of this application should be included in the protection scope of this application.
Claims (10)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011279136.2A CN112269706B (en) | 2020-11-16 | 2020-11-16 | Interface parameter verification method, device, electronic device and computer readable medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011279136.2A CN112269706B (en) | 2020-11-16 | 2020-11-16 | Interface parameter verification method, device, electronic device and computer readable medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN112269706A CN112269706A (en) | 2021-01-26 |
CN112269706B true CN112269706B (en) | 2024-04-05 |
Family
ID=74340677
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202011279136.2A Active CN112269706B (en) | 2020-11-16 | 2020-11-16 | Interface parameter verification method, device, electronic device and computer readable medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112269706B (en) |
Families Citing this family (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113535776A (en) * | 2021-05-28 | 2021-10-22 | 国网辽宁省电力有限公司 | Parameter validity checking method and system applied to monitoring device |
CN113377361B (en) * | 2021-06-28 | 2023-01-13 | 浙江孚临科技有限公司 | Method for realizing timing verification of data source based on linux crontad and jar packets |
CN114666258B (en) * | 2022-03-22 | 2023-11-07 | 阿波罗智联(北京)科技有限公司 | Interface testing method, device, electronic equipment and medium |
CN119324792A (en) * | 2024-08-26 | 2025-01-17 | 中移互联网有限公司 | Interface request processing method and device |
Citations (12)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2018006789A1 (en) * | 2016-07-04 | 2018-01-11 | 中兴通讯股份有限公司 | Parameter checking method and apparatus, and network management server and computer storage medium |
CN108132880A (en) * | 2017-12-21 | 2018-06-08 | 武汉斑马快跑科技有限公司 | A kind of parameter verification method and device |
CN109101812A (en) * | 2018-08-28 | 2018-12-28 | 北京神州绿盟信息安全科技股份有限公司 | A kind of parameter verification method, apparatus, computing device and storage medium |
CN109344642A (en) * | 2018-08-31 | 2019-02-15 | 平安科技(深圳)有限公司 | Interface rules method of calibration, device, computer equipment and storage medium |
CN109408381A (en) * | 2018-10-10 | 2019-03-01 | 四川新网银行股份有限公司 | A kind of product data automatic Verification platform and method based on data check template |
CN109597816A (en) * | 2018-10-30 | 2019-04-09 | 京信通信系统(中国)有限公司 | Parameter verification method, apparatus, computer storage medium and embedded device |
CN109871294A (en) * | 2019-01-31 | 2019-06-11 | 北京百度网讯科技有限公司 | Method and apparatus for verifying data, processing requests |
CN110390069A (en) * | 2019-07-31 | 2019-10-29 | 中国工商银行股份有限公司 | The method, apparatus of data check calculates equipment and medium |
CN110389765A (en) * | 2019-07-24 | 2019-10-29 | 深圳市盟天科技有限公司 | Parameter verification method and parameter verification system |
WO2020124286A1 (en) * | 2018-12-16 | 2020-06-25 | 吉安市井冈山开发区金庐陵经济发展有限公司 | Authentication method |
CN111679975A (en) * | 2020-05-28 | 2020-09-18 | 平安普惠企业管理有限公司 | Document generating method, device, electronic device and medium |
CN111782517A (en) * | 2020-06-23 | 2020-10-16 | 浙江保融科技有限公司 | Automatic file checking method |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9178705B2 (en) * | 2007-04-13 | 2015-11-03 | International Business Machines Corporation | Method and system for stateless validation |
-
2020
- 2020-11-16 CN CN202011279136.2A patent/CN112269706B/en active Active
Patent Citations (12)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2018006789A1 (en) * | 2016-07-04 | 2018-01-11 | 中兴通讯股份有限公司 | Parameter checking method and apparatus, and network management server and computer storage medium |
CN108132880A (en) * | 2017-12-21 | 2018-06-08 | 武汉斑马快跑科技有限公司 | A kind of parameter verification method and device |
CN109101812A (en) * | 2018-08-28 | 2018-12-28 | 北京神州绿盟信息安全科技股份有限公司 | A kind of parameter verification method, apparatus, computing device and storage medium |
CN109344642A (en) * | 2018-08-31 | 2019-02-15 | 平安科技(深圳)有限公司 | Interface rules method of calibration, device, computer equipment and storage medium |
CN109408381A (en) * | 2018-10-10 | 2019-03-01 | 四川新网银行股份有限公司 | A kind of product data automatic Verification platform and method based on data check template |
CN109597816A (en) * | 2018-10-30 | 2019-04-09 | 京信通信系统(中国)有限公司 | Parameter verification method, apparatus, computer storage medium and embedded device |
WO2020124286A1 (en) * | 2018-12-16 | 2020-06-25 | 吉安市井冈山开发区金庐陵经济发展有限公司 | Authentication method |
CN109871294A (en) * | 2019-01-31 | 2019-06-11 | 北京百度网讯科技有限公司 | Method and apparatus for verifying data, processing requests |
CN110389765A (en) * | 2019-07-24 | 2019-10-29 | 深圳市盟天科技有限公司 | Parameter verification method and parameter verification system |
CN110390069A (en) * | 2019-07-31 | 2019-10-29 | 中国工商银行股份有限公司 | The method, apparatus of data check calculates equipment and medium |
CN111679975A (en) * | 2020-05-28 | 2020-09-18 | 平安普惠企业管理有限公司 | Document generating method, device, electronic device and medium |
CN111782517A (en) * | 2020-06-23 | 2020-10-16 | 浙江保融科技有限公司 | Automatic file checking method |
Also Published As
Publication number | Publication date |
---|---|
CN112269706A (en) | 2021-01-26 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN112269706B (en) | Interface parameter verification method, device, electronic device and computer readable medium | |
CN110858172B (en) | A method and device for generating automatic test code | |
CN111666206A (en) | Method, device, equipment and storage medium for acquiring influence range of change code | |
CN112015468B (en) | Interface document processing method and device, electronic equipment and storage medium | |
CN112182037A (en) | Data verification method, device, equipment and storage medium | |
CN111475164B (en) | Component dependency detection method, device and electronic device | |
CN113590172B (en) | A code file publishing method, device, equipment and storage medium | |
CN111459813A (en) | Test processing method and device | |
CN111813623A (en) | A page monitoring method, device, electronic device and storage medium | |
CN110716956A (en) | Data request intercepting method and device | |
CN112131092A (en) | Page debugging method and device | |
CN115222176A (en) | Risk control methods, devices, equipment and media | |
CN115202711A (en) | Data publishing method and system | |
CN112948733B (en) | Interface maintenance method, device, computing equipment and medium | |
CN112822302B (en) | Data normalization method and device, electronic equipment and storage medium | |
CN119031053A (en) | Parameter verification rule generation method and device | |
CN111966576A (en) | Abnormal code positioning method and device, electronic equipment and storage medium | |
CN111159010A (en) | Defect collecting method, defect reporting method and related device | |
CN117454038A (en) | Page detection method and device | |
CN114968822A (en) | Interface testing method, device, computer equipment and storage medium | |
CN115114364A (en) | Method, device, equipment and computer readable medium for matching interface | |
CN113568541A (en) | Page function determination method and device, electronic equipment and storage medium | |
CN113760346A (en) | Information management method and device | |
CN112732471A (en) | Error correction method and error correction device for interface return data | |
CN112052347A (en) | Image storage method and device and electronic equipment |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |