An HTTP interface testing system and method

By using the domain name resolution simulator and HTTP simulator in the HTTP interface testing system to simulate the cloud backend, the problem of intranet and extranet isolation in vehicle networking HIL testing was solved, and the verification test of the interaction function between the vehicle controller and the cloud backend was realized, which improved the testing efficiency and reduced the risk.

CN119788555BActive Publication Date: 2025-10-17CHONGQING CHANGAN AUTOMOBILE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

In the HIL testing of the Internet of Vehicles, the verification test of the interaction function between the on-board controller and the cloud backend is limited by the isolation between the intranet and the external network. It is impossible to simulate the cloud backend on the intranet, resulting in low testing efficiency.

Method used

The system is tested via an HTTP interface. A domain name resolution simulator and an HTTP simulator are used to simulate a cloud backend. The IP address of the domain name resolution simulator is set to the IP address of the domain name resolution server of the controller under test, so as to realize normal communication between the controller under test and the HTTP simulator in the intranet and simulate the cloud backend responding to HTTP requests.

Benefits of technology

In an intranet environment, the verification test of the interaction function between the vehicle controller under test and the cloud backend was realized, which reduced the complexity of the test link, improved the test efficiency, reduced the dependence on the real cloud backend, and reduced the risk of leakage.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119788555B_ABST
    Figure CN119788555B_ABST
Patent Text Reader

Abstract

The embodiment of the application provides a kind of HTTP interface test system and method, it is related to vehicle networking HIL test technical field.The system at least includes: the controller to be measured, ethernet transceiver, domain name resolution simulator, HTTP simulator;Ethernet transceiver forwards the domain name resolution request carrying domain name resolution server IP address sent by the controller to be measured to domain name resolution simulator;Domain name resolution simulator is parsed according to domain name resolution request, the IP address of HTTP simulator is regarded as domain name response result, is returned to the controller to be measured by ethernet transceiver;Ethernet transceiver forwards the HTTP request initiated according to domain name response result by the controller to be measured to HTTP simulator;HTTP simulator is parsed according to HTTP request and obtains HTTP response result, is returned to the controller to be measured by ethernet transceiver, to achieve the verification test of the interactive function of the controller to be measured in intranet and cloud backstage.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The embodiment of the present application relates to the technical field of Internet of Vehicles HIL testing, in particular to an HTTP interface testing system and method. BACKGROUND

[0002] In the field of Internet of Vehicles single HIL (Hardware-in-the-Loop Testing, hardware-in-the-loop testing) testing, for a vehicle-mounted controller which needs to interact with the Internet through a vehicle-mounted gateway, if the correctness of the interaction function with the cloud background needs to be verified, a real vehicle test needs to be used, or a complete networking link needs to be built: vehicle-mounted controller, vehicle-mounted gateway, cloud background. Among them, the vehicle-mounted controller needs to interact with the domain name resolution server and the cloud background through the vehicle-mounted gateway.

[0003] Since the vehicle-mounted gateway is another vehicle-mounted controller, and the cloud background is a server on the Internet, and based on the security and privacy requirements of the development party, in the process of testing in the development party's intranet, the cloud background on the extranet may not be accessed from the intranet, thereby causing the HIL testing work to be unable to be completed, and therefore it is necessary to simulate the cloud background in the intranet, and under the premise that the internal configuration or software of the tested vehicle-mounted controller is not changed, the simulated cloud background and the tested vehicle-mounted controller cannot be normally communicated. In addition, verifying the cloud data uploaded by the tested vehicle-mounted controller on the test bench needs to rely on the real cloud background for analysis, and on the other hand, starting some functions of the tested vehicle-mounted controller on the test bench to perform function testing needs to issue commands through the real cloud background, and therefore before the cloud background is developed and improved, the cloud data uploaded by the tested vehicle-mounted controller and the cloud command receiving function cannot be verified, thereby affecting the testing efficiency. Therefore, how to eliminate the dependence on the real cloud background in the intranet, so as to realize the verification and testing of the interaction function of the tested vehicle-mounted controller and the cloud background on the test bench, and thereby improve the testing efficiency, is a technical problem to be solved by the present application. SUMMARY

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

[0005] The first aspect of the embodiment of the present application provides an HTTP interface testing system, which at least comprises: a tested controller, an Ethernet transceiver, a cloud platform simulation unit; the cloud platform simulation unit at least comprises: a domain name resolution simulator, an HTTP simulator; wherein the IP address of the domain name resolution simulator is the domain name resolution server IP address configured in the tested controller;

