Configuration file processing methods, electronic devices and readable storage media

CN120803902BActive Publication Date: 2026-08-11HONOR DEVICE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-28
Publication Date
2026-08-11

AI Technical Summary

Benefits of technology

[0043]上述第二方面、第三方面、第四方面和第五方面所获得的技术效果与上述第一方面中对应的技术手段获得的技术效果近似,在这里不再赘述。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120803902B_ABST
    Figure CN120803902B_ABST
Patent Text Reader

Abstract

This application discloses a configuration file processing method, an electronic device, and a readable storage medium, belonging to the field of computer technology. The method includes: obtaining a target configuration file in a first language format; the target configuration file includes a first configuration file for a first testing environment and a second configuration file for a second testing environment; the first testing environment is used to test a first target under test, and the second testing environment is used to test a second target under test; converting the target configuration file in the first language format into a file to be processed in a second language format; the file to be processed includes a first file to be processed and a second file to be processed; the file to be processed in the second language format includes extractable key-value pair information; comparing the key-value pair information of the first file to be processed and the second file to be processed to obtain difference data between the first configuration file and the second configuration file. Embodiments of this application can control the running efficiency of a target object by correctly setting the configuration file.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a configuration file processing method, an electronic device, and a readable storage medium. Background Technology

[0002] With the development of computer technology, the pace of updates and replacements for computer-related products is accelerating. The functionality of computer products relies heavily on the support of various applications and software. To achieve new functions, applications and software with new features are required. Furthermore, the operation of these applications and software can be adjusted and controlled through configuration files. For example, when the target environment is a test environment, updates to applications and software require testing the new version in a simulated real-world usage scenario to determine if it will function correctly after release. Due to the rapid pace of software and application updates, it is essential to improve the efficiency of testing new versions. Test environment configuration files allow for adjustments to the operation of software and applications within the test environment; properly configuring these files facilitates efficient testing of software and applications. Summary of the Invention

[0003] This application provides a configuration file processing method, an electronic device, and a readable storage medium, which can help control the running efficiency of a target object by correctly configuring the configuration file. The technical solution is as follows:

[0004] In a first aspect, embodiments of this application provide a configuration file processing method, comprising: obtaining a target configuration file in a first language format; the target configuration file including a first configuration file of a first target object and a second configuration file of a second target object; converting the target configuration file in the first language format into a file to be processed in a second language format; the file to be processed including a first file to be processed obtained by converting the first configuration file and a second file to be processed obtained by converting the second configuration file; the file to be processed in the second language format including extractable key-value pair information; the key-value pair information in the file to be processed in the second language format corresponding to the key-value pair information in the target configuration file; the key-value pair information being used to record configuration items and configurations of configuration items in a test environment; comparing the key-value pair information of the first file to be processed and the key-value pair information of the second file to be processed to obtain difference data between the first configuration file and the second configuration file; the difference data being used to determine the configuration setting method for the first target object and the second target object.

[0005] In this embodiment, the configuration file can be used to configure various target objects. Target objects can be programs, software systems, applications, interfaces, servers, databases, or systems containing information receiving and sending devices. The configuration file allows for control and modification of the target object's operation. For example, for an application's configuration file, the application's network address, auto-join mode, network speed, applicable file formats, supported network types, and permissions can be modified. The configuration file may contain numerous configuration items, each corresponding to multiple parameters. Determining the differences in configuration files for different applications and other target objects helps in reasonably adjusting the configuration settings for the target object. For example, modifying the configuration file can adjust the operation of an online platform. Therefore, the method provided in this embodiment helps the target object function better.

[0006] The first target object is a first test environment, and the second target object is a second test environment; the first test environment is used to test the first target to be tested, and the second test environment is used to test the second target to be tested.

[0007] Because the target under test may be updated rapidly, multiple targets may need to be tested simultaneously. Two or more test environments can be used to test different versions of the target under test in parallel during version iteration testing. The target under test may change during the testing process. After testing the first and second targets under test in two test environments, the configuration data in both test environments changes. By comparing the configuration data in the two test environments, difference data is obtained. At least one of the two test environments can be modified based on this difference data. Then, the first and second targets under test are re-evaluated using the modified test environment. This helps to consider more comprehensive factors, optimize the configuration environment, and obtain more accurate test results for the target under test. Therefore, the method provided in this application embodiment allows for parallel testing of different versions of the same initial target under test using different test environments, achieving accurate test results. This allows for parallel testing of different targets under test, helping to improve testing efficiency while ensuring test accuracy.

[0008] In one implementation, comparing the key-value pair information corresponding to the first file to be processed and the key-value pair information corresponding to the second file to be processed to obtain the difference data between the first configuration file and the second configuration file includes: comparing the first file to be processed with the second file to be processed to determine first difference data between the first file to be processed and the second file to be processed; comparing the second file to be processed with the first file to be processed to determine second difference data between the second file to be processed and the first file to be processed; and converting the first difference data and the second difference data into the first language format to obtain the difference data between the first configuration file and the second configuration file.

[0009] Using the first and second files to be processed as references, the corresponding difference data is obtained and then integrated into the difference data of the first and second configuration files. This allows for a more comprehensive and complete identification of the differences between the first and second configuration files, facilitating comprehensive optimization of the target object's configuration based on these complete differences. When the target object is a test environment, the accuracy of the test results can be guaranteed.

[0010] In one implementation, the key-value pair information includes a key and a value; comparing the key-value pair information corresponding to the first file to be processed and the key-value pair information corresponding to the second file to be processed includes: determining a target file and a reference file, wherein the target file is one of the first file to be processed and the second file to be processed, and the reference file is the other of the first file to be processed and the second file to be processed; comparing each target key with each reference key respectively; wherein the target key is a key in the target file, and the reference key is a key in the reference file that corresponds sequentially to the target key; and if the target key does not have a matching key in the reference key, recording the target key in the difference data.

[0011] In some common language conversion formats of configuration files, keys are unique, but there may be multiple values ​​corresponding to a key. In this embodiment, the keys in the file to be processed are first matched. If the keys are different, it is not necessary to determine whether the values ​​are the same, which simplifies the amount of information that needs to be compared and improves the comparison efficiency.

[0012] In one embodiment, the configuration file processing method further includes: if the target key has the same key as the reference key, comparing the type of the value of the target key with the type of the value of the matching key; the matching key is the same reference key as the target key; if the types are different, recording the target key in the difference data.

[0013] In some common data exchange formats for configuration files, a key may correspond to multiple values. Therefore, comparing the target key value with the reference key value one by one, or comparing the target key value with the matching key value one by one, can increase the number of comparison operations. By determining whether the value types are the same, some key-value pairs with the same matching key but different value types can be filtered out. This not only accurately identifies inconsistent key-value pairs but also reduces the amount of data to be compared, improving comparison efficiency.

[0014] In one embodiment, the configuration file processing method further includes: if the types are the same and the value corresponding to the type represents at least one key, taking the at least one key included in the corresponding value as a new target key, taking the key included in the value corresponding to the matching key as a new reference key, and returning to the step of comparing the target key with the reference key.

[0015] In this embodiment, for complex values, a cyclic comparison method is used to fully compare the contents contained in the value and obtain accurate difference data.

[0016] In one embodiment, the configuration file processing method further includes: recording the target key in a current comparison list before recording the target key in the difference data; removing the target key from the current comparison list after recording the target key in the difference data; and, if the target key is the last key included in the values ​​corresponding to other keys, removing the target key from the current comparison list and then removing the last key in the current comparison list.

[0017] In this embodiment of the application, the current comparison list is equivalent to a temporary list used to record the key-value pairs currently being compared. When a key-value pair is being matched with other key-value pairs, the corresponding key is recorded in the current comparison list so as to update the comparison status in real time and avoid duplicate comparisons or omission of key-value pairs during the comparison process.

[0018] In one implementation, the type indicates that when the corresponding value includes at least one key, the type is a dictionary type, a set type, or a list type.

[0019] The method provided in this application embodiment can compare values ​​of dictionary type, set type and list type by comparing the keys included in the value and then further comparing the values ​​included in the value, thereby improving the comparison efficiency of values ​​of this type of complex type.

[0020] In one implementation, before comparing the key-value pair information corresponding to the first file to be processed and the key-value pair information corresponding to the second file to be processed to obtain the difference data between the first configuration file and the second configuration file, the method further includes: receiving a sorting comparison instruction; the sorting comparison instruction is used to indicate that the order of the list-type values ​​in the file to be processed is not compared; sorting the list-type values ​​according to a preset rule; and replacing the list-type values ​​before sorting with the sorted list-type values.

[0021] Using the above method, when comparing list-type values, operators can choose not to consider the order factor, providing a flexible option for comparing configuration files.

[0022] In one embodiment, sorting the values ​​containing order information in the file to be processed according to a preset rule includes: classifying the elements contained in the list-type values ​​to obtain multiple categories of values ​​containing order information; sorting the values ​​contained in each category according to a preset first sorting rule; and sorting each category according to a preset second sorting rule to obtain a sorted first file to be processed and a sorted second file to be processed.

[0023] The above method allows for the sorting of elements within each category, thereby disrupting the original order of the elements and unifying the order of identical elements. This ensures that when comparing elements, the original order of the elements is excluded, and only the similarity of the elements contained in the values ​​is compared.

[0024] In one implementation, the second language format is JSON format, and the multiple categories include: string, array, integer, dictionary type and list type.

[0025] In JSON format, key-value pair information can be recorded in a concise and clear way. By setting the values ​​in the key-value pair information of JSON format into multiple formats, it is possible to sort multiple values ​​under a category, avoiding the problem of inconsistent sorting rules caused by different sorting methods for values ​​in different categories.

[0026] In one embodiment, the configuration file processing method further includes: determining modification items and corresponding modification content based on the difference data; modifying the modification items in the first configuration file and the second configuration file to the corresponding modification content to obtain an updated first configuration file and an updated second configuration file; updating a first test environment based on the updated first configuration file, and updating a second test environment based on the updated second configuration file.

[0027] In this embodiment, the configuration and modification content of the test environment are first determined in the difference data. Then, the configuration of the test environment is modified and updated to improve the efficiency of test environment maintenance and help to align test environments with different configurations so as to better apply to the parallel testing of subsequent different versions of the target under test with the same initial version.

[0028] In one implementation, the first language format is YAML format and the second language format is JSON format.

