Test environment building method and device, computer device and storage medium
By managing virtual images through an image database, the problem of low reusability of test environments caused by differences between different chips is solved, enabling efficient test environment setup and management and reducing costs.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- FOSS (HANGZHOU) INTELLIGENT TECH CO LTD
- Filing Date
- 2022-12-30
- Publication Date
- 2026-04-14
AI Technical Summary
In the existing technology, the construction of automotive software testing environments needs to be set up separately according to the differences in chips from different manufacturers, resulting in extremely low reusability of the testing environment and increasing testing costs and time.
The system manages virtual images through an image database, receives test environment allocation requests from clients, determines the target virtual image information corresponding to the virtual image identifier, and sends it to the client to build the test environment, supporting code compilation environments for different chips.
It improves the reusability of the testing environment, reduces user setup time and testing costs, and achieves efficient management of the testing environment.
Smart Images

Figure CN116010268B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a method, apparatus, computer equipment, and storage medium for setting up a test environment. Background Technology
[0002] ASPICE is a software process improvement and capability assessment standard in the automotive industry, widely used in the automotive supply chain. It serves as the standard for automakers to evaluate suppliers' software development processes. ASPICE's V-shaped development model includes coding development at the bottom, design on the left, and testing on the right. In practice, testing is integrated throughout the entire development process to ensure that every line of code correctly implements every requirement. Therefore, software capable of unit and integration testing is widely used in the industry. However, in related technologies, testing software requires installation and the setup of a suitable testing environment. Because different manufacturers choose different chips, these differences lead to different code compilation environments. A separate testing environment needs to be set up for each manufacturer's choice to compile the code. Each set of testing environments is destroyed after use, resulting in extremely low reusability.
[0003] Therefore, there is an urgent need in related technologies for a method that can manage the testing environment and reduce testing costs. Summary of the Invention
[0004] Therefore, it is necessary to provide a test environment construction method, apparatus, computer equipment, and computer-readable storage medium that can manage the test environment and improve its utilization rate, in order to address the above-mentioned technical problems.
[0005] Firstly, this application provides a method for setting up a test environment, applicable to the field of automotive software testing. The method includes:
[0006] Receive a test environment allocation request from a client, wherein the test environment allocation request includes a virtual image identifier;
[0007] In response to the test environment allocation request, the target virtual image information corresponding to the virtual image identifier is determined from the image database;
[0008] The target virtual image information is sent to the client, enabling the client to build a test environment based on the target virtual image information.
[0009] Optionally, in one embodiment of this application, determining the target virtual image information corresponding to the virtual image identifier from the image database in response to the test environment allocation request includes:
[0010] The target virtual image is retrieved from the image database based on the virtual image identifier;
[0011] If the target virtual image exists in the image database, the target virtual image information is returned;
[0012] If the target virtual image does not exist in the image database, an error message will be returned.
[0013] Optionally, in one embodiment of this application, the target virtual image information includes storage location information.
[0014] Optionally, in one embodiment of this application, the step of sending the target virtual image information to the client further includes:
[0015] Obtain the status of the license service and identify the license service in the idle state as the target license service;
[0016] Sending the target virtual image information to the client includes:
[0017] The target license service and the target virtual image information are sent to the client.
[0018] Optionally, in one embodiment of this application, after receiving the test environment allocation request from the client, the method further includes:
[0019] The test environment allocation request is stored;
[0020] After sending the target virtual image information to the client, the process also includes:
[0021] After a preset time interval, a response request is sent to the client;
[0022] If no response is received, the stored test environment allocation request for the client will be deleted.
[0023] Secondly, this application also provides a method for setting up a test environment, applicable to the field of automotive software testing. The method includes:
[0024] Send a test environment allocation request to the server;
[0025] Receive the target virtual image information returned by the server based on the test environment allocation request;
[0026] A test environment is built based on the target virtual image information.
[0027] Optionally, in one embodiment of this application, the target virtual image information includes storage location information, and the step of building a test environment based on the target virtual image information includes:
[0028] Obtain the target virtual image based on the storage location information;
[0029] A test environment is built based on the target virtual image.
[0030] Thirdly, this application also provides a test environment setup apparatus. The apparatus includes:
[0031] The test environment allocation request receiving module is used to receive test environment allocation requests from clients, wherein the test environment allocation request includes a virtual image identifier;
[0032] The test environment allocation request processing module is used to determine the target virtual image information corresponding to the virtual image identifier from the image database in response to the test environment allocation request;
[0033] The target virtual image information sending module is used to send the target virtual image information to the client, so that the client can build a test environment based on the target virtual image information.
[0034] Fourthly, this application also provides a computer device. The computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the steps of the methods described in the various embodiments above.
[0035] Fifthly, this application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program thereon, which, when executed by a processor, implements the steps of the methods described in the various embodiments above.
[0036] The aforementioned test environment setup method, apparatus, computer equipment, and storage medium receive a test environment allocation request from a client, which includes a virtual image identifier. Then, in response to the request, they determine the target virtual image information corresponding to the virtual image identifier from an image database. Finally, they send the target virtual image information to the client, enabling the client to build a test environment based on the target virtual image information. In other words, when a user needs to build a test environment, pre-made virtual images can be used preferentially, reducing the time and cost of setting up the test environment. Furthermore, the pre-made virtual images are stored in the image database, preventing destruction and allowing for reuse, greatly facilitating test environment management. Attached Figure Description
[0037] Figure 1 This is an application environment diagram of a test environment setup method in one embodiment;
[0038] Figure 2 This is a flowchart illustrating a test environment setup method in one embodiment;
[0039] Figure 3 This is a schematic diagram illustrating communication between the client and the server in one embodiment;
[0040] Figure 4 This is a schematic diagram illustrating the actual interaction process between the client, server, image database, and license service in one embodiment;
[0041] Figure 5 This is a schematic diagram of the virtual image creation process in one embodiment;
[0042] Figure 6 This is a structural block diagram of a test environment setup device in one embodiment;
[0043] Figure 7 This is a structural block diagram of a test environment setup device in one embodiment;
[0044] Figure 8 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0045] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0046] The test environment setup method provided in this application embodiment can be applied to, for example... Figure 1 In the application environment shown, terminal 102 communicates with server 104 via a network. A data storage system can store the data that server 104 needs to process. The data storage system can be integrated onto server 104 or located in the cloud or on other network servers. Terminal 102 can be, but is not limited to, various personal computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices. IoT devices can include smart speakers, smart TVs, smart air conditioners, smart in-vehicle devices, etc. Portable wearable devices can include smartwatches, smart bracelets, head-mounted devices, etc. Server 104 can be implemented using a standalone server or a server cluster consisting of multiple servers.
[0047] In one embodiment, such as Figure 2 As shown, a method for setting up a test environment is provided, including the following steps:
[0048] S201: Receive a test environment allocation request from the client, wherein the test environment allocation request includes a virtual image identifier.
[0049] The execution entity of each embodiment of this application can be a server. The server can provide at least one preset port, through which the server can transmit data with clients, databases, etc.
[0050] Software testing, as a phase in the software development cycle, verifies the correctness, quality, and performance of critical business software. Integration testing is a level of software testing where individual units are combined and tested to verify that they function as expected when integrated. In specific applications, software that can perform integration testing includes Vector CAST and Helix QAC. This application embodiment uses Vector CAST as an example.
[0051] When using Vector CAST, a corresponding test environment needs to be set up. Specifically, you first need to deploy it on your computer system, refer to the manual to install the software, configure the IP port and other information for the corresponding license service, and configure a suitable compiler. After the test environment is set up, the Vector CAST software can be used normally.
[0052] As intelligent driving functions become increasingly complex, features such as highway navigation assistance, urban navigation assistance, and cross-level memory parking are gradually being implemented, leading to increasingly stringent demands on sensors and computing power. To address the computing power issue, a wide variety of chips are available on the market. With the increase in projects, different manufacturers have more choices of chips. The differences in chips result in different code compilation environments. The test environment built based on the traditional Vector CAST method is strongly correlated with the code compilation environment. Different chips require different test environments. Therefore, in one embodiment of this application, a pre-built virtual image from an image database is used as the test environment.
[0053] In one embodiment of this application, virtual images are pre-built for different chip-specific code compilation environments. Then, identification information is assigned to each virtual image to form a virtual image identifier, and the virtual images are stored in an image database. The virtual image identifier can be a unique identifier capable of identifying and distinguishing different virtual images. In one embodiment of this application, the identification information and the virtual images can be pre-stored in the form of a chart. For example, in one instance, the storage relationship table is shown in Table 1 below, which records the correspondence between the identification information and the virtual images.
[0054] Virtual Image Identification information Virtual Image A Identifier A Virtual Image B Identifier B Virtual image C Identifier C
[0055] In this embodiment, a user can send a test environment allocation request to the server through the client, and the server receives the test environment allocation request through the preset port. The test environment allocation request may carry the virtual image identifier of the target virtual image to be allocated. After receiving the test environment allocation request, the server can parse the test environment allocation request to determine the corresponding virtual image identifier of the target virtual image to be allocated.
[0056] S203: In response to the test environment allocation request, determine the target virtual image information corresponding to the virtual image identifier from the image database.
[0057] In this embodiment of the application, after determining the virtual image identifier corresponding to the test environment allocation request, the server can select the target virtual image information that matches the virtual image identifier corresponding to the test environment allocation request from multiple identifier information pre-stored in the image database.
[0058] In practical applications, the target virtual image to be allocated corresponding to the test environment allocation request may be a virtual image that has been previously created and stored in the image database, or it may be a new test environment that requires the creation of a new virtual image to support it.
[0059] Based on this, in one embodiment of this application, determining the target virtual image information corresponding to the virtual image identifier from the image database in response to the test environment allocation request includes:
[0060] S301: Search for the target virtual image from the image database based on the virtual image identifier.
[0061] S303: If the target virtual image exists in the image database, then return the target virtual image information.
[0062] S305: If the target virtual image does not exist in the image database, an error message is returned.
[0063] In one embodiment of this application, the server selects target virtual image information that matches the virtual image identifier corresponding to the test environment allocation request from a plurality of identifier information pre-stored in the image database. If the virtual image identifier exists among the plurality of identifier information pre-stored in the image database, the target virtual image exists, and the target virtual image information is returned. If the virtual image identifier does not exist among the plurality of identifier information pre-stored in the image database, it indicates that the target virtual image to be allocated corresponding to the test environment allocation request has not been created before, and the target virtual image does not exist; therefore, an error message is returned. In this embodiment, by determining whether the target virtual image exists in the image database, accurate information can be returned in a timely manner, facilitating the acquisition of target virtual image information.
[0064] In one embodiment of this application, the target virtual image information includes storage location information.
[0065] After obtaining the target virtual image information, in order to accurately acquire the target virtual image for building a test environment, in one embodiment of this application, the target virtual image information includes storage location information. When the client receives the target virtual image information, it can acquire the target virtual image based on the storage location information for building the test environment.
[0066] S205: Send the target virtual image information to the client, so that the client can build a test environment based on the target virtual image information.
[0067] In this embodiment, the server can send the target virtual image information to the client through the preset port. Alternatively, the target virtual image information can be sent via network protocols such as HTTP, TCP / IP, or FTP. After receiving the target virtual image information, the client can build a test environment based on it.
[0068] In the above-described test environment setup method, a test environment allocation request is received from a client, which includes a virtual image identifier. Then, in response to the request, the target virtual image information corresponding to the virtual image identifier is determined from the image database. Finally, the target virtual image information is sent to the client, enabling the client to set up the test environment based on the target virtual image information. In other words, when a user needs to set up a test environment, pre-made virtual images can be used preferentially, reducing the time and cost of setting up the test environment. Furthermore, the pre-made virtual images are stored in the image database, preventing destruction and allowing for reuse, greatly facilitating test environment management.
[0069] In one embodiment of this application, the step of sending the target virtual image information to the client further includes:
[0070] Obtain the status of the license service and identify the license service in the idle state as the target license service.
[0071] For the integration testing software to function properly, license service support is also required. Therefore, in one embodiment of this application, before sending the target virtual image information to the client, the server obtains the status of the license service. If the license service is idle, it is identified as the target license service and its information is recorded. If the license service is not idle, it is not recorded.
[0072] Sending the target virtual image information to the client includes:
[0073] The target license service and the target virtual image information are sent to the client.
[0074] In one embodiment of this application, after obtaining the license service status and determining the target license service, the target license service and the target virtual image information are sent together to the client. The client can establish a connection with the target license service, enabling the client to use the integration testing software normally.
[0075] In this embodiment, by obtaining the status of the license service and sending the available license service information to the client, it can be ensured that the client has the permission to use the integration testing software.
[0076] In one embodiment of this application, after receiving the test environment allocation request from the client, the method further includes:
[0077] The test environment allocation request is stored.
[0078] In one embodiment of this application, after receiving the test environment allocation request from the client, the server stores the test environment allocation request and records information related to the test environment allocation request.
[0079] After sending the target virtual image information to the client, the process also includes:
[0080] S401: After a preset time interval, send a response request to the client.
[0081] S403: If no response is received, delete the stored test environment allocation request for the client.
[0082] In one embodiment of this application, after the server sends the target virtual image information to the client, it can send a response request to the client through the preset port after a preset time interval. Of course, the response request can also be sent via network protocols such as HTTP, TCP / IP, or FTP. If no timely response is received, the stored test environment allocation request for the client is deleted. In specific applications, such as... Figure 3 As shown, in step 301, the client sends a test environment allocation request. In step 303, the server stores the test environment allocation request. In step 305, the server sends the target license service and the target virtual image information to the client. In step 307, the client sends an OK message to the server. In step 309, the server records that the client is online and can receive information. In step 311, after a preset interval, the server sends a response request to the client. In step 313, if no response is received, the stored test environment allocation request for the client is deleted. Specifically, for example, if no further request is received from the client within a 5-second interval, an online response request is sent; if no response is received, the client is recorded as offline, and the relevant information for the client is deleted.
[0083] In this embodiment, by managing the test environment allocation request information, normal communication between the client and the server can be guaranteed.
[0084] This application also provides a method for setting up a test environment, applicable to the field of automotive software testing. The method includes:
[0085] S501: Send a test environment allocation request to the server.
[0086] In one embodiment of this application, a user can send a test environment allocation request to the server through the client. The test environment allocation request may carry the virtual image identifier of the target virtual image to be allocated.
[0087] S503: Receive the target virtual image information returned by the server based on the test environment allocation request.
[0088] In one embodiment of this application, the client receives target virtual image information that matches the virtual image identifier obtained by the server from the image database based on the test environment allocation request.
[0089] S505: Build a test environment based on the target virtual image information.
[0090] In one embodiment of this application, after receiving the target virtual image information, the client obtains the target virtual image based on the target virtual image information and builds a test environment.
[0091] In this embodiment, a test environment allocation request is sent to the server. Then, the target virtual image information returned by the server based on the test environment allocation request is received. Finally, the test environment is built based on the target virtual image information. This reduces the time users spend building test environments and lowers testing costs.
[0092] In one embodiment of this application, the target virtual image information includes storage location information, and the step of building a test environment based on the target virtual image information includes:
[0093] S601: Obtain the target virtual image based on the storage location information.
[0094] S603: Build a test environment based on the target virtual image.
[0095] In one embodiment of this application, after receiving the target virtual image information, the client obtains the target virtual image based on the storage location information of the target virtual image information, and then builds a test environment based on the target virtual image, which can ensure that the integration test software can be put into normal use.
[0096] The following specific example illustrates the actual interaction process between the server and the client. Figure 4 As shown, the test environment setup system may include a server, a client, a license service, and an image database. Step 401: The client sends a test environment allocation request to the server. Then, the server executes step 403, responding to the test environment allocation request by determining the target virtual image information corresponding to the virtual image identifier from the image database. Then, the server executes step 405, obtains the status of the license service, and identifies the idle license service as the target license service. Step 407: The target license service and the target virtual image information are sent to the client. The client executes step 409, setting up the test environment based on the target virtual image information. In a specific application, the image database may be the Nexus repository manager.
[0097] In one embodiment of this application, such as Figure 5As shown, users can create target virtual images through a client and upload them to an image database for management. The method for creating the target virtual image includes: the client installs an open-source application container engine tool, such as Docker. First, the default Docker configuration is modified, changing the image server address to the address of the image database. Then, the client creates a project directory and places the files required for the compilation environment and the integration testing software installation package in the project directory. Next, an empty container file, Dockerfile, is created, and the dependent virtual machine Ubuntu system version, compilation environment setup commands, and integration testing software installation commands are written into the container file. Then, the virtual image is built using the `docker build` command and a virtual image identifier is added using `docker tag`. Finally, the virtual image is uploaded to the image database for management. Finally, the virtual image information is recorded and stored in a configuration file.
[0098] In one embodiment of this application, the client deployment method includes: first, connecting a computer to the environment to be tested; then, installing the open-source application container engine tool Docker and the client script; finally, configuring the environment to ensure normal communication between the client and the server, image database service, and license service. The client executes the following steps during runtime: first, starting the client script and sending a test environment allocation request; then, receiving the target virtual image information returned by the server based on the test environment allocation request, obtaining the storage location information of the target virtual image and the idle status of the license service; finally, using the Docker command to download the virtual image according to the storage location information, starting the container, and using the script to connect to an idle license service; if there is no idle license service, using the Docker command to destroy the container and release resources.
[0099] In one embodiment of this application, the server deployment method includes installing a server-side monitoring program on a server. When the server runs, it performs the following steps: First, it starts the server-side monitoring program and receives a test environment allocation request from a client, the request including a virtual image identifier. Then, in response to the test environment allocation request, it determines the target virtual image information corresponding to the virtual image identifier from the image database. Next, it obtains the status of the license service and identifies the idle license service as the target license service. Finally, it sends the target license service and the target virtual image information to the client, enabling the client to build a test environment based on the target virtual image information. After a preset time interval, it sends a response request to the client. If no response is received, it deletes the stored test environment allocation request from the client and simultaneously sets the license service status connected to the client to idle.
[0100] In one embodiment of this application, when a new environment needs to be tested, a new test environment needs to be set up. First, the configuration file is modified to add the test environment information. Then, the client script and server monitoring program are started. Next, the client sends a test environment allocation request to the server monitoring program. Then, in response to the test environment allocation request, the server monitoring program determines the target virtual image information corresponding to the virtual image identifier from the image database, obtains the status of the license service, and identifies the idle license service as the target license service. Then, the server monitoring program sends the target license service and the target virtual image information to the client. Finally, based on the target virtual image information, the client downloads the target virtual image from the image database to its local machine, starts the virtual image environment, requests a connection to the license service, and the integration testing software within the virtual image can interact with the test environment.
[0101] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0102] Based on the same inventive concept, this application also provides a test environment setup apparatus for implementing the test environment setup method described above. The solution provided by this apparatus is similar to the solution described in the above method; therefore, the specific limitations in one or more test environment setup apparatus embodiments provided below can be found in the limitations of the test environment setup method described above, and will not be repeated here.
[0103] In one embodiment, such as Figure 6 As shown, a test environment setup device 600 is provided, including: a test environment allocation request receiving module 601, a test environment allocation request processing module 603, and a target virtual image information sending module 605, wherein:
[0104] The test environment allocation request receiving module 601 is used to receive a test environment allocation request from a client, wherein the test environment allocation request includes a virtual image identifier.
[0105] The test environment allocation request processing module 603 is used to determine the target virtual image information corresponding to the virtual image identifier from the image database in response to the test environment allocation request.
[0106] The target virtual image information sending module 605 is used to send the target virtual image information to the client, so that the client can build a test environment based on the target virtual image information.
[0107] Optionally, in one embodiment of this application, the test environment allocation request processing module 603 is further configured to:
[0108] The target virtual image is retrieved from the image database based on the virtual image identifier;
[0109] If the target virtual image exists in the image database, the target virtual image information is returned;
[0110] If the target virtual image does not exist in the image database, an error message will be returned.
[0111] Optionally, in one embodiment of this application, the target virtual image information includes storage location information.
[0112] Optionally, in one embodiment of this application, the test environment setup apparatus further includes a license service status acquisition module.
[0113] The license service status acquisition module is used to acquire the status of the license service and identify the license service in the idle state as the target license service.
[0114] Optionally, in one embodiment of this application, the target virtual image information sending module 505 is further configured to:
[0115] The target license service and the target virtual image information are sent to the client.
[0116] Optionally, in one embodiment of this application, the test environment setup apparatus further includes a test environment allocation request storage module.
[0117] The test environment allocation request storage module is used to store the test environment allocation request;
[0118] After sending the target virtual image information to the client, the process also includes:
[0119] After a preset time interval, a response request is sent to the client;
[0120] If no response is received, the stored test environment allocation request for the client will be deleted.
[0121] Optionally, in one embodiment of this application, such as Figure 7 As shown, a test environment setup apparatus 700 is provided, including a test environment allocation request sending module 701, a target virtual image information receiving module 703, and a test environment setup module 705, wherein:
[0122] The test environment allocation request sending module 701 is used to send a test environment allocation request to the server.
[0123] The target virtual image information receiving module 703 is used to receive the target virtual image information returned by the server based on the test environment allocation request.
[0124] The test environment setup module 705 is used to set up a test environment based on the target virtual image information.
[0125] Optionally, in one embodiment of this application, the test environment setup module 705 is further used for:
[0126] Obtain the target virtual image based on the storage location information;
[0127] A test environment is built based on the target virtual image.
[0128] Each module in the aforementioned test environment setup device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in the processor of a computer device in hardware form or independent of it, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.
[0129] In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 8As shown, the computer device includes a processor, memory, communication interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, NFC (Near Field Communication), or other technologies. When the computer program is executed by the processor, it implements a method for setting up a test environment. The display screen can be an LCD screen or an e-ink screen. The input devices can be a touch layer covering the display screen, buttons, a trackball, or a touchpad on the computer device's casing, or an external keyboard, touchpad, or mouse.
[0130] Those skilled in the art will understand that Figure 8 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0131] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above-described method embodiments.
[0132] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps in the above method embodiments.
[0133] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.
[0134] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0135] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A method for setting up a test environment, applied to a server and specifically to the field of automotive software testing, characterized in that: The method includes: For different chip code compilation environments, virtual images are pre-built. Then, identification information is assigned to the virtual images to form the virtual image identifier of the virtual images, and the virtual images are stored in the image database. Receive a test environment allocation request from a client, wherein the test environment allocation request includes a virtual image identifier; In response to the test environment allocation request, the target virtual image information corresponding to the virtual image identifier is determined from the image database; The target virtual image information is sent to the client, enabling the client to build a test environment based on the target virtual image information; The step of determining the target virtual image information corresponding to the virtual image identifier from the image database in response to the test environment allocation request includes: The target virtual image is retrieved from the image database based on the virtual image identifier. If the target virtual image exists in the image database, the target virtual image information is returned; The server selects a target virtual image from multiple identifiers pre-stored in the image database that matches the virtual image identifier corresponding to the test environment allocation request. If the virtual image identifier exists in the multiple identifiers pre-stored in the image database, then the target virtual image exists, and the server returns the target virtual image information. If the virtual image identifier is not found among the multiple identifiers pre-stored in the image database, it indicates that the target virtual image does not exist, and an error message is returned. Before sending the target virtual image information to the client, the process also includes: Obtain the status of the license service and identify the license service in the idle state as the target license service; Sending the target virtual image information to the client includes: Send the target license service and the target virtual image information to the client; The process of receiving the test environment allocation request from the client also includes: The test environment allocation request is stored; After sending the target virtual image information to the client, the process also includes: After a preset time interval, a response request is sent to the client; If no response is received, the stored test environment allocation request for the client will be deleted.
2. The method according to claim 1, characterized in that, The target virtual image information includes storage location information.
3. A method for setting up a test environment, applied to the client side and specifically to the field of automotive software testing, characterized in that... The method includes: The server pre-builds virtual images for different chip code compilation environments, then assigns identification information to the virtual images to form virtual image identifiers, and stores the virtual images in the image database. The client sends a test environment allocation request to the server, so that the server can search for the target virtual image in the image database based on the virtual image identifier; the test environment allocation request includes the virtual image identifier; if the target virtual image exists in the image database, the target virtual image information is returned; The server retrieves the target virtual image from the image database based on the virtual image identifier, including: Select the target virtual image information that matches the virtual image identifier corresponding to the test environment allocation request from multiple identifier information pre-stored in the image database. If the virtual image identifier exists in the multiple identifier information pre-stored in the image database, the target virtual image exists, and the target virtual image information is returned; if the virtual image identifier does not exist in the multiple identifier information pre-stored in the image database, it means that the target virtual image does not exist, and an error message is returned. Before sending the target virtual image information to the client, the process also includes: Obtain the status of the license service and identify the license service in the idle state as the target license service; store the test environment allocation request; After the server sends the target virtual image information to the client, it further includes: sending a response request to the client after a preset time interval; if no response is received, deleting the stored test environment allocation request of the client. The client receives the target virtual image information and target license service returned by the server based on the test environment allocation request; The client builds a test environment based on the target virtual image information.
4. The method according to claim 3, characterized in that, The target virtual image information includes storage location information, and the step of building a test environment based on the target virtual image information includes: Obtain the target virtual image based on the storage location information; A test environment is built based on the target virtual image.
5. A test environment setup device, characterized in that, The device includes: The test environment allocation request receiving module is used to receive test environment allocation requests from clients, the test environment allocation requests including virtual image identifiers; it is also used to pre-build virtual images for code compilation environments corresponding to different chips, then allocate identification information to the virtual images to form the virtual image identifiers of the virtual images, and store the virtual images in the image database. The test environment allocation request processing module is used to search for a target virtual image in the image database based on the virtual image identifier; if the target virtual image exists in the image database, the target virtual image information is returned; the server selects the target virtual image information that matches the virtual image identifier corresponding to the test environment allocation request from multiple identifier information pre-stored in the image database; if the virtual image identifier exists in the multiple identifier information pre-stored in the image database, the target virtual image exists, and the target virtual image information is returned; if the virtual image identifier does not exist in the multiple identifier information pre-stored in the image database, it means that the target virtual image does not exist, and an error message is returned. The target virtual image information sending module is used to send the target virtual image information to the client, enabling the client to build a test environment based on the target virtual image information; Before sending the target virtual image information to the client, the process also includes: Obtain the status of the license service and identify the license service in an idle state as the target license service; sending the target virtual image information to the client includes: sending the target license service and the target virtual image information to the client; After receiving the test environment allocation request from the client, the method further includes: storing the test environment allocation request; after sending the target virtual image information to the client, the method further includes: sending a response request to the client after a preset time interval; if no response is received, deleting the stored test environment allocation request from the client.
6. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 4.
7. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 4.
Citation Information
Patent Citations
Test method, test platform and target server
CN110399307A
Cloud computing environment building method and device, electronic equipment and computer readable storage medium
CN114637666A