CN110933143B - Method and device for determining delivery request - Google Patents

Method and device for determining delivery request Download PDF

Info

Publication number
CN110933143B
CN110933143B CN201911082939.6A CN201911082939A CN110933143B CN 110933143 B CN110933143 B CN 110933143B CN 201911082939 A CN201911082939 A CN 201911082939A CN 110933143 B CN110933143 B CN 110933143B
Authority
CN
China
Prior art keywords
delivery
request
determining
verified
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.)
Active
Application number
CN201911082939.6A
Other languages
Chinese (zh)
Other versions
CN110933143A (en
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.)
Beijing QIYI Century Science and Technology Co Ltd
Original Assignee
Beijing QIYI Century Science and Technology 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 Beijing QIYI Century Science and Technology Co Ltd filed Critical Beijing QIYI Century Science and Technology Co Ltd
Priority to CN201911082939.6A priority Critical patent/CN110933143B/en
Publication of CN110933143A publication Critical patent/CN110933143A/en
Application granted granted Critical
Publication of CN110933143B publication Critical patent/CN110933143B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/55Push-based network services
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/60Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources

Abstract

The embodiment of the invention provides a method and a device for determining a delivery request, wherein the method comprises the following steps: acquiring a plurality of HTTP requests; storing the plurality of HTTP requests into a preset database; the preset database stores delivery key information; matching the plurality of HTTP requests with delivery key information in the preset database, and determining delivery requests to be verified according to matching results; verifying the delivery request to be verified, and determining a delivery sequence according to a verification result; and determining a target delivery request according to the delivery sequence, and delivering the target delivery request. The delivery required to be verified can be quickly and accurately positioned in the plurality of HTTP requests through the embodiment of the invention, in addition, the embodiment of the invention can also verify whether the delivery sending sequence meets the requirement through the preset delivery sequence, and the verification process is simple.

Description