[0029] Using YAML to record configuration files facilitates debugging of the target object's operation by operators through the configuration file. Using JSON format for the files to be processed helps to perform a comprehensive, thorough, and accurate comparison of key-value pairs, enabling the rapid identification of differences between target configuration files.

[0030] In one implementation, the target configuration file includes annotation data of key-value pair information; the file to be processed includes the annotation data and the path of the key of the annotation data in the file to be processed; the method further includes: supplementing the annotation data into the key-value pair information corresponding to the difference data according to the path of the key.

[0031] Since YAML is used as the primary language format in this embodiment, the configuration can be interpreted through annotation data, further facilitating the deployment of testers during the testing process. After obtaining the difference data of the file to be processed, the difference data is converted back to YAML format, and annotation data is added to the difference data. This helps relevant operators understand the difference data and more accurately determine how to change the configuration of the test environment.

[0032] Secondly, embodiments of this application provide an electronic device, which includes a processor and a memory;

[0033] The memory is used to store a program for an electronic device to perform the method provided in any embodiment of the present application, and to store data involved in implementing the method provided in any embodiment of the present application;

[0034] The processor is configured to execute programs stored in memory.

[0035] Optionally, there may be one or more processors and one or more memories.

[0036] Alternatively, the memory can be integrated with the processor, or the memory can be set up separately from the processor.

[0037] The processing device in the second aspect above can be a chip. The processor can be implemented in hardware or software. When implemented in hardware, the processor can be a logic circuit, integrated circuit, etc. When implemented in software, the processor can be a general-purpose processor that reads software code stored in memory. The memory can be integrated into the processor or located outside the processor and exist independently.

[0038] In the specific implementation process, the memory can be a non-transitory memory, such as read-only memory (ROM), which can be integrated with the processor on the same chip or set on different chips. This application does not limit the type of memory or the way the memory and processor are set.

[0039] Thirdly, embodiments of this application provide a computer-readable storage medium storing instructions that, when executed on a computer, enable the computer to perform the method described in the first aspect.

[0040] Fourthly, embodiments of this application provide a computer program product that, when run on a computer, causes the computer to perform any of the possible implementations of the first aspect.

[0041] Fifthly, embodiments of this application also provide a processor, including: an input circuit, an output circuit, and a processing circuit. The processing circuit is used to receive signals through the input circuit and transmit signals through the output circuit, causing the processor to execute the method in any of the embodiments of the first aspect described above.

[0042] In specific implementation, the processor can be a chip, the input circuit can be input pins, the output circuit can be output pins, and the processing circuit can be transistors, gate circuits, flip-flops, and various logic circuits. The input signal received by the input circuit can be received and input by, for example, but not limited to, a receiver, and the signal output by the output circuit can be, for example, but not limited to, output to and transmitted by a transmitter. Furthermore, the input circuit and the output circuit can be the same circuit, which is used as both the input circuit and the output circuit at different times. This application does not limit the specific implementation of the processor and various circuits.

[0043] The technical effects achieved by the second, third, fourth, and fifth aspects mentioned above are similar to those achieved by the corresponding technical means in the first aspect mentioned above, and will not be repeated here. Attached Figure Description

[0044] Figure 1AThis is a schematic diagram illustrating an application scenario of an embodiment of this application;

[0045] Figure 1B This is a schematic diagram of the test environment for an embodiment of this application;

[0046] Figure 2 This is a schematic diagram illustrating another application scenario of an embodiment of this application;

[0047] Figure 3A This is a schematic diagram of a method flow provided in an embodiment of this application;

[0048] Figure 3B This is a schematic diagram of configuration file processing provided for another embodiment of this application;

[0049] Figures 4A-4C This is another application scenario illustration of this application;

[0050] Figure 5 This is a schematic diagram of configuration file processing in one example of this application;

[0051] Figure 6 This is a schematic diagram illustrating the configuration file format conversion in one example of this application;

[0052] Figure 7 This is a flowchart illustrating the sorting method in one example of this application;

[0053] Figure 8 This is a schematic diagram showing the comparison of key-value pair information in an example of this application;

[0054] Figure 9 This is a schematic diagram illustrating the process of adding annotations to the difference data in an example of this application;

[0055] Figure 10 This is a schematic diagram of file processing in one example of this application;

[0056] Figure 11 This is a schematic diagram of the configuration file processing flow, which is another example of this application.

[0057] Figure 12 A schematic diagram of a configuration file processing device provided in an embodiment of this application;

[0058] Figure 13 This is a schematic diagram of the system architecture that may be included in the test environment in the embodiments of this application;

[0059] Figure 14 This is a schematic diagram of the structure of an electronic device that may be included in a test environment according to an embodiment of this application. Detailed Implementation

[0060] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.

[0061] It should be understood that "multiple" as mentioned in this application refers to two or more. In the description of this application, unless otherwise stated, " / " indicates "or," for example, A / B can mean A or B; "and / or" in this document is merely a description of the relationship between related objects, indicating that three relationships can exist, for example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Furthermore, to facilitate a clear description of the technical solutions of this application, the terms "first," "second," etc., are used to distinguish identical or similar items with essentially the same function and effect. Those skilled in the art will understand that the terms "first," "second," etc., do not limit the quantity or execution order, and that "first," "second," etc., do not necessarily imply differences.

[0062] References to "an embodiment," "a particular embodiment," "a implementation," "some implementations," or "some embodiments" as used in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, phrases such as "in one embodiment," "in some embodiments," "in other embodiments," "in yet another embodiment," "exemplary," "as an example," or "in a possible implementation" appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "configured as," "having," and variations thereof mean "including, but not limited to," unless otherwise specifically emphasized.

[0063] Electronic devices can include terminals and servers. Terminals can include mobile terminals and fixed terminals. Mobile terminals can include laptops, tablets, mobile phones, PDAs, smart wearable devices, electronic calendars, and e-readers, etc. Fixed terminals can include desktop computers or smart home devices, etc. Electronic devices have become integrated into all aspects of people's daily lives, becoming an inseparable part of life. Software, applications, or operating systems support the functions of electronic devices, work with them to process user commands, and provide users with the text, images, audio, or video data they need. Most software, applications, or operating systems are updated in a partial manner. After the initial version of software, applications, or operating systems is released, modifications are made based on usage, adding new features, fixing patches, or improving existing functions, resulting in a new version. Simultaneously, improvements to the hardware of electronic devices also lead to new versions of software, applications, or operating systems to adapt to the improved hardware structure of the electronic devices.

[0064] Figure 1A This is a schematic diagram illustrating an application scenario of an embodiment of this application. Figure 1A In the application scenario shown, the target object is the test environment, which is used to test the target under test. The target under test may include a new version of an operating system, a new version of an application, a new version of software, an initial version of a new operating system, an initial version of a new application, an initial version of new software, documents, or data, etc. Generally, during the development process of the target under test, testing may be frequently required. Before the target under test is publicly released to users, the production and development team deploys the target under test in the test environment, which can be built to simulate a real-world usage environment. For example... Figure 1A As shown, the test environment of the target under test may include server 101, network device 102, client 103 and storage device 104.

[0065] The server 101 may be equipped with server-side data and tools for running the target under test, such as: a network response module for user operations, a module for establishing specified network connections for users, a module for providing service data to users, a module for receiving data sent by users, a module for storing data sent by users, and a module for forwarding data sent by users. The server 101 may include a high-performance central processing unit (CPU), such as a multi-core, multi-threaded processor, and may also include sufficient memory space to handle simulated multi-user requests when simulating high-concurrency user requests.

[0066] Taking the updated version of a social application as an example, server 101 needs to be configured with a module for receiving user-sent data, used to receive social interaction data sent by users; a module for forwarding user-sent data, used to forward the social interaction data sent by users to the clients of other users; a module for establishing specified network connections for users, used to establish network connections between users and other users' social accounts after receiving instant communication requests sent by users; a network response module for user operations, used to send social interaction information to the user's client after receiving the user's operation of receiving social interaction information; and a module for providing service data to users, used to perform operations such as location based on user instructions.

[0067] Network device 102 can be used to connect server 101 and client 103 via wired and / or wireless means. Network device 102 may include one or more of the following: switch, router, firewall, bridge, hub, gateway, network interface card, wireless access point, modem, and fiber optic transceiver. Network device 102 may have a high maximum data bandwidth to simulate network data transmission processes in real-world multi-user concurrent scenarios.

[0068] Client 103 can be any type of electronic device as described in the embodiments of this application. Client 103 can be an electronic device used as a client in a real-world application, or it can employ a physical machine, virtual machine, or cloud host to simulate client operations. Client 103 also includes software or hardware configurations compatible with the target under test. Alternatively, client 103 may include a target configuration that is part of the target under test; during testing, the compatibility of the target configuration with other parts of the target under test is also part of the testing objectives. Furthermore, client 103 may include a quantity expansion module to simulate and generate operation information for at least one client, and, when necessary, simulate and generate operation information for multiple parallel clients.

[0069] Storage device 104 can have a large storage capacity to store historical test data, data under test, or configuration files. In addition, storage device 104 can have corresponding interfaces to ensure the reliability and performance of data access and management. Storage device 104 can connect to other network devices to obtain necessary test data. For example, before testing, other network devices can be used to collect or generate test samples, which can then be input into storage device 104 for simulation of the target under test.

[0070] Figure 1A The test environment shown can be set up on the server side, and the client can call it remotely. Figure 1AThe test environment shown (i.e., the online test platform) is used to test the code, software, application, or data on the client's local machine.

[0071] Because new functionalities of electronic devices rely on systems, applications, or software, users' needs for these functions may vary at different times, and even within a short period, a user's need for a particular function can change significantly. For example, during holidays, due to promotions or temporary absence from work, users' needs for using electronic devices for consumption, entertainment, interaction, or going out may change considerably. Similarly, the occurrence of well-known or important events (such as sporting events) can significantly increase users' attention to event-related information. Consequently, developers may need to release different new versions of the target device within a short period. Furthermore, for the same user need, developers may generate more than two different new versions of the target device, requiring testing of multiple new versions of the target device within a short timeframe.

