CN112019558A - Universal baffle testing method, device, equipment and computer storage medium - Google Patents

Universal baffle testing method, device, equipment and computer storage medium Download PDF

Info

Publication number
CN112019558A
CN112019558A CN202010920098.8A CN202010920098A CN112019558A CN 112019558 A CN112019558 A CN 112019558A CN 202010920098 A CN202010920098 A CN 202010920098A CN 112019558 A CN112019558 A CN 112019558A
Authority
CN
China
Prior art keywords
request message
field information
information
access party
preset
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
CN202010920098.8A
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.)
OneConnect Smart Technology Co Ltd
OneConnect Financial Technology Co Ltd Shanghai
Original Assignee
OneConnect Financial Technology Co Ltd Shanghai
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 OneConnect Financial Technology Co Ltd Shanghai filed Critical OneConnect Financial Technology Co Ltd Shanghai
Priority to CN202010920098.8A priority Critical patent/CN112019558A/en
Publication of CN112019558A publication Critical patent/CN112019558A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/22Parsing or analysis of headers
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/02Network architectures or network communication protocols for network security for separating internal from external traffic, e.g. firewalls
    • H04L63/0227Filtering policies
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/08Network architectures or network communication protocols for network security for authentication of entities
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/08Network architectures or network communication protocols for network security for authentication of entities
    • H04L63/083Network architectures or network communication protocols for network security for authentication of entities using passwords

Abstract

The invention relates to the technical field of test processing, and discloses a universal baffle testing method, which comprises the following steps: intercepting a request message sent by an access party by adopting a preset interceptor; analyzing the request message to obtain the information of each field of the request message and the matching weight of the information of each field; determining a target response message of the request message according to the field information and the field information matching weight; the invention also discloses a universal baffle plate testing device, equipment and a computer storage medium, which reduce the workload of developers, reduce the waste of human resources and improve the testing efficiency.

Description

