CN118069539A - Data processing method, device, electronic equipment and storage medium - Google Patents

Data processing method, device, electronic equipment and storage medium Download PDF

Info

Publication number
CN118069539A
CN118069539A CN202410474889.0A CN202410474889A CN118069539A CN 118069539 A CN118069539 A CN 118069539A CN 202410474889 A CN202410474889 A CN 202410474889A CN 118069539 A CN118069539 A CN 118069539A
Authority
CN
China
Prior art keywords
verification
check
rule
parameter
character
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202410474889.0A
Other languages
Chinese (zh)
Inventor
张经纬
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
CCB Finetech Co Ltd
Original Assignee
CCB Finetech Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by CCB Finetech Co Ltd filed Critical CCB Finetech Co Ltd
Priority to CN202410474889.0A priority Critical patent/CN118069539A/en
Publication of CN118069539A publication Critical patent/CN118069539A/en
Pending legal-status Critical Current

Links

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

The invention discloses a data processing method, a data processing device, electronic equipment and a storage medium, and relates to the technical field of computers. One embodiment of the method comprises the following steps: responding to the processing instruction, acquiring corresponding interface information and interface message, extracting a first character and a second character, acquiring description information associated with the first character, and fusing the description information and the second character to obtain verification characteristics; inquiring corresponding rule group information to determine a check rule set, and extracting an associated check expression and a check field; and acquiring parameter values corresponding to the context parameters, calculating a check reference range based on the check expression and the parameter values, extracting corresponding field values from the interface message based on the check field, executing a check program based on the check reference range and the field values, obtaining a check result, and generating check feedback information. The implementation mode can solve the problems that the mode of carrying out specific development on the requirement of each interface needs to be re-carded and developed when the requirement changes, the operation is complex and the efficiency is low.

Description