[0072] Therefore, in some embodiments of this application, two or more testing systems can be used to test two or more targets separately. For example... Figure 1B As shown, when testing different new versions of the target device, the R&D team can use two or more parallel testing systems, each with an independent testing environment, for example... Figure 1B The test environment is divided into two parts: ENV1 and ENV2. This improves the overall testing efficiency of the target under test. Suppose the developer has two different new versions of the target under test and needs to determine the final release version from them. If the developer uses ENV1 to test one new version of the target under test and ENV2 to test the other, then theoretically, they can save about half the time compared to using a single test system to test both new versions sequentially. Furthermore, since the two different new versions of the target under test are new versions of the same application, software, or system, both test systems and their corresponding test environments should use the same configuration to accurately compare the test results of the two different new versions of the target under test.

[0073] However, during testing, if vulnerabilities or other issues arise with the target under test, the development team may adjust the target and consequently adjust the configuration of the testing environment based on various situations that occur during the testing process. This can lead to differences in the configuration of the two testing environments used to test different versions of the target. For example, Figure 1BThe configuration files for ENV1 and ENV2 shown are identical (version V1) when the target under test is not tested in the corresponding environment. During testing, the two different newer versions of the target under test changed, and the test environment configuration may have been adjusted to determine if the target under test was experiencing testing failures due to configuration issues. After testing, the configuration file for ENV1 became version V2, and the configuration file for ENV2 became version V1 SP. Therefore, after testing the two different newer versions of the target under test, the configuration files for ENV1 and ENV2 may differ. To continue testing other newer versions of the target under test using the two test environments, the configuration differences between the two test environments can be identified to ensure that the same initial test environment is provided for different or identical targets under test in subsequent tests.

[0074] Figure 1B The scenario shown, which uses two or more test environments, is applicable not only to different new versions of the target under test, but also to different stages, modules, or patch versions of the same target under test. Generally, the configuration files in the test environments are likely to be recorded in the same language.

[0075] Figure 2 This diagram illustrates another scenario in which the embodiments of this application can be applied. A user uses a first test environment and a second test environment to test a first target under test and a second target under test, respectively. The initial configurations of the first test environment and the second test environment can be the same, or the differences between the initial configurations of the first test environment and the second test environment are known. After at least one test environment completes the testing of the target under test, configuration files for the first test environment and the second test environment are obtained. Both the first test environment and the second test environment can adopt... Figure 1A The manner shown, or including with Figure 1A Equivalent functional modules. Users can submit the obtained configuration file to the corresponding interface provided by server 202 through terminal 201. Server 202 determines the difference data between the two test environments based on the two configuration files and sends the difference data to terminal 201.

[0076] Apart from Figure 2 Beyond the scenarios shown, a processing module for comparing differences in configuration files can also be configured on the user's terminal. After obtaining configuration files from different test environments via wired or wireless means, the user's terminal can run the processing module locally to determine the differences in the configuration files.

[0077] Apart from Figures 1A to 2In addition to the scenarios described above and similar related scenarios, the configuration file processing method provided in this application embodiment can also be applied to other related scenarios, which will not be listed one by one here.

[0078] exist Figure 1A-Figure 2 Based on the scenario shown, the specific implementation of the configuration file processing method provided in the embodiments of this application will be described next. Figure 3A This is a flowchart illustrating a configuration file processing method according to an exemplary embodiment. This method can be implemented by the electronic device involved in this application embodiment through the interaction of multiple modules. The method may include at least some or all of the following steps S31-S34. Steps S31-S34 can be executed by a server or a user device.

[0079] Step S31: Obtain the target configuration file in the first language format; the target configuration file includes a first configuration file of the first target object and a second configuration file of the second target object.

[0080] Step S31 may further include: the server obtaining the target configuration file in the first language format according to the instructions of the user-input data.

[0081] The target object can be an object whose behavior can be controlled through a configuration file; it can be a software object, a hardware object, or a combination of both. For example, the target object can include various categories, such as: operating systems, applications, software, electronic devices, systems composed of electronic devices, application programming interfaces (APIs), large language models, online data processing platforms, or databases of computer products. The first target object and the second target object can be of the same category, such as the same program, application, system, or platform. Alternatively, the first target object and the second target object can be of different categories, such as the first target object being an application and the second target object being an electronic device.

[0082] The first language format is the original format used in the configuration file of the first target object and the original format used in the configuration file of the second target object.

[0083] In one possible implementation, the first target object is a first test environment, and the second target object is a second test environment. The first test environment is used to test the first target under test, and the second test environment is used to test the second target under test. Correspondingly, the first language format is the original language format used by the configuration file in the test environment of the target under test. The target configuration file may include two or more configuration files that need to be processed. To determine possible changes in the configuration file of a test environment, at least two target configuration files can be compared to identify their differences. Different files included in the target configuration file may correspond to different test environments. Simultaneously, to determine configuration differences between other target objects, such as two applications, two systems, two online platforms, or two software programs, different files included in the target configuration file correspond to different target objects. The configuration files for different target objects may be obtained in different ways; for example, one configuration file may be obtained from external device transmission, and another configuration file may be obtained from received network data.

[0084] A test environment can be a combination of software, hardware, and networks used to test the target under test. For example, if the target under test is a camera application, the test environment may include the camera, the camera driver, the operating system running the camera driver, a server providing network data for the camera application, network devices simulating the communication network between the server and the client, or network devices simulating the wireless LAN between the server and the client. Alternatively, the test environment may include equivalent modules that provide the aforementioned functions.

[0085] For a given test environment, its configuration file contains various parameters and settings that define the specific behaviors and conditions of the test. The configuration file allows developers to separate the configuration information of the target under test (DUT) from the DUT's runtime code. This allows developers to change the behavior of the DUT or adapt it to different environments by modifying the configuration file without modifying the DUT's code. During testing, the configuration file can be used to define the test environment, test data, and test parameters, providing a flexible way to change the behavior and parameters of the DUT during testing, such as feature on / off, performance tuning, and logging. Furthermore, the configuration file can also be used to store security-related test information (such as keys), and by managing access permissions appropriately, it helps prevent the leakage of security-related test information.

[0086] In this embodiment of the application, when the target object is a test environment, the target to be tested can also be called the object under test. The target to be tested may include: a program, application, software, operating system, file, interface, database, or data, etc. The first target to be tested and the second target to be tested may include at least one of the following implementation methods.

[0087] (1) Two completely different test targets that can be tested in the same test environment. For example, different types of test targets such as different software with the same function, software and operating system, application and program, different files, or different software that can run on the same system.

[0088] (2) Different versions are formed by making partial modifications based on the same initial target to be tested. For example, modifying the first part of the initial software results in the first target to be tested. Adding new functions to the initial software results in the second target to be tested.

[0089] (3) An initial target to be tested, and a version formed after some modifications to the initial target to be tested. For example, an initial version of the application, and a version formed after some modifications to the initial version of the application.

[0090] (4) Any version of the target to be tested, and a reference version of the target to be tested. For example, for the file to be tested, the reference version can be set as the first file in advance, and other versions can be referenced by the first file, and the other versions of the file to be tested can be the second target to be tested.

[0091] (5) Any two unrelated test targets. The configuration file processing method provided in this application can be used to compare any two configuration files that need to be compared, regardless of whether the test environment corresponding to these two configuration files is used to test the same series of test targets.

[0092] (6) Versions of the same target under test after different testing stages. During the testing process, the operator may modify the target under test according to the progress of the testing process. For example, the first target under test becomes the second target under test after being tested in ENV1. However, ENV2 does not test any target under test, so ENV2 does not change the first target under test, and the version corresponding to ENV2 is the first target under test.

[0093] (7) Different parts of the same target to be tested.

[0094] In one possible implementation, the first test environment is used to test the first target under test. This could mean that the first test environment has already tested the first target under test, or that the first test environment plans to test the first target under test at some future point in time, but has not yet completed the testing of the first target under test when executing step S31. Similarly, the second test environment is used to test the second target under test, which could include situations where the second test environment has not yet tested the second target under test, has already completed the testing of the second target under test, or has already partially tested the second target under test.

[0095] In other possible implementations, the configuration file for the target object may include optional items that define or limit the target object, as well as the corresponding selections for these optional items. Optional items can also be called configuration items, and the selections for these optional items can be configuration settings or parameters.

[0096] For example, when the target object is a program, the configuration file can be used to configure optional items in the hardware or software of the environment in which the program runs. These may include: the function libraries called, the model of the processor called, the compiler type, and the default programming language.

[0097] For example, when the target object is an application, the configuration file can be used to configure the default audio and video data playback parameters, the default mode of the display interface, the online data acquisition method, and the types of shortcut keys supported during application runtime.

[0098] For example, when the target is office software, the configuration file can be used to configure whether the office software supports compression, image display methods, encryption methods, supported languages, and application system types.

[0099] For example, when the target is a cloud computing service, the configuration file can be used to configure the cloud computing network, supported software versions and types, resource pools, data transfer speed, load balancing methods, parallel computing strategies, maximum number of parallel computing operations, and backups.

[0100] In this embodiment of the application, when the server executes step S31, it can obtain at least one of the first configuration file and the second configuration file based on the file transmitted by the user from the server's local or remote location.

[0101] In this embodiment of the application, the client can execute step S31 locally, whereby the client obtains at least one of the first configuration file and the second configuration file locally, or receives the first configuration file or the second configuration file remotely transmitted from the server.

[0102] Step S32: Convert the target configuration file in the first language format into a file to be processed in the second language format; the file to be processed includes a first file to be processed obtained by converting the first configuration file and a second file to be processed obtained by converting the second configuration file; the file to be processed in the second language format includes extractable key-value pair information; the key-value pair information in the file to be processed in the second language format corresponds to the key-value pair information in the target configuration file; the key-value pair information is used to record configuration items and configuration of configuration items in the test environment.

[0103] Step S32 can be executed by the server, or by a client configured with an execution module. It can also be executed by the server calling other servers, or by the client calling a server.

[0104] In one possible implementation, the step of converting the target configuration file in the first language format into a file to be processed in the second language format may include: converting the first configuration file into a first file to be processed, and converting the second configuration file into a second file to be processed.

[0105] In step S32, the target configuration file is converted to a different language format to obtain the file to be processed. The configuration items and specific parameters in the target configuration file themselves do not change, but the way the configuration items and specific parameters are recorded changes.

[0106] In this embodiment, the language format, also known as the data exchange format, is the information expression specification (or standard way of information expression) used for transmitting data between different systems, different computer languages, different programs, different modules, or different devices. The language format can be used to define the structure and representation of data during transmission and exchange, ensuring compatibility and consistency between different systems or platforms.