Method and device for determining delivery request
Technical Field
The invention relates to the technical field of delivery, in particular to a method and a device for determining a delivery request.
Background
Delivery is a common means now used by many internet enterprises for data recovery. The internet enterprise can perform correct data analysis on the recycled data, so that the product can be improved according to the result obtained by analysis, and the user experience of the user on the application is improved; the enterprise can also make corresponding decisions according to the analyzed result so as to promote the development of the enterprise. The quality of the delivery function is therefore crucial to the accuracy of the data.
In the prior art, delivery test faces the problems of numerous HTTP/HTTPS requests and complicated field check. Too many delivery test requests result in extremely high concurrency of the delivery requests, and if the delivery test requests are performed synchronously with the delivery test of the function test, a large amount of test time is often occupied for checking delivery.
Disclosure of Invention
In view of the above problems, embodiments of the present invention have been made to provide a method for determining a delivery request and a corresponding device for determining a delivery request that overcome or at least partially solve the above problems.
In order to solve the above problem, an embodiment of the present invention discloses a method for determining a delivery request, where the method includes:
acquiring a plurality of HTTP requests;
storing the plurality of HTTP requests into a preset database; the preset database stores delivery key information;
matching the plurality of HTTP requests with delivery key information in the preset database, and determining delivery requests to be verified according to matching results;
verifying the delivery request to be verified, and determining a delivery sequence according to a verification result;
and determining a target delivery request according to the delivery sequence, and delivering the target delivery request.
Optionally, the saving the plurality of HTTP requests to a preset database includes:
and concurrently processing the plurality of HTTP requests by adopting a preset thread pool, and storing the processed plurality of HTTP requests into a preset database.
Optionally, the concurrently processing the multiple HTTP requests by using a preset thread pool, and storing the processed HTTP requests in a preset database includes:
respectively determining a request type corresponding to the HTTP request in each thread; the request type comprises a GET request or a POST request;
when the request type of the HTTP request is a GET request, determining a delivery domain name of the GET request;
matching the delivery domain name of the GET request with a preset domain name list, and storing the GET request successfully matched in the preset database;
when the request type of the HTTP request is a POST request, HOST information and website information contained in the POST request are acquired;
determining a delivery domain name of the POST request by adopting the HOST information and the website information;
and matching the delivery domain name of the POST request with a preset domain name, and storing the POST request successfully matched in the preset database.
Optionally, the delivery key information includes a first tester IP, a first expected verification time period, and a template table; the matching the plurality of HTTP requests with the delivery key information in the preset database, and determining the delivery request to be verified according to the matching result comprises the following steps:
respectively extracting a GET request stored in a preset database or a second tester IP contained in a POST request;
matching the second tester IP with the first tester IP, and determining a successfully matched GET request or POST request as a first delivery request to be verified;
extracting a second expected verification time period contained in the first delivery request to be verified;
matching the second expected verification time period with the first expected verification time period, and determining the successfully matched first delivery request to be verified as a second delivery request to be verified;
extracting a template ID contained in the second request to be verified;
matching the template ID with the template table, and determining the successfully matched template as a target template;
extracting a target delivery domain name and target key parameters from the target template;
and determining a third delivery request to be verified by adopting the target delivery domain name and the target key parameter.
Optionally, the verifying the delivery request to be verified, and determining a delivery sequence according to a verification result includes:
disassembling and verifying the third delivery request to be verified to obtain a verification result;
and determining the delivery sequence by adopting the checking result.
Optionally, the determining a target delivery request according to the delivery order and delivering the target delivery request includes:
comparing the delivery sequence with a preset delivery sequence, and judging whether the delivery sequence of the delivery request to be verified is consistent with the preset delivery sequence;
and if the delivery sequence of the delivery request to be verified is consistent with the preset delivery sequence, determining the delivery request to be verified with the delivery sequence consistent with the preset delivery sequence as a target delivery request, and delivering the target delivery request.
Optionally, the method further comprises:
and if the delivery sequence of the delivery request to be verified is inconsistent with the preset delivery sequence, marking the delivery request to be verified with the delivery sequence inconsistent with the preset delivery sequence.
The embodiment of the invention also discloses a device for determining the delivery request, which comprises:
the HTTP request acquisition module is used for acquiring a plurality of HTTP requests;
the HTTP request storage module is used for storing the plurality of HTTP requests into a preset database; the preset database stores delivery key information;
the to-be-verified delivery request determining module is used for matching the plurality of HTTP requests with delivery key information in the preset database and determining the to-be-verified delivery request according to a matching result;
the delivery sequence determining module is used for verifying the delivery request to be verified and determining a delivery sequence according to a verification result;
and the target delivery request determining module is used for determining a target delivery request according to the delivery sequence and delivering the target delivery request.
The embodiment of the invention also discloses a device, which comprises:
one or more processors; and
one or more machine readable media having instructions stored thereon that, when executed by the one or more processors, cause the apparatus to perform one or more methods as recited in any one of the above.
Embodiments of the invention also disclose one or more machine-readable media having instructions stored thereon, which when executed by one or more processors, cause the processors to perform one or more methods as recited in any of the above.
The embodiment of the invention has the following advantages: the embodiment of the invention obtains a plurality of HTTP requests; storing the plurality of HTTP requests into a preset database; matching the plurality of HTTP requests with delivery key information in a preset database, and determining delivery requests to be verified according to matching results; verifying the delivery request to be verified, and determining a delivery sequence according to a verification result; and determining a target delivery request according to the delivery sequence, and delivering the target delivery request. Therefore, the delivery needing to be verified can be quickly and accurately positioned in the plurality of HTTP requests, in addition, the embodiment of the invention can also verify whether the delivery sending sequence meets the requirement or not through the preset delivery sequence, and the verification process is simple.
Drawings
FIG. 1 is a flow chart of the steps of one embodiment of a method of determining delivery requests of the present invention;
FIG. 2 is a flow chart of steps of another embodiment of a method of determining a delivery request of the present invention;
FIG. 3 is a flow chart of the steps of a method of the present invention for saving HTTP requests from a redis database to a MYSQL database;
FIG. 4 is a schematic diagram of a delivery request determination method according to an embodiment of the invention;
FIG. 5 is a block diagram of a delivery request determining apparatus according to an embodiment of the present invention.
Detailed Description
In order to make the aforementioned objects, features and advantages of the present invention more comprehensible, the present invention is described in detail with reference to the accompanying drawings and the detailed description thereof.
Aiming at the problems of numerous HTTP/HTTPS requests and complicated field verification in the existing delivery test process, the embodiment of the invention provides a core concept that the acquired HTTP requests are matched through preset delivery key information so as to obtain delivery requests to be verified, a delivery sequence is determined according to the delivery requests to be verified, and then the delivery sequence of the delivery requests to be verified is matched with the preset delivery sequence so as to determine target delivery requests.
The following is illustrated by specific examples:
referring to fig. 1, a flowchart illustrating steps of an embodiment of a method for determining a delivery request according to the present invention is shown, which may specifically include the following steps:
step 101, acquiring a plurality of HTTP requests;
in the embodiment of the present invention, the HTTP request needs to be acquired before being delivered.
In practical application, all HTTP requests sent by an application terminal can be intercepted by a Web application framework Django service of an open source code.
Step 102, storing the plurality of HTTP requests into a preset database; the preset database stores delivery key information;
in the embodiment of the present invention, the preset database may be a relational database management system database MYSQL database. When all HTTP requests sent by an application terminal are intercepted through the Django service, the IP address of the HTTP request sending terminal, the domain name to which the request is to reach, the type of the request and the like can be obtained, and therefore relevant information of the request can be stored in the MYSQL database according to different types.
Wherein, the database can store the delivery key information. Delivery critical information may be used to determine the delivery request required, which may be, for example, a delivery request within a desired delivery time period.
103, matching the plurality of HTTP requests with delivery key information in the preset database, and determining delivery requests to be verified according to matching results;
delivery is a common means for data recovery of many internet enterprises at present, and the delivery request refers to an HTTP request or an HTTPs request which needs to be delivered.
In the embodiment of the invention, the delivery request to be verified refers to a request needing further verification.
After the HTTP request is stored in the database, the HTTP request stored in the database may be matched with the delivery key information stored in the database, so as to determine the delivery request to be verified according to the matching result.
104, verifying the delivery request to be verified, and determining a delivery sequence according to a verification result;
after the delivery request to be verified is determined, the delivery request to be verified needs to be verified to obtain a verification result, and the delivery sequence can be determined according to the verification result, wherein the delivery sequence can be used for determining whether delivery meets the requirements, for example, whether the delivery request is delivered sequentially according to the time sequence in the expected delivery time period is judged.
And 105, determining a target delivery request according to the delivery sequence, and delivering the target delivery request.
After the delivery sequence is determined, a target delivery request can be determined according to the delivery sequence, and the target delivery request is delivered; the target delivery requests are delivery requests with delivery sequences meeting the requirements of preset delivery sequences, for example, the delivery requests are delivered sequentially according to a time sequence in an expected delivery time period;
the embodiment of the invention obtains a plurality of HTTP requests; storing the plurality of HTTP requests into a preset database; matching the plurality of HTTP requests with delivery key information in a preset database, and determining delivery requests to be verified according to matching results; verifying the delivery request to be verified, and determining a delivery sequence according to a verification result; and determining a target delivery request according to the delivery sequence, and delivering the target delivery request. The delivery required to be verified can be quickly and accurately positioned in the plurality of HTTP requests through the embodiment of the invention, in addition, the embodiment of the invention can also verify whether the delivery sending sequence meets the requirement through the preset delivery sequence, and the verification process is simple.
Referring to fig. 2, a flowchart of steps of an embodiment of a method for determining a delivery request according to the present invention is shown, and specifically, the method may include the following steps:
step 201, acquiring a plurality of HTTP requests;
in the embodiment of the present invention, the HTTP request needs to be obtained before the request is delivered.
In practical application, all HTTP requests sent by an application terminal can be intercepted by a Web application framework Django service of an open source code.
Step 202, concurrently processing the plurality of HTTP requests by adopting a preset thread pool, and storing the processed plurality of HTTP requests into a preset database; the preset database stores delivery key information;
in the embodiment of the present invention, the preset database may be a relational database management system database MYSQL database. The database may store delivery key information. The delivery key information may be information that determines a delivery request.
When all HTTP requests sent by an application terminal are intercepted through the Django service, the IP address of the HTTP request sending terminal, the domain name to which the request is to reach, the type of the request and the like can be obtained, and therefore relevant information of the request can be stored in the MYSQL database according to different types.
In practical applications, the delivery of HTTP requests is often concurrent, so for high concurrent delivery, a preset thread pool can be used to process multiple HTTP requests concurrently. When all HTTP requests sent by an application terminal are intercepted, a thread is allocated to each request, and the HTTP requests are processed through a plurality of threads and stored in a MYSQL database.
In an embodiment of the present invention, step 202 may include the following sub-steps:
a substep S11 of respectively determining the request types corresponding to the HTTP requests in each thread; the request type comprises a GET request or a POST request;
in practical applications, the HTTP request has a corresponding request type; for example, the request type of the HTTP request may include a GET request or a POST request;
wherein, the GET request is a request for data from the server, and the data is transmitted by adding the parameters of the request as character strings to the URL.
A POST request is a request to submit data to a server. Data transfer is performed by placing the data in a request body in json format. In the embodiment of the invention, in order to enable the POST and the GET request to have the same form of URL, json can be extracted and spliced with the URL, so that the presentation form of the json is consistent with that of the GET request.
When processing an HTTP request by a thread, it is first necessary to determine to which request the HTTP request to be processed belongs.
Substep S12, when the request type of the HTTP request is a GET request, determining the delivery domain name of the GET request;
a domain name is the name of a computer or group of computers on the internet that consists of a string of names separated by dots that identify the electronic position (sometimes also referred to as the geographic location) of the computer at the time of data transmission.
When the request type of the HTTP request is a GET request, the HTTP request may be filtered through an intermediate service, and the filtering through the intermediate service is mainly based on the domain name, so that when the request type of the HTTP request is determined to be a GET request, the domain name of the GET request may be determined first.
Substep S13, matching the delivery domain name of the GET request with a preset domain name list, and storing the GET request successfully matched in the preset database;
after the domain name of the GET request is determined, whether the obtained GET request is the GET request needing to be verified or not can be determined in a mode of matching the domain name of the GET request in a preset domain name list. And if the domain name is successfully matched, storing the corresponding GET request in a preset database.
Substep S14, when the request type of the HTTP request is POST request, obtaining HOST information and website information contained in the POST request;
HOST information is mainly used to specify the hostname and port number where the resource is located, and the format is partially the same as the hostname and port number in the complete URL of the resource.
The domain name can be extracted through the HOST information and the website information.
When the request type of the HTTP request is a POST request, the POST request may be filtered by specifying a domain name, and therefore, in order to perform filtering, first, HOST information and website information of the POST request may be acquired, and the domain name may be extracted from the HOST information and the website information.
Substep S15, adopting the HOST information, the website information determining the delivery domain name of the POST request;
after the HOST information and the website information of the POST request are obtained, the delivery domain name of the POST request can be determined according to the HOST information and the website information.
And a substep S16, matching the delivery domain name of the POST request with a preset domain name, and storing the POST request successfully matched in the preset database.
After the delivery domain name of the POST request is determined, the delivery domain name of the POST can be matched with a preset domain name, and the POST request successfully matched with the preset domain name is stored in a preset database.
In the embodiment of the present invention, before storing the HTTP request in the MYSQL database, information such as a website URL, a domain name, a main data request of the HTTP request may be pre-stored in a redis database (a network-supported, memory-based, or persistent log-type, Key-Value database), and then the HTTP request is stored in the MYSQL database from the redis database.
FIG. 3 is a flowchart illustrating steps of saving an HTTP request from a redis database to a MYSQL database according to an embodiment of the present invention.
As shown in the figure, after reading the HTTP request in the redis, it is first determined whether there is an HTTP request URL including a domain name in the HTTP request, if so, it may be determined that the HTTP request is a GET request, and if not, it may be determined that the HTTP request is a POST request. And when the HTTP request is a GET request, acquiring the URL, the IP address, the expected verification time period and the request type of the HTTP request, and storing the URL, the IP address, the expected verification time period and the request type into a MYSQL database. When the HTTP request is a POST request, acquiring a domain name of the POST request and a requestbody in a json format, adding the requestbody in the json format behind the domain name to obtain a URL in a form consistent with that of the GET request, and storing the URL, the IP address, the expected verification time period, the request type and the like of the POST request in a MYSQL database.
Step 203, matching the plurality of HTTP requests with delivery key information in the preset database, and determining delivery requests to be verified according to matching results;
after the HTTP request is stored in the database, the HTTP request stored in the database may be matched with the delivery key information stored in the database, so as to determine the delivery request to be verified according to the matching result.
In the embodiment of the invention, in order to accurately position the tested delivery, data matching can be carried out by combining related delivery key information stored in a database, so that the specific tested delivery is accurately positioned. In the embodiment of the present invention, the delivery key information may include the first tester IP, the first expected verification time period, and the template table.
In the embodiment of the present invention, the matching the multiple HTTP requests with the delivery key information in the preset database, and determining the delivery request to be verified according to the matching result may include the following sub-steps:
substep S21, respectively extracting a GET request stored in the preset database, or a second tester IP included in the POST request;
in the embodiment of the present invention, the second tester IP included in the GET request or POST request stored in the preset database may be extracted as a parameter for the first screening delivery.
Substep S22, matching the second tester IP with the first tester IP, and determining a successfully matched GET request or POST request as a first delivery request to be verified;
and matching the acquired second testing machine IP with the first testing machine IP stored in the preset database to serve as first screening, and when the matching is successful, determining the successfully matched GET request or POST request as a first delivery request to be verified.
Substep S23, extracting a second expected verification time period contained in the first to-be-verified delivery request;
in an embodiment of the invention, a second expected verification time period included in the first delivery-to-be-verified request can be extracted as a parameter for second delivery screening.
Substep S24, matching the second expected verification time period with the first expected verification time period, and determining the successfully matched first delivery request to be verified as a second delivery request to be verified;
and matching the obtained second expected verification time period with the first expected verification time period stored in the preset database to serve as second screening, and when the matching is successful, determining the successfully matched GET request or POST request as a second delivery request to be verified.
A substep S25, extracting a template ID included in the second request to be verified;
in the embodiment of the invention, a second testing machine IP included in the second delivery request to be verified can be extracted as a parameter for the third delivery screening.
Substep S26, matching the template ID with the template table, and determining the successfully matched second request to be verified as a target template;
and matching the acquired template ID with a template table stored in a preset database to serve as secondary screening, and determining the successfully matched template as a target template when the matching is successful.
Substep S27, extracting a target delivery domain name and target key parameters from the target template;
in the embodiment of the invention, after the target template is determined, the target delivery domain name and the target key parameter can be extracted from the target template.
And a substep S28, determining a third delivery request to be verified by adopting the target delivery domain name and the target key parameter.
And determining the GET request or POST request matched with the target delivery domain name and the target key parameter as a third delivery request to be verified.
Step 204, verifying the delivery request to be verified, and determining a delivery sequence according to a verification result;
after the delivery request to be verified is determined, the delivery request to be verified needs to be verified and a verification result is obtained, and the delivery sequence can be determined according to the verification result.
In an embodiment of the present invention, step 204 may include the following sub-steps:
substep S31, performing disassembly verification on the third delivery request to be verified to obtain a verification result;
and when the third delivery request to be verified is determined, disassembling and verifying the third delivery request to be verified to obtain a verification result.
Specifically, for the GET request, the domain name part of the URL of the GET request may be removed, then the remaining character strings are segmented by "&", then secondary segmentation is performed by "&", the result is stored in the dictionary type in the key-value form, the check result is obtained, and the check result is stored in the database.
For the POST request, json can be directly converted into a dictionary type to obtain a check result, and the check result is stored in a database.
By analogy, all deliveries to be tested can be done in a concurrent fashion through the thread pool.
And a substep S32, determining the delivery sequence by using the checking result.
After the verification result is obtained, the delivery sequence can be determined by using the verification result.
Step 205, determining a target delivery request according to the delivery sequence, and delivering the target delivery request.
After the delivery order is determined, the target delivery requests may be determined according to the delivery order and delivered.
In an embodiment of the present invention, step 205 may include the following sub-steps:
the substep S41 is to compare the delivery sequence with a preset delivery sequence and judge whether the delivery sequence of the delivery request to be verified is consistent with the preset delivery sequence;
in the embodiment of the invention, a delivery sequence can be preset according to actual needs, after the delivery sequence of the delivery request to be verified is obtained, the obtained delivery sequence of the delivery request to be verified can be compared and sorted by using an SQL statement according to the preset delivery sequence, and whether the delivery sequence of the delivery request to be verified is consistent with the preset delivery sequence is judged.
And a substep S42, if the delivery sequence of the delivery request to be verified is consistent with the preset delivery sequence, determining the delivery request to be verified with the delivery sequence consistent with the preset delivery sequence as a target delivery request, and delivering the target delivery request.
When the delivery sequence of the delivery request to be verified is consistent with the preset delivery sequence, the positioning of the delivery request is proved to be accurate, at the moment, the delivery request to be verified with the delivery sequence consistent with the preset delivery sequence can be determined as a target delivery request, and the target delivery request is delivered.
In the embodiment of the invention, if the delivery sequence of the delivery request to be verified is inconsistent with the preset delivery sequence, the delivery request to be verified with the delivery sequence inconsistent with the preset delivery sequence is marked.
FIG. 4 is a diagram illustrating a delivery request determining method according to an embodiment of the invention.
As shown in fig. 4, when the settlement is triggered, a TMP list concerned by the user, a settlement field configured by the user, and an IP set by the user may be obtained in advance, so that the delivery URL required by the template is filtered out by the template list according to the IP, the duration; the TMP is delivery template information, records relevant requirements of the delivery request, such as a domain name for delivery, an index to be included in the request, a format of the index (such as a fixed value, a regular expression, a non-empty value, and the like), and is used to provide a basic comparison parameter for subsequent verification.
And then, parameter configuration of the user can be obtained, the concerned TMP value is replaced according to the keywords, so that a delivery field is determined to be checked, and the request is checked to obtain a checking result.
And finally, acquiring delivery sequence configuration, comparing and sequencing the verification results, determining a correct verification sequence, and displaying the verification result.
The embodiment of the invention obtains a plurality of HTTP requests; storing the plurality of HTTP requests into a preset database; matching the plurality of HTTP requests with delivery key information in a preset database, and determining delivery requests to be verified according to matching results; verifying the delivery request to be verified, and determining a delivery sequence according to a verification result; and determining a target delivery request according to the delivery sequence, and delivering the target delivery request. Therefore, the delivery needing to be verified can be quickly and accurately positioned in the plurality of HTTP requests, in addition, the embodiment of the invention can also check whether the delivery sending sequence meets the requirement or not through the preset delivery sequence, and the checking process is simple.
It should be noted that, for simplicity of description, the method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present invention is not limited by the illustrated order of acts, as some steps may occur in other orders or concurrently in accordance with the embodiments of the present invention. Further, those skilled in the art will appreciate that the embodiments described in the specification are presently preferred and that no particular act is required to implement the invention.
Referring to fig. 5, a block diagram of a structure of an embodiment of a delivery request determining apparatus of the present invention is shown, which may specifically include the following modules:
an HTTP request obtaining module 501, configured to obtain multiple HTTP requests;
an HTTP request saving module 502, configured to save the plurality of HTTP requests to a preset database; the preset database stores delivery key information;
a delivery request to be verified determining module 503, configured to match the multiple HTTP requests with the delivery key information in the preset database, and determine a delivery request to be verified according to a matching result;
a delivery sequence determining module 504, configured to verify the delivery request to be verified, and determine a delivery sequence according to a verification result;
and a target delivery request determining module 505, configured to determine a target delivery request according to the delivery order, and deliver the target delivery request.
In this embodiment of the present invention, the HTTP request saving module includes:
and the HTTP request storage sub-module is used for concurrently processing the plurality of HTTP requests by adopting a preset thread pool and storing the processed plurality of HTTP requests into a preset database.
In this embodiment of the present invention, the HTTP request saving sub-module includes:
the request type determining unit is used for respectively determining the request type corresponding to the HTTP request in each thread; the request type comprises a GET request or a POST request;
the delivery domain name determining unit of the GET request is used for determining the delivery domain name of the GET request when the request type of the HTTP request is the GET request;
a GET request storage unit, configured to match the delivery domain name of the GET request with a preset domain name list, and store the successfully matched GET request in the preset database;
the device comprises a HOST information and website information acquisition unit, a response unit and a response unit, wherein the HOST information and website information acquisition unit is used for acquiring HOST information and website information contained in a POST request when the request type of the HTTP request is the POST request;
a delivery domain name determining unit of the POST request, which is used for determining the delivery domain name of the POST request by adopting the HOST information and the website information;
and the POST request storage unit is used for matching the delivery domain name of the POST request with a preset domain name and storing the POST request successfully matched in the preset database.
In the embodiment of the invention, the delivery key information comprises a first tester IP, a first expected verification time period and a template table; the delivery request to be verified determining module comprises:
a second tester IP extraction submodule, configured to extract a GET request stored in a preset database, or a second tester IP included in a POST request, respectively;
a first delivery request to be verified determining submodule, configured to match the second tester IP with the first tester IP, and determine a GET request or a POST request that is successfully matched as a first delivery request to be verified;
the second expected verification time period extracting submodule is used for extracting a second expected verification time period contained in the first delivery request to be verified;
the second to-be-verified delivery request determining submodule is used for matching the second expected verification time period with the first expected verification time period and determining the successfully-matched first to-be-verified delivery request as a second to-be-verified delivery request;
a template ID extraction submodule for extracting a template ID contained in the second request to be verified;
the target template determining submodule is used for matching the template ID with the template table and determining the successfully matched template as a target template;
the target delivery domain name and target key parameter extraction sub-module is used for extracting a target delivery domain name and target key parameters from the target template;
and the third to-be-verified delivery request determining submodule is used for determining a third to-be-verified delivery request by adopting the target delivery domain name and the target key parameter.
In an embodiment of the present invention, the delivery order determining module includes:
the disassembly and verification sub-module is used for performing disassembly and verification on the third delivery request to be verified to obtain a verification result;
and the delivery sequence determining submodule is used for determining the delivery sequence by adopting the checking result.
In an embodiment of the present invention, the target delivery request determining module includes:
the judging submodule is used for comparing the delivery sequence with a preset delivery sequence and judging whether the delivery sequence of the delivery request to be verified is consistent with the preset delivery sequence or not;
and the target delivery request determining submodule is used for determining the delivery request to be verified with the delivery sequence consistent with the preset delivery sequence as the target delivery request and delivering the target delivery request if the delivery sequence of the delivery request to be verified is consistent with the preset delivery sequence.
In the embodiment of the present invention, the method further includes:
and the marking sub-module is used for marking the delivery requests to be verified, of which the delivery sequence is inconsistent with the preset delivery sequence, if the delivery sequence of the delivery requests to be verified is inconsistent with the preset delivery sequence.
For the device embodiment, since it is basically similar to the method embodiment, the description is simple, and for the relevant points, refer to the partial description of the method embodiment.
An embodiment of the present invention further provides an apparatus, including:
one or more processors; and
one or more machine-readable media having instructions stored thereon, which when executed by the one or more processors, cause the apparatus to perform methods as described in embodiments of the invention.
Embodiments of the invention also provide one or more machine-readable media having instructions stored thereon, which when executed by one or more processors, cause the processors to perform the methods described in embodiments of the invention.
The embodiments in the present specification are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, apparatus, or computer program product. Accordingly, embodiments of the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, embodiments of the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
Embodiments of the present invention are described with reference to flowchart illustrations and/or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing terminal to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing terminal to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing terminal to cause a series of operational steps to be performed on the computer or other programmable terminal to produce a computer implemented process such that the instructions which execute on the computer or other programmable terminal provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present invention have been described, additional variations and modifications of these embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all such alterations and modifications as fall within the scope of the embodiments of the invention.
Finally, it should also be noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or terminal 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 terminal. 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 terminal that comprises the element.
The method for determining a delivery request and the device for determining a delivery request provided by the present invention are described in detail above, and specific examples are applied herein to explain the principle and the implementation of the present invention, and the description of the above embodiments is only used to help understanding the method of the present invention and the core idea thereof; meanwhile, for a person skilled in the art, according to the idea of the present invention, the specific embodiments and the application range may be changed, and in summary, the content of the present specification should not be construed as a limitation to the present invention.

