HTTP interface test system and method

By using the HTTP interface test system in the Internet of Vehicles HIL test, simulating domain name resolution and HTTP response, the problem of not being able to verify the interaction function of the on-board controller and the cloud backend on the intranet is solved, and an efficient testing process is achieved.

CN119788555AActive Publication Date: 2025-04-08CHONGQING CHANGAN AUTOMOBILE CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202311287529.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-10-07
Publication Date
2025-04-08
Estimated Expiration
2043-10-07

AI Technical Summary

Technical Problem

In the HIL test of the Internet of Vehicles, it is impossible to verify the correctness of the interactive functions of the on-board controller under test and the cloud backend in the intranet, resulting in inefficient testing.

Method used

It provides an HTTP interface test system, including a controller under test, an Ethernet transceiver and a cloud platform simulation unit. The cloud platform simulation unit includes a domain name resolution emulator and an HTTP emulator. By simulating domain name resolution and HTTP response, it realizes the interactive function verification of the controller under test and the cloud backend.

Benefits of technology

The verification test of the interactive function of the on-board controller under test and the cloud backend is implemented in the intranet, eliminating the dependence on the real cloud backend, reducing the complexity of the test link, and improving the testing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119788555A_ABST
    Figure CN119788555A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides an HTTP (Hyper Text Transport Protocol) interface test system and method, and relates to the technical field of Internet of Vehicles HIL test. The system at least comprises a tested controller, an Ethernet transceiver, a domain name resolution simulator and an HTTP simulator, the Ethernet transceiver forwards a domain name resolution request which is sent by the tested controller and carries the IP address of the domain name resolution server to the domain name resolution simulator; the domain name resolution simulator performs resolution according to the domain name resolution request, takes the IP address of the HTTP simulator as a domain name response result, and returns the domain name response result to the tested controller through the Ethernet transceiver; the Ethernet transceiver forwards an HTTP request initiated by the tested controller according to the domain name response result to the HTTP simulator; and the HTTP simulator analyzes according to the HTTP request to obtain an HTTP response result, and returns the HTTP response result to the tested controller through the Ethernet transceiver, so that the verification test of the interaction function of the tested controller and the cloud background in the intranet is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the technical field of vehicle networking HIL testing, and in particular to an HTTP interface testing system and method. Background Art

[0002] In the field of vehicle networking single HIL (Hardware-in-the-Loop Testing), for vehicle controllers that need to interact with the Internet through vehicle gateways, if you want to verify the correctness of their interaction functions with the cloud backend, you need to use real vehicle testing, or you need to build a complete network link: vehicle controller, vehicle gateway, cloud backend. Among them, the vehicle controller needs to interact with the domain name resolution server and the cloud backend through the vehicle gateway.

[0003] Since the vehicle gateway is another vehicle controller, and the cloud backend is a server on the Internet, and based on the developer's security and confidentiality requirements, during the test on the developer's intranet, it may not be possible to access the cloud backend on the external network from the intranet, which results in the inability to complete the HIL test. Therefore, it is necessary to simulate the cloud backend in the intranet. Without changing the internal configuration or software of the vehicle controller under test, it is impossible to achieve normal communication between the simulated cloud backend and the vehicle controller under test. In addition, to verify the cloud data uploaded by the vehicle controller under test on the test bench, it is necessary to rely on the real cloud backend for parsing. On the other hand, to enable certain functions of the vehicle controller under test on the test bench for functional testing, it is necessary to issue commands through the real cloud backend. Therefore, before the cloud backend is developed and improved, it is impossible to verify the cloud data and cloud command receiving functions of the vehicle controller under test, thereby affecting the test efficiency. Therefore, how to eliminate the dependence on the real cloud backend in the intranet, so as to realize the verification test of the interaction function between the vehicle controller under test and the cloud backend on the test bench, and thus improve the test efficiency, is a technical problem to be solved by the present invention. Summary of the invention

[0004] In order to solve at least part or all of the above technical problems, an embodiment of the present invention provides an HTTP interface testing system and method to implement verification testing of the interaction function between the tested vehicle controller and the cloud backend in an intranet.

[0005] A first aspect of an embodiment of the present invention provides an HTTP interface test system, the HTTP interface test system comprising at least: a controller under test, an Ethernet transceiver, and a cloud platform simulation unit; the cloud platform simulation unit comprises at least: a domain name resolution simulator and an HTTP simulator; wherein the IP address of the domain name resolution simulator is the IP address of the domain name resolution server configured in the controller under test;

[0006] The Ethernet transceiver is used to receive a domain name resolution request carrying the IP address of the domain name resolution server sent by the controller under test, and send the domain name resolution request to the domain name resolution simulator;

[0007] The domain name resolution simulator is used to perform domain name resolution according to the domain name resolution request, obtain a domain name response result, and return the domain name response result to the controller under test through the Ethernet transceiver, wherein the domain name response result is the IP address of the HTTP simulator;

[0008] The Ethernet transceiver is used to receive the HTTP request initiated by the controller under test according to the domain name response result, and send the HTTP request to the HTTP emulator according to the IP address of the HTTP emulator in the HTTP request;

[0009] The HTTP emulator is used to parse and respond according to the HTTP request to obtain an HTTP response result, and return the HTTP response result to the controller under test through the Ethernet transceiver.

[0010] Optionally, the domain name resolution simulator comprises: a domain name resolution simulation unit and a domain name resolution data response unit; wherein the domain name resolution simulation unit is bound to the IP address of the domain name resolution simulator;

[0011] The domain name resolution simulation unit is used to receive the domain name resolution request forwarded by the Ethernet transceiver, and send the domain name resolution request to the domain name resolution data response unit;

[0012] The domain name resolution data response unit is used to determine the domain name response result according to the domain name resolution request, and return the domain name response result to the domain name resolution simulation unit;

[0013] The domain name resolution simulation unit is used to return the domain name response result to the controller under test through the Ethernet transceiver.

[0014] Optionally, the domain name resolution data response unit stores a plurality of domain name index records mapping the correspondence between domain names and IP addresses, and the IP address in each of the domain name index records is the IP address of the HTTP emulator;

[0015] The domain name resolution data response unit is used to determine the IP address corresponding to the query domain name according to the query domain name in the domain name resolution request and the domain name index record, and return the IP address as the domain name response result to the domain name resolution simulation unit.

[0016] Optionally, the HTTP simulator includes: an HTTP simulation unit and an HTTP data response unit; wherein the HTTP simulation unit is bound to an IP address of the HTTP simulator, and the IP address of the HTTP simulator is the IP address of the vehicle gateway configured in the controller under test;

[0017] The HTTP simulation unit is used to receive the HTTP request forwarded by the Ethernet transceiver, and send the HTTP request to the HTTP data response unit;

[0018] The HTTP data response unit is used to determine the HTTP response result according to the HTTP request, and return the HTTP response result to the HTTP simulation unit;

[0019] The HTTP simulation unit is used to return the HTTP response result to the controller under test through the Ethernet transceiver.

[0020] Optionally, the HTTP data response unit stores a plurality of HTTP response records, and the HTTP response records are corresponding relationships between URL paths and HTTP response data;

[0021] The HTTP data response unit is used to determine the HTTP response data corresponding to the URL path in the HTTP request according to the URL path in the HTTP request and the HTTP response record, and return the HTTP response data as the HTTP response result to the HTTP simulation unit.