Universal baffle testing method, device, equipment and computer storage medium
Technical Field
The invention relates to the technical field of test processing, in particular to a universal baffle test method, a universal baffle test device, universal baffle test equipment and a computer storage medium.
Background
The interaction inside and across the existing system is mostly realized by adopting an interface, so that the problem that the calling party of the interface often needs to wait for the development of the called method to complete the joint debugging during the testing, and the verification cost of the functional scenes such as boundary values, network abnormity and the like is high during the testing exists.
The baffle technology returns customizable data for the calling method, so that the problems existing in the test related to the interface calling type are solved, but the testing method adopting the baffle is poor in applicability, each team needs to develop a set of baffle scheme for meeting the testing requirement, the baffle sharing of cross-team, cross-language and cross-platform cannot be realized, and the workload of developers is increased, the human resource waste is caused, and the testing efficiency is low.
Disclosure of Invention
The invention mainly aims to provide a universal baffle testing method, a universal baffle testing device, universal baffle testing equipment and a computer storage medium, and aims to solve the technical problems of heavy workload of developers, waste of human resources and low testing efficiency in the baffle testing method.
In order to achieve the above object, the present invention provides a universal baffle testing method, comprising the steps of:
intercepting a request message sent by an access party by adopting a preset interceptor;
analyzing the request message to obtain the information of each field of the request message and the matching weight of the information of each field;
determining a target response message of the request message according to the field information and the field information matching weight;
and sending the target response message to the access party so that the access party completes the test.
In an embodiment, the step of analyzing the request packet to obtain each field information of the request packet and each matching weight of the field information includes:
judging whether a preset analysis rule capable of analyzing the request message exists or not;
if the preset analysis rule capable of analyzing the request message exists, analyzing the request message by adopting the preset analysis rule, and obtaining the field information and the field information matching weight of the request message.
If the preset analysis rule capable of analyzing the request message does not exist, returning a prompt to the access party so that the access party uploads the self-defined analysis rule;
receiving a custom analysis rule uploaded by the access party;
and analyzing the request message by using the custom analysis rule to obtain each field information of the request message and each field information matching weight.
In an embodiment, after the step of analyzing the request packet by using the custom analysis rule to obtain each field information of the request packet and each matching weight of each field information, the method includes:
adding the self-defined analysis rule into a preset analysis rule base, and sharing the preset analysis rule base;
when a preset interceptor intercepts the request message which is sent by the access party or other access parties and can be analyzed by the custom analysis rule, the custom analysis rule in the preset analysis rule base is directly adopted for analysis.
In an embodiment, before the step of intercepting, by a preset interceptor, a request packet sent by an access party, the method includes:
receiving verification information sent by the access party and verifying the verification information;
and when the verification information passes the verification, establishing a secure connection with an access party according to the verification information and configuring the access party authority.
In an embodiment, the step of intercepting, by a preset interceptor, a request packet sent by an access party includes:
intercepting a pending message sent by an access party by adopting a preset interceptor, and judging whether the pending message contains a baffle test content;
and if the pending message contains the baffle test content, determining the pending message as a request message.
In an embodiment, the step of determining the target response packet of the request packet according to the field information and the field information matching weight includes:
acquiring a preset configuration list according to the uniform resource identifiers in the field information;
traversing and matching the field information in the preset configuration list, and judging whether a response message matched with the field information exists or not;
and if no response message matched with the information of each field exists, prompting that the test fails.
In an embodiment, after the step of performing traversal matching on the information of each field in the preset configuration list and determining whether a response packet matching the information of each field exists, the method includes:
if the response messages matched with the field information exist, judging the number of the response messages;
when the number of the response messages is unique, taking the response messages as target response messages;
when the number of the response messages is not unique, matching with the response messages according to the matching weight of each field information;
and determining the response message with the closest matching weight of each field information as a target response message.
In addition, in order to achieve the above object, the present invention also provides a universal barrier testing apparatus, comprising:
the interception module is used for intercepting a request message sent by an access party by adopting a preset interceptor;
the analysis module is used for analyzing the request message and obtaining the matching weight of each field information and each field information of the request message;
the matching module is used for determining a target response message of the request message according to the field information and the field information matching weight;
and the sending module is used for sending the target response message to the access party so as to enable the access party to complete the test.
In addition, in order to achieve the purpose, the invention also provides a universal baffle plate testing device;
the universal bezel testing apparatus comprises: a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein:
the computer program when executed by the processor implements the steps of the universal barrier testing method as described above.
In addition, to achieve the above object, the present invention also provides a computer storage medium;
the computer storage medium has stored thereon a computer program which, when executed by a processor, implements the steps of the universal barrier testing method as described above.
The invention provides a universal baffle test method, a device, equipment and a computer storage medium, which adopt a preset interceptor to intercept a request message sent by an access party, further process the request message by using the interceptor, and the request message is in a packaging format, need to be analyzed for obtaining the content and subsequent matching of the request message, obtain each field information and each field information matching weight of the request message, determine a target response message of the request message according to each field information and each field information matching weight, distinguish that a baffle developed in the prior art only contains a response message for certain test and can only carry out certain test, determine the target response message of the request message in a matching mode, and then send the target response message to the access party to enable the access party to complete the test, the target response message of the request message is determined in a matching mode, so that the current situation that the developed baffle only contains the response message for certain type of test and can only carry out certain type of test is changed, the baffle sharing of cross-team, cross-language and cross-platform is realized, the workload of developers is reduced, the waste of human resources is reduced, and the test efficiency is improved.
Drawings
FIG. 1 is a schematic diagram of an apparatus in a hardware operating environment according to an embodiment of the present invention;
FIG. 2 is a schematic flow chart of a first embodiment of a universal barrier testing method of the present invention;
FIG. 3 is a schematic flow chart of a second embodiment of the universal barrier testing method of the present invention;
FIG. 4 is a flow chart illustrating a third embodiment of the universal barrier testing method of the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
Because the existing baffle testing method is poor in applicability, each team needs to develop a set of baffle scheme for meeting testing requirements, and the sharing of baffles across teams, languages and platforms cannot be realized, so that the workload of developers is increased, the manpower resource is wasted, and the testing efficiency is low.
The invention provides a solution, a preset interceptor is adopted to intercept a request message sent by an access party, the request message is further processed by the interceptor, the request message is in a packaging format, the request message is required to be analyzed for obtaining the content therein and subsequently matching, the matching weight of each field information and each field information of the request message is obtained, a target response message of the request message is determined according to the matching weight of each field information and each field information, a baffle developed in the prior art only contains a certain type of response message for testing and only can carry out certain type of testing, the target response message of the request message is determined in a matching mode, and then the target response message is sent to the access party, so that the access party completes the testing, and because the target response message of the request message is determined in a matching mode, the current situation that the developed baffle only contains response messages for certain types of tests and can only carry out certain types of tests is changed, the baffle sharing of cross-team, cross-language and cross-platform is realized, the workload of developers is reduced, the waste of human resources is reduced, and the test efficiency is improved.
As shown in fig. 1, fig. 1 is a schematic structural diagram of a terminal (also called universal barrier testing device, where the universal barrier testing device may be formed by a single universal barrier testing device, or may be formed by combining other devices with the universal barrier testing device) of a hardware operating environment according to an embodiment of the present invention.
The terminal of the embodiment of the invention can be a fixed terminal or a mobile terminal, such as an intelligent air conditioner with a networking function, an intelligent electric lamp, an intelligent power supply, an intelligent sound box, an automatic driving automobile, a Personal Computer (PC), a smart phone, a tablet computer, an electronic book reader, a portable computer and the like.
As shown in fig. 1, the terminal may include: a processor 1001, such as a Central Processing Unit (CPU), a network interface 1004, a user interface 1003, a memory 1005, and a communication bus 1002. Wherein a communication bus 1002 is used to enable connective communication between these components. The user interface 1003 may include a Display screen (Display), an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a WIreless interface (e.g., WIFI interface, WIreless FIdelity, WIFI interface). The memory 1005 may be a high-speed RAM memory or a non-volatile memory (e.g., a magnetic disk memory). The memory 1005 may alternatively be a storage device separate from the processor 1001.
Optionally, the terminal may further include a camera, a Radio Frequency (RF) circuit, a sensor, an audio circuit, and a WiFi module; the input unit is compared with a display screen and a touch screen; the network interface may optionally be other than WiFi, bluetooth, probe, etc. in the wireless interface. Such as light sensors, motion sensors, and other sensors. In particular, the light sensor may include an ambient light sensor and a proximity sensor; of course, the mobile terminal may also be configured with other sensors such as a gyroscope, a barometer, a hygrometer, a thermometer, and an infrared sensor, which are not described herein again.
Those skilled in the art will appreciate that the terminal structure shown in fig. 1 is not intended to be limiting and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
As shown in fig. 1, the computer software product is stored in a storage medium (storage medium: also called computer storage medium, computer medium, readable storage medium, computer readable storage medium, or direct storage medium, etc., and the storage medium may be a non-volatile readable storage medium, such as RAM, magnetic disk, optical disk), and includes several instructions for enabling a terminal device (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the method according to the embodiments of the present invention, and a memory 1005 as a computer storage medium may include an operating system, a network communication module, a user interface module, and a computer program.
In the terminal shown in fig. 1, the network interface 1004 is mainly used for connecting to a backend server and performing data communication with the backend server; the user interface 1003 is mainly used for connecting a client (user side) and performing data communication with the client; and the processor 1001 may be configured to call up a computer program stored in the memory 1005 and perform the steps of the universal barrier test method provided by the following embodiments of the present invention.
Referring to fig. 2, in a first embodiment of a universal barrier testing method according to the present invention, the universal barrier testing method includes:
and step S10, intercepting the request message sent by the access party by adopting a preset interceptor.
The baffle cloud platform adopts the request message that the preset interceptor intercepted the access side and sent, general baffle test equipment refers to a server, computer and the like that have the general baffle test method of deployment, and follow-up will unify becomes baffle cloud platform, the interceptor is used for receiving all kinds of request messages that the access side sent, and possesses the effect of judging and filtering all kinds of request messages, and the setting mode of interceptor can be multiple, and this embodiment adopts the separate setting mode of interceptor and access side, works as when interceptor and access side separate setting, the interceptor setting can be on the network side, can regard as with baffle cloud platform parallel relation, also can regard as component in the baffle cloud platform. The interceptor is configured to intercept a request packet and determine a type of a test requested by a client, where the type of the test may include a baffle test, a service function test, and other test types, and the request packet is not limited to the two test types in implementation and may include at least identification information of a request object and attribute information such as a category attribute of the test object. The interceptor can judge whether the test requested by the access party comprises a baffle test or not based on the request message, and if the test comprises the baffle test, the interceptor informs the baffle cloud platform, so that the baffle cloud platform is specifically used for reading a corresponding response message after receiving the notice and providing the response message for the access party.
Further, before the step S10, the method may further include:
step a1, receiving the verification information sent by the access party and verifying the verification information.
Step a2, when the verification information passes the verification, establishing a secure connection with the access party according to the verification information and configuring the access party authority.
And the baffle cloud platform receives verification information sent by the access party and verifies the verification information, and when the verification information passes verification, the baffle cloud platform establishes safe connection with the access party according to the verification information and configures the access party authority. Specifically, when an access party accesses the barrier cloud platform, user identity information, an access party key and a signature key are provided, the user identity information is used for verifying whether the access party is a user of the barrier cloud platform, the access party key and the signature key correspond to services available to the access party, if the access party key and the signature key specify interface services available to the access party on the barrier cloud platform and permissions for using the interface services, if the access party key and the signature key are readable, writable or readable, the access party key and the signature key can be generated by certain operation according to the user identity information, the access party key can be customized and aged, the service period of the access party is limited, risks caused by counterfeiting and leakage are reduced, and logical isolation and safe transmission of the access party and the barrier cloud platform are realized by using the information verification.
Specifically, step S10 may include:
and b1, intercepting the pending message sent by the access party by adopting a preset interceptor, and judging whether the pending message contains the baffle test content.
Step b2, if the pending message contains the baffle test content, determining the pending message as a request message.
The method comprises the steps that a baffle cloud platform intercepts a pending message sent by an access party by a preset interceptor, judges whether the pending message contains baffle test content, if the pending message contains the baffle test content, the baffle cloud platform determines the pending message as a request message, the pending request message may be the baffle test content or may be non-baffle test content, so that the pending message needs to be discriminated, the pending message comprises identification information of the access party, the identification information is marked as first identification information in the embodiment, the interceptor can match the first identification information with second identification information of a test object needing baffle test, and if the matching is successful, the pending message is considered as the request message. In addition, the request message includes attribute information of the request object, for example, a category attribute, the interface may be divided into a plurality of categories, if only one of the categories needs to be subjected to the baffle test, at this time, the interceptor may be configured to determine whether the access party includes a class table that needs to be subjected to the test, and if the access party includes the class table, determine that the pending message of the access party includes the baffle test, and is the request message.
Step S20, analyzing the request message, and obtaining each field information of the request message and each field information matching weight.
And the baffle cloud platform analyzes the request message to obtain the information of each field of the request message and the matching weight of the information of each field. The baffle cloud platform analyzes the request message according to a default http protocol to obtain each field information and a field information containing each field information matching weight, for example, after the request message sent by the access terminal is analyzed, each field information matching weight is defined in the request message when the access terminal generates the request message, the baffle cloud platform analyzes the field information containing each field information matching weight by using a preset analysis rule or a custom analysis rule uploaded by the access terminal to obtain the matching weight of each corresponding conventional field information, or the baffle cloud platform analyzes the request message according to the custom analysis rule provided by the access terminal in advance to directly obtain each field information and each field information matching weight to realize a more simplified analysis step, and the specific implementation Method for analyzing the request message by the access terminal custom analysis rule is described in the subsequent embodiments And (5) clearing.
And step S30, determining the target response message of the request message according to the field information and the matching weight of the field information.
And the baffle cloud platform determines a target response message of the request message according to the field information and the field information matching weight, and the step generally comprises the steps of obtaining a preset configuration list according to a uniform resource identifier contained in the request message, and then determining in a traversing and matching manner in the baffle configuration list by using the field information.
Step S40, sending the target response message to the access party, so that the access party completes the test.
And the baffle cloud platform sends the target response message to the access party so that the access party completes the test.
In this embodiment, a preset interceptor is used to intercept a request message sent by an access party; analyzing the request message to obtain the information of each field of the request message and the matching weight of the information of each field; determining a target response message of the request message according to the field information and the field information matching weight; and sending the target response message to the access party so that the access party completes the test, the current situation that the developed baffle only contains the response message for certain test and can only perform certain test is changed, the baffle sharing of cross-team, cross-language and cross-platform is realized, the workload of developers is reduced, the waste of human resources is reduced, and the test efficiency is improved.
Further, on the basis of the first embodiment of the present invention, a second embodiment of the universal barrier testing method of the present invention is further provided, where this embodiment is a refinement step of step S20 in the first embodiment, and the universal barrier testing method includes:
step S21, determining whether there is a preset parsing rule that can parse the request message.
Step S22, if there is a preset analysis rule capable of analyzing the request message, the preset analysis rule is adopted to analyze the request message, and each field information of the request message and each matching weight of each field information are obtained.
And step S23, if the preset analysis rule capable of analyzing the request message does not exist, returning a prompt to the access party so that the access party uploads the self-defined analysis rule.
And step S24, receiving the custom analysis rule uploaded by the access party.
And step S25, analyzing the request message by using the custom analysis rule to obtain each field information of the request message and each field information matching weight.
The baffle cloud platform judges whether a preset analysis rule capable of analyzing the request message exists or not, if the preset analysis rule capable of analyzing the request message exists, the baffle cloud platform analyzes the request message by adopting the preset analysis rule to obtain each field information and each field information matching weight of the request message, if the preset analysis rule capable of analyzing the request message does not exist, the baffle cloud platform returns a prompt to the access party to enable the access party to upload the custom analysis rule, receives the custom analysis rule uploaded by the access party, analyzes the request message by using the custom analysis rule, and obtains each field information and each field information matching weight of the request message.
The matching weight of each field information refers to the matching weight corresponding to each field information in different access party self-defined request messages, if an access party A defines a request message containing a plurality of fields of Method, URI, HeaderParams, QueryString, RequestBody and FormPeaams, in order to identify the matching weight, the access party adds corresponding matching weight information into each field, and the baffle cloud platform analyzes the request message by using the digital identification, so that the digital identification corresponding to each field in the request message, namely the matching weight of each field information, can be read.
The baffle cloud platform judges whether a preset analysis rule capable of analyzing the request message exists or not, if the preset analysis rule capable of analyzing the request message exists, the user-defined analysis rule is adopted to analyze the request message, the matching weight of each field information and each field information of the request message is obtained, and after the user-defined analysis rule is uploaded by an access party, the user-defined analysis rule can be used as the analysis rule of the subsequent request message to analyze the request message in a default mode.
The baffle cloud platform receives the self-defined analysis rule uploaded by the access party, and because the request message can define information such as field information, field information matching weight and the like by the access party, when the request message is self-defined by the access party, the analysis mode of the request message also needs to be correspondingly changed, and the baffle cloud platform opens the limitation of the analysis rule, so that the access party can upload the self-defined analysis rule by the access party to adapt to the self-defined request message of the access party.
In this embodiment, the baffle cloud platform may have a preset parsing rule for parsing the conventional request message, and may also have a customized parsing rule for parsing the customized request message, and the customized parsing rule may be stored in a preset parsing rule base for subsequent parsing of the corresponding request message and sharing to other access parties.
Further, the step S25 is followed by:
and c1, adding the self-defined analysis rule into a preset analysis rule base, and sharing the preset analysis rule base.
Step c2, when the preset interceptor intercepts the request message which can be analyzed by the self-defined analysis rule and is sent by the access party or other access parties again, the self-defined analysis rule in the preset analysis rule base is directly adopted for analysis.
The baffle cloud platform adds the custom analysis rule into a preset analysis rule base and shares the preset analysis rule base, when a preset interceptor intercepts a request message which is sent by the access party or other access parties and can be analyzed by the custom analysis rule, the custom analysis rule in the preset analysis rule base is directly adopted for analysis, the baffle cloud platform can be shared by a plurality of items, so that the method of adding the custom analysis rule uploaded by the access party into the preset analysis rule base is adopted, the access party determines whether the custom analysis rule is open, and when the request message sent by a subsequent access party can be analyzed by the custom analysis rule, the custom analysis rule is directly adopted for analysis.
In this embodiment, the baffle cloud platform realizes that various request messages such as conventional request messages and access party-defined request messages are processed by reserving a way for a developer to upload a self-defined analysis rule by himself, and the applicability of the baffle cloud platform is improved.
Further, referring to fig. 4, on the basis of the first embodiment of the present invention, a third embodiment of the universal barrier testing method of the present invention is further provided, and this embodiment is a refinement step of step S30 in the first embodiment, and the universal barrier testing method includes:
step S31, obtaining a preset configuration list according to the uniform resource identifier in each field information.
And step S32, traversing and matching the field information in the preset configuration list, and judging whether a response message matched with the field information exists.
And step S33, if no response message matched with the information of each field exists, prompting that the test fails.
And the baffle cloud platform acquires a preset configuration list according to the uniform resource identifier in each field information, performs traversal matching on each field information in the preset configuration list, judges whether a response message matched with each field information exists or not, and prompts test failure if the response message matched with each field information does not exist.
The baffle cloud platform obtains a preset configuration list according to the uniform resource identifier in each field information, traverses each field in the preset configuration list, judges whether a response message matched with each field information exists or not, if no response message matched with each field information exists, the baffle cloud platform prompts test failure, in addition, it can be understood that, when the fields contained in the request message sent by the access party after analysis, such as Method, URI, HeaderParams and QueryString, do not find a response message which can be fed back according to the Method, URI, HeaderParams and QueryString fields after traversing the preset configuration list, or a response message C which can be fed back according to the Method, URI, HeaderParams and QueryString fields exists, but the field information matching weight of the response message C has a larger difference with the field information matching weight of the request message, and receives the response message customized by a tester, and taking the preset message as a preset message which corresponds to the request message and needs to be returned, and updating the preset message into an interface baffle configuration list, so that the application range of the baffle cloud platform is wider.
Further, step S32 is followed by:
and step S34, if the response messages matched with the field information exist, judging the number of the response messages.
And step S35, when the number of the response messages is unique, the response messages are used as target response messages.
And step S36, when the number of the response messages is not unique, matching the response messages according to the matching weight of each field information.
And step S37, determining the response message with the most similar matching weight of each field information as the target response message.
If the response messages matched with the field information exist, the baffle cloud platform judges the number of the response messages, when the number of the response messages is unique, the baffle cloud platform takes the response messages as target response messages, when the number of the response messages is not unique, the baffle cloud platform matches with the response messages according to the matching weights of the field information, and the baffle cloud platform determines the response messages with the closest matching weights of the field information as the target response messages. The baffle cloud platform acquires a preset configuration list according to uniform resource identifiers in the field information, the baffle cloud platform performs traversal matching on the field information in the preset configuration list to determine a response message matched with the field information, when the number of the response messages is not unique, the baffle cloud platform takes the response message as a target response message, when the number of the target response message is not unique, the baffle cloud platform performs matching with the response message according to the matching weight of the field information, the baffle cloud platform determines the response message with the closest matching weight of the field information as the target response message, the baffle cloud platform acquires the preset configuration list according to the uniform resource identifiers, performs first traversal matching in the preset configuration list according to the field information, and selects the target response message matched with the field information, if the request message sent by the access terminal contains a Method, a URI, a HeadersParams, a QueryString, a RequestBody, and a FormParams information field after being analyzed, the baffle platform traverses a preset configuration list to obtain a response message in which both a response message a and a response message B can feed back according to the Method, the URI, the HeadersParams, the QueryString, the RequestBody, and the FormParams fields, so that it is necessary to further determine the returned target response message, calculate the weight coefficient of each field information of the response message a and the response message B by the matching weight corresponding to each field information obtained by the analysis, take the response message with each field information weight closest to the request message as the target response message, and track the target response message configured by the interface baffle with the highest weight coefficient, it can be understood that under the matching strategy, the matching results of the request message and the target response message may not be one-to-one, or there may be a one-to-many situation, and when the matching result of the request message and the target response message is one-to-one, directly adopting the target response message, and when the matching result of the request message and the target response message is one-to-many, introducing field information weight, matching, and selecting the response message with the field information weight information closest to the request message as the target response message.
In this embodiment, when there is no response packet corresponding to the request packet in the baffle cloud platform, a prompt indicating that the test fails is output to notify a tester or the tester defines the response packet by himself, so that the customizability and the application range of the baffle cloud platform are wider.
In addition, an embodiment of the present invention further provides a universal baffle testing apparatus, where the universal baffle testing apparatus includes:
the interception module is used for intercepting a request message sent by an access party by adopting a preset interceptor;
the analysis module is used for analyzing the request message and obtaining the matching weight of each field information and each field information of the request message;
the matching module is used for determining a target response message of the request message according to the field information and the field information matching weight;
and the sending module is used for sending the target response message to the access party so as to enable the access party to complete the test.
The steps implemented by each functional module of the universal baffle testing device can refer to each embodiment of the universal baffle testing method of the present invention, and are not described herein again.
In addition, in order to achieve the purpose, the invention also provides a universal baffle plate testing device;
the universal bezel testing apparatus comprises: a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein:
the computer program, when executed by the processor, implements the operations of the universal barrier testing method provided by the above embodiments.
In addition, the embodiment of the invention also provides a computer storage medium.
The computer storage medium has stored thereon a computer program that, when executed by a processor, implements the operations in the universal barrier testing method provided by the above embodiments.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity/action/object from another entity/action/object without necessarily requiring or implying any actual such relationship or order between such entities/actions/objects; the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
For the apparatus embodiment, since it is substantially similar to the method embodiment, it is described relatively simply, and reference may be made to some descriptions of the method embodiment for relevant points. The above-described apparatus embodiments are merely illustrative, in that elements described as separate components may or may not be physically separate. Some or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of the invention. One of ordinary skill in the art can understand and implement it without inventive effort.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) as described above and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (10)