[0107] Language formats can include Extensible Markup Language (XML), JavaScript Object Notation (JSON), YAML (Yaml Ain't Markup Language), Hypertext Transfer Language (HTML), Specification and Description Language (SDL), and Initialization File (INI). The first language format can be one of the aforementioned language formats, and the second language format can be another of the aforementioned language formats; the first language format and the second language format are different language formats.

[0108] In addition to converting configuration files in the same language format to a second language format for configuration comparison, embodiments of this application can also convert configuration files in different language formats to a second language format for configuration comparison.

[0109] For the target configuration file, which uses a first-language format, configuration items and specific parameters can be represented using key-value pairs. Each key-value pair includes a key and a value. The key corresponds to a configuration item, and the value corresponds to a specific parameter of that configuration item (also known as the configuration of the configuration item).

[0110] In the first-language format, directly reading key-value pair information is more difficult than in the second-language format. The difficulty of directly reading key-value pair information can be determined based on empirical data or by recording test results. When converting from the first-language format to the second-language format, the key-value pair information in the target configuration file should be preserved.

[0111] In this embodiment, the configuration item can be a variable item configured in the test environment. For the test environment, configuration items may include, for example, hardware configuration (such as selected hardware, hardware circuit switches, etc.), software configuration, network configuration, data source configuration, data transmission configuration, and data storage configuration. The configuration of a configuration item can also be referred to as its parameter or content. For example, if the configuration item is a port number, its configuration might be "2390"; if it's a host, its configuration might be "Local Host". Another example is a configuration item specifying the supported formula version in a document application, which might be configured as "Formula 3.0". Yet another example is a configuration item specifying whether the target application's web version supports file transfer, which might be configured as "No".

[0112] In this embodiment, the key-value pair information in the target configuration file is used to record configuration items and their configurations in the test environment. For example, the key-value pair information in the first configuration file is used to record configuration items and their configurations in the first test environment. The key-value pair information in the second configuration file is used to record configuration items and their configurations in the second test environment. The key-value pair information included in the first and second files to be processed is used to record configuration items and their configurations in the first and second test environments, respectively. However, the recording method and extraction difficulty of the key-value pair information change after the language format is converted from the first language format to the second language format.

[0113] Step S33: Compare the key-value pair information of the first file to be processed and the key-value pair information of the second file to be processed to obtain the difference data between the first configuration file and the second configuration file.

[0114] Step S33 can be executed by the server, or by a client configured with an execution module, or by the server calling another server to execute it, or by the client calling a server to execute it.

[0115] In one possible implementation, step S33 can be expressed as: comparing the key-value pair information of the first file to be processed with the key-value pair information of the second file to be processed, and determining the difference data of the key-value pair information of the first file to be processed and the second file to be processed, as the difference data of the first configuration file and the second configuration file.

[0116] Alternatively, in another possible implementation, step S33 can also be expressed as: comparing the key-value pair information of the first file to be processed and the key-value pair information of the second file to be processed, determining the difference data of the key-value pair information of the first file to be processed and the second file to be processed, and then performing format conversion to obtain the difference data of the first configuration file and the second configuration file.

[0117] The difference data between the first configuration file and the second configuration file, also known as the difference points between the first configuration file and the second configuration file (that is, the difference data can also be called difference points), may include the difference data between the first configuration file and the second configuration file, and / or the difference data between the second configuration file and the first configuration file.

[0118] In one possible implementation, the difference data between the first configuration file and the second configuration file may include at least one of the following cases.

[0119] (1) Key-value pairs that exist in the first configuration file but not in the second configuration file.

[0120] If the initial configuration of the first test environment is the same as the initial configuration of the second test environment, and a configuration item is deleted during the testing of the second target in the second test environment, then there may be data discrepancies (1).

[0121] If the initial configuration of the first test environment is different from that of the second test environment, and a configuration item in the first test environment does not exist in the second test environment, then there may be discrepancies in the data (1).

[0122] If the initial configuration of the first test environment is the same, but the value of a configuration item in the first configuration file is deleted, then there may be different data (1).

[0123] (2) The same key exists in both the first configuration file and the second configuration file, but the specific values ​​in the key-value pair information are different.

[0124] If the initial configuration of the first test environment is the same as the initial configuration of the second test environment, and during the testing of the second target in the second test environment, the specific configuration corresponding to a configuration item is modified to other content, then there may be discrepancies in the data (2).

[0125] If the initial configuration of the first test environment is the same as the initial configuration of the second test environment, but the specific configurations are different, then there may be data discrepancies (2).

[0126] (3) Key-value pairs exist in both the first and second configuration files, but appear in different orders.

[0127] (4) It exists in both the first and second configuration files, but the order of the contents in the values ​​corresponding to the key-value pairs is different.

[0128] For example, in key-value pair information, where the key further includes multiple keys and / or multiple values, the order of the multiple keys and / or multiple values ​​may differ.

[0129] In one possible implementation, when a configuration item in the target configuration file is deleted, the possible deletion methods include: (1) deleting the configuration corresponding to the configuration item, thus making the configuration corresponding to the configuration item an empty value; (2) modifying the configuration corresponding to the configuration item to an invalid value; (3) deleting the configuration item and its corresponding configuration while retaining the location of the configuration item; (4) deleting the configuration item, its corresponding configuration, and the location of the configuration item. The location of the configuration item can be represented by a symbol, a space, or a blank line.

[0130] In one possible implementation, comparing the key-value pairs of the first file to be processed and the key-value pairs of the second file to be processed can include: sequentially comparing the key-value pairs of the first file to be processed and the key-value pairs of the second file in the same order. For example, if the key-value pairs of the first file to be processed are key11-value11, key12-value12, and key13-value13 from the beginning, and the key-value pairs of the second file to be processed are key21-value21, key22-value22, and key23-value23 from the beginning, then key11 and key21, key12 and key22, and key13 and key23 are compared sequentially, and then value11 and value21, value12 and value22, and value13 and value23 are compared sequentially.

[0131] In another possible implementation, comparing the key-value pairs of the first file to be processed and the key-value pairs of the second file to be processed can include: comparing the key-value pairs of the first file to be processed with the corresponding key-value pairs in the second file to be processed. The corresponding order can refer to an order that should be the same but is actually different. For example, during the testing of the first target, after deleting configuration items, configurations, and their positions in the first test environment, subsequent configuration items are moved one position forward. Then, starting from the deleted configuration item, the configuration items in the first file to be processed correspond to the next-order configuration items in the second file with the same order.

[0132] Step S34: Determine the configuration settings for the first test environment and the second test environment based on the difference data.

[0133] Step S34 can be executed by the server, or by a client configured with an execution module, or by the server calling another server to execute it, or by the client calling a server to execute it.

[0134] In steps S31-S34, each step can be executed by a different execution entity, or all steps can be executed by the same execution entity. For example, steps S31-S34 can all be executed by the server, or steps S31-S33 can be executed by the server and step S34 can be executed by the client.

[0135] When step S34 is executed by the server, it may further include: processing and calculating the difference data on the server side according to the difference data and the pre-set configuration setting rules, and determining to modify the configuration of at least one of the first test environment and the second test environment according to the calculation results.

[0136] The above process can be executed by the client, or by the client calling the server to execute it.

[0137] Alternatively, step S34 may include: displaying the difference data; receiving a configuration setting method instruction based on the difference data; and configuring at least one of the first and second test environments according to the configuration setting method instruction. The configuration setting method instruction may be sent by an operator based on the difference data.

[0138] In this embodiment of the application, determining the configuration settings for the first test environment and the second test environment based on the difference data may include: determining to modify the configuration of the first test environment and / or the configuration of the second test environment based on the difference data.

[0139] Furthermore, modifying the configuration of the first test environment and / or the second test environment may include one of the following methods.

[0140] (1) Modify the configuration of the first test environment so that the configuration of the first test environment is the same as that of the second test environment.

[0141] (2) Modify the configuration of the second test environment so that the configuration of the second test environment is the same as that of the first test environment.

[0142] (3) Modify at least some of the difference data in the first test environment and / or the second test environment.

[0143] (4) Merge the mergeable items of the difference data in the first test environment and the second test environment. For example, merge key-value pairs with the same key but different values. The resulting key is the key in the original key-value pair information, and the resulting value includes all the values ​​in the original key-value pair information.

[0144] Because the target may be updated rapidly, multiple targets may need to be tested simultaneously. (Refer to...) Figure 3B As shown, two or more test environments (with configuration files designated as the first and second configuration files, respectively) can be used to perform parallel testing on different versions of the target under test during version iteration testing. The target under test may change during the testing process, even as each test environment is testing it. For example, the first target under test may have a patch version, i.e. Figure 3BThe V1 SP version is shown, and the second target under test is version V2. After testing the first and second targets under test using two test environments, ENV1 and ENV2, the configuration data in both test environments changes. By comparing the configuration data in the two test environments, difference data is obtained. At least one of the two test environments can be modified based on the difference data. Then, the first and second targets under test are re-evaluated using the modified test environment. This helps to consider more comprehensive factors and optimize the configuration environment to obtain more accurate test results for the target under test. Therefore, the method provided in this application embodiment can also obtain accurate test results by using different test environments to test different versions of the same initial target under test in parallel. This allows for parallel testing of different targets under test, which helps to improve testing efficiency while ensuring test accuracy.

[0145] Understandably, in other possible implementations, more than two test environments can be used to test more targets in parallel. This allows more target configuration files to be converted into files to be processed for comparison, obtaining difference data. The test results can then be improved based on the difference data, thus allowing more targets to be tested in parallel and further improving testing efficiency.

[0146] In one implementation, Figure 3A Based on the illustrated embodiment, step S33, namely, comparing the key-value pair information corresponding to the first file to be processed and the key-value pair information corresponding to the second file to be processed to obtain the difference data between the first configuration file and the second configuration file, may further include: comparing the first file to be processed with the second file to be processed to determine the first difference data between the first file to be processed and the second file to be processed; comparing the second file to be processed with the first file to be processed to determine the second difference data between the second file to be processed and the first file to be processed; and converting the first difference data and the second difference data into the first language format to obtain the difference data between the first configuration file and the second configuration file.

[0147] In one possible implementation, comparing the first file to be processed with the second file to be processed can mean comparing the second file to be processed with a reference. Similarly, comparing the second file to be processed with the first file to be processed can mean comparing the first file to be processed with a reference.

[0148] Using the first and second files to be processed as references, the corresponding difference data is obtained and then integrated into the difference data of the first and second configuration files. This allows for a more comprehensive and complete identification of the differences between the first and second configuration files, which helps to optimize the target object based on these complete differences. When the target object is the test environment, this can improve the accuracy of the test results.

[0149] For example, a user needs to use an online testing platform to test program code. The user determines which of the available testing platforms best suits their testing requirements. Therefore, the user can access the server-side interface through a client, open a webpage for visually accessing the server, enter the address to retrieve the test platform's configuration file, submit a comparison command, and instruct the server to retrieve the configuration file from that address and execute the command. Figure 3A as well as Figure 3A The method in the relevant embodiments compares the configuration files.

[0150] In addition, users can access the test platform's configuration file address and obtain the configuration file through the client, storing it locally on the client. Then, the client sends the configuration file to the server, allowing the server to receive and execute commands based on the configuration file. Figure 3A as well as Figure 3A Methods of related embodiments.

[0151] In one implementation, the key-value pair information includes a key and a value; the same steps are used for comparison when the first configuration file is used as a reference file and when the second configuration file is used as a reference file. That is, in one possible implementation, comparing the key-value pair information corresponding to the first file to be processed and the key-value pair information corresponding to the second file to be processed includes: determining a target file and a reference file, wherein the target file is one of the first file to be processed and the second file to be processed, and the reference file is the other of the first file to be processed and the second file to be processed; comparing each target key with each reference key; wherein the target key is a key in the target file, and the reference key is a key in the reference file that corresponds sequentially to the target key; if no matching key exists among the reference keys, the target key is recorded in the difference data.

[0152] In this embodiment, the first file to be processed and the second file to be processed can be automatically selected as target files sequentially, while the other file can be used as a reference file. The final generated difference data includes both the difference data between the first file to be processed and the second file to be processed, and the difference data between the second file to be processed and the first file to be processed.

[0153] Alternatively, based on user instructions, one of the first and second files to be processed can be used as the target file, and the other as the reference file. The final generated difference data will include only the differences between the first and second files to be processed, or only the differences between the second and first files to be processed.

[0154] For example, users can access an interface provided by the server to open a web page for visual access to the server. Through this visual page, they can provide configuration files or the address to obtain configuration files. When submitting a configuration file, users can choose to perform a one-way or two-way comparison. If the user chooses to specify either the first or second configuration file as a reference file, the client simultaneously sends a one-way comparison command upon submission. The server then performs a one-way comparison on both configuration files based on this command. Otherwise, the client can send a two-way comparison command by default upon user submission, and a two-way comparison can be performed by default.

[0155] For example, when a user submits the first and second configuration files directly on the server, they can also send one-way or two-way comparison commands.

[0156] In one possible implementation, the keys in the reference file that correspond to the target key in the same order may include: keys in the reference file that are in the same order as the target key, and / or keys in the reference file that are in a different order than the target key but can be misaligned.

[0157] In some common data exchange formats for configuration files (such as JSON), keys are unique, while multiple values ​​may exist for each key. In this embodiment, the keys in the file to be processed are first matched. If the keys are different, it is not necessary to determine whether the values ​​are the same, which simplifies the amount of information that needs to be compared and improves the comparison efficiency.

[0158] In one implementation, if the target key and reference key are compared and it is determined that the target key and reference key are the same (that is, a reference key is determined as the matching key of the target key), further comparison of the corresponding values ​​is required. Accordingly, the configuration file processing method further includes: if the target key has a matching key in the reference key, comparing the type of the target key's value with the type of the matching key's value; the matching key is a reference key that is the same as the target key; if the types are different, recording the target key in the difference data.

[0159] In some common data exchange formats for configuration files, a key may correspond to multiple values. Therefore, comparing the target key value with the reference key value one by one, or comparing the target key value with the matching key value one by one, can increase the number of comparison operations. By determining whether the value types are the same, some key-value pairs with the same matching key but different value types can be filtered out. This not only accurately identifies inconsistent key-value pairs but also reduces the amount of data to be compared, improving comparison efficiency.

[0160] In one implementation, the possible types of values ​​can be defined, and for some complex types of values, a cyclical comparison subprocess can be set. Correspondingly, the configuration file processing method further includes: if the types are the same, and the value corresponding to the type represents at least one key, then using the at least one key included in the corresponding value as a new target key, and the key included in the value corresponding to the matching key as a new reference key, and returning to the step of comparing the target key with the reference key.

[0161] For example, in general, key-value pair information can be represented in key-value form, where the value may further include at least one key-value pair; that is, key-value pair information may be represented as key1-key11-value11. In this case, key1 is the key, and "key11-value11" is the value. In another case, the value of a key may not include the key, but only multiple values; that is, key-value pair information may be represented as key1-value11-value12. For the former case, by using the keys in the values ​​sequentially as reference keys, the complex values ​​in the former case can be compared.

[0162] On the client or server side, a module can be set up to compare key-value pairs in the file to be processed. By calling the module, the comparison rules are executed.

[0163] In one implementation, the configuration file processing method further includes: recording the target key in a current comparison list before recording the target key in the difference data; removing the target key from the current comparison list after recording the target key in the difference data; and, if the target key is the last key included in the values ​​corresponding to other keys, removing the target key from the current comparison list and then removing the last key in the current comparison list.

[0164] For example, a list of key-value pairs might contain: key1 - (key2 - value1, key3 - value2). This means that the value corresponding to key1 is the two key-value pairs within the parentheses. When comparing to key2, the comparison list contains keys including key1 - key2. After comparing value1, the last key in the comparison list (key2) is deleted (or cleared), leaving key1. Next, the comparison is performed on key3, which contains keys including key1 - key3. After comparing value2, the last key in the list (key3) is deleted. Since key3 is the last key of the key-value pair, key1 is then deleted as well.

[0165] In this embodiment of the application, the current comparison list is equivalent to a temporary list used to record the key-value pairs currently being compared. When a key-value pair is being matched with other key-value pairs, the corresponding key is recorded in the current comparison list so as to update the comparison status in real time and avoid duplicate comparisons or omission of key-value pairs during the comparison process.

[0166] In one case, the type indicates that the corresponding value includes at least one key, and the type is a dictionary (dict), a set (set), or a list (list).

[0167] In this embodiment, the dictionary type is a key-value type, which is equivalent to the key-value pair information included in the value of the key-value pair information.

[0168] List types can be ordered collections of elements. Elements can be keys or values ​​of any type. Each element can be considered as a value contained within a list of values.

[0169] Collection types can include unordered elements. Elements can be keys or values ​​of any type.

[0170] The method provided in this application embodiment can compare values ​​of dictionary type, set type and list type by comparing the keys included in the value and then further comparing the values ​​included in the value, thereby improving the comparison efficiency of values ​​of this type of complex type.

[0171] In one embodiment, based on Figure 3AIn the illustrated embodiments and related embodiments, step S33, which is before comparing the key-value pair information corresponding to the first file to be processed and the key-value pair information corresponding to the second file to be processed to obtain the difference data between the first configuration file and the second configuration file, further includes: receiving a sorting comparison instruction; the sorting comparison instruction is used to indicate that the order of the list-type values ​​in the file to be processed is not compared; sorting the list-type values ​​according to a preset rule; and replacing the list-type values ​​before sorting with the sorted list-type values.

[0172] Sorting and comparison instructions can be commands sent from the client to the server, which then sorts the values ​​of a specified type according to the instructions. Alternatively, sorting and comparison instructions can be received by the client or server via external devices such as a keyboard or mouse, and the corresponding sorting of the values ​​of a specified type can be performed locally on the client or server.

[0173] Using the above method, when comparing list-type values, operators can choose not to consider the order factor, providing a flexible option for comparing configuration files.

[0174] In one embodiment, sorting the values ​​containing order information in the file to be processed according to a preset rule includes: classifying the elements contained in the list-type values ​​to obtain multiple categories of values ​​containing order information; sorting the values ​​contained in each category according to a preset first sorting rule; and sorting each category according to a preset second sorting rule to obtain sorted list-type values.

[0175] In this embodiment, after sorting, target values ​​and reference values ​​are selected for comparison, wherein the order of the reference values ​​corresponds to the order of the target values. By classifying the elements contained in the list-type values, it is possible to sort the list-type values ​​according to a set rule. Thus, the re-sorted list-type values ​​do not contain the original element sorting information, and the elements are sorted according to preset rules such as numerical size or alphabetical order. If the list-type values ​​contain the same elements but in different orders, then according to the above method, when comparing the elements contained in the list-type values ​​in order, these list-type values ​​can be identified as the same values.

[0176] In one implementation, the multiple categories include: string, array, integer, dictionary type, and list type.

[0177] The above method allows for the sorting of elements within each category, thereby disrupting the original order of the elements and unifying the order of identical elements. This ensures that when comparing elements, the original order of the elements is excluded, and only the similarity of the elements contained in the values ​​is compared.

[0178] In one implementation, the first language format is YAML format and the second language format is JSON format.

[0179] YAML format can be converted to JSON format with almost no loss. When the primary language format is YAML, the configuration file contains key-value pair information.

[0180] For example, features of the YAML format include: case sensitivity; use of indentation to represent hierarchical relationships; support for data formats such as strings (string, str), integers (integer), floating-point numbers (float), booleans (bool), null values, time, and dates; the use of "#" to represent comments; keys and values ​​in objects can be separated by ":", with a space after the colon; and indentation is used to represent the hierarchical structure of objects; array elements begin with "-", each line represents one array element, and the array hierarchy is also represented by indentation. Special symbols in YAML can include: ---, indicating the beginning of the file; ..., indicating the end of the file; and !!, indicating type conversion, etc.

[0181] In this embodiment, the configuration files in the test environment are originally recorded using YAML format. YAML is concise and intuitive, making the configuration files more readable and easier for testers to manipulate. In JSON format, key-value pairs are expressed more intuitively and are easier to identify and extract. Therefore, using YAML to record configuration files helps testers debug during the testing process. Using JSON format for the files to be processed facilitates a comprehensive, thorough, and accurate comparison of key-value pairs, enabling the rapid identification of differences between target configuration files.

[0182] In one implementation, the target configuration file includes annotation data of key-value pair information; the file to be processed includes the annotation data and the path of the key of the annotation data in the file to be processed; the configuration file method for the test environment further includes: supplementing the annotation data into the key-value pair information corresponding to the difference data according to the path of the key.

[0183] Since YAML is used as the primary language format in this embodiment, the configuration can be interpreted through annotation data, further facilitating the deployment of testers during the testing process. After obtaining the difference data of the file to be processed, the difference data is converted back to YAML format, and annotation data is added to the difference data. This helps relevant operators understand the difference data and more accurately determine how to change the configuration of the test environment.

[0184] In another possible implementation, the first language format is XML and the second language format is JSON.

[0185] In another possible implementation, the first language format is YAML and the second language format is XML.

[0186] In another possible implementation, the first language format is HTML and the second language format is XML.

[0187] In another possible implementation, the first language format is HTML and the second language format is JSON.

[0188] In one implementation, determining the configuration settings for the first test environment and the second test environment based on the difference data includes: determining modification items and corresponding modification content based on the difference data; modifying the modification items in the first configuration file and the second configuration file to the corresponding modification content to obtain an updated first configuration file and an updated second configuration file; updating the first test environment based on the updated first configuration file, and updating the second test environment based on the updated second configuration file.

[0189] In another possible implementation, the first configuration file can be supplemented based on the differences between it and the second configuration file, and the second configuration file can be supplemented based on the differences between it and the first configuration file. For example, suppose the initial configurations of the first and second test environments include Aa and Bb, where "-" indicates the key-value separator, with the key before the "-" and the value after the "-". After comparing the target configuration files, it is determined that a new configuration Cc has been added to the first configuration file, and a new configuration Dd has been added to the second configuration file. Therefore, configuration Cc can be supplemented to the second configuration file, and configuration Dd can be supplemented to the first configuration file.

[0190] In this embodiment, the configuration and modification content of the test environment are first determined in the difference data. Then, the configuration of the test environment is modified and updated to improve the efficiency of test environment maintenance and help to align test environments with different configurations so as to better apply to the parallel testing of subsequent different versions of the target under test with the same initial version.

[0191] exist Figure 3A Based on the embodiments shown, Figure 4A This illustrates another application scenario of the method provided in the embodiments of this application. Users can remotely access the interface provided by the server through a client to invoke the server's functions to implement the configuration file processing method. For example... Figure 4A As shown in Figure a, users can access a website provided by the server (e.g., XXX: / / XXXXX.XXXXXX.XX) through their client's browser and use the configuration file upload control on the website to upload a first configuration file and a second configuration file. The first and second configuration files can be stored locally on the client. After clicking the configuration file upload control, the user is taken to a local file selection interface, such as... Figure 4A As shown in b. After selecting a configuration file, the user can click the comparison control on the page to upload the first and second configuration files to the server for comparison. The server can then execute... Figure 3A The steps of the illustrated embodiment or any related embodiment involve comparing the first configuration file and the second configuration file to obtain difference data. After obtaining the difference data on the server side, the difference data of the configuration files can be displayed to the user, such as... Figure 4B a and Figure 4B As shown in b, different cards are used to display to the user the difference data between the first profile and the second profile, as well as the difference data between the second profile and the first profile.

[0192] exist Figure 4COn the page shown in section 'a', users can also choose whether to sort the value or key-value pair information of a specified type. For example, users can choose to sort key-value pairs of type dict, values ​​of type list, or both dict and list types. Furthermore, users can select the sorting range, allowing them to input the starting line number or starting line configuration item and parameters of the configuration file segments to be sorted, as well as the ending line number or ending line configuration item and parameters, thus sorting the selected segments during comparison. If the user does not fill in any content in the input box corresponding to the sorting, but selects the dict and / or list option for sorting, then by default, the entire configuration file range will be sorted. Users can enter the sorting range for the first configuration file in the input box corresponding to sorting range 1, and the sorting range for the second configuration file in the input box corresponding to sorting range 2.

[0193] After the user selects the sorting method, when the user clicks the configuration file upload control, a sorting command is sent at the same time, and the server performs sorting-related steps on the configuration file.

[0194] In one possible implementation, the user can choose to upload a configuration file as the first configuration file, and the server can use a default configuration file as the second configuration file. Alternatively, the user can choose a configuration file provided by the server as both the first and second configuration files.

[0195] In one possible implementation, the user can select the target application's configuration file as the first configuration file and the target system's configuration file as the second configuration file. Figure 4B a or Figure 4B b) Determine the difference data between the first configuration file and the second configuration file, and determine the compatibility between the target application and the target system and the incompatible configuration items based on the difference data, so as to select whether to use the target application on the target system.