[0022] Optionally, the HTTP interface test system further includes: test software, the test software communicates with the cloud platform simulation unit, and the cloud platform simulation unit further includes: a data setting unit;

[0023] The test software is used to send a data setting command to the data setting unit, wherein the data setting command is used to set HTTP response data corresponding to different URL paths;

[0024] The data setting unit is used to monitor the data setting command sent by the test software, and when receiving the data setting command, set the HTTP response record stored in the HTTP data response unit according to the data setting command.

[0025] Optionally, the cloud platform simulation unit further includes: a data acquisition unit;

[0026] The test software is used to send a data acquisition command to the data acquisition unit;

[0027] The data acquisition unit is used to monitor the data acquisition command sent by the test software, and when receiving the data acquisition command, obtain the HTTP request data corresponding to the HTTP request identifier from the HTTP data response unit according to the HTTP request identifier carried in the data acquisition command, and return the HTTP request data to the test software;

[0028] The test software is used to receive the HTTP request data.

[0029] Optionally, when the test software supports secondary development, the cloud platform simulation unit is implemented in the test software.

[0030] Optionally, the HTTP interface test system further includes: a host running the test software, the host including at least a first network card and a second network card;

[0031] The first network card is used to configure the domain name resolution server IP address configured in the controller under test as the IP address of the domain name resolution simulator;

[0032] The second network card is used to configure the IP address of the vehicle gateway configured in the controller under test as the IP address of the HTTP emulator.

[0033] Optionally, the first network card and the second network card are the same network card or two different network cards;

[0034] In the case that the first network card and the second network card are two different network cards, both the first network card and the second network card are connected to the Ethernet transceiver via a network cable.

[0035] Optionally, the Ethernet transceiver is in switch mode, the Ethernet transceiver is connected to the host via a USB cable, and the controller under test and the host are respectively connected to the Ethernet transceiver via network cables.

[0036] A second aspect of an embodiment of the present invention provides an HTTP interface testing method, which is applied to an HTTP interface testing system, wherein the HTTP interface testing system at least includes: a controller under test, an Ethernet transceiver, and a cloud platform simulation unit; the cloud platform simulation unit at least includes: a domain name resolution simulator and an HTTP simulator; wherein the IP address of the domain name resolution simulator is the IP address of the domain name resolution server configured in the controller under test; the HTTP interface testing method includes:

[0037] Receiving, via the Ethernet transceiver, a domain name resolution request carrying the IP address of the domain name resolution server sent by the controller under test, and sending the domain name resolution request to the domain name resolution simulator;

[0038] Perform domain name resolution according to the domain name resolution request through the domain name resolution simulator to obtain a domain name response result, and return the domain name response result to the controller under test through the Ethernet transceiver, wherein the domain name response result is the IP address of the HTTP simulator;

[0039] Receiving, via the Ethernet transceiver, an HTTP request initiated by the controller under test according to the domain name response result, and sending the HTTP request to the HTTP emulator according to the IP address of the HTTP emulator in the HTTP request;

[0040] The HTTP emulator parses and responds according to the HTTP request to obtain an HTTP response result, and returns the HTTP response result to the controller under test through the Ethernet transceiver.

[0041] Optionally, the domain name resolution simulator includes: a domain name resolution simulation unit and a domain name resolution data response unit; wherein the domain name resolution simulation unit is bound to the IP address of the domain name resolution simulator; the “performing domain name resolution according to the domain name resolution request through the domain name resolution simulator to obtain a domain name response result, and returning the domain name response result to the controller under test through the Ethernet transceiver” includes:

[0042] Receiving the domain name resolution request forwarded by the Ethernet transceiver through the domain name resolution simulation unit, and sending the domain name resolution request to the domain name resolution data response unit;

[0043] Determine the domain name response result according to the domain name resolution request through the domain name resolution data response unit, and return the domain name response result to the domain name resolution simulation unit;

[0044] The domain name resolution simulation unit returns the domain name response result to the controller under test through the Ethernet transceiver.

[0045] Optionally, the domain name resolution data response unit stores a plurality of domain name index records that map domain names to IP addresses, and the IP address in each of the domain name index records is the IP address of the HTTP emulator; the above-mentioned “determining the domain name response result according to the domain name resolution request through the domain name resolution data response unit, and returning the domain name response result to the domain name resolution simulation unit” may specifically include:

[0046] Through the domain name resolution data response unit, according to the query domain name in the domain name resolution request, the IP address corresponding to the query domain name is determined according to the domain name index record, and the IP address is returned to the domain name resolution simulation unit as the domain name response result.

[0047] Optionally, the HTTP emulator includes: an HTTP emulation unit and an HTTP data response unit; wherein the HTTP emulation unit is bound to the IP address of the HTTP emulator, and the IP address of the HTTP emulator is the IP address of the vehicle gateway configured in the controller under test; the “parsing and responding according to the HTTP request through the HTTP emulator to obtain an HTTP response result, and returning the HTTP response result to the controller under test through the Ethernet transceiver” includes:

[0048] Receiving the HTTP request forwarded by the Ethernet transceiver through the HTTP simulation unit, and sending the HTTP request to the HTTP data response unit;

[0049] Determine the HTTP response result according to the HTTP request through the HTTP data response unit, and return the HTTP response result to the HTTP simulation unit;

[0050] The HTTP response result is returned to the controller under test through the HTTP simulation unit via the Ethernet transceiver.

[0051] Optionally, the HTTP data response unit stores a plurality of HTTP response records, where the HTTP response record is a correspondence between a URL path and HTTP response data; the above “determining the HTTP response result according to the HTTP request through the HTTP data response unit, and returning the HTTP response result to the HTTP simulation unit” may include:

[0052] The HTTP data response unit determines the HTTP response data corresponding to the URL path in the HTTP request according to the HTTP response record based on the URL path in the HTTP request, and returns the HTTP response data as the HTTP response result to the HTTP simulation unit.

[0053] Optionally, the HTTP interface test system further includes: test software, the test software communicates with the cloud platform simulation unit, and the cloud platform simulation unit further includes: a data setting unit; the method further includes:

[0054] Sending a data setting command to the data setting unit through the test software, wherein the data setting command is used to set HTTP response data corresponding to different URL paths;

[0055] The data setting unit monitors the data setting command sent by the test software, and when the data setting command is received, the HTTP response record stored in the HTTP data response unit is set according to the data setting command.

[0056] Optionally, the cloud platform simulation unit further includes: a data acquisition unit; and the method further includes:

[0057] Sending a data acquisition command to the data acquisition unit through the test software;

[0058] The data acquisition unit monitors the data acquisition command sent by the test software, and when the data acquisition command is received, obtains the HTTP request data corresponding to the HTTP request identifier from the HTTP data response unit according to the HTTP request identifier carried in the data acquisition command, and returns the HTTP request data to the test software;

[0059] The test software is used to receive the HTTP request data.

[0060] Optionally, when the test software supports secondary development, the cloud platform simulation unit is implemented in the test software.

[0061] Optionally, the HTTP interface test system further includes: a host running the test software, the host including at least a first network card and a second network card; the method further includes:

[0062] By means of the first network card, the IP address of the domain name resolution server configured in the controller under test is configured as the IP address of the domain name resolution simulator;

[0063] The IP address of the vehicle gateway configured in the controller under test is configured as the IP address of the HTTP emulator through the second network card.

[0064] Optionally, the first network card and the second network card are the same network card or two different network cards;