1. A universal baffle testing method is characterized by comprising the following steps:
intercepting a request message sent by an access party by adopting a preset interceptor;
analyzing the request message to obtain the information of each field of the request message and the matching weight of the information of each field;
determining a target response message of the request message according to the field information and the field information matching weight;
and sending the target response message to the access party so that the access party completes the test.
2. The universal bezel testing method as recited in claim 1, wherein said step of parsing said request message to obtain field information and matching weights of field information of said request message comprises:
judging whether a preset analysis rule capable of analyzing the request message exists or not;
if the preset analysis rule capable of analyzing the request message exists, analyzing the request message by adopting the preset analysis rule, and obtaining the field information and the field information matching weight of the request message.
If the preset analysis rule capable of analyzing the request message does not exist, returning a prompt to the access party so that the access party uploads the self-defined analysis rule;
receiving a custom analysis rule uploaded by the access party;
and analyzing the request message by using the custom analysis rule to obtain each field information of the request message and each field information matching weight.
3. The universal baffle test method of claim 2, wherein the step of parsing the request message using the custom parsing rule to obtain field information and matching weights of the field information of the request message is followed by the step of:
adding the self-defined analysis rule into a preset analysis rule base, and sharing the preset analysis rule base;
when a preset interceptor intercepts the request message which is sent by the access party or other access parties and can be analyzed by the custom analysis rule, the custom analysis rule in the preset analysis rule base is directly adopted for analysis.
4. The universal bezel testing method as claimed in claim 1, wherein the step of intercepting the request message sent by the access party by using the preset interceptor is preceded by the steps of:
receiving verification information sent by the access party and verifying the verification information;
and when the verification information passes the verification, establishing a secure connection with an access party according to the verification information and configuring the access party authority.
5. The method for testing a universal bezel as recited in claim 1, wherein the step of intercepting the request message sent by the access party by using a predetermined interceptor comprises:
intercepting a pending message sent by an access party by adopting a preset interceptor, and judging whether the pending message contains a baffle test content;
and if the pending message contains the baffle test content, determining the pending message as a request message.
6. The universal bezel testing method of claim 1, wherein the step of determining the target response packet of the request packet based on the field information and the field information match weights comprises:
acquiring a preset configuration list according to the uniform resource identifiers in the field information;
traversing and matching the field information in the preset configuration list, and judging whether a response message matched with the field information exists or not;
and if no response message matched with the information of each field exists, prompting that the test fails.
7. The method for testing a universal bezel of claim 6, wherein after the step of performing traversal matching on the information of each field in the preset configuration list and determining whether there exists a response packet matching the information of each field, the method comprises:
if the response messages matched with the field information exist, judging the number of the response messages;
when the number of the response messages is unique, taking the response messages as target response messages;
when the number of the response messages is not unique, matching with the response messages according to the matching weight of each field information;
and determining the response message with the closest matching weight of each field information as a target response message.
8. A universal barrier testing apparatus, comprising:
the interception module is used for intercepting a request message sent by an access party by adopting a preset interceptor;
the analysis module is used for analyzing the request message and obtaining the matching weight of each field information and each field information of the request message;
the matching module is used for determining a target response message of the request message according to the field information and the field information matching weight;
and the sending module is used for sending the target response message to the access party so as to enable the access party to complete the test.
9. A universal bezel testing apparatus, comprising: a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein:
the computer program, when executed by the processor, implementing the steps of the universal barrier testing method of any one of claims 1 to 7.
10. A computer storage medium, characterized in that the computer storage medium has stored thereon a computer program which, when being executed by a processor, carries out the steps of the universal barrier testing method according to any one of claims 1 to 7.
CN202010920098.8A 2020-09-03 2020-09-03 Universal baffle testing method, device, equipment and computer storage medium Pending CN112019558A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010920098.8A CN112019558A (en) 2020-09-03 2020-09-03 Universal baffle testing method, device, equipment and computer storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010920098.8A CN112019558A (en) 2020-09-03 2020-09-03 Universal baffle testing method, device, equipment and computer storage medium