[0196] exist Figure 3A Based on the illustrated embodiments, in another possible application scenario of this application, a user needs to use either Platform 1 or Platform 2 for code testing. To determine which platform to use, the user can obtain configuration files for Platform 1 and Platform 2 from their respective access interfaces, then send these configuration files to the server. The server compares the configuration files, obtains the differences, and returns the data to the user. The user can then view the differences through a client and choose to use either Platform 1 or Platform 2. Figure 4BAs shown, in this scenario, users can select to upload configuration files on the server-side webpage, uploading the configuration files from Platform 1 and Platform 2 to the server for comparison. Users can also fill in the configuration file retrieval address on the webpage, and the server will retrieve the configuration file based on that address for comparison. Figure 4B In the scenario shown, users can still choose to sort the configuration files.

[0197] In another possible implementation, users can obtain online or offline configuration files through software tools installed on the client, and then compare the online or offline configuration files using these tools. For example, refer to... Figure 4C As shown in Figure a, in addition to uploading a configuration file, users can also choose an online configuration file. After the user clicks to select an online configuration file, a command to select the configuration file is generated and sent to the server. The server then returns a list of available configuration files, as shown in Figure a. Figure 4C As shown in b, the list of optional configuration files includes multiple configuration file sources. A configuration file source can be determined by the server receiving a configuration file selection instruction, sending a request to a verified source server, which then sends the latest configuration file source to the server, which in turn returns it to the client.