[0065] In the case that the first network card and the second network card are two different network cards, both the first network card and the second network card are connected to the Ethernet transceiver via a network cable.

[0066] Optionally, the Ethernet transceiver is in switch mode, the Ethernet transceiver is connected to the host via a USB cable, and the controller under test and the host are respectively connected to the Ethernet transceiver via network cables.

[0067] Through the HTTP interface test system provided in this embodiment, a cloud platform simulation unit is developed to simulate the cloud background to verify the correctness of the interaction function between the vehicle controller under test and the cloud background in the HIL test field. By developing a domain name resolution simulator, the IP address of the domain name resolution simulator is set to the domain name resolution server IP address configured in the controller under test, and all domain name resolution requests initiated by the controller under test through the Ethernet transceiver are responded to as the IP address of the HTTP simulator in the domain name resolution simulator, thereby realizing normal communication between the simulated HTTP simulator and the controller under test, and receiving and responding to any HTTP request initiated by the controller under test to the cloud background in the HTTP simulator, so that the vehicle controller under test does not need to be connected to the real Internet, and the interaction function between the vehicle controller under test and the cloud background can be verified, eliminating the dependence on the real cloud background in the single HIL test stage, and realizing the verification test of the interaction function between the vehicle controller under test and the cloud background on the intranet test bench, reducing the complexity of the test link, and thus improving the test efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0068] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative labor.

[0069] Figure 1 is a structural block diagram of an HTTP interface testing system shown in one embodiment of the present invention;

[0070] Figure 2 It is a schematic diagram of a domain name resolution simulator workflow shown in one embodiment of the present invention;

[0071] Figure 3 It is a schematic diagram of a HTTP emulator workflow shown in one embodiment of the present invention;

[0072] Figure 4 It is an overall system architecture diagram of an HTTP interface testing system shown in one embodiment of the present invention;

[0073] Figure 5 It is a block diagram of the internal implementation of a cloud platform simulation unit shown in one embodiment of the present invention;

[0074] Figure 6 It is a flowchart of the steps of the HTTP interface testing method provided by an embodiment of the present invention;

[0075] Among them, the figure markings are: 1-host running the test software, 2-Ethernet transceiver, 3-USB cable, 4-network cable with interface type T1, 5-network cable with interface type TX, 6-controller under test, 11-cloud platform simulation unit, 111-domain name resolution simulation unit, 112-domain name resolution data response unit, 113-data setting unit, 114-data acquisition unit, 115-HTTP data response unit, 116-HTTP simulation unit, 12-test software, 11-1-domain name resolution simulator, 11-2-HTTP simulator. DETAILED DESCRIPTION

[0076] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0077] refer to Figure 1 , Figure 1 FIG. 1 is a structural block diagram of an HTTP interface testing system according to an embodiment of the present invention. Figure 1 As shown, the HTTP interface test system of this embodiment at least includes: a controller under test 6, an Ethernet transceiver 2, and a cloud platform simulation unit 11; the cloud platform simulation unit 11 at least includes: a domain name resolution simulator 11-1, and an HTTP simulator 11-2. The Ethernet transceiver 2 establishes communication connections with the cloud platform simulation unit 11 and the controller under test 6, respectively, and can communicate through Ethernet messages.

[0078] The Ethernet transceiver 2 is used to receive a domain name resolution request carrying the domain name resolution server IP address sent by the controller under test 6, and send the domain name resolution request to the domain name resolution simulator 11-1.

[0079] In this embodiment, the controller under test is an on-board controller, specifically, an on-board controller used to verify the interactive function with the Internet in the HIL test. The controller under test is itself configured with the IP address of the domain name resolution server in the Internet, so that before accessing the HTTP server in the Internet, the IP address of the corresponding HTTP server is queried in the domain name resolution server through the domain name. In this embodiment, the IP address of the domain name resolution simulator is set to the IP address of the domain name resolution server configured in the controller under test. The controller under test can initiate a domain name resolution request, which carries at least the IP address of the domain name resolution server configured in the controller under test. The Ethernet transceiver receives the domain name resolution request and sends the domain name resolution request to the domain name resolution simulator in the cloud platform simulation unit according to the IP address of the domain name resolution server carried in the domain name resolution request.

[0080] The domain name resolution simulator 11-1 is used to perform domain name resolution according to the domain name resolution request, obtain a domain name response result, and return the domain name response result to the controller under test 6 through the Ethernet transceiver 2. The domain name response result is the IP address of the HTTP simulator.

[0081] In this embodiment, after receiving the domain name resolution request, the domain name resolution simulator can perform domain name resolution on the domain name resolution request, thereby obtaining a corresponding domain name response result, and the domain name response result is the IP address of the HTTP simulator. That is to say, in the domain name resolution simulator, all domain name resolution requests initiated by the controller under test can be responded to as the IP address of the HTTP simulator. After the domain name resolution simulator obtains the domain name response result, it can return the domain name response result to the controller under test through the Ethernet transceiver.

[0082] The Ethernet transceiver 2 is used to receive the HTTP request initiated by the controller under test 6 according to the domain name response result, and send the HTTP request to the HTTP emulator 11-2 according to the IP address of the HTTP emulator 11-2 in the HTTP request.

[0083] In this embodiment, after the controller under test receives the domain name response result, i.e., the IP address of the HTTP emulator, returned by the domain name resolution emulator through the Ethernet transceiver, an HTTP request can be initiated. The HTTP request generated by the controller under test carries the IP address of the HTTP emulator returned by the domain name resolution emulator. After the Ethernet transceiver receives the HTTP request, it can forward the HTTP request to the HTTP emulator according to the IP address of the HTTP emulator written in the HTTP request.

[0084] The HTTP emulator 11 - 2 is used to parse the response according to the HTTP request, obtain an HTTP response result, and return the HTTP response result to the controller under test 6 through the Ethernet transceiver 2 .

[0085] In this embodiment, after the HTTP emulator receives the HTTP request forwarded by the controller under test through the Ethernet transceiver, it can parse and respond to the HTTP request to obtain an HTTP response result, and then return the HTTP response result to the controller under test through the Ethernet transceiver. That is to say, in this embodiment, any HTTP request initiated by the controller under test to the cloud backend is responded to in the HTTP emulator.

[0086] In an optional implementation, during the actual development process, the controller under test can send an HTTP request according to the HTTP data format defined in the interface document, and the cloud platform simulation unit can respond according to the HTTP data format defined in the interface document. This embodiment achieves the purpose of simulating the cloud backend by simultaneously simulating the domain name resolution server and the HTTP server, following the above-mentioned configuration method, and parsing and responding to the data according to the interface document in the HTTP emulator.

[0087] In this embodiment, the cloud backend is simulated by a cloud simulation platform, the domain name resolution server is simulated by a domain name resolution simulator, the HTTP server is simulated by an HTTP simulator, the IP address of the domain name resolution simulator is set to the IP address of the domain name resolution server configured in the controller under test, and all domain name resolution requests initiated by the controller under test are responded to the IP address of the HTTP simulator through the domain name resolution simulator, thereby realizing normal communication between the HTTP simulator simulated in the intranet and the vehicle-mounted controller under test, so that the vehicle-mounted controller under test can complete the verification of the interactive function between the controller under test and the cloud backend without being connected to the real Internet, thereby eliminating the dependence on the real Internet cloud backend, reducing the complexity of the test link, improving the test efficiency, reducing the test cost, and shortening the test cycle; and, since this embodiment no longer relies on the cloud backend on the Internet, the HTTP interface test system of this embodiment can completely carry out test activities on a single host based on the local area network, reducing the risk of leakage that may be caused by the communication between the vehicle-mounted controller and the Internet cloud backend, and complying with information security and confidentiality specifications.