Data processing method, device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a data processing method, apparatus, electronic device, and storage medium.
Background
With the gradual development of the application system to a distributed and lightweight architecture form, the original single large-scale system is usually split into a plurality of subsystems and sub-components, so that the data interaction between red copper and the components through interfaces is greatly increased, and an interface field verification link becomes an important ring in the software development work. Among the numerous interface fields, date type is a very common type, and business class verification applications in interface verification are relatively widespread. In the related art, verification development of interfaces is usually specific development according to preset templates and tools for each interface so as to adapt to different interface verification, but when the requirements change in this way, re-carding and development are needed, so that the operation is complex and the efficiency is low.
Disclosure of Invention
In view of this, embodiments of the present invention provide a method, an apparatus, an electronic device, and a storage medium for data processing, which can solve the problems of complex operation and low efficiency caused by re-carding and development when the requirements change in a specific development manner for each interface according to a preset template and a tool.
To achieve the above object, according to one aspect of an embodiment of the present invention, there is provided a method of data processing.
The data processing method of the embodiment of the invention comprises the following steps: responding to a processing instruction, acquiring corresponding interface information and an interface message, extracting a first character and a second character from the interface message, acquiring description information associated with the first character, and calling a preset fusion model to fuse the description information and the second character to obtain verification characteristics of the interface message;
Inquiring rule group information corresponding to the verification features from a preset configuration manager to determine a verification rule set, and extracting verification expressions and verification fields associated with each verification rule;
For each check rule, acquiring a parameter value of a corresponding context parameter, calculating a check reference range based on the check expression and the parameter value, extracting a corresponding field value from the interface message based on the check field, and executing a check program based on the check reference range and the field value to obtain a check result;
and generating verification feedback information based on the verification result of each verification rule and the interface information.
In one embodiment, the obtaining the parameter value of the corresponding context parameter includes:
analyzing the check rule to determine a type tag of a parameter included in the check rule, and determining a context parameter based on the type tag;
Determining the context parameter as a parameter value of the context parameter in response to the context parameter being of a preset type; and responding to the context parameters including preset characters, inquiring a method class corresponding to the preset characters, and calling the method class to acquire the parameter values of the context parameters.
In yet another embodiment, the context parameter includes a plurality of;
Calculating a check reference range based on the check expression and the parameter value, comprising:
Acquiring function information of a check expression corresponding to the check rule so as to inquire an associated input parameter array;
And determining parameter values associated with the input parameter array based on the arrangement sequence of the context parameters so as to input the check expression and calculate a check reference range.
In yet another embodiment, invoking the method class to obtain the parameter value of the context parameter includes:
Splitting the context parameters into a first character and a second character, determining a difference parameter based on the second character and an input parameter template of the method class, and calling the method class to acquire parameter values of the context parameters according to the first character and filling characters corresponding to the difference parameter.
In yet another embodiment, the obtaining the parameter value of the corresponding context parameter further includes:
invoking a preset rule template corresponding to the verification rule to verify the verification rule;
acquiring parameter values corresponding to the context parameters in response to successful verification; and determining that the verification rule is abnormal in response to verification failure.
In yet another embodiment, further comprising:
Responding to a verification rule updating instruction, acquiring corresponding rule information to be updated, and determining rule group information to be updated and an updating type;
And inquiring a rule group to be updated in response to the update type being a preset type, reading a target check rule from the rule group to be updated based on the rule information to be updated, and updating the target check rule according to update information in the rule information to be updated.
In another embodiment, the merging the description information and the second character to obtain the verification feature of the interface message includes:
And identifying a plurality of service features in the description information, calculating a hash value of each service feature, splicing the hash values, calling a preset interpolation model, and fusing the second character with the spliced hash values to obtain the verification feature of the interface message.
To achieve the above object, according to another aspect of an embodiment of the present invention, there is provided an apparatus for data processing.
The device for processing data in the embodiment of the invention comprises: the device comprises an acquisition unit, a verification unit and a verification unit, wherein the acquisition unit is used for responding to a processing instruction, acquiring corresponding interface information and interface messages, extracting a first character and a second character from the interface messages, acquiring description information associated with the first character, and calling a preset fusion model to fuse the description information with the second character to obtain verification characteristics of the interface messages;
the extraction unit is used for inquiring rule group information corresponding to the verification features from a preset configuration manager to determine a verification rule set and extracting verification expressions and verification fields associated with each verification rule;
the verification unit is used for obtaining parameter values of corresponding context parameters for each verification rule, calculating a verification reference range based on the verification expression and the parameter values, extracting corresponding field values from the interface message based on the verification field, and executing a verification program based on the verification reference range and the field values to obtain a verification result;
And the generating unit is used for generating verification feedback information based on the verification result of each verification rule and the interface information.
In one embodiment, the verification unit is specifically configured to:
analyzing the check rule to determine a type tag of a parameter included in the check rule, and determining a context parameter based on the type tag;
Determining the context parameter as a parameter value of the context parameter in response to the context parameter being of a preset type; and responding to the context parameters including preset characters, inquiring a method class corresponding to the preset characters, and calling the method class to acquire the parameter values of the context parameters.
In yet another embodiment, the context parameter includes a plurality of;
The verification unit is specifically configured to:
Acquiring function information of a check expression corresponding to the check rule so as to inquire an associated input parameter array;
And determining parameter values associated with the input parameter array based on the arrangement sequence of the context parameters so as to input the check expression and calculate a check reference range.
In a further embodiment, the verification unit is specifically configured to:
querying annotations of the context parameters based on the location information to obtain parameter attributes of the context parameters from the annotations to determine parameter values of the context parameters in combination with the parameter attributes and the values.
In a further embodiment, the verification unit is specifically configured to:
Splitting the context parameters into a first character and a second character, determining a difference parameter based on the second character and an input parameter template of the method class, and calling the method class to acquire parameter values of the context parameters according to the first character and filling characters corresponding to the difference parameter.
In yet another embodiment, the obtaining unit is further configured to obtain corresponding rule information to be updated in response to the check rule update instruction, and determine rule group information to be updated and an update type;
The apparatus further comprises:
And the updating unit is used for responding to the updating type as a preset type, inquiring the rule group to be updated, reading the target check rule from the rule group to be updated based on the rule information to be updated, and updating the target check rule according to the updating information in the rule information to be updated.
In a further embodiment, the acquiring unit is specifically configured to:
And identifying a plurality of service features in the description information, calculating a hash value of each service feature, splicing the hash values, calling a preset interpolation model, and fusing the second character with the spliced hash values to obtain the verification feature of the interface message.
To achieve the above object, according to still another aspect of an embodiment of the present invention, there is provided an electronic apparatus.
An electronic device according to an embodiment of the present invention includes: one or more processors; and the storage device is used for storing one or more programs, and when the one or more programs are executed by the one or more processors, the one or more processors are enabled to realize the data processing method provided by the embodiment of the invention.
To achieve the above object, according to still another aspect of an embodiment of the present invention, a computer-readable medium is provided.
A computer readable medium of an embodiment of the present invention has stored thereon a computer program which, when executed by a processor, implements a method for data processing provided by the embodiment of the present invention.
To achieve the above object, according to still another aspect of an embodiment of the present invention, there is provided a computer program product.
A computer program product according to an embodiment of the present invention includes a computer program that, when executed by a processor, implements a method for data processing according to an embodiment of the present invention.
One embodiment of the above invention has the following advantages or benefits: in the embodiment of the invention, corresponding interface information and interface messages are obtained in response to a processing instruction, then related description information is obtained through a first character in the interface messages, verification features are obtained after the first character and the second character are fused, rule group information corresponding to the verification features is queried from a preset configuration manager to determine a verification rule set, and a verification expression and a verification field associated with each verification rule are extracted; for each check rule, parameter values corresponding to the context parameters can be obtained, so that a check reference range is calculated based on the check expression and the parameter values, corresponding field values are extracted from the interface message based on the check fields, and a check program is executed based on the check reference range and the field values, so that a check result is obtained; and generating verification feedback information based on the verification result of each verification rule and the interface information. In the embodiment of the invention, when the interface is tested, the check rule can be extracted from the configuration manager, the check rule comprises a check expression and a check field, the check reference range of the check rule can be calculated through the combination of the parameter value of the context parameter and the check expression in the check table rule, namely, whether the interface meets the range of the check requirement or not is judged, and then the field value of the check field in the interface message can be checked, and the check result is further determined.
Further effects of the above-described non-conventional alternatives are described below in connection with the embodiments.
Drawings
The drawings are included to provide a better understanding of the invention and are not to be construed as unduly limiting the invention. Wherein:
FIG. 1 is a schematic diagram of one main flow of a method of data processing according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of yet another main flow of a method of data processing according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of the main units of an apparatus for data processing according to an embodiment of the present invention;
FIG. 4 is a diagram of an exemplary system architecture in which embodiments of the present invention may be applied;
FIG. 5 is a schematic diagram of a computer system suitable for use in implementing embodiments of the present invention.
Detailed Description
Exemplary embodiments of the present invention will now be described with reference to the accompanying drawings, in which various details of the embodiments of the present invention are included to facilitate understanding, and are to be considered merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
It is noted that embodiments of the application and features of the embodiments may be combined with each other without conflict. The technical scheme of the application obtains, stores, uses, processes and the like the data, which all meet the relevant regulations of national laws and regulations.
The embodiment of the invention provides a data processing system which can be used for checking a single scene of data, and can be particularly identical to checking interface data.
An embodiment of the present invention provides a method for data processing, which may be performed by a data processing system, as shown in fig. 1, and includes:
S101: responding to the processing instruction, acquiring corresponding interface information and interface message, extracting first character and second character from the interface message, acquiring description information associated with the first character, and calling a preset fusion model to fuse the description information and the second character to obtain the verification feature of the interface message.
The processing instruction may be triggered by the data processing system, or may be triggered by an external system, where the data processing system may trigger a corresponding processing instruction after receiving the interface packet. The processing instructions represent instructions to check the interface, and may specifically include instructions to check the date of the interface. The processing instruction may include interface information, so in this step, corresponding interface information may be obtained from the processing instruction, and further, an interface packet may be obtained according to the interface information.
Because the corresponding verification requirements of different service types are different, and the specific rules of verification are different due to the different attributes in the same service type, in all embodiments of the present invention, a first character and a second character may be extracted from an interface message, where the first character may be used to represent the service type of the message, and the second character may be used to represent an attribute value of the message corresponding to the personalized attribute. For example, the service types may include login service, payment service, etc., and the personalization or attributes may be set according to the requirements, e.g., for login service, the personalization attributes may include whether it is a member, login device type, etc. For different service types, the verification requirement can be determined through the description information, then the association relation with the first character can be established, after the interface message is received, the corresponding description information can be obtained based on the first character, then the description information and the second character in the interface message can be fused, and the verification characteristic of the interface message can be obtained, so that rule group information suitable for verification of the interface message can be determined.
Specifically, the description information may include a plurality of service features to represent the need of the verification, so that in this step, a plurality of service features in the description information may be identified, and then a hash value of each service feature is calculated, and then the hash values are spliced, where a splicing manner may be preset. And for the spliced hash value, fusing the second character into the spliced hash value by an interpolation method to obtain the verification characteristic of the interface message. The interpolation method can be set as an interpolation model, and the specific mode can be preconfigured.
It should be noted that, in the embodiment of the present invention, the description information may be text information, and at this time, the service features may be identified from the description information through a preset keyword library, or the description information may include a set formed by each service feature, and at this time, each service feature may be identified from the description information.
S102: inquiring rule group information corresponding to the verification features from a preset configuration manager to determine a verification rule set, and extracting verification expressions and verification fields associated with each verification rule.
Each check rule can be preconfigured in the configuration manager, and the check rules can be configured in groups, so that the corresponding relation between the check features and the rule group information can be established, and the corresponding rule group information is queried from the preset configuration manager. The verification rule set may include a basic rule set and a personalized rule set, where the basic rule set may represent verification rules applicable to each received verification rule to meet a basic verification requirement of the interface, and the personalized rule set may be configured based on the interface to meet a personalized verification requirement. After the rule group information is inquired, the checking rule set for checking the interface can be determined.
In the embodiment of the invention, the check rule can be associated with a check expression and a check field, the check expression represents a check condition expression, and the check field identifies a field used by the check rule. So that after the set of check rules is determined 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 (1 a,2b,3 c) indicates the check condition that the field value of the check field needs to satisfy.
S103: and for each check rule, acquiring parameter values of the corresponding context parameters, calculating a check reference range based on the check expression and the parameter values, extracting corresponding field values from the interface message based on the check field, and executing a check program based on the check reference range and the field values to obtain a check result.
The context parameters represent parameters needed to be used in the verification expression, which usually need to be pre-configured or obtained when in use, and can also be updated or obtained in real time through a configuration mode.
Specifically, this step may be performed as follows: analyzing the check rule to determine a type tag of a parameter included in the check rule, and determining a context parameter based on the type tag; determining the context parameter as a parameter value of the context parameter in response to the context parameter being of a preset type; and responding to the context parameters as preset characters, inquiring a method class corresponding to the preset characters, and calling the method class to acquire the parameter values of the context parameters.
The parameters included in the verification rule may be pre-configured with labels to indicate which are context parameter types, and thus the context parameters may be determined. Specifically, the context parameters may be configured in the check expression, or may be configured separately and a correspondence relationship with the check rule may be established. For example, for before (1A, 2B, 3C), before may set the type tag as a function, and 1A,2B,3C may set the type tag as a context parameter.
When the context parameter is of a pre-type, the parsed context parameter may be directly determined as the parameter value of the context parameter, i.e. 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 and 3 are context parameters, and the type is the number, and then 1,2 and 3 can be directly determined as the context parameters to be the numerical values. At this time, if there is only one context parameter, the parameter value of the context parameter may be directly determined, and if there is more than one context parameter, the parameter value of the context parameter may be determined in combination with the location information of the context parameter; when the values of the context parameters need to be obtained, preset characters can be configured, the preset characters are configured with corresponding method classes, and the parameter values of the context parameters can be obtained through the method classes. Taking the verification expression as before (a, B, C) as an example, A, B, C may represent a context parameter, and its value is a preset character that is preconfigured, so that the corresponding parameter value may be obtained according to a method class that is preconfigured A, B, C respectively and corresponds to.
It should be noted that, the context parameters may include a plurality of context parameters, where the context parameters are generally associated with input parameters of the functions in the check expression, in this embodiment of the present invention, an input parameter array of each function information may be set to represent the function input parameters, and further, parameter values associated with the input parameter array are determined based on the arrangement sequence of each context parameter, that is, the obtained parameter values are sequentially determined as element values of the input parameter array according to the arrangement sequence of each context parameter, that is, the input parameters of the functions in the check expression, so as to calculate the check reference range. The check reference range represents an allowable range of the check field so that the check field is checked through this range.
In one embodiment, for verification of the time field, the verification expression is typically determining a time range, so the context parameter is typically a time-acquired method class, for which an input parameter template may be set so that an accurate input parameter may be determined when the method class is called. For example, the input parameters for the time-acquisition method class may be represented as N-M-R, where N represents year-M represents month-R represents week. The context parameter may comprise two parts, one part being a specific value and one part being a unit of the value, for example the context parameter may be 5 months-2 weeks, in which case it may be split into two parts, namely the first character: 5. 2, second character: month, week, the second week of 5 months; thus, the second character is compared with the set input parameter template, so that the difference parameter can be determined to be N. At this time, filling of the input parameters of the method class can be performed through preset filling characters, namely, the input parameters are determined according to the filling characters corresponding to the first characters and the difference parameters, for example, if the filling parameters are set to be 0, the input parameters can be determined to be 0-5-2, and then the method class is called to acquire the parameter values of the context parameters, namely, a specific time range.
It should be noted that, in this step, before obtaining the parameter value corresponding to the context parameter, the verification rule may be verified to determine whether the verification rule is a normal verification rule, which may be specifically executed as follows: calling a preset rule template corresponding to the verification rule to verify the verification rule; acquiring parameter values corresponding to the context parameters in response to successful verification; in response to the verification failing, a verification rule exception is determined. The preset rule template can comprise contents required by the check rule, and if the contents are required to comprise the check expression and the check field, whether the contents in the check rule are comprehensive or not can be verified, if the check rule fails to verify, the check rule can be described as abnormal, and at the moment, the execution of subsequent operations can be stopped.
In the embodiment of the invention, the interface verification can comprise technical type verification and service type verification, so that the verification step can be divided into two sub-steps according to the verification type, for example, the technical type verification is executed first and then the service type verification is executed, and the verification principle of each sub-step is the same as that in the embodiment of the invention.
S104: and generating check feedback information based on the check result of each check rule and the interface information.
The verification result in the step can include verification passing and verification failing, and the verification feedback information can include the verification result, so that subsequent result inquiry and duplication are facilitated.
In the embodiment of the invention, the home banquet rule can be updated according to the requirement, and the method can be concretely implemented as follows: responding to a verification rule updating instruction, acquiring corresponding interface information to be updated, inquiring the corresponding rule information to be updated, and determining rule group information to be updated and updating types; and inquiring the rule group to be updated in response to the update type being a preset type, reading the target check rule from the rule group to be updated based on the rule information to be updated, and updating the target check rule according to the update information in the rule information to be updated. The update type may specifically include addition, modification, deletion, and the like, and the preset rule in this step may represent rule modification.
In the embodiment of the invention, when the interface is tested, the check rule can be extracted from the configuration manager, the check rule comprises a check expression and a check field, the check reference range of the check rule can be calculated through the combination of the parameter value of the context parameter and the check expression in the check table rule, namely, whether the interface meets the range of the check requirement or not is judged, and then the field value of the check field in the interface message can be checked, and the check result is further determined.
It should be noted that, in the configuration manager of the embodiment of the present invention, the configuration may be performed on the inspection rule, and the association relationship between the inspection rule set and the inspection rule, and between the inspection rule set and the inspection feature may be established by means of a key value pair, for example, a code of the inspection rule set may be set, and further, an inspection rule list associated with the code may be set, and the inspection rule may include a range rule, an interval rule, and so on. Meanwhile, a rule manager can be preconfigured: the method is used for integrating all verification rules, can support more rule functions to be expanded, and can realize the expansion and configuration of the interface verification expression according to the requirement. The embodiment of the invention can write the check logic in a templated mode, and the template can contain a plurality of abstract methods (namely functional coding segments to be realized by users), thereby facilitating customized development according to the characteristics of the application program.
The method for data processing in the embodiment of the present invention will be specifically described with reference to the embodiment shown in fig. 1, and as shown in fig. 2, the method includes:
S201: and responding to the processing instruction, and acquiring corresponding interface information and interface messages.
S202: extracting a first character and a second character from the interface message, acquiring description information associated with the first character, and calling a preset fusion model to fuse the description information and the second character to obtain verification features of the interface message.
S203: inquiring rule group information corresponding to the verification features from a preset configuration manager to determine a verification rule set, and extracting verification expressions and verification fields associated with each verification rule.
S204: for each verification rule, the verification rule is parsed to determine a type tag for parameters included in the verification rule, and context parameters are determined based on the type tag.
S205: in response to the context parameter being of a preset type, determining the context parameter as a parameter value of the context parameter; and responding to the context parameters including preset characters, inquiring a method class corresponding to the preset characters, and calling the method class to acquire the parameter values of the context parameters.
S206: and calculating a check reference range based on the check expression and the parameter value.
S207: and extracting a corresponding field value from the interface message based on the check field so as to execute a check program based on the check reference range and the field value to obtain a check result.
S208: and generating check feedback information based on the check result of each check rule and the interface information.
It should be noted that the data processing principle in the embodiment of the present invention is the same as that in the embodiment shown in fig. 1, and will not be described herein.
In order to solve the problems existing in the prior art, an embodiment of the present invention provides a data processing apparatus 300, as shown in fig. 3, the apparatus 300 includes:
The obtaining unit 301 is configured to obtain 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, obtain description information associated with the first character, and call a preset fusion model to fuse the description information and the second character, so as to obtain verification features of the interface message;
The extracting unit 302 is configured to query rule set information corresponding to the verification features 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 checking unit 303, configured to obtain, for each of the check rules, a parameter value corresponding to a context parameter, so as to calculate a check reference range based on the check expression and the parameter value, extract, based on the check field, a corresponding field value from the interface packet, and perform a check procedure based on the check reference range and the field value, so as to obtain a check result;
And the generating unit 304 is configured to generate verification feedback information based on the verification result of each verification rule and the interface information.
It should be understood that the manner of implementing the embodiment of the present invention is the same as that of implementing the embodiment shown in fig. 1, and will not be described herein.
In one embodiment, the verification unit 303 is specifically configured to:
analyzing the check rule to determine a type tag of a parameter included in the check rule, and determining a context parameter based on the type tag;
Determining the context parameter as a parameter value of the context parameter in response to the context parameter being of a preset type; and responding to the context parameters including preset characters, inquiring a method class corresponding to the preset characters, and calling the method class to acquire the parameter values of the context parameters.
In yet another embodiment, the context parameter includes a plurality of;
the verification unit 303 is specifically configured to:
Acquiring function information of a check expression corresponding to the check rule so as to inquire an associated input parameter array;
And determining parameter values associated with the input parameter array based on the arrangement sequence of the context parameters so as to input the check expression and calculate a check reference range.
In yet another embodiment, the verification unit 303 is specifically configured to:
querying annotations of the context parameters based on the location information to obtain parameter attributes of the context parameters from the annotations to determine parameter values of the context parameters in combination with the parameter attributes and the values.
In yet another embodiment, the verification unit 303 is specifically configured to:
Splitting the context parameters into a first character and a second character, determining a difference parameter based on the second character and an input parameter template of the method class, and calling the method class to acquire parameter values of the context parameters according to the first character and filling characters corresponding to the difference parameter.
In yet another embodiment, the obtaining unit 301 is further configured to obtain corresponding rule information to be updated in response to a verification rule update instruction, and determine rule group information to be updated and an update type;
The apparatus 300 further comprises:
And the updating unit is used for responding to the updating type as a preset type, inquiring the rule group to be updated, reading the target check rule from the rule group to be updated based on the rule information to be updated, and updating the target check rule according to the updating information in the rule information to be updated.
In yet another embodiment, the obtaining unit 301 is specifically configured to:
And identifying a plurality of service features in the description information, calculating a hash value of each service feature, splicing the hash values, calling a preset interpolation model, and fusing the second character with the spliced hash values to obtain the verification feature of the interface message.
It should be understood that the manner of implementing the embodiments of the present invention is the same as that of implementing the embodiments shown in fig. 1 and 2, and will not be described herein.
In the embodiment of the invention, when the interface is tested, the check rule can be extracted from the configuration manager, the check rule comprises a check expression and a check field, the check reference range of the check rule can be calculated through the combination of the parameter value of the context parameter and the check expression in the check table rule, namely, whether the interface meets the range of the check requirement or not is judged, and then the field value of the check field in the interface message can be checked, and the check result is further determined.
According to an embodiment of the present invention, an electronic device and a readable storage medium are also provided.
The electronic equipment of the embodiment of the invention comprises: at least one processor; and a memory communicatively coupled to the at least one processor; 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 performs the data processing method provided by the embodiment of the present invention.
Fig. 4 illustrates an exemplary system architecture 400 of a data processing method or apparatus to which embodiments of the present invention may be applied.
As shown in fig. 4, the system architecture 400 may include terminal devices 401, 402, 403, a network 404, and a server 405. The network 404 is used as a medium to provide communication links between the terminal devices 401, 402, 403 and the server 405. The network 404 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others.
A user may interact with the server 405 via the network 404 using the terminal devices 401, 402, 403 to receive or send messages or the like. Various client applications may be installed on the terminal devices 401, 402, 403.
The terminal devices 401, 402, 403 may be, but are not limited to, smartphones, tablets, laptop and desktop computers, etc.
The server 405 may be a server providing various services, such as a background management server (by way of example only) providing support for shopping-type websites browsed by users using the terminal devices 401, 402, 403. The background management server may analyze and process the received data such as the product information query request, and feed back the processing result (e.g., product information—only an example) to the terminal device.
It should be noted that the method for processing data provided in the embodiment of the present invention is generally executed by the server 405, and accordingly, the device for processing data is generally disposed in the server 405.
It should be understood that the number of terminal devices, networks and servers in fig. 4 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Referring now to FIG. 5, there is illustrated a schematic diagram of a computer system 500 suitable for use in implementing embodiments of the present invention. The computer system illustrated in fig. 5 is merely an example, and should not be construed as limiting the functionality and scope of use of embodiments of the present invention.
As shown in fig. 5, 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 section 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, ROM 502, and RAM 503 are connected to each other through a bus 504. An input/output (I/O) interface 505 is also connected to bus 504.
The following components are connected to the I/O interface 505: an input section 506 including a keyboard, a mouse, and the like; an output portion 507 including a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker, and the like; a storage portion 508 including a hard disk and the like; and a communication section 509 including a network interface card such as a LAN card, a modem, or the like. The communication section 509 performs communication processing via a network such as the internet. The 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, or the like is mounted on the drive 510 as needed so that a computer program read therefrom is mounted into the storage section 508 as needed.
In particular, according to embodiments of the present disclosure, the processes described above with reference to flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method shown in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via the communication portion 509, and/or installed from the removable media 511. The above-described functions defined in the system of the present invention are performed when the computer program is executed by a Central Processing Unit (CPU) 501.
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 two. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, 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 disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present invention, however, the computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, with the computer-readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a unit, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units involved in the embodiments of the present invention may be implemented in software or in hardware. The described units may also be provided in a processor, for example, 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 unit itself in some cases, and for example, the acquisition unit may also be described as "a unit of acquisition function".
As another aspect, the present invention also provides a computer-readable medium that may be contained in the apparatus described in the above embodiments; or may be present alone without being fitted into the device. The computer readable medium carries one or more programs which, when executed by a device, cause the device to perform the method of data processing provided by the present invention.
As another aspect, the present invention also provides a computer program product, including a computer program, where the program when executed by a processor implements a method for processing data provided by an embodiment of the present invention.
The above embodiments do not limit the scope of the present invention. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives can occur depending upon design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the scope of the present invention.