[0198] At the same time, Figure 4C In the interface shown in b, if the user selects a source, they can also access the sub-path corresponding to that source and further determine the configuration file from the sub-path.

[0199] In one possible implementation, users can also choose to upload a first configuration file and select a second online configuration file. Besides online platforms providing configuration files, online configuration file sources can also include any device capable of providing online configuration files, such as a remotely connected server with access restrictions.

[0200] In another possible implementation, the user can also configure the execution on the client or server side. Figure 3A as well as Figure 3A The relevant methods or software, by opening the application or software, can obtain a configuration file from local or remote sources, and convert the language format of the configuration file from a first language format to a second language format, either locally or by calling a remote server. Then, it obtains the local file to be processed, or receives a second file to be processed remotely. The application or software is then run on the client or server side to determine the differences in the configuration file data. Users can use an application installed on their mobile phones to execute... Figure 3A And the methods in the related embodiments.

[0201] The following section provides an example of this application.

[0202] Example (1)

[0203] In this example, combined Figures 5 to 10 Please provide an explanation.

[0204] In one example of this application, the first language format is YAML, and the second language format is JSON. (See reference...) Figure 5 As shown, in this example, a configuration file comparison system is set up. This system uses the method provided in the embodiments of this application to compare the first and second configuration files corresponding to two test environments, obtaining the difference data. For example... Figure 5 As shown, two YAML-formatted configuration files are simultaneously input into the configuration file comparison system. After data comparison, the system outputs and displays the data differences between the two configuration files. Any user of the testing system can configure the two YAML-formatted configurations according to the output differences, making the configurations of the two test environments identical.

[0205] Still refer to Figure 5 and Figure 10 As shown, the configuration file comparison system supports the simultaneous input of two (or more) YAML language format configuration files (equivalent to the target configuration file in the aforementioned embodiment), and will output two comparison results, corresponding to the differences between the two YAML language format configuration files.