[0088] In combination with the above embodiments, in one implementation, an embodiment of the present invention further provides an HTTP interface test system. In the HTTP interface test system, the domain name resolution simulator includes a domain name resolution simulation unit and a domain name resolution data response unit. The domain name resolution simulation unit is bound to the IP address of the domain name resolution simulator, that is, bound to the IP address of the domain name resolution server configured in the controller under test.

[0089] The domain name resolution simulation unit is used to receive the domain name resolution request forwarded by the Ethernet transceiver, and send the domain name resolution request to the domain name resolution data response unit.

[0090] In this embodiment, the domain name resolution simulation unit waits for the domain name resolution request forwarded by the controller under test through the Ethernet transceiver, and submits the domain name resolution request to the domain name resolution data response unit.

[0091] The domain name resolution data response unit is used to determine the domain name response result according to the domain name resolution request, and return the domain name response result to the domain name resolution simulation unit.

[0092] In this embodiment, after the domain name resolution data response unit receives the domain name resolution request submitted by the domain name resolution simulation unit, it can parse the domain name resolution request, determine the IP address of the HTTP emulator as the domain name response result, and return the domain name response result to the domain name resolution simulation unit.

[0093] The domain name resolution simulation unit is used to return the domain name response result to the controller under test through the Ethernet transceiver.

[0094] In this embodiment, the domain name resolution simulation unit receives the domain name response result returned from the domain name resolution data response unit, and sends the domain name response result to the controller under test through the Ethernet transceiver, thereby completing the domain name query operation.

[0095] In the domain name resolution emulator of this embodiment, specifically, the domain name resolution simulation unit completes the reception of the domain name resolution request and the return of the domain name response result, and the domain name resolution data response unit performs the specific resolution operation of the domain name resolution request, and any domain name resolution request sent by the controller under test is responded to and returned as the IP address of the HTTP emulator.

[0096] In an optional implementation, in the domain name resolution simulation unit, the IP address of the domain name resolution simulator: IP1 and the port number can be bound, and the domain name resolution data response unit callback function can be set. The port number uses the default port number of the domain name resolution protocol, and then the domain name resolution simulator is started.

[0097] In combination with the above embodiments, in one implementation, an embodiment of the present invention further provides an HTTP interface testing system. In the HTTP interface testing system, the domain name resolution data response unit stores a plurality of domain name index records mapping domain names to IP addresses, and the IP address in each of the domain name index records is the IP address of the HTTP emulator.

[0098] In this embodiment, a plurality of domain name index records are stored in the domain name resolution data response unit, and the domain name index record is a record of the corresponding relationship between the mapped domain name and the IP address, and the IP address used in each domain name index record is the IP address of the HTTP emulator. In other words, in the domain name index record, the IP address corresponding to any domain name is the IP address of the HTTP emulator, thereby ensuring that all domain name resolution requests initiated by the controller under test are responded to as the IP address of the HTTP emulator.

[0099] The domain name resolution data response unit is used to determine the IP address corresponding to the query domain name according to the query domain name in the domain name resolution request and the domain name index record, and return the IP address as the domain name response result to the domain name resolution simulation unit.

[0100] In this embodiment, after receiving the domain name resolution request, the domain name resolution data response unit can determine the IP address corresponding to the query domain name based on the query domain name in the domain name resolution request and the stored domain name index record, that is, determine that the IP address corresponding to the query domain name is the IP address of the HTTP emulator, and return the IP address as the domain name response result to the domain name resolution simulation unit.

[0101] That is to say, the domain name resolution data response unit indexes the IP address corresponding to the domain name according to the domain name in the domain name resolution request submitted by the domain name resolution simulation unit, and returns the IP address to the domain name resolution simulation unit. The IP address returned by the domain name resolution data response unit in this embodiment is the IP address of the HTTP simulator, namely IP2.

[0102] In one embodiment, Figure 2 As shown, Figure 2 FIG. 1 is a schematic diagram of a domain name resolution simulator workflow according to an embodiment of the present invention. Figure 2 In the process, before the controller under test sends an HTTP request, it will first send a domain name resolution request message to query the IP address of the HTTP request domain name. The domain name resolution request message is forwarded through the Ethernet transceiver, and the domain name resolution request message is received by the domain name resolution simulation unit, which resolves it into a domain name resolution request object and submits the domain name resolution request object to the domain name resolution data response unit. The domain name resolution data response unit packages the query result into a domain name resolution response object and returns it to the domain name resolution simulation unit. The domain name resolution simulation unit sends the domain name resolution response object, and the domain name resolution response object is in the form of a domain name resolution response message, passes through the Ethernet transceiver, and is finally returned to the controller under test. From then on, the controller under test completes the domain name resolution query action.

[0103] In combination with the above embodiments, in one implementation, an embodiment of the present invention further provides an HTTP interface test system. In the HTTP interface test system, the HTTP emulator includes: an HTTP emulation unit and an HTTP data response unit; wherein the HTTP emulation unit is bound to the IP address of the HTTP emulator, and the IP address of the HTTP emulator is the IP address of the vehicle gateway configured in the controller under test.

[0104] The HTTP simulation unit is used to receive the HTTP request forwarded by the Ethernet transceiver, and send the HTTP request to the HTTP data response unit;

[0105] In this embodiment, the HTTP simulation unit is bound to the IP address of the HTTP simulator, and the IP address of the HTTP simulator is the IP address of the vehicle gateway configured in the controller under test, that is, the HTTP simulation unit is bound to the IP address of the vehicle gateway configured in the controller under test. The HTTP simulation unit waits for the HTTP request forwarded by the controller under test through the Ethernet transceiver, specifically, the HTTP request may include a GET request and a POST request, and submits the HTTP request to the HTTP data response unit.

[0106] The HTTP data response unit is used to determine the HTTP response result according to the HTTP request, and return the HTTP response result to the HTTP simulation unit.

[0107] In this embodiment, after receiving the HTTP request submitted by the HTTP simulation unit, the HTTP data response unit may parse the HTTP request, determine the corresponding HTTP response result, and return the HTTP response result to the HTTP simulation unit.

[0108] The HTTP simulation unit is used to return the HTTP response result to the controller under test through the Ethernet transceiver.

[0109] In this embodiment, the HTTP simulation unit receives the HTTP response result returned from the HTTP data response unit, and sends the HTTP response result to the controller under test through the Ethernet transceiver, thereby completing the HTTP request action.

[0110] In the HTTP emulator of this embodiment, the HTTP simulation unit specifically completes the reception of HTTP requests and the return of HTTP response results, and the HTTP data response unit performs specific response operations on HTTP requests, and responds to any HTTP request sent by the controller under test to obtain and return the HTTP response results.

[0111] In an optional implementation, in the HTTP simulation unit, the IP address of the HTTP simulator: IP2 and the port number can be bound, and the URL path callback function can be set. The HTTP simulator IP address: IP2 is the IP address of the vehicle gateway configured in the controller under test. For the HTTP protocol, the port number is 80, and for the HTTPS protocol, the port number is 443. In addition, for the HTTPS protocol, it is also necessary to set the certificate file in the HTTP simulation unit. The certificate file can be generated by the OpenSSL tool, and finally start running the HTTP simulator.