Claims (12)

1.A method of data processing, comprising:
Responding to a processing instruction, acquiring corresponding interface information and an interface message, extracting a first character and a second character from the interface message, acquiring description information associated with the first character, and calling a preset fusion model to fuse the description information and the second character to obtain verification characteristics of the interface message;
Inquiring rule group information corresponding to the verification features from a preset configuration manager to determine a verification rule set, and extracting verification expressions and verification fields associated with each verification rule;
For each check rule, acquiring a parameter value of a corresponding context parameter, calculating a check reference range based on the check expression and the parameter value, extracting a corresponding field value from the interface message based on the check field, and executing a check program based on the check reference range and the field value to obtain a check result;
and generating verification feedback information based on the verification result of each verification rule and the interface information.
2. The method of claim 1, wherein the obtaining parameter values for the corresponding context parameters comprises:
analyzing the check rule to determine a type tag of a parameter included in the check rule, and determining a context parameter based on the type tag;
Determining the context parameter as a parameter value of the context parameter in response to the context parameter being of a preset type; and responding to the context parameters including preset characters, inquiring a method class corresponding to the preset characters, and calling the method class to acquire the parameter values of the context parameters.
3. The method of claim 2, wherein the context parameter comprises a plurality of;
Calculating a check reference range based on the check expression and the parameter value, comprising:
Acquiring function information of a check expression corresponding to the check rule so as to inquire an associated input parameter array;
And determining parameter values associated with the input parameter array based on the arrangement sequence of the context parameters so as to input the check expression and calculate a check reference range.
4. The method of claim 2, wherein invoking the method class to obtain the parameter value of the context parameter comprises:
Splitting the context parameters into a first character and a second character, determining a difference parameter based on the second character and an input parameter template of the method class, and calling the method class to acquire parameter values of the context parameters according to the first character and filling characters corresponding to the difference parameter.
5. The method of claim 1, wherein the obtaining parameter values corresponding to the context parameters further comprises:
invoking a preset rule template corresponding to the verification rule to verify the verification rule;
acquiring parameter values corresponding to the context parameters in response to successful verification; and determining that the verification rule is abnormal in response to verification failure.
6. The method as recited in claim 1, further comprising:
Responding to a verification rule updating instruction, acquiring corresponding rule information to be updated, and determining rule group information to be updated and an updating type;
And inquiring a rule group to be updated in response to the update type being a preset type, reading a target check rule from the rule group to be updated based on the rule information to be updated, and updating the target check rule according to update information in the rule information to be updated.
7. The method of claim 1, wherein fusing the description information and the second character to obtain the verification feature of the interface message comprises:
And identifying a plurality of service features in the description information, calculating a hash value of each service feature, splicing the hash values, calling a preset interpolation model, and fusing the second character with the spliced hash values to obtain the verification feature of the interface message.
8. An apparatus for data processing, comprising:
the device comprises an acquisition unit, a verification unit and a verification unit, wherein the acquisition unit is used for responding to a processing instruction, acquiring corresponding interface information and interface messages, extracting a first character and a second character from the interface messages, acquiring description information associated with the first character, and calling a preset fusion model to fuse the description information with the second character to obtain verification characteristics of the interface messages;
the extraction unit is used for inquiring rule group information corresponding to the verification features from a preset configuration manager to determine a verification rule set and extracting verification expressions and verification fields associated with each verification rule;
the verification unit is used for obtaining parameter values of corresponding context parameters for each verification rule, calculating a verification reference range based on the verification expression and the parameter values, extracting corresponding field values from the interface message based on the verification field, and executing a verification program based on the verification reference range and the field values to obtain a verification result;
And the generating unit is used for generating verification feedback information based on the verification result of each verification rule and the interface information.
9. The apparatus according to claim 8, wherein the verification unit is specifically configured to:
analyzing the check rule to determine a type tag of a parameter included in the check rule, and determining a context parameter based on the type tag;
Determining the context parameter as a parameter value of the context parameter in response to the context parameter being of a preset type; and responding to the context parameters including preset characters, inquiring a method class corresponding to the preset characters, and calling the method class to acquire the parameter values of the context parameters.
10. An electronic device, comprising:
One or more processors;
Storage means for storing one or more programs,
When executed by the one or more processors, causes the one or more processors to implement the method of any of claims 1-7.
11. A computer readable medium, on which a computer program is stored, characterized in that the program, when being executed by a processor, implements the method according to any of claims 1-7.
12. A computer program product comprising a computer program, characterized in that the program, when executed by a processor, implements the method according to any of claims 1-7.
CN202410474889.0A 2024-04-19 2024-04-19 Data processing method, device, electronic equipment and storage medium Pending CN118069539A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410474889.0A CN118069539A (en) 2024-04-19 2024-04-19 Data processing method, device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410474889.0A CN118069539A (en) 2024-04-19 2024-04-19 Data processing method, device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN118069539A true CN118069539A (en) 2024-05-24