[0206] exist Figure 5 On this basis, Figure 6 This demonstrates the initial operations performed after a YAML-formatted configuration file is input into a configuration file comparison system. Upon receiving the YAML-formatted configuration file, the system reads the key-value pairs and comment data from the file. The key-value pairs are converted to JSON format and stored, resulting in JSON-formatted key-value pair information. The comment data is then supplemented with key information and stored as JSON-formatted comment data. (See reference...) Figure 10 As shown, the annotation data, after being converted to JSON format, is used in the subsequent retrieval and filtering sub-process (i.e. Figure 9 (The sub-process shown). The key information supplemented for each annotation data entry includes the path to the key corresponding to the annotation data; that is, the supplemented key information includes all keys directly or indirectly corresponding to the annotation data. The JSON-formatted key-value pair information includes the first and second files to be processed in the aforementioned embodiments.

[0207] exist Figure 5 On this basis, Figure 7The document demonstrates the process by which the configuration file comparison system converts YMAL-formatted configuration data into JSON format and then sorts it according to the received sorting instructions. Figure 7 The steps shown can be performed Figure 6 The process shown will be executed afterward. The configuration file comparison system will provide an option to select whether to sort, and will receive the selection instruction through this option. If the user selects the sorting option, the configuration file comparison system will pass is_sorted=1 as the sorting instruction; otherwise, it will pass is_sorted=0. When the configuration file system receives a selection of is_sorted=1, it will sort the values ​​of the specified type. If is_sorted=0 is passed, the values ​​of the specified type will not be sorted, and the order of the values ​​will also be used as one of the criteria for determining whether they are the same.

[0208] In this embodiment of the application, values ​​of type list can be used as follows: Figure 7 The sorting is performed as shown, and the sorting process includes... Figure 7 Steps S71-S75 are shown.

[0209] Step S71: Input the key-value pair information in JSON language format into the sorting module.

[0210] Step S72: Recursively traverse the key-value pair information in JSON language format, obtain the value data with data type list, and store it in the list array.

[0211] Step S73: For each list array, iterate through the list array, and store the elements in the list array into the corresponding category array according to the category to which they belong.

[0212] As an example, the classification criteria can be found in Table 1 below.

[0213]

[0214] Table 1

[0215] Each type in Table 1 can be sorted using pre-defined rules. For example, the general sorting rules for elements in a string list type are: uppercase letters, lowercase letters, numbers, and Chinese characters in that order; multiple letters that are all uppercase or all lowercase are sorted alphabetically; multiple numbers are sorted by their numerical value; and multiple Chinese characters are sorted according to the order of their first letter in the alphabet.

[0216] Step S74: Sort the lists for each category, and then merge the categorized lists in the order of none_list, int_list, str_list, dict_list, and list_list to obtain the sorted list.

[0217] Step S75: Replace the unsorted values ​​in the JSON key-value pair information with the sorted values.

[0218] Reference Figure 10 As shown, after Figure 7 The corresponding subprocess sorts the first and second files to be processed, resulting in sorted first and second files to be processed.

[0219] exist Figure 5 and Figure 5 Based on relevant examples, Figure 8 This demonstrates the process of comparing key-value pairs in JSON using a configuration file comparison system. The key-value pair information set of one file to be processed is recorded as A, equivalent to the first file to be processed in the aforementioned embodiment. The key-value pair information set of the other file to be processed is recorded as B, equivalent to the second file to be processed in the aforementioned embodiment. Comparing the two JSON-formatted key-value pairs may include steps S81-S810 as shown in Figure 8.

[0220] Step S81: Determine the type of key-value pairs between A and B. If both are dictionary-type key-value pairs, or both are array lists, proceed to the next step for comparison. Otherwise, determine that the entire text is inconsistent and directly output the input data as the comparison result.

[0221] Step S82: Recursively traverse A, record the keys encountered, and store them in a key list key_list. If the traversal is an array, use the array index as the key.

[0222] Step S83: Based on the key traversed, determine whether the key exists in the corresponding key-value pairs in A and B. If not, add the current key_list content to the result set, clear the key at the end of the key_list, and continue traversing.

[0223] Step S84: For keys that exist in both A and B, determine whether their corresponding values ​​are of the same data type. If they are different, add the key_list to the result set and clear the key at the end of the key_list, then continue to traverse the keys of A.

[0224] Step S85: If the value types are the same, determine whether the values ​​are the same based on their types.

[0225] When executing step S85, steps S86-S88 can be executed according to different values.

[0226] Step S86: If the type of value is an array list or dictionary object, then continue to traverse the array list or dictionary object.

[0227] Step S87: If the value is of another type, compare the values ​​corresponding to the same key in A and B to see if they are equal. If not, add the key_list to the result set. After the comparison is complete, clear the last key in the key_list and continue iterating to the next key.

[0228] Step S88: If the key being traversed is the last key in the current array or object, after the traversal ends, the traversal of the corresponding key in the current array or object will be completed and the traversal of the next key of the current data will continue. Therefore, after clearing the last key in the key_list, the last key in the current key_list needs to be cleared again.

[0229] Step S89: After the comparison is completed, output the result set of the array list consisting of different key_lists as the preliminary comparison result of A.

[0230] A preliminary comparison result, equivalent to the first difference data in the aforementioned embodiments, such as... Figure 10 As shown.

[0231] Replace A with B and repeat steps S82 to S89 to obtain a preliminary comparison result for B. This preliminary comparison result for B corresponds to the second difference data in the aforementioned embodiment, such as... Figure 10 As shown.

[0232] exist Figure 8 Based on this, the preliminary comparison results of A and B are filtered and retrieved to obtain the difference data. The process of transforming the preliminary comparison results into the final difference data includes... Figure 9 Steps S91-S93 are shown.

[0233] Step S91: Iterate through the key_list in the preliminary comparison results of A and the key_list in the preliminary comparison results of B, and add the value corresponding to the key.

[0234] The data with added values ​​is added to the result set.

[0235] Step S92: Convert the JSON-formatted result set of the search results into a YMAL-formatted result set.

[0236] Step S93: Iterate through the YAML result set line by line to obtain the key path. Extract the corresponding comment data for the key path from the JSON comment data and add it to the end of the last key corresponding to the key path in the YAML result set to obtain the difference data of the target configuration file.

[0237] Combination Figure 10 As shown, the difference data in the target configuration file includes first difference data in YAML format and second difference data in YAML format.

[0238] Example (2)

[0239] When the first language format is YAML and the second language format is JSON, the configuration file processing methods include: Figure 11 The steps are shown.

[0240] Step S1101: The client receives the first and second configuration files in YAML format uploaded by the user.

[0241] Step S1102: The client accesses the network interface for language format conversion and sends the configuration file to the first server.

[0242] Step S1103: The first server converts the configuration file into a second language format to obtain the file to be processed.

[0243] In practical implementations, to ensure information is not leaked, a default replacement rule can be used to replace the configuration corresponding to the configuration item, thereby hiding the configuration content. Alternatively, encryption methods can be employed to hide at least some sensitive configurations.

[0244] Step S1104: The client receives the file to be processed returned by the first server.

[0245] If the configuration file is encrypted or partially hidden before format conversion, in step S1103, the client can restore the hidden content in the intermediate file to be processed and obtain the file to be processed.

[0246] Through steps S1101 to S1104, the client can convert the first configuration file in YAML format into a first file to be processed in JSON format, and convert the second configuration file in YAML format into a second file to be processed in JSON format.

[0247] As an example, the specific contents of the YAML format of the first configuration file and the second configuration file are shown in Table 2 below.

[0248]

[0249] Table 2

[0250] Accordingly, the first file to be processed in JSON format obtained from the first configuration file shown in Table 2 is: {'a': {'a1': 'ha', 'aa': 1, 'ab': 'a', 'ac': [11, 'aa']}, 'b': {'ba': 2, 'bb':'b', 'bc': [22, 'bb']}, 'c': 'c', 'd': 1, 'e': 'e'}.

[0251] The second file to be processed, in JSON format, obtained from the second configuration file conversion shown in Table 2, is: {'a': {'a1': 'ha', 'aa': 2, 'ad': 'b', 'ac': [12, 'ab']}, 'b': {'bd': 1, 'bb': 'a', 'bc': [21, 'ba']}, 'c': 'c1', 'd': 2, 'e': 'e'}.

[0252] Step S1105: The client accesses the comparison interface and sends the first and second files to be processed to the second server.

[0253] When sending, certain hiding or encryption methods can be used to process the first and second files to be processed in order to ensure that sensitive content is not leaked.

[0254] Step S1106: The second server compares the first file to be processed and the second file to be processed to obtain the first difference data and the second difference data.

[0255] Step S1107: The client receives the first difference data and the second difference data returned by the second server.

[0256] Step S1108: The client accesses the language format conversion interface and sends the first difference data and the second difference data to the first server.

[0257] Step S1109: The first server converts the first difference data into YAML format and the second difference data into YAML format.

[0258] Based on the data shown in Table 2, the first difference data is shown in Table 3 below.

[0259]

[0260] Table 3

[0261] Based on the data shown in Table 2, the second set of difference data is shown in Table 4 below.

[0262]

[0263] Table 4

[0264] Step S1110: The client receives the difference data in YAML format returned by the second server and displays the difference data.

[0265] The YAML format data shown in Tables 3 and 4 can be used to generate a display of the difference data after adding annotation data on a second server or client, or it can be used directly as the display result.

[0266] Corresponding to the method provided in the embodiments of this application, the embodiments of this application also provide a configuration file processing device, such as... Figure 12 As shown, it includes: a configuration file acquisition module 1201, a format conversion module 1202, and a comparison module 1203.

[0267] The configuration file acquisition module 1201 is used to obtain a target configuration file in a first language format. The target configuration file may include a first configuration file of a first target object and a second configuration file of a second configuration object.

[0268] The target configuration file includes a first configuration file for a first test environment and a second configuration file for a second test environment; the first test environment is used to test a first target under test, and the second test environment is used to test a second target under test.

[0269] The format conversion module 1202 is used to convert the target configuration file in the first language format into a file to be processed in the second language format; the file to be processed includes a first file to be processed obtained by converting the first configuration file and a second file to be processed obtained by converting the second configuration file; the file to be processed in the second language format includes extractable key-value pair information; the key-value pair information in the file to be processed in the second language format corresponds to the key-value pair information in the target configuration file; the key-value pair information is used to record configuration items and configuration of configuration items in the test environment.

[0270] The comparison module 1203 is used to compare the key-value pair information of the first file to be processed and the key-value pair information of the second file to be processed to obtain the difference data between the first configuration file and the second configuration file.

[0271] In other embodiments of this application, in the configuration file processing apparatus, each module is further configured to perform operations related to... Figure 3A The methods implemented in the relevant embodiments or examples.

[0272] Meanwhile, the configuration file processing device for the test environment in this application embodiment may also include other functional modules to implement any steps and functions in the configuration file processing method provided in any embodiment of this application.

[0273] The functional units and modules in the above embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of the embodiments of this application.

[0274] This application also provides a chip, including a processor. The processor is used to read and execute a computer program stored in a memory to perform the configuration file processing method provided in any embodiment of this application.

[0275] Optionally, the chip may also include a memory, which is connected to the processor via a circuit or wire.

[0276] This application also provides a chip system including a processor. The processor is used to read and execute a computer program stored in a memory to perform the methods provided in any embodiment of this application.

[0277] Optionally, the chip system also includes a memory, which is connected to the processor via circuitry or wires.

[0278] In one embodiment of this application, the method can be applied to a client, which can be a mobile phone. Furthermore, the method provided in this application can also be applied to an Android system. A schematic diagram of the configured software architecture is shown below. Figure 13 As shown, Figure 13 The electronic device shown runs the Android operating system. In other embodiments, the electronic device may be equipped with other types of operating systems.

[0279] See Figure 13 A layered architecture divides software into several layers, each with a clear role and function. Layers communicate with each other through software interfaces. In some embodiments, the Android system comprises multiple layers, from top to bottom: the application layer, the application framework layer, the Android runtime, the system layer, and the kernel layer.

[0280] Figure 13 This is a block diagram of a software system for an electronic device to which the method provided in the embodiments of this application is applied. See also... Figure 13 A layered architecture divides software into several layers, each with a clear role and function. Layers communicate with each other through software interfaces. In some embodiments, the Android system comprises multiple layers, from top to bottom: the application layer, the application framework layer, the Android runtime, the system layer, and the kernel layer. When a model call instruction is issued, the instruction is reported layer by layer from the bottom up to the application framework layer or the application layer.

[0281] The application layer can include a series of application packages. For example... Figure 13 As shown, the application package can include desktop applications, camera, gallery, calling, map, navigation, Bluetooth, music, video and other applications.

[0282] The application framework layer provides application programming interfaces (APIs) and a programming framework for applications in the application layer. The application framework layer includes some predefined functions. For example... Figure 13 As shown, the application framework layer may include a window manager, content provider, interface layer, phone manager, resource manager, notification manager, etc.

[0283] The system layer includes the Android Runtime. The Android Runtime consists of core libraries and a virtual machine. The Android Runtime is responsible for the scheduling and management of the Android system.

[0284] The kernel layer is the layer between hardware and software. The kernel layer contains at least the display driver, camera driver, audio driver, and sensor driver.

[0285] Under the above four-layer architecture, the receiving device also has a hardware layer, which may include the aforementioned electronic device hardware components, such as displays and buttons.

[0286] Meanwhile, the method in this application embodiment can be applied to Figure 13 The electronic device shown may also include other functional modules for the target under test to run in a test environment. Simultaneously, the test environment can simulate... Figure 13 The architecture shown can also be referenced in the configuration file. Figure 13 Configure the architecture shown.

[0287] As an example of this application, the aforementioned electronic device, or a test device used to simulate the function of the aforementioned electronic device, can access a base station and also has the ability to access a wireless local area network. For example, the electronic device is a mobile phone, tablet, smartwatch, or laptop. (Reference) Figure 14 , Figure 14 This is a schematic diagram of the structure of an electronic device corresponding to the configuration file processing method of this application embodiment. The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a headphone jack 170D, a sensor module 180, buttons 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, a barometric pressure sensor 180C, a magnetic sensor 180D, an accelerometer sensor 180E, a distance sensor 180F, a proximity sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.

[0288] It is understood that the structures illustrated in the embodiments of this application do not constitute a specific limitation on the electronic device 100. In other embodiments of this application, the electronic device 100 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0289] Processor 110 may include one or more processing units, such as: application processor (AP), modem processor, graphics processing unit (GPU), image signal processor (ISP), controller, memory, video codec, digital signal processor (DSP), and / or neural network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.