[0006] The Ethernet transceiver is configured 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 emulator.

[0007] The domain name resolution emulator is configured 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, the domain name response result being the IP address of the HTTP emulator.

[0008] The Ethernet transceiver is configured to receive an 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 configured to perform analysis and response according to the HTTP request, 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 emulator comprises a domain name resolution emulation unit and a domain name resolution data response unit, wherein the domain name resolution emulation unit is bound with the IP address of the domain name resolution emulator.

[0011] The domain name resolution emulation unit is configured 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 configured 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 emulation unit.

[0013] The domain name resolution emulation unit is configured 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 of mapping domain names and IP addresses, and the IP address in each domain name index record is the IP address of the HTTP emulator.

[0015] The domain name resolution data response unit is configured 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 emulation unit.

[0016] Optionally, the HTTP emulator comprises an HTTP simulation unit and an HTTP data response unit; the HTTP simulation unit is bound with an IP address of the HTTP emulator, and the IP address of the HTTP emulator is an IP address of a vehicle gateway configured in the controller under test;

[0017] The HTTP simulation unit is configured 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 configured 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 configured 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 record is a corresponding relationship between a URL path and HTTP response data.

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

[0022] Optionally, the HTTP interface test system further comprises a test software, the test software and the cloud platform simulation unit communicate with each other, and the cloud platform simulation unit further comprises a data setting unit.

[0023] The test software is configured 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.

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

[0025] Optionally, the cloud platform simulation unit further comprises a data acquisition unit.

[0026] The test software is configured to send a data acquisition command to the data acquisition unit.

[0027] The data acquisition unit is configured to listen to the data acquisition command sent by the test software, and in the case that the data acquisition command is received, acquire 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 configured to receive the HTTP request data.

[0029] Optionally, in the case that 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 comprises a host running the test software, and the host comprises at least a first network card and a second network card.

[0031] The first network card is configured to configure the domain name resolution server IP address configured in the measured controller as the IP address of the domain name resolution simulator.

[0032] The second network card is configured to configure the IP address of the vehicle-mounted gateway configured in the measured controller as the IP address of the HTTP simulator.