[0112] In combination with the above embodiments, in one implementation, an embodiment of the present invention further provides an HTTP interface test system. In the HTTP interface test system, the HTTP data response unit stores multiple HTTP response records, and the HTTP response record is a correspondence between a URL path and HTTP response data.

[0113] In this embodiment, the HTTP request carries a URL path, and the HTTP data response unit stores multiple HTTP response records, each HTTP response record is a correspondence between a URL path and an HTTP response, so that different HTTP responses can be obtained for different URL path requests initiated by the controller under test.

[0114] The HTTP data response unit is used to determine the HTTP response data corresponding to the URL path in the HTTP request according to the URL path in the HTTP request and the HTTP response record, and return the HTTP response data as the HTTP response result to the HTTP simulation unit.

[0115] In this embodiment, after the HTTP data response unit obtains the HTTP request, it can parse the URL path in the HTTP request, and based on the URL path and the stored HTTP response record, determine the HTTP response data corresponding to the URL path in the HTTP request, and return the HTTP response data as an HTTP response result to the HTTP simulation unit.

[0116] That is to say, the HTTP data response unit can receive multiple URL paths of HTTP requests initiated by each controller under test. Therefore, in the HTTP data response unit, a callback function corresponding to each URL path is set, the HTTP request is saved in the callback function, the data of the HTTP request is parsed according to the interface document of the project, and the HTTP response that needs to be returned by the URL path is returned according to the interface document of the project. For example, HTTP request 1, HTTP response 1, HTTP request 2, and HTTP response 2 used in the URL path callback function are all global variables and can be accessed from other places in the code.

[0117] Therefore, during the operation of the HTTP simulation unit, if it receives an HTTP request sent by the controller under test through the Ethernet transceiver, and the URL path of the HTTP request is bound to a callback function, it will submit the HTTP request to the corresponding URL path callback function in the HTTP data response unit, and then send the HTTP response returned by the URL path callback function to the controller under test through the Ethernet transceiver.

[0118] In combination with the above embodiments, in one implementation, an embodiment of the present invention further provides an HTTP interface testing system. In the HTTP interface testing system, the HTTP interface testing system further includes: testing software, the testing software communicates with the cloud platform simulation unit, and the cloud platform simulation unit further includes: a data setting unit.

[0119] The test software is used to send a data setting command to the data setting unit, and the data setting command is used to set the HTTP response data corresponding to different URL paths.

[0120] In this embodiment, the test software can communicate with the data setting unit in the cloud platform simulation unit. The user can make any settings for the HTTP response records stored in the HTTP data response unit through the test software. The test software responds to the user's setting operation and sends a data setting command to the data setting unit. The data setting command is used to set the HTTP response data corresponding to different URL paths.

[0121] The data setting unit is used to monitor the data setting command sent by the test software, and when receiving the data setting command, set the HTTP response record stored in the HTTP data response unit according to the data setting command.

[0122] In this embodiment, the data setting unit can monitor the data setting command sent by the test software, and in the case of monitoring the data setting command, set the HTTP response record stored in the HTTP data response unit according to the data setting command. For example, if the data setting unit receives the data setting command 1 and data of the test software, the data of HTTP response 1 is set; if the data setting command 2 and data of the test software are received, the data of HTTP response 2 is set; there can be multiple such operations.

[0123] In this embodiment, the data setting unit communicates with the test software and receives the data setting command and data of the test software to achieve the purpose of changing the HTTP response data corresponding to different URL paths and simulating various test conditions. That is to say, in this embodiment, any data can be assigned to the HTTP response data in the test software, so various test conditions can be simulated, the functional test coverage is improved, and the development of automated functional tests can be more easily realized in the test software.

[0124] In combination with the above embodiments, in one implementation, an embodiment of the present invention further provides an HTTP interface testing system. In the HTTP interface testing system, the cloud platform simulation unit further includes: a data acquisition unit.

[0125] The test software is used to send a data acquisition command to the data acquisition unit.

[0126] In this embodiment, the test software can communicate with the data acquisition unit in the cloud platform simulation unit, and the user can view the HTTP request data in the test software through the test software. The test software responds to the user's acquisition operation and sends a data acquisition command to the data acquisition unit.

[0127] The data acquisition unit is used to listen to the data acquisition command sent by the test software, and when receiving the data acquisition command, obtain the HTTP request data corresponding to the HTTP request identifier from the HTTP data response unit according to the HTTP request identifier carried in the data acquisition command, and return the HTTP request data to the test software.

[0128] In this embodiment, the data setting unit can monitor the data acquisition command sent by the test software, and when the data acquisition command is monitored, that is, when the data acquisition command is received, the HTTP request data corresponding to the HTTP request identifier is obtained from the HTTP data response unit according to the HTTP request identifier carried in the data acquisition command, and the HTTP request data is returned to the test software.

[0129] For example, the data acquisition unit listens to the data acquisition command sent by the test software and performs event response. If the test software receives data acquisition command 1, then according to the identifier of HTTP request 1 carried in the data acquisition command 1, the data of HTTP request 1 corresponding to the identifier of HTTP request 1 is obtained from the data response unit and sent to the test software; if the test software receives data acquisition command 2, then according to the identifier of HTTP request 2 carried in the data acquisition command 2, the data of HTTP request 2 corresponding to the identifier of HTTP request 2 is obtained from the data response unit and sent to the test software. There can be multiple such operations.

[0130] The test software is used to receive the HTTP request data.

[0131] In this embodiment, the test software may receive HTTP request data returned by the data acquisition unit. It should be noted that the HTTP request data is relevant data carried by the HTTP request sent by the controller under test.

[0132] In the related art, it is necessary to rely on the cloud backend on the Internet to view data and interact with the vehicle controller. In this embodiment, the data acquisition unit can communicate with the test software, receive the data acquisition command of the test software, and send data to the test software, so as to achieve the purpose of viewing HTTP request data in the test software and perform data analysis. In this way, the difficulty of error troubleshooting is reduced, and the dependence on the cloud backend and vehicle gateway in the single HIL test stage is eliminated.

[0133] In one embodiment, Figure 3 As shown, Figure 3 FIG. 1 is a schematic diagram of a HTTP simulator workflow according to an embodiment of the present invention. Figure 3 In the code, the controller under test initiates an HTTP request, which is forwarded through the Ethernet transceiver in the form of an HTTP request message, received by the host's network card, and submitted to the HTTP simulation unit. After receiving the HTTP request message, the HTTP simulation unit parses the URL path, generates an HTTP request object and submits the HTTP request object to the HTTP data response unit. The HTTP data response unit returns the HTTP response object corresponding to the HTTP request object. After receiving the HTTP response object, the HTTP simulation unit sends it out. The HTTP response object is forwarded through the host's network card and Ethernet transceiver in the form of an HTTP response message, and finally returned to the controller under test. From then on, the controller under test completes the HTTP request action.

[0134] Furthermore, after the HTTP data response unit obtains the HTTP request object, the global HTTP data request object can be shared with the data acquisition unit, so that when the test software sends a data acquisition request, the data acquisition unit returns the global HTTP data request object to the test software, so that the test software can obtain the global HTTP data request object. After the test software sets the data of the global HTTP response object, the test software can send the set data of the global HTTP response object to the data setting unit, so that the data setting unit shares the data of the global HTTP response object with the HTTP data response unit.