Publications (1)

Publication Number Publication Date
CN112019558A true CN112019558A (en) 2020-12-01

Family

ID=73516874

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010920098.8A Pending CN112019558A (en) 2020-09-03 2020-09-03 Universal baffle testing method, device, equipment and computer storage medium

Country Status (1)

Country Link
CN (1) CN112019558A (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5615360A (en) * 1990-11-13 1997-03-25 International Business Machines Corporation Method for interfacing applications with a content addressable memory
CN105335281A (en) * 2014-07-30 2016-02-17 阿里巴巴集团控股有限公司 Method and device for automatic mock of external dependency
US20170214701A1 (en) * 2016-01-24 2017-07-27 Syed Kamran Hasan Computer security based on artificial intelligence
CN110191013A (en) * 2019-04-19 2019-08-30 深圳壹账通智能科技有限公司 Electronic device, the Mock test method of more capital's interfaces and storage medium
CN110347596A (en) * 2019-07-02 2019-10-18 腾讯科技(深圳)有限公司 A kind of test method, device, system, electronic equipment and medium
CN110445815A (en) * 2019-09-20 2019-11-12 北京天地和兴科技有限公司 A kind of industry control protocol depth analytic method
CN110502426A (en) * 2019-07-08 2019-11-26 中国工商银行股份有限公司 The test method and device of distributed data processing system

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5615360A (en) * 1990-11-13 1997-03-25 International Business Machines Corporation Method for interfacing applications with a content addressable memory
CN105335281A (en) * 2014-07-30 2016-02-17 阿里巴巴集团控股有限公司 Method and device for automatic mock of external dependency
US20170214701A1 (en) * 2016-01-24 2017-07-27 Syed Kamran Hasan Computer security based on artificial intelligence
CN110191013A (en) * 2019-04-19 2019-08-30 深圳壹账通智能科技有限公司 Electronic device, the Mock test method of more capital's interfaces and storage medium
CN110347596A (en) * 2019-07-02 2019-10-18 腾讯科技(深圳)有限公司 A kind of test method, device, system, electronic equipment and medium
CN110502426A (en) * 2019-07-08 2019-11-26 中国工商银行股份有限公司 The test method and device of distributed data processing system
CN110445815A (en) * 2019-09-20 2019-11-12 北京天地和兴科技有限公司 A kind of industry control protocol depth analytic method

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
云效DEVOPS平台: "如何让测试少加班?阿里Mock平台使用方法揭秘!", 《阿里云开发者社区》 *

Similar Documents

Publication Publication Date Title
CN110519380B (en) Data access method and device, storage medium and electronic equipment
CN107133180B (en) Dynamic page testing method, testing device and storage medium
CN110442524B (en) Method and device for testing web service interface with authentication authorization
CN113676336A (en) Microservice access proxy method, apparatus and storage medium
CN110869907B (en) Method and terminal for browsing application page
EP2759956A1 (en) System for testing computer application
US20110191764A1 (en) Systems, methods, and apparatuses for facilitating distribution of firmware updates
CN109726108B (en) Front-end code testing method, device, system and medium based on analog data
CN108228444B (en) Test method and device
CN113572689A (en) Microservice gateway management method, system, device, readable storage medium and product
CN111026672A (en) Test method, terminal equipment and mock server
CN111563015B (en) Data monitoring method and device, computer readable medium and terminal equipment
CN112866348B (en) Database access method and device, computer equipment and storage medium
CN110674023B (en) Interface testing method and device
KR101657667B1 (en) Malicious app categorization apparatus and malicious app categorization method
CN108737350B (en) Information processing method and client
CN112019558A (en) Universal baffle testing method, device, equipment and computer storage medium
CN112788640B (en) Communication equipment testing method and device, storage medium and terminal
CN114817076A (en) Data processing method, device, equipment, medium and product of vehicle-mounted operating system
CN114585055A (en) Vehicle-mounted WiFi access method, vehicle controller, cloud server and mobile terminal
CN109933990B (en) Multi-mode matching-based security vulnerability discovery method and device and electronic equipment
CN109714371B (en) Industrial control network safety detection system
CN113726612A (en) Method and device for acquiring test data, electronic equipment and storage medium
CN111078477A (en) Interface test method and device, storage medium and electronic equipment
CN113760688A (en) Remote debugging method, system, webpage server, equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20201201