[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, the first network card and the second network card are both connected to the Ethernet transceiver through a network cable.

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

[0036] The second aspect of the embodiment of the application provides an HTTP interface test method applied to an HTTP interface test system, the HTTP interface test system at least comprising a measured controller, an Ethernet transceiver and a cloud platform simulation unit, the cloud platform simulation unit at least comprising a domain name resolution simulator and an HTTP simulator, wherein the IP address of the domain name resolution simulator is the domain name resolution server IP address configured in the measured controller, and the HTTP interface test method comprises the following steps:

[0037] The domain name resolution request sent by the measured controller and carrying the domain name resolution server IP address is received through the Ethernet transceiver, and the domain name resolution request is sent to the domain name resolution simulator.

[0038] The domain name resolution emulator resolves the domain name according to the domain name resolution request, obtains a domain name response result, and returns the domain name response result to the measured controller through the Ethernet transceiver, the domain name response result being an IP address of the HTTP emulator;

[0039] The Ethernet transceiver receives an HTTP request initiated by the measured controller according to the domain name response result, and sends the HTTP request to the HTTP emulator according to the IP address of the HTTP emulator in the HTTP request;

[0040] The HTTP emulator resolves the HTTP request according to the HTTP request, obtains an HTTP response result, and returns the HTTP response result to the measured controller through the Ethernet transceiver.

[0041] Optionally, the domain name resolution emulator comprises a domain name resolution emulation unit and a domain name resolution data response unit; the domain name resolution emulation unit is bound with an IP address of the domain name resolution emulator; the "the domain name resolution emulator resolves the domain name according to the domain name resolution request, obtains a domain name response result, and returns the domain name response result to the measured controller through the Ethernet transceiver" comprises:

[0042] The domain name resolution emulation unit receives the domain name resolution request forwarded by the Ethernet transceiver, and sends the domain name resolution request to the domain name resolution data response unit;

[0043] The domain name resolution data response unit determines the domain name response result according to the domain name resolution request, and returns the domain name response result to the domain name resolution emulation unit;

[0044] The domain name resolution emulation unit returns the domain name response result to the measured controller through the Ethernet transceiver.

[0045] Optionally, the domain name resolution data response unit stores a plurality of domain name index records of mapping domain names and IP addresses; the IP address in each domain name index record is an IP address of the HTTP emulator; the "the domain name resolution data response unit determines the domain name response result according to the domain name resolution request, and returns the domain name response result to the domain name resolution emulation unit" can specifically comprise:

[0046] The domain name resolution data response unit determines an IP address corresponding to the query domain name according to the domain name index record according to the query domain name in the domain name resolution request, and returns the IP address as the domain name response result to the domain name resolution simulation unit.

[0047] Optionally, the HTTP simulator comprises an HTTP simulation unit and an HTTP data response unit; the HTTP simulation unit is bound with an IP address of the HTTP simulator, and the IP address of the HTTP simulator is an IP address of a vehicle-mounted gateway configured in the controller under test; the "analyzing and responding 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" comprises:

[0048] The HTTP simulation unit receives the HTTP request forwarded by the Ethernet transceiver and sends the HTTP request to the HTTP data response unit;

[0049] The HTTP data response unit determines the HTTP response result according to the HTTP request and returns the HTTP response result to the HTTP simulation unit;

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

[0051] Optionally, the HTTP data response unit stores a plurality of HTTP response records, and the HTTP response record is a corresponding relationship between a URL path and HTTP response data; the "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" can comprise:

[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 according to 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 comprises a test software, the test software and the cloud platform simulation unit communicate with each other, and the cloud platform simulation unit further comprises a data setting unit; the method further comprises:

[0054] The test software sends a data setting command to the data setting unit, the data setting command being used for setting HTTP response data corresponding to different URL paths.

[0055] The data setting unit listens to the data setting command sent by the test software, and sets the HTTP response record stored in the HTTP data response unit according to the data setting command in a case where the data setting command is received.

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

[0057] The test software sends a data acquisition command to the data acquisition unit.

[0058] The data acquisition unit listens to the data acquisition command sent by the test software, and acquires 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 in a case where the data acquisition command is received.

[0059] The test software is used for receiving the HTTP request data.

[0060] Optionally, in a case where 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 comprises a host running the test software, the host comprising at least a first network card and a second network card, and the method further comprises:

[0062] The first network card is configured to configure the domain name resolution server IP address configured in the tested controller as the IP address of the domain name resolution simulator.

[0063] The second network card is configured to configure the IP address of the vehicle-mounted gateway configured in the tested controller as the IP address of the HTTP simulator.

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

[0065] In a case where the first network card and the second network card are two different network cards, the first network card and the second network card are both connected to the Ethernet transceiver through network cables.

[0066] Optionally, the Ethernet transceiver is in a switch mode, the Ethernet transceiver is connected to the host through a USB line, and the measured controller and the host are connected to the Ethernet transceiver through network cables respectively.

[0067] By the HTTP interface test system provided by the embodiment, a cloud platform simulation unit is developed to simulate a cloud backend to verify the correctness of the interaction function between the measured vehicle-mounted controller and the cloud backend in the HIL test field. By developing a domain name resolution simulator, the IP address of the domain name resolution simulator is set as the IP address of the domain name resolution server configured in the measured controller, and all domain name resolution requests initiated by the measured controller through the Ethernet transceiver are responded as the IP address of the HTTP simulator in the domain name resolution simulator, so that the normal communication between the simulated HTTP simulator and the measured controller is realized. Any HTTP request initiated by the measured controller to the cloud backend is received and responded in the HTTP simulator, so that the measured vehicle-mounted controller can verify the interaction function between the measured vehicle-mounted controller and the cloud backend without connecting to the real Internet, the dependence on the real cloud backend in the single HIL test stage is eliminated, the verification test of the interaction function between the measured vehicle-mounted controller and the cloud backend on the intranet bench is realized, the complexity of the test link is reduced, and the test efficiency is improved. BRIEF DESCRIPTION OF DRAWINGS

[0068] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following will briefly introduce the drawings needed to be used in the description of the embodiments of the present application. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can also be obtained by those skilled in the art without creative labor.

[0069] Figure 1 is a structural block diagram of an HTTP interface test system according to an embodiment of the present application;

[0070] Figure 2 is a working flow diagram of a domain name resolution simulator according to an embodiment of the present application;

[0071] Figure 3 is a working flow diagram of an HTTP simulator according to an embodiment of the present application;

[0072] Figure 4 is a whole system architecture diagram of an HTTP interface test system according to an embodiment of the present application;

[0073] Figure 5 is an internal implementation block diagram of a cloud platform simulation unit according to an embodiment of the present application;

[0074] Figure 6 is a step flow chart of the HTTP interface test method provided by one embodiment of the present application;

[0075] Wherein, the reference signs are: 1-host running test software, 2-ethernet transceiver, 3-USB line, 4-network cable with T1 interface type, 5-network cable with TX interface type, 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 technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work fall within the scope of protection of the present application.

[0077] Reference Figure 1 , Figure 1 is a structural block diagram of an HTTP interface test system shown by one embodiment of the present application. As shown in Figure 1 , the HTTP interface test system of the present 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. Wherein, the ethernet transceiver 2 respectively has a communication connection with the cloud platform simulation unit 11 and the controller under test 6, and the communication can be realized through ethernet messages.

[0078] Wherein, the ethernet transceiver 2 is configured to receive a domain name resolution request carrying an IP address of a domain name resolution server 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 to be tested is a vehicle-mounted controller, which can be a vehicle-mounted controller used for verifying the Internet interaction function in HIL testing. The controller to be tested is configured with an IP address of a domain name resolution server in the Internet, so as to query the IP address of a corresponding HTTP server in the domain name resolution server through a domain name before accessing the HTTP server in the Internet. In this embodiment, the IP address of the domain name resolution simulator is set as the IP address of the domain name resolution server configured in the controller to be tested. The controller to be tested can initiate a domain name resolution request, which at least carries the IP address of the domain name resolution server configured in the controller to be tested. 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 configured 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 to be tested 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. The domain name response result is the IP address of the HTTP simulator. That is, in the domain name resolution simulator, all domain name resolution requests initiated by the controller to be tested can be responded as the IP address of the HTTP simulator. After obtaining the domain name response result, the domain name resolution simulator can return the domain name response result to the controller to be tested through the Ethernet transceiver.

[0082] The Ethernet transceiver 2 is configured to receive an HTTP request initiated by the controller to be tested 6 according to the domain name response result, and send the HTTP request to the HTTP simulator 11-2 according to the IP address of the HTTP simulator 11-2 in the HTTP request.

[0083] In this embodiment, after receiving the domain name response result returned by the domain name resolution simulator through the Ethernet transceiver, the controller to be tested can initiate an HTTP request. The HTTP request generated by the controller to be tested carries the IP address of the HTTP simulator returned by the domain name resolution simulator. After receiving the HTTP request, the Ethernet transceiver can forward the HTTP request to the HTTP simulator according to the IP address of the HTTP simulator written in the HTTP request.

[0084] The HTTP simulator 11-2 is configured to parse the HTTP request and 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 receiving the HTTP request forwarded by the Ethernet transceiver of the controller under test, the HTTP simulator can parse the HTTP request and obtain an HTTP response result, and return the HTTP response result to the controller under test through the Ethernet transceiver. That is, in this embodiment, the HTTP simulator responds to any HTTP request initiated by the controller under test to the cloud background.

[0086] In an optional embodiment, in 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. In this embodiment, by simultaneously simulating the domain name resolution server and the HTTP server, the above configuration method is used, and the data is parsed and responded in the HTTP simulator according to the interface document, so as to simulate the cloud background.

[0087] In this embodiment, the cloud simulation platform simulates the cloud background, the domain name resolution simulator simulates the domain name resolution server, and the HTTP simulator simulates the HTTP server. The IP address of the domain name resolution simulator is set as 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 by the domain name resolution simulator as the IP address of the HTTP simulator, so as to realize the normal communication between the HTTP simulator simulated in the intranet and the controller under test, so that the controller under test can complete the verification of the interaction function between the controller under test and the cloud background without connecting to the real Internet, thereby eliminating the dependence on the real Internet cloud background, reducing the complexity of the test link, improving the test efficiency, reducing the test cost, and shortening the test period. Since this embodiment no longer depends on the cloud background on the Internet, the HTTP interface test system of this embodiment can be based on a single host on a local area network to carry out test activities, reduce the risk of leakage caused by communication between the vehicle-mounted controller and the Internet cloud background, and meet the information security and confidentiality specifications.

[0088] In combination with the above embodiments, in an embodiment, the present embodiment 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 with the IP address of the domain name resolution simulator, that is, the IP address of the domain name resolution server configured in the controller under test.

[0089] The domain name resolution simulation unit is configured 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 configured 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, the domain name resolution simulation unit specifically 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 as the IP address of the HTTP emulator and returned.

[0096] In an optional embodiment, the domain name resolution simulation unit can be bound to the IP address of the domain name resolution simulator: IP1 and the port number, 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 conjunction 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 multiple domain name index records that map domain names to IP addresses, and the IP address in each domain name index record is the IP address of the HTTP emulator.

[0098] In the embodiment, the domain name resolution data response unit stores a plurality of domain name index records, the domain name index record is a record mapping the corresponding relationship between the domain name and the IP address, and the IP address used in each domain name index record is the IP address of the HTTP simulator. That is, in the domain name index record, the IP address corresponding to any domain name is the IP address of the HTTP simulator, thereby ensuring that all domain name resolution requests initiated by the measured controller are responded as the IP address of the HTTP simulator.

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

[0100] In the embodiment, after the domain name resolution data response unit receives the domain name resolution request, the IP address corresponding to the query domain name can be determined according to the query domain name in the domain name resolution request according to the stored domain name index record, that is, the IP address corresponding to the query domain name is determined as the IP address of the HTTP simulator, and the IP address is returned as the domain name response result to the domain name resolution simulation unit.

[0101] That is, 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 embodiment is the IP address of the HTTP simulator, that is, IP2.

[0102] In one embodiment, as shown in Figure 2 Figure 2 is a schematic diagram of a domain name resolution simulation process according to an embodiment of the application. In Figure 2 , before the measured controller sends an HTTP request, the measured controller sends 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, the domain name resolution simulation unit receives the domain name resolution request message, parses 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 packs 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, which is in the form of a domain name resolution response message, through the Ethernet transceiver, and finally returns it to the measured controller. From now on, the measured controller completes the domain name resolution query action.

[0103] ​In combination with the above embodiments, in an implementation, the embodiments of the present application further provide an HTTP interface test system. In the HTTP interface test system, the HTTP simulator comprises an HTTP simulation unit and an HTTP data response unit; the HTTP simulation unit is bound with an IP address of the HTTP simulator, and the IP address of the HTTP simulator is an IP address of a vehicle gateway configured in the controller under test.

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

[0105] In the present embodiment, the HTTP simulation unit is bound with 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 with 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 Ethernet transceiver, and specifically, the HTTP request can comprise 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 configured to determine the HTTP response result according to the HTTP request and return the HTTP response result to the HTTP simulation unit.

[0107] In the present embodiment, after receiving the HTTP request submitted by the HTTP simulation unit, the HTTP data response unit can 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 configured to return the HTTP response result to the controller under test through the Ethernet transceiver.

[0109] In the present 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 simulator in the present embodiment, the reception of the HTTP request and the return of the HTTP response result are completed by the HTTP simulation unit, the specific response operation of the HTTP request is performed by the HTTP data response unit, and the HTTP response result is returned in response to any HTTP request sent by the controller under test.

[0111] In an alternative embodiment, in the HTTP simulation unit, the IP address IP2 and the port number of the HTTP simulator can be bound, and the URL path callback function can be set. The IP address IP2 of the HTTP simulator is the IP address of the vehicle gateway configured in the controller under test. The port number is 80 for the HTTP protocol and 443 for the HTTPS protocol. In addition, for the HTTPS protocol, a certificate file needs to be set in the HTTP simulation unit. The certificate file can be generated by the OpenSSL tool, and finally the HTTP simulator is started.

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

[0113] In this embodiment, the HTTP request carries the URL path, and the HTTP data response unit stores a plurality of HTTP response records, each of which is a corresponding relationship between a URL path and an HTTP response. Therefore, different URL path requests initiated by the controller under test can be obtained to obtain different HTTP responses.

[0114] The HTTP data response unit is configured to determine the HTTP response data corresponding to the URL path in the HTTP request according to the HTTP response record according to the URL path in the HTTP request, 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, the URL path in the HTTP request can be parsed, and the HTTP response data corresponding to the URL path in the HTTP request can be determined according to the stored HTTP response record according to the URL path, and the HTTP response data is returned as the HTTP response result to the HTTP simulation unit.

[0116] That is, the HTTP data response unit can receive multiple HTTP requests initiated by each of the controllers under test, and 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 required to be returned by the URL path is returned according to the interface document of the project. For example, the HTTP request 1, the HTTP response 1, the HTTP request 2, and the HTTP response 2 used in the URL path callback function are global variables, which can be accessed in other places of the code.

[0117] Therefore, during the running of the HTTP simulation unit, if an HTTP request sent by the controller under test through the Ethernet transceiver is received, and the URL path of the HTTP request is bound with a callback function, the HTTP request is submitted to the corresponding URL path callback function in the HTTP data response unit, and then the HTTP response returned by the URL path callback function is sent to the controller under test through the Ethernet transceiver.

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

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

[0120] In the present embodiment, the test software can communicate with the data setting unit in the cloud platform simulation unit, and the user can perform any setting of the HTTP response record stored in the HTTP data response unit through the test software. The test software sends a data setting command to the data setting unit in response to the setting operation of the user, and the data setting command is configured to set the HTTP response data corresponding to different URL paths.

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

[0122] In this embodiment, the data setting unit can listen to the data setting command sent by the test software, and in the case of listening to 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 the HTTP response 1 is set; if the data setting command 2 and data of the test software are received, the data of the HTTP response 2 is set; there can be multiple such operations.

[0123] In this embodiment, the data setting unit communicates with the test software, receives the data setting command and data of the test software, so as to change the HTTP response data corresponding to different URL paths, and simulate various test working conditions. That is, in this embodiment, the data of the HTTP response in the test software can be assigned to any data, so that various test working conditions can be simulated, the coverage of the functional test is improved, and the development of the automatic functional test is easier to realize in the test software.

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

[0125] The test software is configured 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 achieve the purpose of viewing the HTTP request data in the test software through the test software. The test software sends a data acquisition command to the data acquisition unit in response to the user's acquisition operation.

[0127] The data acquisition unit is configured to listen to the data acquisition command sent by the test software, and in the case of receiving the data acquisition command, acquire 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 listen to the data acquisition command sent by the test software, and in the case of listening to the data acquisition command, that is, in the case of receiving the data acquisition command, acquire 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.

[0129] The data acquisition unit listens to the data acquisition command sent by the test software and responds to the event. If the data acquisition command 1 of the test software is received, the data of the HTTP request 1 corresponding to the identifier of the HTTP request 1 carried in the data acquisition command 1 is acquired from the data response unit according to the identifier of the HTTP request 1, and is sent to the test software. If the data acquisition command 2 of the test software is received, the data of the HTTP request 2 corresponding to the identifier of the HTTP request 2 carried in the data acquisition command 2 is acquired from the data response unit according to the identifier of the HTTP request 2, and is sent to the test software. There can be multiple such operations.

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

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

[0132] In the related art, the data needs to be viewed on the cloud background on the Internet and interacted with the vehicle-mounted 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 view the 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 background and the vehicle-mounted gateway in the single HIL test stage is eliminated.

[0133] In one embodiment, as shown in Figure 3 , the HTTP request data is sent to the test software. Figure 3 is a schematic diagram of a HTTP emulator workflow according to an embodiment of the present application. In Figure 3 , the controller under test initiates an HTTP request in the code. The HTTP request is in the form of an HTTP request message, is forwarded by an Ethernet transceiver, is received by a network card of a host computer, and is submitted to an HTTP simulation unit. The HTTP simulation unit receives the HTTP request message, parses the URL path in the HTTP request message, generates an HTTP request object, and submits the HTTP request object to an HTTP data response unit. The HTTP data response unit returns an HTTP response object corresponding to the HTTP request object. The HTTP simulation unit receives the HTTP response object, sends it out, and the HTTP response object is in the form of an HTTP response message, is forwarded by the Ethernet transceiver and the network card of the host computer, and is finally returned to the controller under test. Thus, the controller under test completes the HTTP request action.

[0134] Further, after the HTTP data response unit acquires the HTTP request object, the global HTTP data request object can be shared to 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 acquire 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 to the HTTP data response unit.

[0135] In combination with the above embodiments, in an implementation, the embodiments of the present application further provide an HTTP interface test system. In the HTTP interface test system, in the case that the test software supports secondary development, the cloud platform simulation unit can be directly implemented in the test software.

[0136] In combination with the above embodiments, in an implementation, the embodiments of the present application further provide an HTTP interface test system. In the HTTP interface test system, the HTTP interface test system further comprises: a host running the test software, the host comprising at least a first network card and a second network card. Wherein,

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

[0138] The second network card is configured to configure the IP address of the vehicle-mounted gateway configured in the tested controller as the IP address of the HTTP simulator.

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

[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, the above IP1 and the above IP2 can be configured on the two different network cards of the host, or can be configured on the same network card of the host. In the case that the first network card and the second network card are two different network cards, the first network card and the second network card both 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 the 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 conjunction with the above embodiments, in one implementation, an embodiment of the present invention further provides an HTTP interface testing system. In this HTTP interface testing 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 network cables.

[0143] In this embodiment, the Ethernet transceiver is a switch, and the Ethernet transceiver is connected to the host via a USB cable. A closed-loop hardware pathway is formed by connecting the controller under test and the Ethernet transceiver, and the host and the Ethernet transceiver, respectively, via a wiring harness and a network cable. The Ethernet transceiver is connected to the host via a USB cable primarily for communication with the test software on the host, while the Ethernet transceiver is connected to the host via a network cable primarily for communication with the cloud platform simulation unit on the host.

[0144] In another embodiment, Figure 4 As shown, Figure 4 This is a diagram illustrating the overall system architecture of an HTTP interface testing system according to one embodiment of the present invention. The HTTP interface testing system of this embodiment includes: a controller under test 6, an Ethernet transceiver 2, test software 12, a host 1 running the test software, and a cloud platform simulation unit 11 implemented in 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, Figure 5 As shown, Figure 5 This is a block diagram of the internal implementation of a cloud platform simulation unit shown in one embodiment of the present invention. Figure 5In the middle, the bench is built, the Ethernet transceiver is the switch mode, and the Ethernet transceiver is connected to the host computer through the USB line. The measured controller and the Ethernet transceiver, the host computer and the Ethernet transceiver are connected into a closed loop hardware path through the wire harness and the network cable respectively. The IP address of the domain name resolution server (DNS server) and the IP address of the vehicle gateway are set in the vehicle-mounted controller (i.e. the measured controller 6): IP1 and IP2. And the IP address (IP1) and the mask of the domain name resolution emulator are configured in the network card of the host computer, and the IP address (IP2) and the mask of the HTTP emulator are configured.

[0147] In the domain name resolution emulation unit, the IP address: IP1 of the domain name resolution emulator and the port number are bound, and the domain name resolution data response unit callback function is set. The port number uses the default port number of the domain name resolution protocol, and finally the domain name resolution emulator is started.

[0148] The domain name resolution data response unit indexes the IP address corresponding to the domain name in the domain name resolution request submitted by the domain name resolution emulation unit, and returns the IP address to the domain name resolution emulation unit. The IP address returned by the domain name resolution data response unit in the application is the IP address of the HTTP emulator, i.e. IP2.

[0149] In the HTTP emulation unit, the IP address: IP2 of the HTTP emulator and the port number are bound, and the URL path callback function is set. The HTTP emulator IP address: IP2 is the vehicle-mounted gateway IP configured in the measured controller. For HTTP protocol, the port number is 80, and for HTTPS protocol, the port number is 443. In addition, for HTTPS protocol, a certificate file also needs to be set. The certificate file can be generated by OpenSSL tool. Finally, the HTTP emulator is started.

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

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

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

[0153] In the embodiment, the purpose of simulating the cloud end background in the internal network is achieved by simulating the domain name resolution server and the HTTP server, the normal communication between the simulated cloud end background and the vehicle-mounted controller under test is realized, the dependence on the vehicle-mounted gateway and the Internet cloud end background is eliminated, the test cost is reduced, and the test period is shortened. The data of the HTTP response in the test software can be assigned to any data, so various test working conditions can be simulated, the coverage of the functional test is improved, and the development of the automatic functional test is easier to realize in the test software. In addition, the embodiment no longer depends on the cloud end background on the Internet, so the technology described in the application can be completely based on a single host in the local area network to carry out the test activities, the risk of company information leakage caused by the communication between the vehicle-mounted controller and the Internet cloud end background is reduced, and the information security and confidentiality specifications of the company are met.

[0154] Based on the same inventive concept, an embodiment of the application provides an HTTP interface test method. Referring to Figure 6 , Figure 6 is a step flowchart of the HTTP interface test method provided by an embodiment of the application. As shown in Figure 6 , the method is applied to an HTTP interface test system, and 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. The IP address of the domain name resolution simulator is the IP address of a domain name resolution server configured in the controller under test. The HTTP interface test method includes the following steps.

[0155] Step S61: receiving a domain name resolution request carrying the IP address of the domain name resolution server sent by the controller under test through the Ethernet transceiver, 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, obtaining a domain name response result, and returning the domain name response result to the controller under test through the Ethernet transceiver, the domain name response result being the IP address of the HTTP simulator;

[0157] Step S63: 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;

[0158] Step S64: parsing the response 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.

[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, through the domain name resolution simulation unit, the domain name resolution request forwarded by the Ethernet transceiver, 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; and the above-mentioned “determining, by the domain name resolution data response unit, the domain name response result according to the domain name resolution request, and returning the domain name response result to the domain name resolution simulation unit” may specifically include:

[0164] The domain name resolution data response unit determines 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 returns the IP address as the domain name response result to the domain name resolution simulation unit.

[0165] 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 above step S64 may include:

[0166] The HTTP simulation unit receives the HTTP request forwarded by the Ethernet transceiver and sends the HTTP request to the HTTP data response unit;

[0167] The HTTP data response unit determines the HTTP response result according to the HTTP request and returns the HTTP response result to the HTTP simulation unit;

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

[0169] Optionally, the HTTP data response unit stores a plurality of HTTP response records, and the HTTP response record is a corresponding relationship between a URL path and HTTP response data. The above "determining the HTTP response result according to the HTTP request and returning the HTTP response result to the HTTP simulation unit" can 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 according to 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 comprises a test software, the test software and the cloud platform simulation unit communicate with each other, and the cloud platform simulation unit further comprises a data setting unit; the method further comprises:

[0172] The test software sends 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;

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

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

[0175] The test software sends a data acquisition command to the data acquisition unit;

[0176] The data acquisition unit listens to the data acquisition command sent by the test software, and in the case of receiving the data acquisition command, acquires 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 configured to receive the HTTP request data.

[0178] Optionally, in the case that 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 comprises a host running the test software, and the host comprises at least a first network card and a second network card; the method further comprises:

[0180] The domain name resolution server IP address configured in the tested controller is configured as the IP address of the domain name resolution simulator through the first network card.

[0181] The IP address of the vehicle gateway configured in the tested controller is configured as the IP address of the HTTP simulator 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, the first network card and the second network card are both connected to the Ethernet transceiver through network cables.

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

[0185] It should be noted that, for the method embodiments, in order to simply describe, they are all described as a series of action combinations, but those skilled in the art should know that the embodiments of the present application are not limited to the order of the described actions, because according to the embodiments of the present application, certain steps can be performed in other order or simultaneously. Secondly, those skilled in the art should know that the embodiments described in the specification all belong to preferred embodiments, and the actions involved are not necessarily necessary for the embodiments of the present application.

[0186] For the method embodiments, since they are basically similar to the system embodiments, the description is relatively simple, and the relevant parts can be referred to the part of the system embodiments.

[0187] Each of the embodiments in the specification is described in a progressive manner, and each embodiment focuses on the difference from other embodiments, and the same or similar parts between the embodiments can be referred to each other.

[0188] Although the preferred embodiments of the embodiments of the present application have been described, those skilled in the art can make further changes and modifications to the embodiments once they know the basic inventive concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications falling within the scope of the embodiments of the present application.

[0189] Finally, it should also be noted that, in this document, the relationship terms such as first and second 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 the entities or operations. Moreover, the terms "include", "contain" or any other variants thereof are intended to cover non-exclusive inclusion, so that the process, method, article or terminal device including a series of elements not only includes those elements, but also includes other elements not explicitly listed or inherent to such process, method, article or terminal device. Without more limitations, the element defined by the statement "including a" does not exclude the presence of another identical element in the process, method, article or terminal device including the element.

[0190] The above describes in detail the HTTP interface test system and method provided by the present application, and the principles and implementation modes of the present application are described by applying specific examples; the above embodiment description is only used to help understand the method of the present application and its core idea; at the same time, for those skilled in the art, according to the idea of the present application, there will be changes in the specific implementation mode and application range; in view of the above, the content of the specification should not be understood as a limitation of the present application.

Claims

1. An HTTP interface testing system, characterized in that: The HTTP interface test system includes at least: a controller under test, an Ethernet transceiver, and a cloud platform simulation unit; the cloud platform simulation unit includes 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; The Ethernet transceiver is configured 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, where the domain name response result is the IP address of the HTTP simulator; The Ethernet transceiver is configured to receive an 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 configured 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 configured 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 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 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, wherein: The HTTP simulator includes: 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 emulation unit is configured 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 configured 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 configured to monitor the data setting command sent by the test software, and upon 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 further 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 configured to monitor the data acquisition command sent by the test software, and upon receiving the data acquisition command, obtain 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 testing 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, and is connected to the host via a USB cable. 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 includes at least: a controller under test, an Ethernet transceiver, and a cloud platform simulation unit; the cloud platform simulation unit includes 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; 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; 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; 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 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; performing domain name resolution according to the domain name resolution request by 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, including: receiving, through the domain name resolution simulation unit, the domain name resolution request forwarded by the Ethernet transceiver, 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, wherein: 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 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, including: receiving, through the HTTP emulation unit, the HTTP request forwarded by the Ethernet transceiver, 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

  • 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