Claims (10)

1. A method for determining delivery requests, the method comprising:
acquiring a plurality of HTTP requests; the request type of the HTTP request comprises a GET request or a POST request;
storing the plurality of HTTP requests into a preset database; the HTTP request comprises a second tester IP, a second expected verification time period and a template ID; the preset database stores delivery key information; the delivery key information comprises a first tester IP, a first expected verification time period and a template table;
matching the plurality of HTTP requests with delivery key information in the preset database, and determining delivery requests to be verified according to matching results; the delivery request to be verified is determined by matching the second tester IP with the first tester IP, the second expected verification time period with the first expected verification time period, and the template ID with the template table;
verifying the delivery request to be verified, and determining a delivery sequence according to a verification result;
and determining a target delivery request according to the delivery sequence, and delivering the target delivery request.
2. The method of claim 1, wherein saving the plurality of HTTP requests to a preset database comprises:
and concurrently processing the plurality of HTTP requests by adopting a preset thread pool, and storing the processed plurality of HTTP requests into a preset database.
3. The method of claim 2, wherein concurrently processing the plurality of HTTP requests using a preset thread pool, and storing the processed HTTP requests in a preset database comprises:
respectively determining a request type corresponding to the HTTP request in each thread; when the request type of the HTTP request is a GET request, determining a delivery domain name of the GET request;
matching the delivery domain name of the GET request with a preset domain name list, and storing the GET request successfully matched in the preset database;
when the request type of the HTTP request is a POST request, HOST information and website information contained in the POST request are acquired;
determining a delivery domain name of the POST request by adopting the HOST information and the website information;
and matching the delivery domain name of the POST request with a preset domain name, and storing the POST request successfully matched in the preset database.
4. The method as claimed in claim 3, wherein the matching the plurality of HTTP requests with the delivery key information in the preset database, and determining the delivery request to be verified according to the matching result comprises:
respectively extracting a GET request and a second tester IP contained in a POST request stored in a preset database;
matching the second tester IP with the first tester IP, and determining a successfully matched GET request or POST request as a first delivery request to be verified;
extracting a second expected verification time period contained in the first delivery request to be verified;
matching the second expected verification time period with the first expected verification time period, and determining the successfully matched first delivery request to be verified as a second delivery request to be verified;
extracting a template ID contained in the second delivery request to be verified;
matching the template ID with the template table, and determining the successfully matched template as a target template;
extracting a target delivery domain name and target key parameters from the target template;
and determining a third delivery request to be verified by adopting the target delivery domain name and the target key parameter.
5. The method as claimed in claim 4, wherein the verifying the delivery request to be verified and determining the delivery sequence according to the verification result comprises:
disassembling and verifying the third delivery request to be verified to obtain a verification result;
and determining the delivery sequence by adopting the checking result.
6. The method according to claim 5, wherein determining a target delivery request according to the delivery order and delivering the target delivery request comprises:
comparing the delivery sequence with a preset delivery sequence, and judging whether the delivery sequence of the delivery request to be verified is consistent with the preset delivery sequence;
and if the delivery sequence of the delivery request to be verified is consistent with the preset delivery sequence, determining the delivery request to be verified with the delivery sequence consistent with the preset delivery sequence as a target delivery request, and delivering the target delivery request.
7. The method of claim 6, further comprising:
and if the delivery sequence of the delivery request to be verified is inconsistent with the preset delivery sequence, marking the delivery request to be verified with the delivery sequence inconsistent with the preset delivery sequence.
8. An apparatus for determining delivery requests, the apparatus comprising:
the HTTP request acquisition module is used for acquiring a plurality of HTTP requests; the request type of the HTTP request comprises a GET request or a POST request;
the HTTP request storage module is used for storing the plurality of HTTP requests into a preset database; the HTTP request comprises a second tester IP, a second expected verification time period and a template ID; the preset database stores delivery key information; the delivery key information comprises a first tester IP, a first expected verification time period and a template table;
the to-be-verified delivery request determining module is used for matching the plurality of HTTP requests with delivery key information in the preset database and determining the to-be-verified delivery request according to a matching result; the delivery request to be verified is determined by matching the second tester IP with the first tester IP, the second expected verification time period with the first expected verification time period, and the template ID with the template table;
the delivery sequence determining module is used for verifying the delivery request to be verified and determining a delivery sequence according to a verification result;
and the target delivery request determining module is used for determining a target delivery request according to the delivery sequence and delivering the target delivery request.
9. An apparatus for determining a delivery request, comprising:
one or more processors; and
one or more machine-readable media having instructions stored thereon that, when executed by the one or more processors, cause the apparatus to perform any of the methods of claims 1-7.
10. One or more machine-readable media having instructions stored thereon, which when executed by one or more processors, cause the processors to perform any of the methods of claims 1-7.
CN201911082939.6A 2019-11-07 2019-11-07 Method and device for determining delivery request Active CN110933143B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911082939.6A CN110933143B (en) 2019-11-07 2019-11-07 Method and device for determining delivery request

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911082939.6A CN110933143B (en) 2019-11-07 2019-11-07 Method and device for determining delivery request

