Data processing method, device, electronic device and storage medium
By obtaining and integrating the information in the interface packets, and combining the verification rules in the configuration manager to perform interface verification, the problem of complex and inefficient interface verification development in the existing technology is solved, and flexible verification rule updates and Efficient interface verification.
Patent Information
- Application Number
- CN202410474889.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-19
- Publication Date
- 2024-09-03
- Estimated Expiration
- 2044-04-19
AI Technical Summary
In the existing technology, when the requirements of each interface are specifically developed based on preset templates and tools, it needs to be reorganized and developed when the requirements change, which is complex and inefficient.
By obtaining the interface information and the first character and the second character in the interface message, calling the preset fusion model to fuse the description information with the second character, the verification characteristics of the interface message are obtained. From the preset configuration manager Query the rule group information corresponding to the verification feature, extract the verification rules and verification fields, calculate the verification reference range based on the verification expression and context parameters, execute the verification program and generate verification feedback information.
It reduces the complexity and time of interface verification development and improves efficiency, so that when requirements change, verification rules can be directly updated without the need for specific development of each interface.
Smart Images

Figure CN118069539B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a data processing method, device, electronic equipment and storage medium. Background Art
[0002] As application systems gradually develop towards distributed and lightweight architectures, the original single large system is usually split into multiple subsystems and subcomponents, so the data interaction between systems and components through interfaces has increased significantly, and the interface field verification link has become an important part of software development. Among the many interface fields, the date type is an extremely common type, and business-type verification in interface verification is widely used. In related technologies, the verification development of interfaces is usually carried out according to preset templates and tools to develop specific requirements for each interface to adapt to different interface verifications, but this method requires re-sorting and development when requirements change, which is complex and inefficient. Summary of the invention
[0003] In view of this, an embodiment of the present invention provides a data processing method, device, electronic device and storage medium, which can solve the problem of performing specific development for the requirements of each interface according to preset templates and tools, requiring re-sorting and development when the requirements change, and resulting in complex operations and low efficiency.
[0004] To achieve the above objective, according to one aspect of an embodiment of the present invention, a method for data processing is provided.
[0005] A data processing method according to an embodiment of the present invention includes: in response to a processing instruction, obtaining corresponding interface information and an interface message, extracting a first character and a second character from the interface message, obtaining description information associated with the first character, calling a preset fusion model to fuse the description information and the second character, and obtaining a verification feature of the interface message;
[0006] Querying the rule group information corresponding to the verification feature from the preset configuration manager to determine the verification rule set, and extracting the verification expression and verification field associated with each verification rule;
[0007] For each of the verification rules, a parameter value of a corresponding context parameter is obtained to calculate a verification reference range based on the verification expression and the parameter value, and a corresponding field value is extracted from the interface message based on the verification field to execute a verification procedure based on the verification reference range and the field value to obtain a verification result;
[0008] Verification feedback information is generated based on the verification results of each of the verification rules and the interface information.
[0009] In one embodiment, obtaining the parameter value of the corresponding context parameter includes:
[0010] Parsing the verification rule to determine a type tag of a parameter included in the verification rule, and determining a context parameter based on the type tag;
[0011] In response to the context parameter being a preset type, determining the context parameter as the parameter value of the context parameter; in response to the context parameter including a preset character, querying a method class corresponding to the preset character to call the method class to obtain the parameter value of the context parameter.
[0012] In yet another embodiment, the context parameters include a plurality of;
[0013] Calculating a verification reference range based on the verification expression and the parameter value includes:
[0014] Obtain function information of the verification expression corresponding to the verification rule to query the associated input parameter array;
[0015] The parameter values associated with the input parameter array are determined based on the arrangement order of each of the context parameters, so as to input the verification expression and calculate the verification reference range.
[0016] In yet another embodiment, calling the method class to obtain the parameter value of the context parameter includes:
[0017] The context parameter is split into a first character and a second character to determine a difference parameter based on the second character and an input parameter template of the method class, and the method class is called to obtain a parameter value of the context parameter according to a fill character corresponding to the first character and the difference parameter.
[0018] In yet another embodiment, obtaining the parameter value of the corresponding context parameter further includes:
[0019] Calling a preset rule template corresponding to the verification rule to verify the verification rule;
[0020] In response to successful verification, a parameter value of a corresponding context parameter is obtained; in response to failed verification, it is determined that the verification rule is abnormal.
[0021] In yet another embodiment, further comprising:
[0022] In response to the verification rule update instruction, obtain corresponding rule information to be updated, and determine the rule group information to be updated and the update type;
[0023] In response to the update type being a preset type, querying the rule group to be updated, reading the target verification rule from the rule group to be updated based on the rule information to be updated, and updating the target verification rule according to the update information in the rule information to be updated.
[0024] In yet another embodiment, the description information and the second character are merged to obtain the verification feature of the interface message, including:
[0025] Identify multiple business features in the description information, calculate the hash value of each of the business features, splice the hash values, call a preset interpolation model, merge the second character with the spliced hash value, and obtain the verification feature of the interface message.
[0026] To achieve the above objective, according to another aspect of an embodiment of the present invention, a data processing device is provided.
[0027] A data processing device according to an embodiment of the present invention includes: an acquisition unit, configured to acquire corresponding interface information and an interface message in response to a processing instruction, extract a first character and a second character from the interface message, acquire description information associated with the first character, and call a preset fusion model to fuse the description information and the second character to obtain a verification feature of the interface message;
[0028] An extraction unit, used to query the rule group information corresponding to the verification feature from a preset configuration manager to determine a verification rule set, and extract a verification expression and a verification field associated with each verification rule;
[0029] A verification unit, configured to obtain, for each of the verification rules, a parameter value of a corresponding context parameter, calculate a verification reference range based on the verification expression and the parameter value, extract a corresponding field value from the interface message based on the verification field, execute a verification procedure based on the verification reference range and the field value, and obtain a verification result;
[0030] A generating unit is used to generate verification feedback information based on the verification results of each of the verification rules and the interface information.
[0031] In one embodiment, the verification unit is specifically used to:
[0032] Parsing the verification rule to determine a type tag of a parameter included in the verification rule, and determining a context parameter based on the type tag;
[0033] In response to the context parameter being a preset type, determining the context parameter as the parameter value of the context parameter; in response to the context parameter including a preset character, querying a method class corresponding to the preset character to call the method class to obtain the parameter value of the context parameter.
[0034] In yet another embodiment, the context parameters include a plurality of;
[0035] The verification unit is specifically used for:
[0036] Obtain function information of the verification expression corresponding to the verification rule to query the associated input parameter array;
[0037] The parameter values associated with the input parameter array are determined based on the arrangement order of each of the context parameters, so as to input the verification expression and calculate the verification reference range.
[0038] In yet another embodiment, the verification unit is specifically configured to:
[0039] The annotation of the context parameter is queried based on the position information to obtain the parameter attribute of the context parameter from the annotation, so as to determine the parameter value of the context parameter in combination with the parameter attribute and the numerical value.
[0040] In yet another embodiment, the verification unit is specifically configured to:
[0041] The context parameter is split into a first character and a second character to determine a difference parameter based on the second character and an input parameter template of the method class, and the method class is called to obtain a parameter value of the context parameter according to a fill character corresponding to the first character and the difference parameter.
[0042] In yet another embodiment, the acquisition unit is further configured to, in response to the verification rule update instruction, acquire corresponding rule information to be updated, and determine rule group information to be updated and an update type;
[0043] The device also includes:
[0044] The updating unit is used for querying the rule group to be updated in response to the update type being a preset type, reading the target verification rule from the rule group to be updated based on the rule information to be updated, and updating the target verification rule according to the update information in the rule information to be updated.
[0045] In yet another embodiment, the acquisition unit is specifically configured to:
[0046] Identify multiple business features in the description information, calculate the hash value of each of the business features, splice the hash values, call a preset interpolation model, merge the second character with the spliced hash value, and obtain the verification feature of the interface message.
[0047] To achieve the above objective, according to another aspect of an embodiment of the present invention, an electronic device is provided.
[0048] An electronic device according to an embodiment of the present invention includes: one or more processors; a storage device for storing one or more programs, when the one or more programs are executed by the one or more processors, the one or more processors implement the data processing method provided by the embodiment of the present invention.
[0049] To achieve the above objective, according to another aspect of an embodiment of the present invention, a computer readable medium is provided.
[0050] A computer-readable medium according to an embodiment of the present invention stores a computer program, and when the program is executed by a processor, the data processing method provided by the embodiment of the present invention is implemented.
[0051] To achieve the above objective, according to another aspect of an embodiment of the present invention, a computer program product is provided.
[0052] A computer program product according to an embodiment of the present invention includes a computer program, and when the program is executed by a processor, the data processing method provided by the embodiment of the present invention is implemented.
[0053] An embodiment of the above invention has the following advantages or beneficial effects: In the embodiment of the present invention, in response to a processing instruction, the corresponding interface information and interface message are obtained, and then the associated description information is obtained through the first character in the interface message, and the verification feature is obtained after being merged with the second character, so as to query the rule group information corresponding to the verification feature from the preset configuration manager to determine the verification rule set, and extract the verification expression and verification field associated with each verification rule; for each verification rule, the parameter value of the corresponding context parameter can be obtained to calculate the verification reference range based on the verification expression and the parameter value, and the corresponding field value is extracted from the interface message based on the verification field, so as to execute the verification program based on the verification reference range and the field value to obtain the verification result; verification feedback information is generated based on the verification result of each of the verification rules and the interface information. In an embodiment of the present invention, when performing interface inspection, verification rules can be extracted from the configuration manager, and the verification rules include verification expressions and verification fields. The verification reference range of the verification rule can be calculated by combining the parameter value of the context parameter in the verification table rule with the verification expression, that is, the range for judging whether the interface meets the verification requirements, and then the field value of the verification field in the interface message can be verified, and then the verification result can be determined. In this way, in an embodiment of the present invention, the verification rules for interface inspection can be separately configured in the configuration manager, and the verification rules are configured through verification expressions and verification fields, and the corresponding relationship with the interface is configured. When in use, the corresponding verification rules are obtained according to the interface information, and there is no need to carry out specific development for each interface. When the inspection requirements change, the verification rules can be directly updated, thereby reducing the complexity of development operations and improving verification development efficiency.
[0054] The further effects of the above-mentioned non-conventional optional manner will be described below in conjunction with specific implementation examples. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] The accompanying drawings are used to better understand the present invention and do not constitute an improper limitation of the present invention.
[0056] Figure 1 is a schematic diagram of a main flow of a data processing method according to an embodiment of the present invention;
[0057] Figure 2 is a schematic diagram of another main flow of a data processing method according to an embodiment of the present invention;
[0058] Figure 3 is a schematic diagram of main units of a data processing apparatus according to an embodiment of the present invention;
[0059] Figure 4 is an exemplary system architecture diagram to which embodiments of the present invention may be applied;
[0060] Figure 5 It is a schematic diagram of the structure of a computer system suitable for implementing the embodiment of the present invention. DETAILED DESCRIPTION
[0061] The following is a description of exemplary embodiments of the present invention in conjunction with the accompanying drawings, including various details of the embodiments of the present invention 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 may be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for clarity and conciseness, the description of well-known functions and structures is omitted in the following description.
[0062] It should be noted that the embodiments and features of the embodiments of the present invention can be combined with each other without conflict. The acquisition, storage, use, and processing of data in the technical solution of this application are in compliance with the relevant provisions of national laws and regulations.
[0063] An embodiment of the present invention provides a data processing system, which can be used for verifying data in a single scenario, specifically the same as verifying interface data.
[0064] The embodiment of the present invention provides a data processing method, which can be executed by a data processing system. Figure 1 As shown, the method includes:
[0065] S101: In response to a processing instruction, corresponding interface information and interface message are obtained, a first character and a second character are extracted from the interface message, description information associated with the first character is obtained, and a preset fusion model is called to fuse the description information and the second character to obtain a verification feature of the interface message.
[0066] The processing instruction may be triggered by the data processing system or by an external system. For example, the data processing system may trigger the corresponding processing instruction after receiving the interface message. The processing instruction indicates an instruction to check the interface, and may specifically include an instruction to perform date verification on the interface. The processing instruction may include interface information, so in this step, the corresponding interface information may be obtained from the processing instruction, and then the interface message may be obtained according to the interface information.
[0067] Since different service types usually correspond to different verification requirements, and the same service type may also result in different specific verification rules due to different attributes, in all embodiments of the present invention, the first character and the second character can be extracted from the interface message, the first character can be used to represent the service type described in the message, and the second character can be used to represent the attribute value of the personalized attribute corresponding to the message. For example, the service type may include login service, payment service, etc., and the personalization or attributes may be set according to the requirements. For example, for the login service, the personalized attributes may include whether the user is a member, the login device type, etc. For different service types, the verification requirements can be determined through the description information, and then an association relationship with the first character can be established. After receiving the interface message, the corresponding description information can be obtained based on the first character therein, and then the description information and the second character in the interface message can be merged to obtain the verification characteristics of the interface message, so that the rule group information suitable for verification of the interface message can be determined.
[0068] Specifically, the description information may include multiple business features to indicate the requirements of this verification, so in this step, multiple business features in the description information may be identified, and then the hash value of each business feature may be calculated, and then these hash values may be spliced, and the splicing method may be pre-set. For the spliced hash value, the second character may be fused into the spliced hash value by interpolation to obtain the verification feature of the interface message. The interpolation method may be set as an interpolation model, and the specific method may be pre-configured.
[0069] It should be noted that in the embodiments of the present invention, the description information may be text information, in which case the business features may be identified from the description information through a preset keyword library, or the description information may include a set of business features, in which case each business feature may be identified from the description information.
[0070] S102: querying the rule group information corresponding to the verification feature from the preset configuration manager to determine the verification rule set, and extracting the verification expression and verification field associated with each verification rule.
[0071] Among them, each verification rule can be pre-configured in the configuration manager, and the verification rules can be configured in groups, so a correspondence between the verification characteristics and the rule group information can be established, and then the corresponding rule group information can be queried from the preset configuration manager. The verification rule group can include a basic rule group and a personalized rule group. The basic rule combination can represent the verification rules applicable to each reception to meet the basic verification requirements of the interface. The personalized rule group can be personalized based on the interface to meet personalized verification requirements. After querying the rule group information in this step, the verification rule set for the interface can be determined.
[0072] In an embodiment of the present invention, a check rule may be associated with a check expression and a check field, where the check expression represents a check condition expression and the check field identifies a field used by the check rule. Therefore, after determining a check rule set in this step, the associated check expression and check field are extracted for each check rule therein. For example, the check expression may include: before(1A, 2B, 3C), which represents the check condition that the field value of the check field needs to satisfy.
[0073] S103: For each verification rule, obtain the parameter value of the corresponding context parameter, calculate the verification reference range based on the verification expression and the parameter value, extract the corresponding field value from the interface message based on the verification field, execute the verification program based on the verification reference range and the field value, and obtain the verification result.
[0074] The context parameters represent the parameters needed in the validation expression, which usually need to be pre-configured or obtained when used, and can also be updated through configuration or obtained in real time.
[0075] Specifically, this step can be executed as follows: parsing the verification rule to determine the type label of the parameter included in the verification rule, and determining the context parameter based on the type label; in response to the context parameter being a preset type, determining the context parameter as the parameter value of the context parameter; in response to the context parameter being a preset character, querying the method class corresponding to the preset character to call the method class to obtain the parameter value of the context parameter.
[0076] Each parameter included in the validation rule can be pre-configured with a label to indicate which are the context parameter types, and then the context parameters can be determined. Specifically, the context parameters can be configured in the validation expression, or they can be configured separately and establish a corresponding relationship with the validation rule. For example, for before(1A,2B,3C), before can set the type label as function, and 1A, 2B, and 3C can set the type label as context parameter.
[0077] When the context parameter is of a pre-set type, the parsed context parameter can be directly determined as the parameter value of the context parameter, that is, the parameter value of the context parameter is pre-configured. The preset type takes a number as an example. For example, the check expression can be before(1,2,3), 1, 2, 3 are context parameters, and their type is a number, so 1, 2, 3 can be directly determined as the context parameter as a numerical value. At this time, if there is only one context parameter, the parameter value of the context parameter can be directly determined. If there is more than one context parameter, the parameter value of the context parameter can be determined in combination with the location information of the context parameter; when the value of the context parameter needs to be obtained, a preset character can be configured, and the preset character is configured with a corresponding method class, and the parameter value of the context parameter can be obtained through this method class. Take the check expression before(A,B,C) as an example, where A, B, and C can represent context parameters, and their values are pre-configured preset characters, so the corresponding parameter values can be obtained according to the pre-configured method classes corresponding to A, B, and C.
[0078] It should be noted that the context parameter may include multiple context parameters, which are usually associated with the input parameters of the function in the verification expression. In the embodiment of the present invention, the input parameter array of each function information can be set to represent the function input parameters, and then the parameter value associated with the input parameter array is determined based on the arrangement order of each context parameter, that is, the obtained parameter value is determined as the element value of the input parameter array in sequence according to the arrangement order of each context parameter, that is, the input parameter of the function in the verification expression, so that the verification reference range can be calculated. The verification reference range represents the allowable range of the verification field, so that the verification field can be verified through this range.
[0079] In one embodiment, for the verification of the time field, the test expression usually determines a time range, so the context parameter is usually a method class for time acquisition. For the preset method class, an input parameter template can be set so that the accurate input parameter can be determined when the method class is called. For example, the input parameter of the method class for time acquisition can be expressed as NMR, where N represents year, M represents month, and R represents week. The context parameter can include two parts, one for the specific value and one for the unit of the value. For example, the context parameter can be May-2 weeks. At this time, it can be divided into two parts, that is, the first character: 5, 2, the second character: month, week, indicating the second week of May; in this way, by comparing the second character with the set input parameter template, it can be determined that the difference parameter is year, that is, N. At this time, the input parameter of the method class can be filled with the preset filling character, that is, the input parameter is determined according to the filling character corresponding to the first character and the difference parameter. For example, if the filling parameter is set to 0, the input parameter can be determined to be 0-5-2, and then the parameter value of the context parameter, that is, the specific time range, can be obtained by calling the method class.
[0080] It should be noted that in this step, before obtaining the parameter value of the corresponding context parameter, the verification rule can be verified to determine whether it is a normal verification rule. Specifically, it can be performed as follows: calling the preset rule template corresponding to the verification rule to verify the verification rule; in response to successful verification, obtaining the parameter value of the corresponding context parameter; in response to failed verification, determining that the verification rule is abnormal. The preset rule template can include the content required by the verification rule, such as the verification expression and the verification field, and then verify whether the content in the verification rule is comprehensive. If the verification rule fails to be verified, it can be said that the verification rule is abnormal, and the subsequent operations can be stopped at this time.
[0081] In an embodiment of the present invention, interface verification may include technical verification and business verification, so the verification step may be divided into two sub-steps according to the verification type, such as performing a technical verification first and then performing a business verification. The verification principle of each sub-step is the same as the verification principle in the embodiment of the present invention.
[0082] S104: Generate verification feedback information based on the verification results of each verification rule and the interface information.
[0083] The verification result of this step may include verification passed or verification failed, and the verification feedback information may include the verification result to facilitate subsequent result query and review.
[0084] In the embodiment of the present invention, the verification rules can be updated according to the needs, which can be specifically performed as follows: in response to the verification rule update instruction, the corresponding interface information to be updated is obtained to query the corresponding rule information to be updated, and the rule group information to be updated and the update type are determined; in response to the update type being the preset type, the rule group to be updated is queried to read the target verification rule from the rule group to be updated based on the rule information to be updated, and the target verification rule is updated according to the update information in the rule information to be updated. The update type can specifically include adding, modifying, deleting, etc., and the preset rule in this step can represent the rule modification.
[0085] In an embodiment of the present invention, when performing interface inspection, verification rules can be extracted from the configuration manager, and the verification rules include verification expressions and verification fields. The verification reference range of the verification rule can be calculated by combining the parameter value of the context parameter in the verification table rule with the verification expression, that is, the range for judging whether the interface meets the verification requirements, and then the field value of the verification field in the interface message can be verified, and then the verification result can be determined. In this way, in an embodiment of the present invention, the verification rules for interface inspection can be separately configured in the configuration manager, and the verification rules are configured through verification expressions and verification fields, and the corresponding relationship with the interface is configured. When in use, the corresponding verification rules are obtained according to the interface information, and there is no need to carry out specific development for each interface. When the inspection requirements change, the verification rules can be directly updated, thereby reducing the complexity of development operations and improving verification development efficiency.
[0086] It should be noted that the configuration manager of the embodiment of the present invention can configure the inspection rules, and establish the association relationship between the inspection rule group and the inspection rules, and the inspection rule group and the verification features in the form of key-value pairs. For example, the code of the inspection rule group can be set, and then the inspection rule list associated with the code can be set. The inspection rules can include range rules, interval rules, etc. At the same time, the rule manager can be pre-configured: it is used to integrate all verification rules, and it can also support the expansion of more rule functions, that is, the interface inspection expression expansion and configuration can be realized as required. The embodiment of the present invention can use a templated method to write the verification logic, and the template can contain multiple abstract methods (referring to the functional coding fragment to be implemented by the user), which is convenient for customized development according to the characteristics of the application.
[0087] Combine the following Figure 1 The embodiment shown in the figure specifically describes the method for data processing in the embodiment of the present invention. Figure 2 As shown, the method includes:
[0088] S201: In response to a processing instruction, obtain corresponding interface information and interface message.
[0089] S202: extracting a first character and a second character from the interface message, obtaining description information associated with the first character, calling a preset fusion model to fuse the description information and the second character, and obtaining a verification feature of the interface message.
[0090] S203: querying the rule group information corresponding to the verification feature from the preset configuration manager to determine the verification rule set, and extracting the verification expression and verification field associated with each verification rule.
[0091] S204: For each verification rule, parse the verification rule to determine a type tag of a parameter included in the verification rule, and determine a context parameter based on the type tag.
[0092] S205: In response to the context parameter being of a preset type, determining the context parameter as a parameter value of the context parameter; in response to the context parameter including a preset character, querying a method class corresponding to the preset character to call the method class to obtain the parameter value of the context parameter.
[0093] S206: Calculate a verification reference range based on the verification expression and the parameter value.
[0094] S207: extracting a corresponding field value from the interface message based on the check field, and executing a check procedure based on the check reference range and the field value to obtain a check result.
[0095] S208: Generate verification feedback information based on the verification results of each verification rule and the interface information.
[0096] It should be noted that the data processing principle in the embodiment of the present invention is the same as Figure 1 The data processing principle in the illustrated embodiments is the same and will not be described in detail here.
[0097] In order to solve the problems existing in the prior art, an embodiment of the present invention provides a data processing device 300, such as Figure 3 As shown, the device 300 includes:
[0098] The acquisition unit 301 is used to respond to the processing instruction, acquire the corresponding interface information and interface message, extract the first character and the second character from the interface message, acquire the description information associated with the first character, call the preset fusion model to fuse the description information and the second character, and obtain the verification feature of the interface message;
[0099] The extraction unit 302 is used to query the rule group information corresponding to the verification feature from the preset configuration manager to determine the verification rule set and extract the verification expression and verification field associated with each verification rule;
[0100] The verification unit 303 is used to obtain a parameter value of a corresponding context parameter for each of the verification rules, so as to calculate a verification reference range based on the verification expression and the parameter value, extract a corresponding field value from the interface message based on the verification field, and execute a verification procedure based on the verification reference range and the field value to obtain a verification result;
[0101] The generating unit 304 is configured to generate verification feedback information based on the verification results of each of the verification rules and the interface information.
[0102] It should be understood that the manner of implementing the embodiments of the present invention is different from the Figure 1 The method of the illustrated embodiment is the same and will not be described again here.
[0103] In one embodiment, the verification unit 303 is specifically configured to:
[0104] Parsing the verification rule to determine a type tag of a parameter included in the verification rule, and determining a context parameter based on the type tag;
[0105] In response to the context parameter being a preset type, determining the context parameter as the parameter value of the context parameter; in response to the context parameter including a preset character, querying a method class corresponding to the preset character to call the method class to obtain the parameter value of the context parameter.
[0106] In yet another embodiment, the context parameters include a plurality of;
[0107] The verification unit 303 is specifically used for:
[0108] Obtain function information of the verification expression corresponding to the verification rule to query the associated input parameter array;
[0109] The parameter values associated with the input parameter array are determined based on the arrangement order of each of the context parameters, so as to input the verification expression and calculate the verification reference range.
[0110] In yet another embodiment, the verification unit 303 is specifically configured to:
[0111] The annotation of the context parameter is queried based on the position information to obtain the parameter attribute of the context parameter from the annotation, so as to determine the parameter value of the context parameter in combination with the parameter attribute and the numerical value.
[0112] In yet another embodiment, the verification unit 303 is specifically configured to:
[0113] The context parameter is split into a first character and a second character to determine a difference parameter based on the second character and an input parameter template of the method class, and the method class is called to obtain a parameter value of the context parameter according to a fill character corresponding to the first character and the difference parameter.
[0114] In yet another embodiment, the acquisition unit 301 is further configured to, in response to the verification rule update instruction, acquire corresponding rule information to be updated, and determine the rule group information to be updated and the update type;
[0115] The device 300 further includes:
[0116] The updating unit is used for querying the rule group to be updated in response to the update type being a preset type, reading the target verification rule from the rule group to be updated based on the rule information to be updated, and updating the target verification rule according to the update information in the rule information to be updated.
[0117] In yet another embodiment, the acquiring unit 301 is specifically configured to:
[0118] Identify multiple business features in the description information, calculate the hash value of each of the business features, splice the hash values, call a preset interpolation model, merge the second character with the spliced hash value, and obtain the verification feature of the interface message.
[0119] It should be understood that the manner of implementing the embodiments of the present invention is different from the Figure 1 , 2 The method of the illustrated embodiment is the same and will not be repeated here.
[0120] In an embodiment of the present invention, when performing interface inspection, verification rules can be extracted from the configuration manager, and the verification rules include verification expressions and verification fields. The verification reference range of the verification rule can be calculated by combining the parameter value of the context parameter in the verification table rule with the verification expression, that is, the range for judging whether the interface meets the verification requirements, and then the field value of the verification field in the interface message can be verified, and then the verification result can be determined. In this way, in an embodiment of the present invention, the verification rules for interface inspection can be separately configured in the configuration manager, and the verification rules are configured through verification expressions and verification fields, and the corresponding relationship with the interface is configured. When in use, the corresponding verification rules are obtained according to the interface information, and there is no need to carry out specific development for each interface. When the inspection requirements change, the verification rules can be directly updated, thereby reducing the complexity of development operations and improving verification development efficiency.
[0121] According to an embodiment of the present invention, the embodiment of the present invention further provides an electronic device and a readable storage medium.
[0122] The electronic device of an embodiment of the present invention comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the one processor, and the instructions are executed by the at least one processor so that the at least one processor executes the data processing method provided by the embodiment of the present invention.
[0123] Figure 4 An exemplary system architecture 400 is shown to which the data processing method or data processing apparatus according to the embodiment of the present invention can be applied.
[0124] like Figure 4 As shown, system architecture 400 may include terminal devices 401, 402, 403, network 404 and server 405. Network 404 is used to provide a medium for communication links between terminal devices 401, 402, 403 and server 405. Network 404 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.
[0125] The user can use the terminal devices 401, 402, 403 to interact with the server 405 through the network 404 to receive or send messages, etc. Various client applications can be installed on the terminal devices 401, 402, 403.
[0126] The terminal devices 401 , 402 , 403 may be, but are not limited to, smart phones, tablet computers, laptop computers, desktop computers, and the like.
[0127] The server 405 may be a server that provides various services, such as a backend management server (only an example) that provides support for shopping websites browsed by users using the terminal devices 401, 402, and 403. The backend management server may analyze and process the received data such as product information query requests, and feed back the processing results (such as product information - only an example) to the terminal device.
[0128] It should be noted that the data processing method provided in the embodiment of the present invention is generally executed by the server 405 , and accordingly, the data processing device is generally set in the server 405 .
[0129] It should be understood that Figure 4 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.
[0130] Reference below Figure 5 , which shows a schematic diagram of the structure of a computer system 500 suitable for implementing an embodiment of the present invention. Figure 5The computer system shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0131] like Figure 5 As shown, the computer system 500 includes a central processing unit (CPU) 501, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 502 or a program loaded from a storage part 508 into a random access memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the system 500 are also stored. The CPU 501, the ROM 502, and the RAM 503 are connected to each other through a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.
[0132] The following components are connected to the I / O interface 505: an input section 506 including a keyboard, a mouse, etc.; an output section 507 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 508 including a hard disk, etc.; and a communication section 509 including a network interface card such as a LAN card, a modem, etc. The communication section 509 performs communication processing via a network such as the Internet. A drive 510 is also connected to the I / O interface 505 as needed. A removable medium 511, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 510 as needed, so that a computer program read therefrom is installed into the storage section 508 as needed.
[0133] In particular, according to the embodiments disclosed in the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present invention include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 509, and / or installed from the removable medium 511. When the computer program is executed by the central processing unit (CPU) 501, the above-mentioned functions defined in the system of the present invention are executed.
[0134] It should be noted that the computer-readable medium shown in the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0135] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a unit, a program segment, or a part of a code, and the above-mentioned unit, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0136] The units involved in the embodiments of the present invention may be implemented by software or hardware. The units described may also be set in a processor, for example, it may be described as: a processor includes an acquisition unit, an extraction unit, a verification unit, and a generation unit. The names of these units do not constitute a limitation on the units themselves in some cases, for example, the acquisition unit may also be described as a "unit for acquisition function".
[0137] As another aspect, the present invention further provides a computer-readable medium, which may be included in the device described in the above embodiment; or may exist independently without being assembled into the device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by a device, the device executes the data processing method provided by the present invention.
[0138] As another aspect, the present invention further provides a computer program product, including a computer program, which, when executed by a processor, implements the data processing method provided by an embodiment of the present invention.
[0139] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A method for data processing, characterized in that: include: In response to the processing instruction, corresponding interface information and interface message are obtained, a first character and a second character are extracted from the interface message, description information associated with the first character is obtained, and a preset fusion model is called to fuse the description information and the second character to obtain a verification feature of the interface message; Querying the rule group information corresponding to the verification feature from the preset configuration manager to determine the verification rule set, and extracting the verification expression and verification field associated with each verification rule; For each of the verification rules, a parameter value of a corresponding context parameter is obtained, so as to calculate a verification reference range based on the verification expression and the parameter value, and a corresponding field value is extracted from the interface message based on the verification field, so as to execute a verification procedure based on the verification reference range and the field value, and obtain a verification result; wherein the context parameter represents a parameter required to be used in the verification expression; Generate verification feedback information based on the verification results of each of the verification rules and the interface information; The obtaining of the parameter value of the corresponding context parameter includes: Parsing the verification rule to determine a type tag of a parameter included in the verification rule, and determining a context parameter based on the type tag; In response to the context parameter being a preset type, determining the context parameter as a parameter value of the context parameter; in response to the context parameter including a preset character, querying a method class corresponding to the preset character to call the method class to obtain the parameter value of the context parameter; The context parameters include multiple; Calculating a verification reference range based on the verification expression and the parameter value includes: Obtain function information of the verification expression corresponding to the verification rule to query the associated input parameter array; The parameter values associated with the input parameter array are determined based on the arrangement order of each of the context parameters, so as to input the verification expression and calculate the verification reference range.
2. The method according to claim 1, characterized in that Calling the method class to obtain the parameter value of the context parameter includes: The context parameter is split into a first character and a second character to determine a difference parameter based on the second character and an input parameter template of the method class, and the method class is called to obtain a parameter value of the context parameter according to a fill character corresponding to the first character and the difference parameter.
3. The method according to claim 1, characterized in that The obtaining of the parameter value of the corresponding context parameter further includes: Calling a preset rule template corresponding to the verification rule to verify the verification rule; In response to successful verification, a parameter value of a corresponding context parameter is obtained; in response to failed verification, it is determined that the verification rule is abnormal.
4. The method according to claim 1, characterized in that: Also includes: In response to the verification rule update instruction, obtain corresponding rule information to be updated, and determine the rule group information to be updated and the update type; In response to the update type being a preset type, querying the rule group to be updated, reading the target verification rule from the rule group to be updated based on the rule information to be updated, and updating the target verification rule according to the update information in the rule information to be updated.
5. The method according to claim 1, characterized in that The description information and the second character are combined to obtain a verification feature of the interface message, including: Identify multiple business features in the description information, calculate the hash value of each of the business features, splice the hash values, call a preset interpolation model, merge the second character with the spliced hash value, and obtain the verification feature of the interface message.
6. A data processing device, characterized in that: include: an acquisition unit, configured to, in response to a processing instruction, acquire corresponding interface information and an interface message, extract a first character and a second character from the interface message, acquire description information associated with the first character, and call a preset fusion model to fuse the description information and the second character to obtain a verification feature of the interface message; An extraction unit, used to query the rule group information corresponding to the verification feature from a preset configuration manager to determine a verification rule set, and extract a verification expression and a verification field associated with each verification rule; A verification unit, configured to obtain a parameter value of a corresponding context parameter for each of the verification rules, calculate a verification reference range based on the verification expression and the parameter value, extract a corresponding field value from the interface message based on the verification field, execute a verification procedure based on the verification reference range and the field value, and obtain a verification result; wherein the context parameter represents a parameter required to be used in the verification expression; A generating unit, configured to generate verification feedback information based on the verification results of each of the verification rules and the interface information; The verification unit is specifically used for: Parsing the verification rule to determine a type tag of a parameter included in the verification rule, and determining a context parameter based on the type tag; In response to the context parameter being a preset type, determining the context parameter as a parameter value of the context parameter; in response to the context parameter including a preset character, querying a method class corresponding to the preset character to call the method class to obtain the parameter value of the context parameter; The context parameters include multiple; The verification unit is specifically used for: Obtain function information of the verification expression corresponding to the verification rule to query the associated input parameter array; The parameter values associated with the input parameter array are determined based on the arrangement order of each of the context parameters, so as to input the verification expression and calculate the verification reference range.
7. An electronic device, characterized in that: include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 5.
8. A computer readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 5 is implemented.
9. A computer program product, comprising a computer program, characterized in that When the program is executed by a processor, the method according to any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
Metadata-based front-end and back-end verification method and device
CN112131100A
Data verification method and device, equipment and storage medium
CN112182037A
Interface parameter verification method and device and computer readable storage medium
CN112579055A
Data verification method and system
CN116431379A
Charging method and device and settlement system
CN116823249A