Family

ID=91107716

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410474889.0A Pending CN118069539A (en) 2024-04-19 2024-04-19 Data processing method, device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN118069539A (en)

Similar Documents

Publication Publication Date Title
CN111274045B (en) Multi-platform docking method and device, computer equipment and readable storage medium
CN111460129B (en) Method, device, electronic equipment and storage medium for generating identification
CN108958959B (en) Method and device for detecting hive data table
WO2021023149A1 (en) Method and apparatus for dynamically returning message
CN113076153B (en) Interface calling method and device
CN113626223A (en) Interface calling method and device
CN115016784B (en) Low code application multiplexing method, application analysis system, equipment and storage medium
CN108959294B (en) Method and device for accessing search engine
CN110851343A (en) Test method and device based on decision tree
CN112559024A (en) Method and device for generating transaction code change list
CN110716956A (en) Data request intercepting method and device
CN112988583A (en) Method and device for testing syntax compatibility of database
CN116737662A (en) Method, device, electronic equipment and storage medium for processing business data
CN111382953A (en) Dynamic process generation method and device
CN116069725A (en) File migration method, device, apparatus, medium and program product
CN112559233B (en) Method, device, equipment and computer readable medium for identifying fault type
CN118069539A (en) Data processing method, device, electronic equipment and storage medium
CN114968822A (en) Interface testing method and device, computer equipment and storage medium
CN116562954A (en) User channel attribution identification method, device, storage medium and program product
CN112783903B (en) Method and device for generating update log
CN113779018A (en) Data processing method and device
CN113704222A (en) Method and device for processing service request
CN113886216A (en) Interface test and tool configuration method, device, electronic equipment and storage medium
CN113032004A (en) Method, apparatus and program product for managing development jobs in a development environment
CN113448960A (en) Method and device for importing form file

Legal Events

Date Code Title Description
PB01 Publication
SE01 Entry into force of request for substantive examination