Publications (2)

Publication Number Publication Date
CN110933143A CN110933143A (en) 2020-03-27
CN110933143B true CN110933143B (en) 2022-06-07

Family

ID=69853430

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911082939.6A Active CN110933143B (en) 2019-11-07 2019-11-07 Method and device for determining delivery request

Country Status (1)

Country Link
CN (1) CN110933143B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101094193A (en) * 2006-06-23 2007-12-26 阿里巴巴公司 Method and system of processing multi-sort delivery requirements from multiple sources
CN102549999A (en) * 2009-09-22 2012-07-04 高通股份有限公司 Enhanced block-request streaming using cooperative parallel HTTP and forward error correction
CN102970112A (en) * 2012-11-30 2013-03-13 中国电子科技集团公司第十五研究所 System and method for transmitting system data
CN108139952A (en) * 2017-06-14 2018-06-08 北京小米移动软件有限公司 Using exchange method, exchange method and device
CN109509041A (en) * 2019-01-07 2019-03-22 武汉稀云科技有限公司 A kind of Internet advertising put-on method and device
CN109558134A (en) * 2017-09-27 2019-04-02 北京京东尚科信息技术有限公司 The method and apparatus of business datum verification

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160140122A1 (en) * 2008-11-26 2016-05-19 David Harrison Relevancy improvement through targeting of information based on data gathered from a capture device associated with a client device
US11722365B2 (en) * 2014-05-13 2023-08-08 Senseware, Inc. System, method and apparatus for configuring a node in a sensor network

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101094193A (en) * 2006-06-23 2007-12-26 阿里巴巴公司 Method and system of processing multi-sort delivery requirements from multiple sources
CN102549999A (en) * 2009-09-22 2012-07-04 高通股份有限公司 Enhanced block-request streaming using cooperative parallel HTTP and forward error correction
CN102970112A (en) * 2012-11-30 2013-03-13 中国电子科技集团公司第十五研究所 System and method for transmitting system data
CN108139952A (en) * 2017-06-14 2018-06-08 北京小米移动软件有限公司 Using exchange method, exchange method and device
CN109558134A (en) * 2017-09-27 2019-04-02 北京京东尚科信息技术有限公司 The method and apparatus of business datum verification
CN109509041A (en) * 2019-01-07 2019-03-22 武汉稀云科技有限公司 A kind of Internet advertising put-on method and device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
城域音视频交互系统服务平台软件的设计与实现;唐少杰;《中国优秀硕士学位论文全文数据库 (信息科技辑)》;20170215;全文 *