[0290] The controller can be the nerve center and command center of the electronic device 100. The controller can generate operation control signals according to the instruction opcode and timing signals to complete the control of fetching and executing instructions.

[0291] The processor 110 may include one or more processing units. These processing units may be independent devices or integrated within one or more processors. The processor 110 may also include memory for storing instructions and data.

[0292] In some embodiments, the processor 110 may include one or more interfaces, such as an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.

[0293] The wireless communication function of electronic device 100 can be realized through antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modem processor and baseband processor, etc.

[0294] The terminal device implements display functions through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, connecting the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations and for graphics rendering.

[0295] Display screen 194 is used to display images, videos, etc. Display screen 194 includes a display panel. In some embodiments, electronic device 100 may include one or N displays screens 194, where N is an integer greater than 1.

[0296] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to perform data storage.

[0297] Internal memory 121 can be used to store computer-executable program code, which includes instructions. Processor 110 executes various functional applications and data processing of electronic device 100 by running the instructions stored in internal memory 121. Internal memory 121 may include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as sound playback, image playback, etc.), etc. The data storage area may store data created by electronic device 100 during use (such as audio data, phonebook, etc.). Furthermore, internal memory 121 may include high-speed random access memory and may also include non-volatile memory, such as at least one disk storage device, flash memory device, universal flash storage (UFS), etc.

[0298] Pressure sensor 180A is used to sense pressure signals and convert them into electrical signals. In some embodiments, pressure sensor 180A may be located on display screen 194. Touch sensor 180K, also known as a "touch panel," may be located on display screen 194. The touch sensor 180K and display screen 194 together form a touchscreen, also known as a "touch panel." Touch sensor 180K is used to detect touch operations applied to or near it. Touch sensor 180K can transmit the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through display screen 194. Bone conduction sensor 180M can acquire vibration signals.

[0299] Buttons 190 include a power button, volume buttons, etc. Buttons 190 can be mechanical buttons or touch buttons. Electronic device 100 can receive button input and generate key signal inputs related to user settings and function control of electronic device 100.

[0300] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product. A computer program product includes one or more computer instructions. When the computer instructions are loaded and executed on a computer, all or part of the flow or function according to the embodiments of this application is generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line, DSL) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access, or a data storage device such as a server or data center that integrates one or more available media. Available media can be magnetic media (such as floppy disks, hard disks, and magnetic tapes), optical media (such as Digital Versatile Discs (DVDs)), or semiconductor media (such as Solid State Disks (SSDs)).

[0301] The above-described embodiments are optional embodiments provided by this application and are not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the technical scope disclosed in this application should be included within the protection scope of this application.

Claims

1. A configuration file processing method, characterized in that, include: Obtain the target configuration file in its first language format; The target configuration file includes a first configuration file for a first target object and a second configuration file for a second target object. The target configuration file includes annotation data of key-value pair information. The first target object is a first test environment, and the first configuration file is a configuration file after testing the first target under test using the first test environment. The second target object is a second test environment, and the second configuration file is a configuration file after testing the second target under test using the second test environment. The first target under test and the second target under test are different versions of the target under test. The target configuration file in the first language format is converted into a file to be processed in the second language format. The file to be processed includes a first file to be processed obtained from the conversion of the first configuration file and a second file to be processed obtained from the conversion of the second configuration file. The file to be processed in the second language format includes extractable key-value pair information. The key-value pair information in the file to be processed in the second language format corresponds to the key-value pair information in the target configuration file. The key-value pair information is used to record the configuration items of the target object and the configuration of the configuration items. The configuration items include: hardware configuration, software configuration, network configuration, data source configuration, data transmission configuration, and data storage configuration. Receive a sort comparison instruction; the sort comparison instruction is used to indicate that the order of list-type values ​​in the file to be processed is not compared, the file to be processed includes the annotation data, and the path of the key of the annotation data in the file to be processed; Sort the values ​​of the list type according to a pre-set rule; The sorted list values ​​are used to replace the unsorted list values ​​to obtain the key-value pair information of the first file to be processed and the key-value pair information of the second file to be processed. By comparing the key-value pair information of the first file to be processed and the key-value pair information of the second file to be processed, difference data between the first configuration file and the second configuration file is obtained; the difference data is used to determine the configuration setting method for the first target object and the second target object, and the difference data is the data obtained by merging the mergeable items of the difference data between the key-value pair information of the first file to be processed and the key-value pair information of the second file to be processed; Based on the path of the key, the annotation data is added to the key-value pair information corresponding to the difference data; Based on the difference data, determine the modification items and the corresponding modification content; Based on the modifications made to the first configuration file relative to the second configuration file and the corresponding modifications, the second configuration file is supplemented to obtain an updated second configuration file; and based on the modifications made to the second configuration file relative to the first configuration file and the corresponding modifications, the first configuration file is supplemented to obtain an updated first configuration file. The first test environment is updated according to the updated first configuration file, and the second test environment is updated according to the updated second configuration file; The third target to be tested is tested using the updated first test environment, and the fourth target to be tested is tested in parallel using the updated second test environment. The third target to be tested and the fourth target to be tested are different versions of the target to be tested. The step of comparing the key-value pair information corresponding to the first file to be processed and the key-value pair information corresponding to the second file to be processed to obtain the difference data between the first configuration file and the second configuration file includes: The first file to be processed is compared with the second file to be processed to determine the first difference data between the first file to be processed and the second file to be processed. The second file to be processed is compared with the first file to be processed to determine the second difference data of the second file to be processed relative to the first file to be processed; The first difference data and the second difference data are converted into the first language format to obtain the difference data between the first configuration file and the second configuration file.

2. The method according to claim 1, characterized in that, The key-value pair information includes a key and a value; comparing the key-value pair information corresponding to the first file to be processed and the key-value pair information corresponding to the second file to be processed includes: Determine the target file and the reference file, wherein the target file is one of the first file to be processed and the second file to be processed, and the reference file is the other of the first file to be processed and the second file to be processed; Each target key is compared with each reference key; the target key is a key in the target file, and the reference key is a key in the reference file that corresponds in order to the target key. If the target key does not have a matching key in the reference key, the target key is recorded in the difference data.

3. The method according to claim 2, characterized in that, The method further includes: If the target key has the same key as the reference key, the type of the value of the target key is compared with the type of the value of the matching key; the matching key is the same as the target key. In cases where the types differ, the target key is recorded in the difference data.

4. The method according to claim 3, characterized in that, The method further includes: If the types are the same and the type indicates that the corresponding value includes at least one key, the at least one key included in the corresponding value is taken as the new target key, and the corresponding key included in the value corresponding to the matching key is taken as the new reference key, and the step of comparing the target key with the reference key is returned.

5. The method according to any one of claims 2-4, characterized in that, The method further includes: Before recording the target key in the difference data, the target key is recorded in the current comparison list; After the target key is recorded in the difference data, the target key is removed from the current comparison list; If the target key is the last key among the values ​​corresponding to other keys, the target key is removed from the current comparison list, and then the last key in the current comparison list is removed.

6. The method according to claim 4, characterized in that, The type indicates that, when the corresponding value includes at least one key, the type is a dictionary type, a set type, or a list type.

7. The method according to claim 1, characterized in that, The step of sorting the values ​​of the list type according to a pre-set rule includes: The elements contained in the list type value are classified to obtain multiple categories of values ​​containing order information; The values ​​contained in each category are sorted according to a preset first sorting rule; According to the preset second sorting rule, the sorted categories are sorted to obtain the sorted first file to be processed and the sorted second file to be processed.

8. The method according to claim 7, characterized in that, The second language format is JSON, and the multiple categories include: string, array, integer, dictionary, and list types.

9. The method according to any one of claims 1-4, characterized in that, The first language format is YAML, and the second language format is JSON.

10. An electronic device, characterized in that, The electronic device includes: a processor and a memory; The memory is used to store a program for the electronic device to execute the method as described in any one of claims 1-9, and to store data related to implementing the method as described in any one of claims 1-9; The processor is configured to execute programs stored in the memory.

11. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores instructions that, when executed on a computer, cause the computer to perform the method as described in any one of claims 1-9.

Citation Information

Patent Citations

  • Configuration file difference verification method and device, equipment and storage medium

    CN112256577A

  • JSON file differentiation comparison method and device

    CN113190220A