[0135] In combination with the above embodiments, in one implementation, an embodiment of the present invention further provides an HTTP interface testing system. In the HTTP interface testing system, when the testing software supports secondary development, the cloud platform simulation unit can be directly implemented in the testing software.

[0136] In combination with the above embodiments, in one implementation, an embodiment of the present invention further provides an HTTP interface testing system. In the HTTP interface testing system, the HTTP interface testing system further includes: a host running the testing software, the host at least including a first network card and a second network card.

[0137] The first network card is used to configure the domain name resolution server IP address configured in the controller under test as the IP address of the domain name resolution simulator;

[0138] The second network card is used to configure the IP address of the vehicle gateway configured in the controller under test as the IP address of the HTTP emulator.

[0139] In this embodiment, the IP address of the domain name resolution simulator: IP1 and the mask are configured on the first network card of the host running the test software, and the IP address of the HTTP simulator: IP2 and the mask are configured on the second network card of the host running the test software. Among them, the IP address of the domain name resolution simulator: IP1 is the IP address of the domain name resolution server configured in the controller under test, and the IP address of the HTTP simulator: IP2 is the IP address of the vehicle gateway configured in the controller under test.

[0140] Further, in an optional embodiment, the first network card and the second network card are the same network card or two different network cards. That is to say, the above IP1 and the above IP2 can be configured on two different network cards of the above host, or can be configured on the same host network card. And in the case where the first network card and the second network card are two different network cards, both the first network card and the second network card need to be connected to the Ethernet transceiver through a network cable.

[0141] In combination with the above embodiments, in an optional implementation manner, the controller under test forwards the domain name resolution request in the form of a domain name resolution request message through an Ethernet transceiver, which is received by the first network card of the host, so that the domain name resolution simulation unit receives the domain name resolution request message; and the domain name resolution simulation unit returns the domain name response object in the form of a domain name resolution response message through the second network card of the host, through the Ethernet transceiver, and finally to the controller under test.

[0142] In combination with the above embodiments, in one implementation, an embodiment of the present invention further provides an HTTP interface test system. In the HTTP interface test system, the Ethernet transceiver is in switch mode, the Ethernet transceiver is connected to the host via a USB cable, and the controller under test and the host are respectively connected to the Ethernet transceiver via a network cable.

[0143] In this embodiment, the Ethernet transceiver is a switch, and the Ethernet transceiver is connected to the host via a USB cable. The controller under test and the Ethernet transceiver, the host and the Ethernet transceiver are connected to form a closed-loop hardware path through a harness and a network cable respectively. Among them, the Ethernet transceiver is connected to the host via a USB cable mainly to communicate with the test software on the host, and the Ethernet transceiver is connected to the host via a network cable mainly to communicate with the cloud platform simulation unit on the host.

[0144] In another embodiment, if Figure 4 As shown, Figure 4 It is an overall system architecture diagram of an HTTP interface test system shown in an embodiment of the present invention. The HTTP interface test system of this embodiment includes: a controller under test 6, an Ethernet transceiver 2, a test software 12, a host 1 running the test software, and a cloud platform simulation unit 11 implemented by code. The cloud platform simulation unit 11 includes: a domain name resolution simulation unit 111, a domain name resolution data response unit 112, an HTTP simulation unit 116, an HTTP data response unit 115, a data setting unit 113, and a data acquisition unit 114.

[0145] Among them, the Ethernet transceiver 2 is a switch, and the Ethernet transceiver 2 is connected to the host 1 running the test software through a USB cable 3. The controller under test 6 and the host 1 running the test software are respectively connected to the Ethernet transceiver 2 through a 4-interface type T1 network cable and a 5-interface type TX network cable, thereby communicating through Ethernet messages.

[0146] In another embodiment, if Figure 5 As shown, Figure 5 This is a block diagram of an internal implementation of a cloud platform simulation unit shown in one embodiment of the present invention. Figure 5In the test bench, the Ethernet transceiver is in switch mode, and the Ethernet transceiver is connected to the host via a USB cable. The controller under test and the Ethernet transceiver, the host and the Ethernet transceiver are connected to form a closed-loop hardware path through a harness and a network cable respectively. The on-board controller (i.e., the controller under test 6) is provided with the IP address of the domain name resolution server (DNS server): IP1 and the IP address of the on-board gateway: IP2. And the IP address (IP1) and mask of the domain name resolution simulator are configured in the network card of the host, and the IP address (IP2) and mask of the HTTP simulator are configured.

[0147] In the domain name resolution simulation unit, bind the IP address of the domain name resolution simulator: IP1 and the port number, set the domain name resolution data response unit callback function, use the default port number of the domain name resolution protocol for the port number, and finally start running the domain name resolution simulator.

[0148] The domain name resolution data response unit indexes the IP address corresponding to the domain name according to the domain name in the domain name resolution request submitted by the domain name resolution simulation unit, and returns the IP address to the domain name resolution simulation unit. The IP address returned by the domain name resolution data response unit in the present invention is the IP address of the HTTP simulator, namely IP2.

[0149] In the HTTP simulation unit, bind the HTTP simulator IP address: IP2 and port number, and set the URL path callback function. HTTP simulator IP address: IP2 is the vehicle gateway IP configured in the controller under test. For the HTTP protocol, the port number is 80, and for the HTTPS protocol, the port number is 443. In addition, for the HTTPS protocol, you also need to set the certificate file, which can be generated by the OpenSSL tool, and finally start running the HTTP simulator.

[0150] In the HTTP data response unit, a callback function corresponding to each URL path is set. The HTTP request is saved in the callback function, the request data is parsed according to the project's interface document, and the HTTP response required to be returned by the URL path is returned according to the project's interface document. The HTTP request 1, HTTP response 1, HTTP request 2, and HTTP response 2 used in the URL path callback function are all global variables and can be accessed from other places in the code.

[0151] In the data acquisition unit, the acquisition command sent by the test software is monitored and event response is performed. If the acquisition command 1 of the test software is received, the data of HTTP request 1 is sent to the test software, and if the acquisition command 2 of the test software is received, the data of HTTP request 2 is sent to the test software.

[0152] In the data setting unit, the setting command sent by the test software is monitored and event response is performed. If the setting command 1 and data of the test software are received, the data of HTTP response 1 is set; if the setting command 2 and data of the test software are received, the data of HTTP response 2 is set.

[0153] In this embodiment, by simulating the domain name resolution server and the HTTP server, the purpose of simulating the cloud background in the intranet is achieved, and the normal communication between the simulated cloud background and the vehicle controller under test is realized, thereby eliminating the dependence on the vehicle gateway and the Internet cloud background, reducing the test cost, and shortening the test cycle. In the test software, any data can be assigned to the data of the HTTP response, so various test conditions can be simulated, the functional test coverage is improved, and the development of automated functional tests can be more easily realized in the test software. In addition, this embodiment no longer relies on the cloud background on the Internet, so the technology described in the present invention can completely carry out test activities based on a single host in the local area network, reducing the company's risk of leakage caused by the communication between the vehicle controller and the Internet cloud background, and complying with the company's information security and confidentiality specifications.

