File high-load environment construction method, vehicle-mounted system test method and equipment
The high-load file environment is constructed through recursive generation and step-by-step replication algorithms, which solves the problem of stability testing of on-board systems under high load conditions, and realizes fast and efficient testing scenario construction, improving the stability and user experience of on-board systems.
Patent Information
- Application Number
- CN202411041391.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-31
- Publication Date
- 2024-12-06
AI Technical Summary
The existing on-board system stability testing methods ignore the performance of file systems under high load conditions, resulting in severe impact on the stability and response speed of on-board system when the number of files is close to or reaches the partition limit, and lack of effective file high-load environment construction. Methods to test the stability of the vehicle system.
By obtaining the configuration information of the file high-load environment, recursively generate benchmark file packages of different levels, and copy them to the device partition using a step-by-step copy algorithm to build a file high-load environment to achieve rapid and efficient testing of the on-board system at high load. stability under .
It realizes rapid and efficient construction of high-load file environments, accurately controls load accuracy, and provides convenient scenario construction technical solutions for the test of file systems under high load conditions, improves the stability and reliability of the on-board system, and improves the user experience. .
Smart Images

Figure CN119088290A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a method for constructing a high-load file environment, and a method and device for testing an in-vehicle system. Background Art
[0002] With the rapid development of vehicle technology, the vehicle system has become an indispensable part of the vehicle. The performance and stability of the vehicle system directly affects driving safety and user experience. The vehicle system has strict requirements for the management of the vehicle's file system, and the performance of the vehicle's file system largely determines the response speed and data processing capabilities of the vehicle system.
[0003] However, current vehicle system stability testing methods often ignore the performance of the file system under high load conditions. When the number of files approaches or reaches the limit of the file system partition, the stability and response speed of the vehicle system may be seriously affected. Therefore, a method for building a high-load file environment is urgently needed to test the stability of the vehicle system under a high-load file environment. Summary of the invention
[0004] One of the purposes of the present invention is to provide a method for constructing a file high-load environment, so as to provide an effective method for constructing a file high-load environment, so as to be used for testing the stability of a vehicle-mounted system in a file high-load environment; the second purpose is to provide a method for testing a vehicle-mounted system.
[0005] In order to achieve the above object, the technical solution adopted by the present invention is as follows:
[0006] A method for constructing a file high-load environment comprises: obtaining configuration information of the file high-load environment, the configuration information comprising a file base, a device identifier of a device to construct the file high-load environment, partitions set in the device, and a load strategy set for the corresponding partitions; recursively generating reference file packages corresponding to different numbers of levels according to the file base; and copying the reference file packages corresponding to different numbers of levels to the partitions in a step-by-step manner according to the load strategy and the device identifier, so as to obtain a constructed file high-load environment.
[0007] According to the above technical means, based on the configuration information of the file high-load environment, benchmark file packages corresponding to different numbers of levels are recursively generated, and the benchmark file packages corresponding to different numbers of levels are copied to the partitions of the device to be constructed for the file high-load environment in a step-by-step manner to obtain a constructed file high-load environment. That is, by recursively generating benchmark file packages and a step-by-step copying algorithm, the file high-load environment can be constructed quickly and efficiently, and the load accuracy can be accurately controlled, providing a convenient scenario construction technical solution for testing the file system under high-load conditions.
[0008] Furthermore, according to the load strategy and device identification, the benchmark file packages corresponding to different numbers of levels are copied to the partitions in a step-by-step manner, including: according to the load strategy and device identification, the benchmark file packages corresponding to different numbers of levels are copied to the partitions in a step-by-step manner in order of the volume of the benchmark file packages corresponding to different numbers of levels from large to small, and each step reserves a preset order of magnitude for the next step.
[0009] Furthermore, the load strategy includes a total load, and according to the load strategy and the device identifier, the benchmark file packages corresponding to different number levels are copied to the partition in a step-by-step manner in the order of the volumes of the benchmark file packages corresponding to different number levels from large to small, including: based on the total load and the preset order of magnitude, determining the number of times the benchmark file packages corresponding to different number levels are copied; according to the number of copies, copying the benchmark file packages corresponding to different number levels to the partition in a step-by-step manner.
[0010] Furthermore, based on the file cardinality, benchmark file packages corresponding to different quantity levels are recursively generated, including: generating a basic file package containing a set number of files; performing a decimal recursive decomposition according to the file cardinality to determine different quantity levels; based on the different quantity levels, recursively copying the basic file package to generate benchmark file packages corresponding to different quantity levels.
[0011] Furthermore, before obtaining the configuration information of the file high-load environment, the file high-load environment construction method also includes at least one of the following: obtaining a device identifier of a connected device; obtaining multiple partitions of the device; obtaining a load mode and a load state of the load mode, the load mode including a file quantity load and a storage space load, and the load state including a used state and an idle state; obtaining a load strategy, the load strategy including a full load strategy, a percentage strategy, and a quantity strategy corresponding to a load state of a used state, and a percentage strategy and a quantity strategy corresponding to a load state of an idle state, the percentage strategy and the quantity strategy corresponding to the total load respectively.
[0012] Furthermore, the configuration information also includes a load mode, and the load mode is a file quantity load.
[0013] Furthermore, the method for constructing a high-load file environment also includes at least one of the following: in response to a reset instruction, clearing configuration information; in response to a log export instruction, exporting logs under a target directory of a device for the high-load file environment to be constructed; in response to a data clearing instruction, clearing data that has been loaded into the device for the high-load file environment to be constructed.
[0014] A method for testing a vehicle-mounted system, comprising:
[0015] In response to a test operation for the vehicle-mounted system, a test result of the vehicle-mounted system in a file high-load environment is obtained, where the file high-load environment is constructed using the file high-load environment construction method as described above;
[0016] Output test results.
[0017] A device for constructing a high-load file environment, comprising:
[0018] An acquisition module is used to acquire configuration information of a file high-load environment, wherein the configuration information includes a file base, a device identifier of a device for constructing a file high-load environment, a partition set in the device, and a load policy set for the corresponding partition;
[0019] A generation module, used for recursively generating benchmark file packages corresponding to different numbers of levels according to the file base;
[0020] The replication module is used to replicate the benchmark file packages corresponding to different numbers of levels to the partitions in a step-by-step manner according to the load strategy and device identification, so as to obtain a constructed file high-load environment.
[0021] Furthermore, the replication module is specifically used to: according to the load strategy and device identification, copy the benchmark file packages corresponding to different number levels to the partitions in a step-by-step manner in order of the volume of the benchmark file packages corresponding to different number levels from large to small, and each step reserves a preset order of magnitude for the next step.
[0022] Furthermore, the load strategy includes the total load. When the replication module is used to copy the benchmark file packages corresponding to different number levels to the partition in a step-by-step manner according to the load strategy and the device identifier and in a descending order of the volume of the benchmark file packages corresponding to different number levels, it is specifically used to: determine the number of replications of the benchmark file packages corresponding to different number levels based on the total load and the preset order of magnitude and in a descending order of the volume of the benchmark file packages corresponding to different number levels; and copy the benchmark file packages corresponding to different number levels to the partition in a step-by-step manner according to the number of replications.
[0023] Furthermore, the generation module is specifically used to: generate a basic file package containing a set number of files; perform decimal recursive decomposition according to the file base to determine different quantity levels; based on the different quantity levels, recursively copy the basic file package to generate benchmark file packages corresponding to different quantity levels.
[0024] Furthermore, before obtaining the configuration information of the file high-load environment, the acquisition module is also used for at least one of the following: obtaining the device identification of the connected device; obtaining multiple partitions of the device; obtaining the load mode and the load status of the load mode, the load mode includes the file quantity load and the storage space load, and the load status includes the used status and the idle status; obtaining the load strategy, the load strategy includes the full load strategy, percentage strategy and quantity strategy corresponding to the load status of the used status and the percentage strategy and quantity strategy corresponding to the load status of the idle status, and the percentage strategy and quantity strategy correspond to the total load respectively.
[0025] Furthermore, the configuration information also includes a load mode, and the load mode is a file quantity load.
[0026] Furthermore, the file high-load environment construction device also includes a processing module, which is used for at least one of the following: clearing configuration information in response to a reset instruction; exporting logs under a target directory of a device for the file high-load environment to be constructed in response to a log export instruction; and clearing data that has been loaded into the device for the file high-load environment to be constructed in response to a data clearing instruction.
[0027] A testing device for an on-vehicle system, comprising:
[0028] An acquisition module, used for obtaining a test result of the vehicle-mounted system in a high-file load environment in response to a test operation for the vehicle-mounted system, where the high-file load environment is constructed by using the high-file load environment construction method as described above;
[0029] Output module, used to output test results.
[0030] An electronic device comprises: a processor, and a memory communicatively connected to the processor;
[0031] Memory stores computer-executable instructions;
[0032] The processor executes the computer execution instructions stored in the memory to implement the above-mentioned file high-load environment construction method or vehicle-mounted system testing method.
[0033] A computer-readable storage medium stores computer program instructions. When the computer program instructions are executed, the above-mentioned file high-load environment construction method or vehicle-mounted system testing method is implemented.
[0034] A computer program product includes a computer program, and when the computer program is executed, the above-mentioned method for constructing a high-load file environment or the method for testing a vehicle-mounted system is implemented.
[0035] Beneficial effects of the present invention: The file high-load environment construction method, vehicle-mounted system testing method and equipment provided by the present invention obtain configuration information of the file high-load environment, the configuration information includes the file base, the device identification of the device to be constructed for the file high-load environment, the partitions set in the device and the load strategy set for the corresponding partitions; according to the file base, recursively generate benchmark file packages corresponding to different numbers of levels, and according to the load strategy and the device identification, copy the benchmark file packages corresponding to the different numbers of levels to the partitions in a step-by-step manner to obtain a constructed file high-load environment, that is, by recursively generating benchmark file packages and a step-by-step copy algorithm, the file high-load environment can be quickly and efficiently constructed, and the load accuracy can be accurately controlled, providing a convenient scenario construction technical solution for testing the file system under high load conditions. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0037] Figure 1 A schematic diagram of an application scenario provided by an embodiment of the present invention;
[0038] Figure 2 A flowchart of a method for constructing a high-load file environment provided by an embodiment of the present invention;
[0039] Figure 3 A flowchart of a method for constructing a high-load file environment provided by another embodiment of the present invention;
[0040] Figure 4 Schematic diagram of the configuration interface of the file high load environment provided by the embodiment of the present invention Figure 1 ;
[0041] Figure 5 Schematic diagram of the configuration interface of the file high load environment provided by the embodiment of the present invention Figure 2 ;
[0042] Figure 6 Schematic diagram of the configuration interface of the file high load environment provided by the embodiment of the present invention Figure 3 ;
[0043] Figure 7 Schematic diagram of the configuration interface of the file high load environment provided by the embodiment of the present invention Figure 4 ;
[0044] Figure 8A flow chart of a method for testing a vehicle-mounted system provided by an embodiment of the present invention;
[0045] Fig. 9 A schematic diagram of the structure of a device for constructing a high-load file environment according to an embodiment of the present invention;
[0046] Fig.10 A schematic diagram of the structure of a testing device for an on-vehicle system provided by an embodiment of the present invention;
[0047] Fig.11 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0048] The following will describe the embodiments of the present invention with reference to the accompanying drawings and preferred embodiments. Those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention. It should be understood that the preferred embodiments are only for illustrating the present invention, not for limiting the scope of protection of the present invention.
[0049] It should be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present invention, and thus the drawings only show components related to the present invention rather than being drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component may be changed arbitrarily, and the component layout may also be more complicated.
[0050] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in the present invention are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards, and corresponding operation entrances shall be provided for users to choose to authorize or refuse.
[0051] With the rapid development of vehicle technology, the in-vehicle system has become an indispensable part of the vehicle. The in-vehicle system provides multiple functions such as navigation, entertainment, communication and vehicle control. The performance stability of the in-vehicle system directly affects driving safety and user experience. The stability test of the in-vehicle system is a key link to ensure its reliability. The in-vehicle system usually uses an operating system based on Linux (an operating system), such as the Android car system, which has strict requirements for the management of the vehicle's file system, and the performance of the file system largely determines the response speed and data processing capabilities of the in-vehicle system.
[0052] However, current vehicle system stability testing methods often ignore the performance of the file system under high load conditions. In actual use, the vehicle system may experience a sharp increase in the number of files due to frequent file operations, such as media playback, navigation data updates, or software upgrades. When the number of files approaches or reaches the limit of the file system partition, the stability and response speed of the vehicle system may be seriously affected. Therefore, there is an urgent need for a method for constructing a file high-load environment to construct a file high-load environment and to test the stability of the vehicle system under a file high-load environment.
[0053] In addition, the complexity and challenges of file load testing of vehicle systems mainly include the following three points: (1) The complexity of simulating a high-load file environment: The file system of the vehicle system needs to handle a huge number of files and directories to support its diverse functional requirements; simulating a high-load file environment involves creating disk space of several gigabytes (GB) to tens of GB on the partition, and generating up to millions of inodes, which is extremely challenging in manual configuration and difficult to achieve accurate and efficient settings; (2) The high cost of simulating a high-load file environment: In order to reach or approach the performance limit of the file system, a large number of files must be created. This process not only places a huge demand on storage space, but also consumes a significant amount of computing resources; the large-scale use of such resources will lead to a significant increase in testing costs, making it difficult to economically and effectively simulate a high-load file environment in a standard test environment; (3) The scalability and maintainability of the test environment: There are many vehicle projects, and the functions of the vehicle system are constantly increasing and updating. The high-load file environment needs to be continuously expanded and maintained to adapt to new testing requirements; this requires the development of a highly compatible high-load file environment configuration solution to reduce the duplication of investment caused by the differentiated requirements of different projects.
[0054] Based on the above problems, the present invention provides a method for constructing a high-load file environment. By obtaining configuration information of the high-load file environment, recursively generating a benchmark file package based on the configuration information, and adopting a step-by-step replication algorithm to realize the construction of the high-load file environment, the high-load file environment can be constructed quickly and effectively, thereby being used to conduct comprehensive and in-depth testing of the performance of the vehicle-mounted system to discover potential system bottlenecks and failure points, thereby improving the stability and reliability of the vehicle-mounted system, and ultimately improving the user experience of the vehicle-mounted system in various usage scenarios.
[0055] The present invention also has the characteristics of being applicable to Android domains, automatically parsing partitions, customizing execution strategies, and concurrent operation of multiple devices.
[0056] In the following, the application scenario of the solution provided by the present invention is firstly described by way of example.
[0057] Figure 1 Schematic diagram of an application scenario provided by an embodiment of the present invention. Figure 1 As shown, in this application scenario, the user configures the relevant parameters of the file high load environment through the client 101, and accordingly, the server 102 obtains the configuration information of the file high load environment, and based on the configuration information, the device ( Figure 1 In the example of the vehicle-mounted system 103, a high-file load environment is constructed to test the stability of the vehicle-mounted system 103 under the high-file load environment.
[0058] It should be noted that Figure 1 This is only a schematic diagram of an application scenario provided by an embodiment of the present invention. Figure 1 does not limit the equipment included in Figure 1 The positional relationship between the devices is limited.
[0059] The technical solution of the present invention is described in detail below through specific embodiments. It should be noted that the following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments.
[0060] Figure 2 The flowchart of the method for constructing a high-load file environment provided by one embodiment of the present invention. The method for constructing a high-load file environment can be executed by software and / or hardware devices. For example, the hardware device can be a device for constructing a high-load file environment, and the device for constructing a high-load file environment can be an electronic device or a processing chip in the electronic device. Figure 2 As shown, the method of the embodiment of the present invention includes:
[0061] S201. Obtain configuration information of a file high-load environment, where the configuration information includes a file base, a device identifier of a device for constructing a file high-load environment, a partition set in the device, and a load policy set for a corresponding partition.
[0062] In an embodiment of the present invention, a user can configure relevant parameters for building a high-load file environment through a front-end configuration interface. Accordingly, an electronic device executing an embodiment of the present method can obtain configuration information of the high-load file environment. Among them, the device for building a high-load file environment is, for example, a device running an Android system, and the device identifier of the device is a unique identifier of the device; the partition set in the device is a disk partition of the device to which files are to be written; the load strategy is used to determine the total number of loads to be written to the partition, and the file base can be determined based on the total number of loads, so that the file base can be configured to obtain the file base included in the configuration information. For how to configure the relevant parameters for building a high-load file environment, please refer to the subsequent embodiments, which will not be repeated here.
[0063] S202: recursively generate reference file packages corresponding to different numbers of levels according to the file base.
[0064] It is understandable that the time required to generate a new file usually exceeds the time required to copy an existing file. Moreover, the more files are copied, the less time each file requires. As shown in Table 1, the time required to create or copy files and transfer files under Windows (a desktop operating system) system and Android system is shown. The efficiency of directly creating files under Android system is much lower than the efficiency of copying files from Windows system to Android system. Specifically, it takes 0.022 seconds to create an empty file under Android system, while it only takes 0.0003 seconds to copy an empty file from Windows system to Android system.
[0065] Table 1
[0066]
[0067] Based on Table 1, a decimal recursive decomposition can be performed according to the file cardinality contained in the configuration information, and the benchmark file packages corresponding to different orders of magnitude can be copied and generated according to the data in the recursive decomposition list. For example, if the file cardinality is 1000, 1000 is recursively decomposed into a decimal to obtain three orders of magnitude of 10, 100 and 1000. Based on these three orders of magnitude, benchmark file packages corresponding to different orders of magnitude are recursively generated. This step can be understood as prefabricating a set of data for building a file high-load environment in a device where a file high-load environment is to be built. By recursively generating benchmark file packages corresponding to different orders of magnitude, the time for file construction can be optimized to the maximum extent, especially when the order of magnitude of the files to be built is large, the time required for building a file high-load environment can be significantly reduced. For specific information on how to recursively generate benchmark file packages corresponding to different orders of magnitude, please refer to the subsequent embodiments, which will not be repeated here.
[0068] S203. According to the load strategy and the device identifier, the benchmark file packages corresponding to different numbers of levels are copied to the partitions in a step-by-step manner to obtain a constructed file high-load environment.
[0069] This step can be understood as the application of recursively generated benchmark file packages corresponding to different numbers of levels. The benchmark file packages need to be configured to the device where the file high-load environment is to be constructed to take effect. Exemplarily, according to the load strategy, the total number of loads to be written to the partition can be determined, and according to the total number of loads and the benchmark file packages corresponding to the different numbers of levels, the benchmark file packages corresponding to the different numbers of levels are copied in a step-by-step manner to the partition of the device corresponding to the device identifier, so as to obtain the constructed file high-load environment. As for how to copy the benchmark file packages corresponding to the different numbers of levels to the partition in a step-by-step manner according to the load strategy and the device identifier, please refer to the subsequent embodiments, which will not be repeated here.
[0070] Referring to Table 1, it can be understood that the efficiency of directly creating files under the Android system is much lower than the efficiency of copying files from the Windows system to the Android system. For example, to build an inode node (number of files) with a load of one million empty files, experiments show that it takes about 28 hours to copy a single file under the Windows system, and about 7 hours to directly create a file under the Android system, while it only takes 9 minutes through step S203 (which can also be understood as a step-by-step copy algorithm), which greatly reduces the time required to build a high-load file environment.
[0071] The method for constructing a file high-load environment provided by an embodiment of the present invention obtains configuration information of the file high-load environment, wherein the configuration information includes a file base, a device identifier of a device for constructing the file high-load environment, partitions set in the device, and a load strategy set for the corresponding partitions; based on the file base, recursively generates benchmark file packages corresponding to different numbers of levels, and based on the load strategy and the device identifier, copies the benchmark file packages corresponding to the different numbers of levels to the partitions in a step-by-step manner to obtain a constructed file high-load environment. That is, by recursively generating benchmark file packages and a step-by-step copy algorithm, the file high-load environment can be constructed quickly and efficiently, and the load accuracy can be accurately controlled, thereby providing a convenient scenario construction technical solution for testing the file system under high-load conditions.
[0072] Figure 3 This is a flowchart of a method for constructing a high-load file environment provided by another embodiment of the present invention. Based on the above embodiment, the embodiment of the present invention further illustrates the method for constructing a high-load file environment. Figure 3 As shown, the method of the embodiment of the present invention may include:
[0073] S301. Obtain configuration information of a file high-load environment, where the configuration information includes a file base, a device identifier of a device for constructing a file high-load environment, a partition set in the device, and a load policy set for a corresponding partition.
[0074] The detailed description of this step can be found in Figure 2 The relevant description of S201 in the illustrated embodiment will not be repeated here.
[0075] In the embodiment of the present invention, Figure 2 The step S202 may further include the following three steps S302 to S304:
[0076] S302: Generate a basic file package containing a set number of files.
[0077] In this step, the number is set to, for example, 10. For example, a basic file package containing 10 files is generated.
[0078] S303: Perform recursive decimal decomposition according to the file base to determine different quantity levels.
[0079] Exemplarily, the file cardinality is, for example, 1000, and 1000 is decomposed recursively in decimal form to obtain three order levels of 10, 100, and 1000.
[0080] S304: Based on different quantity levels, recursively copy the basic file package to generate benchmark file packages corresponding to different quantity levels.
[0081] In this step, after determining different order levels, the basic file package can be recursively copied based on the different order levels to generate benchmark file packages corresponding to different order levels. Exemplarily, as shown in Table 2, a recursive list corresponding to the file cardinality is shown. For example, the file cardinality is 1000, and the corresponding recursive list is [10, 100, 1000], where 10, 100 and 1000 are three different order levels, and these three different order levels correspond to a benchmark file package, namely, a benchmark file package containing 10 files (such as represented by benchmark file package A), a benchmark file package containing 100 files (such as represented by benchmark file package B) and a benchmark file package containing 1000 files (such as represented by benchmark file package C). Benchmark file package A is the basic file package, basic file package B is obtained by copying benchmark file package A 10 times, and benchmark file package C is obtained by copying benchmark file package B 10 times. By recursively copying the basic file package, benchmark file packages corresponding to different order levels are generated.
[0082] Table 2
[0083]
[0084]
[0085] By recursively generating benchmark file packages corresponding to different numbers of levels, the time for file construction can be optimized to the maximum extent. Especially when the number of files to be built is large, the time required for file construction in a high-load environment can be significantly reduced.
[0086] In the embodiment of the present invention, Figure 2 The step S203 may further include the following step S305:
[0087] S305. According to the load strategy and device identification, the benchmark file packages corresponding to different number levels are copied to the partitions in a step-by-step manner in order of the volume of the benchmark file packages corresponding to different number levels from large to small, so as to obtain a constructed file high-load environment, and each step reserves a preset order of magnitude for the next step.
[0088] In this step, the preset order of magnitude is, for example, 3 orders of magnitude. The reason for reserving 3 orders of magnitude is that the file system in the device running the Android system is dynamic, and the operation of the file system itself may increase or decrease files. By reserving a portion of the space for the next level of ladder, the error can be reduced, so that the accuracy of the unit number or 1% can be achieved. Exemplarily, after obtaining the benchmark file packages corresponding to different orders of magnitude, the benchmark file packages corresponding to different orders of magnitude can be copied to the partition in the form of a ladder according to the load strategy and device identification, in the order of the volume of the benchmark file packages corresponding to different orders of magnitude from large to small. Among them, each ladder reserves a preset order of magnitude for the next ladder until all the load data are built on the device in the high-load environment of the file to be built.
[0089] Further, optionally, the load strategy includes a total load, and according to the load strategy and the device identifier, the benchmark file packages corresponding to different number levels are copied to the partition in a step-by-step manner in order of the volumes of the benchmark file packages corresponding to different number levels from large to small. This may include: based on the total load and the preset order of magnitude, determining the number of times the benchmark file packages corresponding to different number levels are copied; and according to the number of copies, copying the benchmark file packages corresponding to different number levels to the partition in a step-by-step manner.
[0090] Exemplarily, based on Table 2, Table 3 shows the relevant information for performing step-by-step replication. As shown in Table 3, taking the total load of 100052 files, the file base of 1000 and the preset order of magnitude of 3 as an example, the recursive base list is obtained by sorting the recursive list in Table 2 in order from large to small, wherein 1000, 100 and 10 are three different order levels, and these three different order levels respectively correspond to a benchmark file package, namely, a benchmark file package containing 1000 files (benchmark file package C), a benchmark file package containing 100 files (benchmark file package B) and a benchmark file package containing 10 files (benchmark file package A), in addition, there is a benchmark file package containing 1 file (for example, represented by benchmark file package D); for each benchmark file package, the number of replications of the benchmark file package can be determined according to the total load and the preset order of magnitude. Specifically, for benchmark file package C, the number of replications of benchmark file package C can be determined to be 97 times, and the corresponding number of replicated files is 97,000, based on the total number of payload files of 100,052, the number of files contained in benchmark file package C of 1,000, and 3 orders of magnitude; for benchmark file package B, the number of replications of benchmark file package B can be determined to be 28 times, and the corresponding number of replicated files is 2,800, based on the total number of remaining payload files of (100,052-97,000), the number of files contained in benchmark file package C of 100, and 3 orders of magnitude; For quasi-file package A, the number of replications of benchmark file package A can be determined to be 22 times, and the corresponding number of replicated files is 220, based on the total number of remaining loads of (100052-97000-2800) files, the number of files contained in benchmark file package A of 10, and 3 orders of magnitude. For benchmark file package D, the number of replications of benchmark file package A can be determined to be 32 times, and the corresponding number of replicated files is 32, based on the total number of remaining loads of (100052-97000-2800-220) files, and the number of files contained in benchmark file package D of 1.
[0091] Table 3
[0092]
[0093] It can be understood that by creating a large number of files in a specified partition and simulating a state where the number of files approaches or reaches the partition limit, the operating performance of the system under this pressure can be tested.
[0094] The method for constructing a high-load file environment provided by the embodiment of the present invention obtains configuration information of the high-load file environment, wherein the configuration information includes the file base, the device identifier of the device to be constructed, the partition set in the device, and the load strategy set for the corresponding partition; generates a basic file package containing a set number of files, performs a decimal recursive decomposition according to the file base, determines different number levels, and recursively copies the basic file package based on the different number levels to generate reference file packages corresponding to different number levels; according to the load strategy and the device identifier, the reference file packages corresponding to different number levels are copied to the partition in a step-by-step manner in the order of the volume of the reference file packages corresponding to different number levels from large to small, and each step reserves a preset number of levels for the next step. In the embodiment of the present invention, by recursively generating the reference file package and the step-by-step copy algorithm, the high-load file environment is constructed quickly and efficiently, wherein, considering the reserved space requirement for the next level processing at each stage and the necessity of dynamically updating the disk information, the preset number of levels is reserved for the next step by each step, so as to achieve an optimized balance between the transmission speed and the transmission accuracy, and ensure the efficiency and accuracy of the construction of the high-load file environment.
[0095] On the basis of the above embodiments, optionally, the method for constructing a high-load file environment provided by an embodiment of the present invention, before obtaining the configuration information of the high-load file environment, further includes at least one of the following: obtaining a device identifier of a connected device; obtaining multiple partitions of the device; obtaining a load mode and a load state of the load mode, the load mode including a file quantity load and a storage space load, the load state including a used state and an idle state; obtaining a load strategy, the load strategy including a full load strategy, a percentage strategy and a quantity strategy corresponding to a load state of a used state, and a percentage strategy and a quantity strategy corresponding to a load state of an idle state, the percentage strategy and the quantity strategy respectively corresponding to the total load.
[0096] Exemplarily, the user can configure the relevant parameters for building a high-load file environment through a front-end configuration interface, and the front-end configuration interface can be constructed, for example, through the tkinter library (a standard graphical user interface library) of Python (an object-oriented interpreted computer programming language). After the user configures the relevant parameters for building a high-load file environment, the electronic device executing the embodiment of the method can be triggered to build a high-load file environment. Among them, the relevant parameters for building a high-load file environment may include a file base, a device identifier of a connected device, multiple partitions of a device, a load mode, a load state of a load mode, and a load strategy.
[0097] Figure 4 Schematic diagram of the configuration interface of the file high load environment provided by the embodiment of the present invention Figure 1 .like Figure 4As shown, the file base can be configured through the virtual control "Settings". For example, after clicking the virtual control "Settings", the file base is set to 1000 in the pop-up window 401. Clicking the virtual control "OK" completes the configuration of the file base. The virtual control "Exit" is used to exit the current entire configuration interface. For other virtual controls, please refer to the subsequent embodiments. Figure 5 Schematic diagram of the configuration interface of the file high load environment provided by the embodiment of the present invention Figure 2 .like Figure 5 As shown, based on Figure 4 , the electronic device executing the embodiment of the present method can automatically detect and collect the connected Android Debug Bridge (Android Debug Bridge, ADB) debugging device information (i.e., device identification), and display it in the "Device" column in the form of a drop-down list for the user to select. The user can select multiple devices to concurrently build a high-load file environment for multiple devices. The device identification of the connected device is, for example, 867652e6, which is the device for which a high-load file environment is to be built. After the user selects a device, the electronic device executing the embodiment of the present method automatically collects and displays the disk partition information of the selected device in the "Partition" column, and displays it in the form of a drop-down list for the user to select the partition to be operated (i.e., the partition to which the file is to be written). Figure 6 Schematic diagram of the configuration interface of the file high load environment provided by the embodiment of the present invention Figure 3 .like Figure 6 As shown, based on Figure 5 "Mode" refers to the type of file load, including two parameters, namely, load mode and load state of load mode. Load mode includes file quantity load and storage space load, and load state includes used state (IUsed) and free state (IFree). Among them, file quantity load means that the load target is inode node (i.e., file quantity), and storage space load means that the load target is disk space. Load mode and load state of load mode are both provided for user selection in the form of drop-down lists. Load can be performed according to the data provided by the user and the selected state to achieve the numerical target set by the user. Figure 7 Schematic diagram of the configuration interface of the file high load environment provided by the embodiment of the present invention Figure 4 .like Figure 7 As shown, based on Figure 6 "Policy" indicates the way to load the file, that is, the load strategy. "Policy" includes the full load strategy, percentage strategy and quantity strategy corresponding to the used load state, and the percentage strategy and quantity strategy corresponding to the idle load state. They are all displayed in the form of a drop-down list for users to select. The percentage can be accurate to two decimal places. Figure 7In the table, "strategy" is the number, the total number of loads is 100052 files, and the unit of the total number of loads varies with the load mode and load strategy. Table 4 shows the corresponding relationship between the parameters in "strategy" and the parameters in "mode". The load state of the load mode corresponds to the load strategy.
[0098] Table 4
[0099]
[0100] refer to Figure 7 ,Optionally, if the user selects multiple partitions, each partition can be loaded in turn according to the configured file base, load mode, load state of the load mode, and load ,strategy.
[0101] Optionally, in the method for constructing a high-load file environment provided by an embodiment of the present invention, the configuration information of the high-load file environment obtained may further include a load mode, where the load mode is a file quantity load.
[0102] It can be understood that for a load mode of file quantity load, the number of files to be loaded can be accurately controlled.
[0103] Based on the above embodiments, optionally, the method for constructing a high-load file environment provided by an embodiment of the present invention also includes at least one of the following: in response to a reset instruction, clearing configuration information; in response to a log export instruction, exporting the log under the target directory of the device for the high-load file environment to be constructed; in response to a data clearing instruction, clearing the data that has been loaded into the device for the high-load file environment to be constructed.
[0104] For example, reference Figure 7 , the electronic device executing the embodiment of the method can be triggered to build a file high-load environment through the virtual control "Start", that is, start to execute the load operation according to the relevant parameters configured by the user; the reset instruction can be triggered through the virtual control "Reset" to clear the configuration information; the log export instruction can be triggered through the virtual control "Export Log" to export the log under the target directory of the device for the file high-load environment to be built, for example, the log under the corresponding directory of the device for the file high-load environment to be built can be exported according to the path set by the user (for example, conf / log_folder.txt); the data clearing instruction can be triggered through the virtual control "Clear Data" to clear the data loaded to the device for the file high-load environment to be built.
[0105] It can be understood that by providing various parameter combinations and logical processing for building a high-load file environment, as well as a load data cleaning function, users can manage and control the high-load file environment more conveniently and efficiently.
[0106] Based on the above embodiments, the method for constructing a high-load file environment provided by the embodiment of the present invention starts with the configuration information of the high-load file environment provided by the user, such as the file base, load mode and load strategy data. According to these data, the reference file packages corresponding to different numbers of levels are recursively generated, and the reference file packages corresponding to different numbers of levels are efficiently copied to the disk space of the device to be constructed for the high-load file environment through the step-by-step replication algorithm. By comprehensively using the reference file package and the step-by-step replication algorithm, the custom configuration of the load value, high-speed file transmission and accurate control of the transmission process are realized, which not only improves the efficiency of the file load environment construction, but also improves the accuracy of the construction process, and provides a fast, accurate and customizable file load environment construction scheme for users. Based on the method for constructing a high-load file environment provided by the embodiment of the present invention, the inode node (number of files) generation rate of one million empty files / 9 minutes (i.e., 1850 empty files / second) and the replication rate of the disk space greater than 30 megabytes / second (depending on the physical speed) can be achieved.
[0107] Based on the above embodiments, Figure 8 Flow chart of a method for testing a vehicle-mounted system provided by an embodiment of the present invention. Figure 8 As shown, the method of the embodiment of the present invention includes:
[0108] S801. In response to a test operation for an in-vehicle system, a test result of the in-vehicle system in a high-file load environment is obtained, where the high-file load environment is constructed by using a method for constructing a high-file load environment in any of the above method embodiments.
[0109] It can be understood that after constructing a high-load file environment using the high-load file environment construction method in any of the above method embodiments, the test results of the vehicle-mounted system in the high-load file environment can be obtained through relevant test operations such as stability testing, aging testing or random testing of the vehicle-mounted system.
[0110] S802: Output test results.
[0111] In this step, after obtaining the test results of the vehicle-mounted system in a high file load environment, the test results can be output to evaluate the performance of the vehicle-mounted system in a high file load environment, discover potential system bottlenecks and failure points, and provide a basis for optimization and improvement of the vehicle-mounted system.
[0112] The testing method for a vehicle-mounted system provided in an embodiment of the present invention obtains the test result of the vehicle-mounted system in a high file load environment by responding to a test operation oriented to the vehicle-mounted system, wherein the high file load environment is constructed by adopting a high file load environment construction method such as any of the above-mentioned method embodiments, and outputs the test result; it can not only evaluate the performance of the vehicle-mounted system in the high file load environment, but also discover potential system bottlenecks and failure points, thereby providing a basis for the optimization and improvement of the vehicle-mounted system; by performing a file load stress test on the vehicle-mounted system, the stability and reliability of the vehicle-mounted system can be effectively improved, thereby ensuring a smooth user experience in various usage scenarios.
[0113] The following are embodiments of the device of the present invention, which can be used to implement the method embodiments of the present invention. For details not disclosed in the device embodiments of the present invention, please refer to the method embodiments of the present invention.
[0114] Fig. 9 A schematic diagram of the structure of a device for constructing a high-load file environment according to an embodiment of the present invention is shown in FIG. Fig. 9 As shown, the file high-load environment construction device 900 of the embodiment of the present invention includes: an acquisition module 901, a generation module 902 and a replication module 903. Among them:
[0115] The acquisition module 901 is used to acquire configuration information of the file high load environment, the configuration information including the file base, the device identification of the device to be used to construct the file high load environment, the partitions set in the device and the load strategy set for the corresponding partitions.
[0116] The generating module 902 is used to recursively generate reference file packages corresponding to different number levels according to the file base.
[0117] The copy module 903 is used to copy the reference file packages corresponding to different numbers of levels to the partitions in a step-by-step manner according to the load strategy and the device identifier, so as to obtain a constructed file high-load environment.
[0118] Furthermore, the replication module 903 can be specifically used to: according to the load strategy and device identification, copy the benchmark file packages corresponding to different number levels to the partitions in a step-by-step manner in the order of the volume of the benchmark file packages corresponding to different number levels from large to small, and each step reserves a preset order of magnitude for the next step.
[0119] Furthermore, the load strategy includes the total load. When the replication module 903 is used to copy the benchmark file packages corresponding to different number levels to the partition in a step-by-step manner according to the load strategy and the device identifier and in a descending order of the volume of the benchmark file packages corresponding to different number levels, it can be specifically used to: determine the number of replications of the benchmark file packages corresponding to different number levels based on the total load and the preset order of magnitude and in a descending order of the volume of the benchmark file packages corresponding to different number levels; and copy the benchmark file packages corresponding to different number levels to the partition in a step-by-step manner according to the number of replications.
[0120] Furthermore, the generation module 902 can be specifically used to: generate a basic file package containing a set number of files; perform decimal recursive decomposition according to the file base to determine different quantity levels; based on the different quantity levels, recursively copy the basic file package to generate benchmark file packages corresponding to different quantity levels.
[0121] Furthermore, before obtaining the configuration information of the file high-load environment, the acquisition module 901 can also be used for at least one of the following: obtaining the device identification of the connected device; obtaining multiple partitions of the device; obtaining the load mode and the load status of the load mode, the load mode includes the file quantity load and the storage space load, and the load status includes the used status and the idle status; obtaining the load strategy, the load strategy includes the full load strategy, percentage strategy and quantity strategy corresponding to the load status of the used status and the percentage strategy and quantity strategy corresponding to the load status of the idle status, and the percentage strategy and quantity strategy correspond to the total load respectively.
[0122] Furthermore, the configuration information also includes a load mode, and the load mode is a file quantity load.
[0123] Furthermore, the file high-load environment construction device 900 may also include a processing module (not shown in the figure) used for at least one of the following: clearing configuration information in response to a reset instruction; exporting logs under the target directory of the device for the file high-load environment to be constructed in response to a log export instruction; clearing data that has been loaded into the device for the file high-load environment to be constructed in response to a data clearing instruction.
[0124] The device of the embodiment of the present invention can be used to execute the solution of the method for building a file high-load environment in any of the above method embodiments. Its implementation principle and technical effects are similar and will not be repeated here.
[0125] Fig.10 A structural diagram of a testing device for a vehicle-mounted system provided by an embodiment of the present invention is shown in FIG. Fig.10 As shown, the vehicle-mounted system testing device 1000 of the embodiment of the present invention includes: an acquisition module 1001 and an output module 1002. Among them:
[0126] The acquisition module 1001 is used to respond to the test operation for the vehicle system and obtain the test results of the vehicle system in a high file load environment, where the high file load environment is constructed using the high file load environment construction method in any of the above method embodiments.
[0127] The output module 1002 is used to output the test results.
[0128] The device of the embodiment of the present invention can be used to execute the solution of the vehicle-mounted system testing method in any of the above method embodiments. Its implementation principle and technical effects are similar and will not be repeated here.
[0129] Fig.11 This is a schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. Fig.11 As shown, the electronic device 1100 may include: at least one processor 1101 and a memory 1102 .
[0130] The memory 1102 is used to store programs. Specifically, the programs may include program codes, and the program codes include computer-executable instructions.
[0131] The memory 1102 may include a high-speed random access memory (RAM), and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.
[0132] The processor 1101 is used to execute the computer-executable instructions stored in the memory 1102 to implement the file high-load environment construction method or the vehicle-mounted system testing method described in the aforementioned method embodiment. Among them, the processor 1101 may be a central processing unit (CPU), or an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present invention. Specifically, when implementing the file high-load environment construction method described in the aforementioned method embodiment, the electronic device may be, for example, an electronic device with processing functions such as a server; when implementing the vehicle-mounted system testing method described in the aforementioned method embodiment, the electronic device may be, for example, an electronic device with processing functions such as an electronic control unit on the vehicle.
[0133] Optionally, the electronic device 1100 may further include a communication interface 1103. In a specific implementation, if the communication interface 1103, the memory 1102 and the processor 1101 are implemented independently, the communication interface 1103, the memory 1102 and the processor 1101 may be interconnected through a bus and communicate with each other. The bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc., but it does not mean that there is only one bus or one type of bus.
[0134] Optionally, in a specific implementation, if the communication interface 1103, the memory 1102 and the processor 1101 are integrated on a chip, the communication interface 1103, the memory 1102 and the processor 1101 can communicate through an internal interface.
[0135] The present invention also provides a computer-readable storage medium, in which computer program instructions are stored. When a processor executes the computer program instructions, the above-mentioned method for constructing a high-load file environment or the method for testing a vehicle-mounted system is implemented.
[0136] The present invention also provides a computer program product, including a computer program, which, when executed by a processor, implements the above-mentioned method for building a high-load file environment or the method for testing a vehicle-mounted system.
[0137] The computer-readable storage medium mentioned above can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read only memory (EEPROM), erasable programmable read only memory (EPROM), programmable read only memory (PROM), read only memory (ROM), magnetic storage, flash memory, magnetic disk or optical disk. The readable storage medium can be any available medium that can be accessed by a general or special-purpose computer.
[0138] An exemplary readable storage medium is coupled to the processor so that the processor can read information from the readable storage medium and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can be located in a dedicated integrated circuit. Of course, the processor and the readable storage medium can also exist as discrete components in a file high-load environment construction device or a test device for an in-vehicle system.
[0139] Those skilled in the art can understand that all or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned storage medium includes: ROM, RAM, disk or optical disk and other media that can store program codes.
[0140] Finally, it should be noted that the above embodiments are only preferred embodiments for fully illustrating the present invention, and the protection scope of the present invention is not limited thereto. Any equivalent substitution or change made by a person skilled in the art based on the present invention is within the protection scope of the present invention.
Claims
1. A method for constructing a high-load file environment, characterized in that: include: Acquire configuration information of a file high-load environment, the configuration information including a file base, a device identifier of a device to construct the file high-load environment, a partition set in the device, and a load strategy set for a corresponding partition; According to the file base, recursively generate benchmark file packages corresponding to different number levels; According to the load strategy and the device identifier, the reference file packages corresponding to the different number levels are copied to the partitions in a step-by-step manner to obtain a constructed file high-load environment.
2. The method for constructing a high-load file environment according to claim 1, characterized in that: The step of copying the reference file packages corresponding to the different number levels to the partitions in a step-by-step manner according to the load strategy and the device identifier includes: According to the load strategy and the device identifier, the benchmark file packages corresponding to the different number levels are copied to the partition in a step-by-step manner in the order of the volume of the benchmark file packages corresponding to the different number levels from large to small, and each step reserves a preset order of magnitude for the next step.
3. The method for constructing a high-load file environment according to claim 2, characterized in that: The load strategy includes the total load, and the step of copying the reference file packages corresponding to the different number levels to the partition in a step-by-step manner according to the load strategy and the device identifier and in a descending order of the volumes of the reference file packages corresponding to the different number levels, includes: Based on the total load and the preset order of magnitude, determining the number of times the reference file packages corresponding to the different order of magnitudes are replicated in descending order of the volumes of the reference file packages corresponding to the different order of magnitudes; According to the number of copies, the reference file packages corresponding to the different numbers of levels are copied to the partitions in a step-by-step manner.
4. The method for constructing a high-load file environment according to claim 1, characterized in that: The recursive generation of reference file packages corresponding to different numbers of levels according to the file base number includes: Generate a basic file package containing a set number of files; Determine the different quantity levels by performing recursive decimal decomposition according to the file cardinality; Based on the different number levels, the basic file package is recursively copied to generate reference file packages corresponding to the different number levels.
5. The method for constructing a high-load file environment according to any one of claims 1 to 4, characterized in that: Before obtaining the configuration information of the file high load environment, at least one of the following items is also included: Get the device ID of the connected device; Get multiple partitions of a device; Obtain a load mode and a load status of the load mode, the load mode includes a file quantity load and a storage space load, and the load status includes a used state and an idle state; Obtain a load strategy, which includes a full load strategy, a percentage strategy, and a quantity strategy corresponding to a used load state, and a percentage strategy and a quantity strategy corresponding to an idle load state, wherein the percentage strategy and the quantity strategy respectively correspond to the total load.
6. The method for constructing a high-load file environment according to claim 5, characterized in that: The configuration information also includes a load mode, and the load mode is the file quantity load.
7. The method for constructing a high-load file environment according to any one of claims 1 to 4, characterized in that: Also includes at least one of the following: In response to a reset instruction, clearing the configuration information; In response to the log export instruction, export the logs in the target directory of the device for building the file high-load environment; In response to the data clearing instruction, the data loaded to the device for constructing the file high-load environment is cleared.
8. A method for testing a vehicle-mounted system, characterized in that: include: In response to a test operation for an in-vehicle system, obtaining a test result of the in-vehicle system in a file high-load environment, wherein the file high-load environment is constructed by using the file high-load environment construction method according to any one of claims 1 to 7; The test result is output.
9. A device for constructing a high-load file environment, characterized in that: include: An acquisition module, used to acquire configuration information of a file high-load environment, wherein the configuration information includes a file base, a device identifier of a device to construct the file high-load environment, a partition set in the device, and a load policy set for the corresponding partition; A generation module, used for recursively generating reference file packages corresponding to different numbers of levels according to the file base; The copy module is used to copy the reference file packages corresponding to the different number levels to the partitions in a step-by-step manner according to the load strategy and the device identifier, so as to obtain a constructed file high-load environment.
10. A vehicle-mounted system testing device, characterized in that: include: an acquisition module, configured to obtain, in response to a test operation for an in-vehicle system, a test result of the in-vehicle system in a file high-load environment, wherein the file high-load environment is constructed by using the file high-load environment construction method according to any one of claims 1 to 7; An output module is used to output the test result.
11. An electronic device, characterized in that: include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the method according to any one of claims 1 to 8.
12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer program instructions, and when the computer program instructions are executed, the method according to any one of claims 1 to 8 is implemented.
13. A computer program product, comprising a computer program, characterized in that When the computer program is executed, the method according to any one of claims 1 to 8 is implemented.