Also Published As

Publication number Publication date
CN110933143A (en) 2020-03-27

Similar Documents

Publication Publication Date Title
CN107943694B (en) Test data generation method and device
CN109902016B (en) Web test method and test platform
CN111240653B (en) Interface document generation method, device and readable storage medium
WO2015176431A1 (en) Method and device for generating test data
CN111563051B (en) Crawler-based data verification method and device, computer equipment and storage medium
WO2018120965A1 (en) Automatic test method and device, and computer-readable storage medium
CN107223257B (en) Test method, test server and test system
CN109358898B (en) Information processing method and device, electronic equipment and storage medium
CN112540924A (en) Interface automation test method, device, equipment and storage medium
CN110933143B (en) Method and device for determining delivery request
CN111368045B (en) User intention recognition method, device, equipment and computer readable storage medium
CN111061733B (en) Data processing method, device, electronic equipment and computer readable storage medium
US20150140957A1 (en) Prepaid phone card charging
CN108829590B (en) Software testing method, device and system
CN111309371A (en) Query method and device
US10289531B2 (en) Software integration testing with unstructured database
CN105468688B (en) Site template processing method and device
CN115168217A (en) Defect discovery method and device for source code file
CN115859065A (en) Model evaluation method, device, equipment and storage medium
CN114238733A (en) Key information extraction method and device, computer storage medium and electronic equipment
CN112187708B (en) Automatic supplementing method and equipment for certificate chain of digital certificate
CN107704484B (en) Webpage error information processing method and device, computer equipment and storage medium
CN114661753A (en) Call bill retrieval method and device
CN110661678B (en) Abnormity monitoring method and device
CN111324757B (en) Map data problem processing method and device

Legal Events

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