[0154] Based on the same inventive concept, an embodiment of the present invention provides an HTTP interface testing method. Figure 6 , Figure 6 1 is a flowchart of the steps of the HTTP interface testing method provided by an embodiment of the present invention. Figure 6 As shown, the method is applied to an HTTP interface test system, the HTTP interface test system at least includes: a controller under test, an Ethernet transceiver, and a cloud platform simulation unit; the cloud platform simulation unit at least includes: a domain name resolution simulator and an HTTP simulator; wherein the IP address of the domain name resolution simulator is the IP address of the domain name resolution server configured in the controller under test; the HTTP interface test method includes:

[0155] Step S61: receiving, through the Ethernet transceiver, a domain name resolution request carrying the IP address of the domain name resolution server sent by the controller under test, and sending the domain name resolution request to the domain name resolution simulator;

[0156] Step S62: performing domain name resolution according to the domain name resolution request through the domain name resolution simulator to obtain a domain name response result, and returning the domain name response result to the controller under test through the Ethernet transceiver, wherein the domain name response result is the IP address of the HTTP simulator;

[0157] Step S63: receiving, through the Ethernet transceiver, an HTTP request initiated by the controller under test according to the domain name response result, and sending the HTTP request to the HTTP emulator according to the IP address of the HTTP emulator in the HTTP request;

[0158] Step S64: parsing the response according to the HTTP request through the HTTP simulator to obtain an HTTP response result, and returning the HTTP response result to the controller under test through the Ethernet transceiver.

[0159] Optionally, the domain name resolution simulator includes: a domain name resolution simulation unit and a domain name resolution data response unit; wherein the domain name resolution simulation unit is bound to the IP address of the domain name resolution simulator; the above step S62 may specifically include:

[0160] Receiving the domain name resolution request forwarded by the Ethernet transceiver through the domain name resolution simulation unit, and sending the domain name resolution request to the domain name resolution data response unit;

[0161] Determine the domain name response result according to the domain name resolution request through the domain name resolution data response unit, and return the domain name response result to the domain name resolution simulation unit;

[0162] The domain name resolution simulation unit returns the domain name response result to the controller under test through the Ethernet transceiver.

[0163] Optionally, the domain name resolution data response unit stores a plurality of domain name index records that map domain names to IP addresses, and the IP address in each of the domain name index records is the IP address of the HTTP emulator; the above-mentioned “determining the domain name response result according to the domain name resolution request through the domain name resolution data response unit, and returning the domain name response result to the domain name resolution simulation unit” may specifically include:

[0164] Through the domain name resolution data response unit, according to the query domain name in the domain name resolution request, the IP address corresponding to the query domain name is determined according to the domain name index record, and the IP address is returned to the domain name resolution simulation unit as the domain name response result.

[0165] Optionally, the HTTP simulator includes: an HTTP simulation unit and an HTTP data response unit; wherein the HTTP simulation unit is bound to an IP address of the HTTP simulator, and the IP address of the HTTP simulator is the IP address of the vehicle gateway configured in the controller under test; the above step S64 may include:

[0166] Receiving the HTTP request forwarded by the Ethernet transceiver through the HTTP simulation unit, and sending the HTTP request to the HTTP data response unit;

[0167] Determine the HTTP response result according to the HTTP request through the HTTP data response unit, and return the HTTP response result to the HTTP simulation unit;

[0168] The HTTP response result is returned to the controller under test through the HTTP simulation unit via the Ethernet transceiver.

[0169] Optionally, the HTTP data response unit stores a plurality of HTTP response records, where the HTTP response record is a correspondence between a URL path and HTTP response data; the above “determining the HTTP response result according to the HTTP request through the HTTP data response unit, and returning the HTTP response result to the HTTP simulation unit” may include:

[0170] The HTTP data response unit determines the HTTP response data corresponding to the URL path in the HTTP request according to the HTTP response record based on the URL path in the HTTP request, and returns the HTTP response data as the HTTP response result to the HTTP simulation unit.

[0171] Optionally, the HTTP interface test system further includes: test software, the test software communicates with the cloud platform simulation unit, and the cloud platform simulation unit further includes: a data setting unit; the method further includes:

[0172] Sending a data setting command to the data setting unit through the test software, wherein the data setting command is used to set HTTP response data corresponding to different URL paths;

[0173] The data setting unit monitors the data setting command sent by the test software, and when the data setting command is received, the HTTP response record stored in the HTTP data response unit is set according to the data setting command.

[0174] Optionally, the cloud platform simulation unit further includes: a data acquisition unit; and the method further includes:

[0175] Sending a data acquisition command to the data acquisition unit through the test software;

[0176] The data acquisition unit monitors the data acquisition command sent by the test software, and when the data acquisition command is received, obtains the HTTP request data corresponding to the HTTP request identifier from the HTTP data response unit according to the HTTP request identifier carried in the data acquisition command, and returns the HTTP request data to the test software;

[0177] The test software is used to receive the HTTP request data.

[0178] Optionally, when the test software supports secondary development, the cloud platform simulation unit is implemented in the test software.

[0179] Optionally, the HTTP interface test system further includes: a host running the test software, the host including at least a first network card and a second network card; the method further includes:

[0180] By means of the first network card, the IP address of the domain name resolution server configured in the controller under test is configured as the IP address of the domain name resolution simulator;

[0181] The IP address of the vehicle gateway configured in the controller under test is configured as the IP address of the HTTP emulator through the second network card.

[0182] Optionally, the first network card and the second network card are the same network card or two different network cards;

[0183] In the case that the first network card and the second network card are two different network cards, both the first network card and the second network card are connected to the Ethernet transceiver via a network cable.

[0184] Optionally, the Ethernet transceiver is in switch mode, the Ethernet transceiver is connected to the host via a USB cable, and the controller under test and the host are respectively connected to the Ethernet transceiver via network cables.

[0185] It should be noted that, for the sake of simplicity, the method embodiments are described as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present invention are not limited by the order of the actions described, because according to the embodiments of the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present invention.

[0186] As for the method embodiment, since it is basically similar to the system embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the system embodiment.

[0187] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

[0188] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present invention.

[0189] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.

[0190] The HTTP interface testing system and method provided by the present invention are introduced in detail above. The principle and implementation mode of the present invention are explained by using specific examples in this article. The description of the above embodiments is only used to help understand the method and core idea of ​​the present invention. At the same time, for those skilled in the art, according to the idea of ​​the present invention, there will be changes in the specific implementation mode and application scope. In summary, the content of this specification should not be understood as limiting the present invention.

Claims

1. An HTTP interface testing system, characterized in that: The HTTP interface test system at least includes: a controller under test, an Ethernet transceiver, and a cloud platform simulation unit; the cloud platform simulation unit at least includes: a domain name resolution simulator and an HTTP simulator; wherein the IP address of the domain name resolution simulator is the IP address of the domain name resolution server configured in the controller under test; The Ethernet transceiver is used to receive a domain name resolution request carrying the IP address of the domain name resolution server sent by the controller under test, and send the domain name resolution request to the domain name resolution simulator; The domain name resolution simulator is used to perform domain name resolution according to the domain name resolution request, obtain a domain name response result, and return the domain name response result to the controller under test through the Ethernet transceiver, wherein the domain name response result is the IP address of the HTTP simulator; The Ethernet transceiver is used to receive the HTTP request initiated by the controller under test according to the domain name response result, and send the HTTP request to the HTTP emulator according to the IP address of the HTTP emulator in the HTTP request; The HTTP emulator is used to parse and respond according to the HTTP request to obtain an HTTP response result, and return the HTTP response result to the controller under test through the Ethernet transceiver.

2. The HTTP interface testing system according to claim 1, characterized in that: The domain name resolution simulator comprises: a domain name resolution simulation unit and a domain name resolution data response unit; wherein the domain name resolution simulation unit is bound to the IP address of the domain name resolution simulator; The domain name resolution simulation unit is used to receive the domain name resolution request forwarded by the Ethernet transceiver, and send the domain name resolution request to the domain name resolution data response unit; The domain name resolution data response unit is used to determine the domain name response result according to the domain name resolution request, and return the domain name response result to the domain name resolution simulation unit; The domain name resolution simulation unit is used to return the domain name response result to the controller under test through the Ethernet transceiver.

3. The HTTP interface testing system according to claim 2, characterized in that: The domain name resolution data response unit stores a plurality of domain name index records that map the corresponding relationship between domain names and IP addresses, and the IP address in each of the domain name index records is the IP address of the HTTP emulator; The domain name resolution data response unit is used to determine the IP address corresponding to the query domain name according to the query domain name in the domain name resolution request and the domain name index record, and return the IP address as the domain name response result to the domain name resolution simulation unit.

4. The HTTP interface testing system according to claim 1, characterized in that: The HTTP simulator comprises: an HTTP simulation unit and an HTTP data response unit; wherein the HTTP simulation unit is bound to an IP address of the HTTP simulator, and the IP address of the HTTP simulator is the IP address of the vehicle gateway configured in the controller under test; The HTTP simulation unit is used to receive the HTTP request forwarded by the Ethernet transceiver, and send the HTTP request to the HTTP data response unit; The HTTP data response unit is used to determine the HTTP response result according to the HTTP request, and return the HTTP response result to the HTTP simulation unit; The HTTP simulation unit is used to return the HTTP response result to the controller under test through the Ethernet transceiver.

5. The HTTP interface testing system according to claim 4, characterized in that: The HTTP data response unit stores a plurality of HTTP response records, wherein the HTTP response record is a correspondence between a URL path and HTTP response data; The HTTP data response unit is used to determine the HTTP response data corresponding to the URL path in the HTTP request according to the URL path in the HTTP request and the HTTP response record, and return the HTTP response data as the HTTP response result to the HTTP simulation unit.

6. The HTTP interface testing system according to claim 5, characterized in that: The HTTP interface testing system further includes: testing software, the testing software and the cloud platform simulation unit communicate with each other, and the cloud platform simulation unit further includes: a data setting unit; The test software is used to send a data setting command to the data setting unit, wherein the data setting command is used to set HTTP response data corresponding to different URL paths; The data setting unit is used to monitor the data setting command sent by the test software, and when receiving the data setting command, set the HTTP response record stored in the HTTP data response unit according to the data setting command.

7. The HTTP interface testing system according to claim 6, characterized in that: The cloud platform simulation unit also includes: a data acquisition unit; The test software is used to send a data acquisition command to the data acquisition unit; The data acquisition unit is used to monitor the data acquisition command sent by the test software, and when receiving the data acquisition command, obtain the HTTP request data corresponding to the HTTP request identifier from the HTTP data response unit according to the HTTP request identifier carried in the data acquisition command, and return the HTTP request data to the test software; The test software is used to receive the HTTP request data.

8. The HTTP interface testing system according to claim 6, characterized in that: In the case where the test software supports secondary development, the cloud platform simulation unit is implemented in the test software.

9. The HTTP interface testing system according to claim 6, characterized in that: The HTTP interface testing system further comprises: a host running the testing software, the host comprising at least a first network card and a second network card; The first network card is used to configure the domain name resolution server IP address configured in the controller under test as the IP address of the domain name resolution simulator; The second network card is used to configure the IP address of the vehicle gateway configured in the controller under test as the IP address of the HTTP emulator.

10. The HTTP interface testing system according to claim 9, characterized in that: The first network card and the second network card are the same network card or two different network cards; In the case that the first network card and the second network card are two different network cards, both the first network card and the second network card are connected to the Ethernet transceiver via a network cable.

11. The HTTP interface testing system according to claim 9, characterized in that: The Ethernet transceiver is in switch mode, the Ethernet transceiver is connected to the host via a USB cable, and the controller under test and the host are respectively connected to the Ethernet transceiver via network cables.

12. A HTTP interface testing method, characterized in that: Applied to an HTTP interface test system, the HTTP interface test system at least includes: a controller under test, an Ethernet transceiver, and a cloud platform simulation unit; the cloud platform simulation unit at least includes: a domain name resolution simulator and an HTTP simulator; wherein the IP address of the domain name resolution simulator is the IP address of the domain name resolution server configured in the controller under test; the HTTP interface test method includes: Receiving, via the Ethernet transceiver, a domain name resolution request carrying the IP address of the domain name resolution server sent by the controller under test, and sending the domain name resolution request to the domain name resolution simulator; Perform domain name resolution according to the domain name resolution request through the domain name resolution simulator to obtain a domain name response result, and return the domain name response result to the controller under test through the Ethernet transceiver, wherein the domain name response result is the IP address of the HTTP simulator; Receiving, via the Ethernet transceiver, an HTTP request initiated by the controller under test according to the domain name response result, and sending the HTTP request to the HTTP emulator according to the IP address of the HTTP emulator in the HTTP request; The HTTP emulator parses and responds according to the HTTP request to obtain an HTTP response result, and returns the HTTP response result to the controller under test through the Ethernet transceiver.

13. The HTTP interface testing method according to claim 12, characterized in that: The domain name resolution simulator comprises: a domain name resolution simulation unit and a domain name resolution data response unit; wherein the domain name resolution simulation unit is bound to the IP address of the domain name resolution simulator; the domain name resolution is performed according to the domain name resolution request by the domain name resolution simulator to obtain a domain name response result, and the domain name response result is returned to the controller under test through the Ethernet transceiver, including: Receiving the domain name resolution request forwarded by the Ethernet transceiver through the domain name resolution simulation unit, and sending the domain name resolution request to the domain name resolution data response unit; Determine the domain name response result according to the domain name resolution request through the domain name resolution data response unit, and return the domain name response result to the domain name resolution simulation unit; The domain name resolution simulation unit returns the domain name response result to the controller under test through the Ethernet transceiver.

14. The HTTP interface testing method according to claim 12, characterized in that: The HTTP simulator comprises: an HTTP simulation unit and an HTTP data response unit; wherein the HTTP simulation unit is bound to the IP address of the HTTP simulator, and the IP address of the HTTP simulator is the IP address of the vehicle gateway configured in the controller under test; the HTTP simulator is used to parse and respond according to the HTTP request to obtain an HTTP response result, and the HTTP response result is returned to the controller under test through the Ethernet transceiver, including: Receiving the HTTP request forwarded by the Ethernet transceiver through the HTTP simulation unit, and sending the HTTP request to the HTTP data response unit; Determine the HTTP response result according to the HTTP request through the HTTP data response unit, and return the HTTP response result to the HTTP simulation unit; The HTTP response result is returned to the controller under test through the HTTP simulation unit via the Ethernet transceiver.

Citation Information

Patent Citations

  • Full-load testing method and system for network hard disk

    CN104125288A

  • Vehicle charging communication test method, network equipment and vehicle charging communication test system

    CN106506281A

  • Testing method of network application interface, device and electronic equipment

    CN107171889A

  • Distribution network terminal communication test system and method based on dynamic domain name resolution

    CN110830602A

  • Data processing method and device, electronic equipment and storage medium

    CN112040027A