Configuration file synchronization method, system, electronic device and storage medium

By maintaining the version number mapping relationship of slave node configuration files in the master node, comparing and synchronizing the configuration file version number, the problem of slave node configuration files in the distributed test system is solved, and unified synchronization management and consistency guarantee of configuration files are realized.

CN119788690APending Publication Date: 2025-04-08北歌(潍坊)智能科技有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411729640.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-28
Publication Date
2025-04-08

AI Technical Summary

Technical Problem

In a distributed testing system, the configuration files of each slave node are prone to be confused, resulting in abnormal interruption of the test program. How to achieve synchronous control of multiple slave node configuration files is a key technical challenge.

Method used

By maintaining the version number mapping relationship of the slave node configuration file in the master node, comparing the configuration file version number currently used by the slave node and the version number recorded in the master node, determining the configuration file version number that needs to be sent to the slave node, and performing synchronization management.

Benefits of technology

Ensure that the parameter configuration files can be synchronized correctly to each slave node, prevent configuration file data loss, ensure consistency of slave node configuration files, and avoid abnormal interruptions in the test program.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119788690A_ABST
    Figure CN119788690A_ABST
Patent Text Reader

Abstract

The present application relates to the field of computer communication technology, and more specifically, to a configuration file synchronization method, system, electronic device and storage medium. The method is applied to a master node in a distributed test system, and the distributed test system also includes a slave node connected to the master node. The method includes: when a first configuration file corresponding to a first version number currently used by the slave node needs to be synchronized, comparing the first version number with a second version number; wherein the second version number is the version number of the first configuration file of the slave node indicated by the mapping relationship in the master node; according to the comparison result of the first version number and the second version number, determining a third version number that needs to be sent to the slave node; and sending the first configuration file corresponding to the second version number and the third version number to the slave node.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer communication technology, and more specifically, to a configuration file synchronization method, system, electronic device and storage medium. Background Art

[0002] In a distributed test system, each slave node needs to perform tests according to the same parameter configuration file to ensure the consistency and reliability of the test results. In actual applications, different products correspond to different parameter configuration files, and as the test requirements change, each parameter configuration file may need to be modified and updated, so the configuration file can easily cause confusion and cause abnormal interruption of the test program. Therefore, how to achieve synchronous control of multiple slave node configuration files is a key technical challenge. Summary of the invention

[0003] One object of the present application is to provide a configuration file synchronization method, system, electronic device and storage medium, which can perform unified synchronization management on multiple slave node configuration files.

[0004] According to a first aspect of an embodiment of the present application, a configuration file synchronization method is provided, which is applied to a master node in a distributed test system, wherein the distributed test system further includes a slave node connected to the master node, and the method includes:

[0005] In the case where the first configuration file corresponding to the first version number currently used by the slave node needs to be synchronized, comparing the first version number with the second version number; wherein the second version number is the version number of the first configuration file of the slave node indicated by the mapping relationship in the master node;

[0006] Determine, according to a comparison result of the first version number and the second version number, a third version number that needs to be sent to the slave node;

[0007] Send the first configuration file corresponding to the second version number and the third version number to the slave node, so that the first configuration file corresponding to the first version number of the slave node is synchronized with the first configuration file corresponding to the second version number, and the first version number of the first configuration file of the slave node is synchronized with the third version number.

[0008] Optionally, the determining, according to the comparison result of the first version number and the second version number, that a third version number of the configuration file needs to be sent to the slave node comprises at least any one of the following:

[0009] When the first version number is higher than the second version number, determining the third version number as an initial version number;

[0010] When the first version number is lower than or equal to the second version number, determining the third version number to be the second version number;

[0011] In the case where the first version number is a set version number, the third version number is determined to be the second version number; wherein the set version number indicates that the first configuration file is empty.

[0012] Optionally, when a first configuration file corresponding to a first version number currently used by the slave node needs to be synchronized, before comparing the first version number with the second version number, the method further includes:

[0013] In response to the received online information reported by the slave node, obtaining a first version number of a first configuration file currently used by the slave node;

[0014] Based on the first version number, it is determined that a first configuration file corresponding to the first version number needs to be synchronized.

[0015] Optionally, the determining, based on the first version number, that a first configuration file corresponding to the first version number needs to be synchronized includes at least any one of the following:

[0016] In the case where the first version number is a set version number, determining that a first configuration file corresponding to the first version number needs to be synchronized; wherein the set version number indicates that the first configuration file is empty;

[0017] In the case where the first version number is an initial version number, determining that the first configuration file corresponding to the first version number needs to be synchronized according to the first content of the first configuration file corresponding to the first version number and the second content of the first configuration file corresponding to the second version number;

[0018] When the first version number is a version number other than the initial version number and the set version number, it is determined that the first configuration file corresponding to the first version number needs to be synchronized based on at least one of a first comparison result between the first version number and the second version number and a second comparison result between the first content and the second content.

[0019] Optionally, when the first configuration file corresponding to the first version number currently used by the slave node needs to be synchronized, before comparing the first version number with the second version number, the method further includes at least any one of the following:

[0020] In response to the second configuration file of the master node being modified, determining that the first configuration file corresponding to the first version number needs to be synchronized;

[0021] In response to a synchronization instruction being triggered, a fourth version number of the second configuration file of the master node indicated by the mapping relationship in the master node is obtained; when the fourth version number is different from the target version number of the second configuration file stored in the master node, it is determined that the first configuration file corresponding to the first version number needs to be synchronized.

[0022] Optionally, the determining that the first configuration file corresponding to the first version number needs to be synchronized includes:

[0023] After updating the fourth version number to the target version number, incrementing the fifth version number of the first configuration file of the slave node indicated by the mapping relationship to the second version number, and synchronizing the first configuration file of the slave node with the fifth version number stored in the master node to the first configuration file with the second version number, determining that the first configuration file corresponding to the first version number needs to be synchronized;

[0024] Among them, the second version number is one version higher than the fifth version number.

[0025] According to a second aspect of an embodiment of the present application, a configuration file synchronization method is provided, which is applied to a slave node in a distributed test system, wherein the distributed test system further includes a master node connected to the slave node, and the method includes:

[0026] Receive a first configuration file and a third version number corresponding to the second version number sent by the master node; wherein the third version number is a version number that needs to be sent to the slave node determined according to a comparison result between the first version number and the second version number, the first version number is a version number of the first configuration file currently used by the slave node, the second version number is a version number of the first configuration file of the slave node indicated by a mapping relationship in the master node, and the comparison result is a result obtained when the first configuration file corresponding to the first version number currently used by the slave node needs to be synchronized;

[0027] The first configuration file corresponding to the first version number of the slave node is synchronized to the first configuration file corresponding to the second version number, and the first version number of the first configuration file is synchronized to the third version number.

[0028] According to a third aspect of an embodiment of the present application, there is provided a configuration file synchronization system, comprising: a master node and a plurality of slave nodes connected to the master node;

[0029] The master node is used to execute the method as described in any one of the first aspects;

[0030] The slave node is used to execute the method as described in the second aspect.

[0031] According to a fourth aspect of an embodiment of the present application, an electronic device is provided, comprising a memory and a processor, wherein the memory is used to store computer instructions, and the processor is used to call the computer instructions from the memory to execute a method as described in any one of the first aspect or the second aspect.

[0032] According to a fifth aspect of an embodiment of the present application, a computer-readable storage medium is provided on which a computer program is stored. When the computer program is executed by a processor, the method described in any one of the first aspect or the second aspect is implemented.

[0033] The master node in the distributed test system of the embodiment of the present application, when it is determined that synchronization is required, synchronizes the configuration file stored in the master node to the slave node, so as to uniformly manage the configuration files of the slave nodes through the master node. In addition, the embodiment of the present application compares the version number of the configuration file currently used by the slave node and the version number corresponding to the configuration file of the slave node indicated by the mapping relationship in the master node according to the version comparison rule, so as to determine the version number of the configuration file that needs to be sent to the slave node, so as to uniformly manage the version number of the slave node configuration file. In this way, it can be ensured that the parameter configuration file can be correctly synchronized to each slave node, and the consistency of the configuration files in each slave node is also ensured while preventing the loss of configuration file data. In addition, through the unified management of the master node, it is also possible to cope with the scene of concurrent modification of different configuration files of different products, avoid the occurrence of abnormal interruption of the test program due to the disorder of the configuration file, thereby improving the user experience. In addition, the method of the present embodiment can also adapt to different synchronization real-time requirements, thereby improving the flexibility of the method of the present embodiment.

[0034] Other features and advantages of the present application will become apparent from the following detailed description of exemplary embodiments of the present application with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate embodiments of the application and, together with the description, serve to explain the principles of the application.

[0036] Figure 1 It is a structural diagram of a distributed testing system provided according to an embodiment of the present application.

[0037] Figure 2 It is a flowchart of a configuration file synchronization method provided in an embodiment of the present application.

[0038] Figure 3 It is a schematic diagram showing a configuration file provided in an embodiment of the present application.

[0039] Figure 4It is a structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0040] Various exemplary embodiments of the present application will now be described in detail with reference to the accompanying drawings. It should be noted that unless otherwise specifically stated, the relative arrangement of the components and steps, numerical expressions and numerical values ​​set forth in these embodiments do not limit the scope of the present application. The following description of at least one exemplary embodiment is in fact merely illustrative and is not intended to limit the present application and its application or use.

[0041] Embodiments of the present application relate to the synchronization of configuration files in a distributed test system. The distributed test system may include a master node and multiple slave nodes connected to the master node. The master node is responsible for coordinating and managing the entire test process, including distributing test tasks, collecting test results, monitoring test status, synchronously updating test parameter configuration files, etc. The slave node is used to perform specific test tasks according to the test parameter configuration files synchronously issued by the master node. The master node may include a control device, which is responsible for coordinating and managing the testing of different functions of the entire product line. The master node may also include multiple control devices, each of which is responsible for coordinating and managing the testing of one or more products, and multiple control devices jointly complete the testing of the entire product line.

[0042] Figure 1 The following schematically shows a distributed test system architecture diagram related to an embodiment of the present application. Figure 1 As shown, the master node can be a host computer system, and the slave node can be a test device bound to a specific product test task. Each slave node can include at least one test device. The test device is, for example, Figure 1 The function board shown in the figure. A function board refers to a circuit board that performs a specific test function. Each function board is used to perform one test task or multiple test tasks with an associated relationship.

[0043] In one example, if Figure 1 As shown, multiple function boards can communicate with the host computer system through one master control. In this example, multiple test tasks executed by multiple function boards controlled by one master control can be different test tasks of the same product, or the same test task of different products.

[0044] Before multiple slave nodes execute test tasks, the parameter configuration files of each slave node need to be consistent to ensure the consistency and reliability of the test results. In actual applications, different products correspond to different parameter configuration files, and as the test requirements change, the parameter configuration files often need to be modified and updated, so the configuration files can easily cause confusion and lead to abnormal interruption of the test program. Therefore, how to achieve synchronous control of multiple slave node configuration files is a key technical challenge.

[0045] Based on this, the present application embodiment provides a configuration file synchronization method. Figure 2 As shown, the method may include steps S110 to S130.

[0046] Step S110, when the first configuration file corresponding to the first version number currently used by the slave node needs to be synchronized, compare the first version number with the second version number; wherein the second version number is the version number of the first configuration file of the slave node indicated by the mapping relationship in the master node.

[0047] In this embodiment, the need to synchronize the first configuration file corresponding to the first version number currently used by the slave node may include the need to synchronize the first configuration file after the slave node goes online, may also include the need to synchronize when the parameter configuration file of the master node is modified, and may also include the need to synchronize when the synchronization instruction is triggered. The synchronization instruction being triggered may include automatic triggering according to a preset synchronization cycle, or may include manual triggering by the user according to demand.

[0048] In one example, in a scenario where the first configuration file needs to be synchronized after the slave node comes online, the first version number may be a version number obtained from the configuration file data reported by the slave node after it comes online. In a scenario where synchronization is required when the parameter configuration file of the master node is modified or synchronization is required when a synchronization instruction is triggered, the first version number may be a version number obtained from the configuration file data stored by the master node. The configuration file data stored by the master node may be the configuration file data indicated by the synchronization result sent to the master node after the slave node's most recent successful synchronization. The first version number in this example does not need to be obtained through real-time communication with the slave node alone, which can reduce dependence on the communication status of the slave node, and can also obtain the first version number more quickly.

[0049] Of course, in another example, the first version number can also be obtained by interacting with the slave node in real time.

[0050] In this embodiment, the first version number may be an initial version number, a set version number, or a currently used version number. The initial version number may be a minimum version number, such as "0". The set version number indicates that the first configuration file is empty. At this time, it can be considered that the test device corresponding to the slave node is a newly added or newly changed device, and there is no configuration file in the device. The set version number may be, for example, "0xff".

[0051] In this embodiment, the configuration file can be named by the identifier of the configuration file, such as "1.config". The master node can store multiple first configuration files corresponding to the second version numbers, and different first configuration files can be used by different test devices. The number of first configuration files can be set according to the number or type of test tasks. The first configuration files stored by the master node can be ordered according to the identification of the test task. In one example, the test tasks can be divided into four types from 1 to 4, such as Figure 3 As shown, the master node may store the first configuration file corresponding to the second version number corresponding to each test task. For example, the first configuration file corresponding to the second version number stored in the master node may include "1.config", "2.config", "3.config", and "4.config". The first configuration file corresponding to the second version number may be a configuration file synchronized by the master node based on the latest second configuration file backed up locally.

[0052] In this embodiment, the second version number can be obtained from a mapping relationship file representing the version number of the slave node configuration file and the version number of the master node configuration file. The mapping relationship file is stored in the master node.

[0053] In an example, the content of the mapping relationship file may be as follows:

[0054] {"CardVer":0,

[0055] "PCVer": 0,

[0056] }

[0057] In this example, the second version number can be obtained from the field corresponding to the node version number (such as "Card1Ver") in the mapping relationship file.

[0058] Step S120: Determine a third version number that needs to be sent to the slave node based on the comparison result of the first version number and the second version number.

[0059] In this embodiment, the comparison result of the first version number and the second version number may include any one of the following: the first version number is higher than the second version number, the first version number is lower than or equal to the second version number, and the first version number is a set version number. The set version number indicates that the first configuration file of the slave node is empty.

[0060] In an example, step S120 may include at least any one of steps S121 to S123.

[0061] Step S121: when the first version number of the first configuration file currently used by the slave node is higher than the second version number of the first configuration file of the slave node indicated by the mapping relationship in the master node, determine that the third version number to be sent to the slave node is the initial version number.

[0062] In this embodiment, the initial version number may be the lowest version number, such as "0".

[0063] Step S122: When the first version number of the first configuration file currently used by the slave node is lower than or equal to the second version number corresponding to the first configuration file of the slave node indicated by the mapping relationship in the master node, determine that the third version number to be sent to the slave node is the second version number.

[0064] Step S123, when the first version number corresponding to the first configuration file currently used by the slave node is the set version number, determine that the third version number of the configuration file that needs to be sent to the slave node is the second version number; wherein the set version number indicates that the first configuration file is empty.

[0065] In this embodiment, different third version numbers may be determined for different comparison results, and the version numbers of configuration files in the slave nodes are uniformly managed through the third version numbers to solve the problem of multiple versions being easily confused in actual applications.

[0066] Step S130, sending the first configuration file corresponding to the second version number and the third version number to the slave node, so that the first configuration file corresponding to the first version number of the slave node is synchronized to the first configuration file corresponding to the second version number, and the first version number of the first configuration file of the slave node is synchronized to the third version number.

[0067] In this embodiment, in the scenario where the first configuration file needs to be synchronized after the slave node goes online, the second configuration file corresponding to the second version number and the third version number are sent to the online slave node, so that the first configuration file corresponding to the first version number of the online slave node is synchronized to the first configuration file corresponding to the second version number, and the first version number of the first configuration file is synchronized to the third version number. In this way, it can be ensured that the configuration file of the online slave node is consistent with the configuration files of other slave nodes, and the version numbers of the slave node configuration files can also be uniformly managed.

[0068] In the scenario where synchronization is required when the parameter configuration file of the master node is modified or the synchronization instruction is triggered, the first configuration file corresponding to the second version number and the third version number are sent to each slave node, so that the first configuration file corresponding to the first version number of each slave node is synchronized with the first configuration file corresponding to the second version number stored in the master node. In addition, the first version number of the first configuration file of each slave node is synchronized to the third version number, which is also convenient for unified management of the master node.

[0069] In this embodiment, sending the first configuration file corresponding to the second version number to the slave node may be sending all the first configuration files corresponding to the second version number stored in the master node to the slave node at the same time, for example, sending "1.config", "2.config", "3.config", and "4.config" to the slave node at the same time. In this way, regardless of whether all the first configuration files corresponding to a certain first version number of the slave node need to be synchronized, full synchronization is performed to ensure the relevance and integrity of all the first configuration files. In addition, when the synchronization fails, it is possible to quickly roll back to the configuration file before synchronization by indicating a few or one fallback version.

[0070] The master node in the distributed test system of the embodiment of the present application, when it is determined that synchronization is required, synchronizes the configuration file stored in the master node to the slave node, so as to uniformly manage the configuration files of the slave nodes through the master node. In addition, the embodiment of the present application compares the version number of the configuration file currently used by the slave node and the version number corresponding to the configuration file of the slave node indicated by the mapping relationship in the master node according to the version comparison rule, so as to determine the version number of the configuration file that needs to be sent to the slave node, so as to uniformly manage the version number of the slave node configuration file. In this way, it can be ensured that the parameter configuration file can be correctly synchronized to each slave node, and the consistency of the configuration files in each slave node is also ensured while preventing the loss of configuration file data. In addition, through the unified management of the master node, it is also possible to cope with the scene of concurrent modification of different configuration files of different products, avoid the occurrence of abnormal interruption of the test program due to the disorder of the configuration file, thereby improving the user experience. In addition, the method of the present embodiment can also adapt to different synchronization real-time requirements, thereby improving the flexibility of the method of the present embodiment.

[0071] In some embodiments, after the test device in the slave node is online, the slave node will report the online information to the master node. In this embodiment, before step S110, the configuration file synchronization method of the embodiment of the present application may also include steps S100 to S101.

[0072] Step S100: In response to the received online information reported by the slave node, a first version number of a first configuration file currently used by the slave node is obtained.

[0073] In one example, the online information reported by the slave node may include a first configuration file currently used by the slave node and a first version number corresponding to the first configuration file. In this example, the first version number may be obtained from the online information reported by the slave node.

[0074] In another example, after the slave node reports the online information, the slave node actively sends the configuration file data including the first configuration file and its corresponding first version number to the master node. In this example, the first version number can be obtained from the configuration file data reported by the slave node.

[0075] In another example, after receiving the online information reported by the slave node, the master node may send a configuration file data acquisition request to the slave node to acquire the first version number.

[0076] Step S101: Based on a first version number corresponding to the first configuration file, it is determined that the first configuration file needs to be synchronized.

[0077] In this embodiment, step S101 may include at least any one of the following:

[0078] In a case where the first version number corresponding to the first configuration file is a set version number, determining that the first configuration file corresponding to the first version number needs to be synchronized; wherein the set version number indicates that the first configuration file is empty;

[0079] When the first version number corresponding to the first configuration file is the initial version number, determining that the first configuration file corresponding to the first version number needs to be synchronized according to the first content of the first configuration file corresponding to the first version number and the second content of the first configuration file corresponding to the second version number;

[0080] When the first version number corresponding to the first configuration file is a version number other than the initial version number and the set version number, it is determined that the first configuration file corresponding to the first version number needs to be synchronized based on at least one of a first comparison result between the first version number and the second version number and a second comparison result between the first content and the second content.

[0081] In this embodiment, determining that the first configuration file corresponding to the first version number needs to be synchronized according to the first content of the first configuration file corresponding to the first version number and the second content of the first configuration file corresponding to the second version number may include: determining that the first configuration file corresponding to the first version number needs to be synchronized according to the first verification code of the first configuration file corresponding to the first version number and the second verification code of the first configuration file corresponding to the second version number, and / or the first length of the first configuration file corresponding to the first version number and the second length of the first configuration file corresponding to the second version number. The verification code of the configuration file is used to uniquely identify the configuration file.

[0082] In one example, a first length of a first configuration file corresponding to a first version number and a second length of a first configuration file corresponding to a second version number are verified; when the first length of the first configuration file corresponding to the first version number and the second length of the first configuration file corresponding to the second version number are the same, a first verification code of the first configuration file corresponding to the first version number and a second verification code of the first configuration file corresponding to the second version number are verified; when the first verification code of the first configuration file corresponding to the first version number and the second verification code of the first configuration file corresponding to the second version number are different, it is determined that the first configuration file corresponding to the first version number needs to be synchronized.

[0083] In this embodiment, determining that the first configuration file corresponding to the first version number needs to be synchronized according to at least one of the first comparison result between the first version number and the second version number and the second comparison result between the first content and the second content may include at least any one of the following:

[0084] When the first comparison result indicates that the first version number and the second version number are different, determining that the first configuration file data needs to be synchronized;

[0085] When the second comparison result indicates that the first configuration file and the second configuration file are different, determining that the first configuration file corresponding to the first version number needs to be synchronized;

[0086] When the first comparison result indicates that the first version number and the second version number are the same, and the second comparison result indicates that the first content and the second content are different, it is determined that the first configuration file corresponding to the first version number needs to be synchronized.

[0087] In this embodiment, comparing the first content of the first configuration file and the second content of the second configuration file may include comparing the first length of the first configuration file and the second length of the second configuration file, and / or comparing the first verification code of the first configuration file and the second verification code of the second configuration file.

[0088] In some embodiments, the modification of the parameter configuration file is performed on the master node. The configuration files can be divided into multiple types according to the test tasks, and a file directory is created for each parameter configuration file, and the parameter configuration file identifier is used as the directory name corresponding to the parameter configuration file. Each time the parameter configuration file is modified on the master node, a newest version of the parameter configuration file is backed up. In an example, Figure 3As shown in the figure, the identifiers of each parameter configuration file are "1", "2", "3", and "4" respectively. The parameter configuration file directories created on the master node are "1", "2", "3", and "4" respectively. Assuming that the configuration file parameters corresponding to the parameter configuration file directory "1" change, the latest version of this configuration file will be backed up in its directory "1". Assuming that the version of the latest configuration file in each parameter configuration file directory is incremented by 1 based on the existing version, then Figure 3 As shown in the figure, the latest version of the configuration file in the parameter configuration file directory "1" is "3".

[0089] In this embodiment, when saving parameters, the historical version backup files in each configuration file directory of the master node will be incremented by one version to ensure that the configuration files of this version in each configuration file target constitute a set of interrelated complete configuration files.

[0090] In this embodiment, before step S110, the configuration file synchronization method of the embodiment of the present application may further include at least any one of steps S103 to S104.

[0091] Step S103: In response to the second configuration file of the master node being modified, it is determined that the first configuration file corresponding to the first version number needs to be synchronized.

[0092] In this embodiment, it is possible to continuously detect whether the second configuration file of the master node has been modified according to a set period, and if it has been modified, directly determine that the first configuration file corresponding to the first version number needs to be synchronized. It is also possible to determine that the first configuration file corresponding to the first version number needs to be synchronized in response to the user's operation of modifying the second configuration file.

[0093] Step S104, in response to the synchronization instruction being triggered, obtain the fourth version number of the second configuration file of the master node indicated by the mapping relationship in the master node; when the fourth version number is different from the target version number of the second configuration file stored in the master node, determine that the first configuration file corresponding to the first version number needs to be synchronized.

[0094] When the fourth version number is the same as the target version number of the second configuration file stored in the master node, the mapping relationship file does not need to be modified, and the first configuration file of the slave node stored in the master node does not need to be synchronized.

[0095] In this embodiment, the synchronization instruction may be triggered automatically according to a preset synchronization period, or may be triggered manually by a user according to real-time requirements.

[0096] In this embodiment, the second configuration file is a configuration file corresponding to each parameter configuration file directory. The third version number can be obtained from the "PCVer" field in the content of the mapping relationship file as described above. The target version number of the second configuration file is the latest version number corresponding to the second configuration file stored in the master node as a backup. Taking the content of the mappingfile as {"CardVer": 0, "PCVer": 1}, and the second configuration file is the configuration file corresponding to the parameter configuration file directory "1" as an example, the third version number of the second configuration file is "1", and the target version number of the second configuration file is "3", then it is determined that the first configuration file corresponding to the first version number needs to be synchronized.

[0097] In this embodiment, in response to the synchronization instruction being triggered, the fourth version number of the master node configuration file indicated by the mapping relationship in the master node is obtained; when the fourth version number is the same as the target version number of the configuration file stored in the master node, it is determined that the first configuration file corresponding to the first version number needs to be synchronized.

[0098] In response to a synchronization instruction being triggered, the embodiment of the present application first compares the fourth version number of the master node configuration file indicated by the mapping relationship and the target version number of the configuration file stored in the master node, and only determines that synchronization is required when they are different. This can avoid repeated synchronization of the same configuration file and reduce resource usage.

[0099] In some embodiments, before determining that the first configuration file needs to be synchronized, it is necessary to ensure that the slave node configuration file stored locally by the master node is consistent with the configuration file most recently updated by the master node and has the correct version number. In this embodiment, determining that the first configuration file corresponding to the first version number needs to be synchronized may include:

[0100] After updating the fourth version number of the second configuration file of the master node indicated by the mapping relationship to the target version number, incrementing the fifth version number of the first configuration file of the slave node indicated by the mapping relationship to the second version number, and synchronizing the first configuration file corresponding to the fifth version number of the slave node stored in the master node to the first configuration file corresponding to the second version number, it is determined that the first configuration file corresponding to the first version number needs to be synchronized; wherein the second version number is one version higher than the fifth version number.

[0101] That is to say, when the parameter configuration file of the master node changes, the latest version of the configuration file is backed up and added to the local configuration file target of the master node, and the fourth version number of the master node configuration file in the mappingfile mapping relationship file is updated to the target version number, and the fifth version number of the slave node configuration file in the mapping relationship file is updated to the second version number, and the current configuration file of the slave node stored in the master node is synchronized to the first configuration file corresponding to the second version number, and then the first configuration file corresponding to the first version number is synchronized.

[0102] Before determining that the first configuration file corresponding to the first version number needs to be synchronized, the embodiment of the present application can ensure that the slave node configuration file stored locally in the master node is consistent with the latest updated configuration file of the master node and has the correct version number, thereby improving the accuracy of unified management of the master node.

[0103] The present application also provides a configuration file synchronization method, which is applied to a slave node in a distributed test system, the distributed test system also includes a master node connected to the slave node, the method includes steps S210 to S220.

[0104] Step S210, receiving the first configuration file and the third version number corresponding to the second version number sent by the master node; wherein the third version number is the version number that needs to be sent to the slave node determined based on the comparison result of the first version number and the second version number, the first version number is the version number corresponding to the first configuration file currently used by the slave node, the second version number is the version number of the first configuration file of the slave node indicated by the mapping relationship in the master node, and the comparison result is the result obtained when the first configuration file corresponding to the first version number currently used by the slave node needs to be synchronized.

[0105] Step S220, synchronize the first configuration file corresponding to the first version number of the slave node to the first configuration file corresponding to the second version number stored in the master node, and synchronize the first version number corresponding to the first configuration file to the third version number.

[0106] The specific manner of the same or similar steps in this embodiment has been described in detail in the embodiment of the method, and will not be elaborated here.

[0107] The embodiment of the present application also provides a configuration file synchronization system, which may include: a master node and a plurality of slave nodes connected to the master node;

[0108] The master node is used to execute the method as described in any one of the first method embodiments;

[0109] The slave node is used to execute the method as described in the second method embodiment.

[0110] In this embodiment, the master node and the slave node can be, for example, Figure 1 The host system and slave nodes are shown.

[0111] Figure 4 Schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 4As shown, the electronic device 1000 may include a memory 1100 and a processor 1200. The memory 1100 may be used to store computer instructions, and the processor 1200 may be used to call computer instructions from the memory 1100 to execute any method in the aforementioned embodiments of the present application.

[0112] It should be noted that the processor 1200 may include one or more processors to execute instructions, and the memory 1100 may also include one or more memories to store computer instructions.

[0113] In some embodiments, the processor 1200 can be used to control the overall operation of the electronic device 1000. For example, the processor 1200 can execute instructions to implement all or part of the steps of the method in any of the foregoing embodiments of the present application. The component can be an internal component of the electronic device itself, or it can be an external group connected to the electronic device wirelessly or wired.

[0114] In some embodiments, the memory 1100 may include one or more memories, and the contents stored in different memories may be the same or different. The memory 1100 may be configured to store various types of data to support the operation of the electronic device 1000. The memory 1100 may be implemented by any type of temporary or non-temporary storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.

[0115] The embodiment of the present application also provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, any method in the aforementioned embodiment of the present application is implemented. Optionally, the computer-readable storage medium may be a non-transitory storage medium, but is not limited thereto, and may also be a transient storage medium.

[0116] An embodiment of the present application further provides a computer program product, which may include a computer program, and when the computer program is executed by a processor, any method in the aforementioned embodiments of the present application can be implemented.

[0117] The present application may be a system, a method and / or a computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for causing a processor to implement any method in the aforementioned embodiments of the present application.

[0118] A computer-readable storage medium may be a tangible device that can hold and store instructions used by an instruction execution device. A computer-readable storage medium may be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. More specific examples of computer-readable storage media (a non-exhaustive list) include: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a static random access memory (SRAM), a portable compact disk read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanical encoding device, such as a punch card or a raised structure in a groove on which instructions are stored, and any suitable combination of the foregoing. As used herein, a computer-readable storage medium is not to be interpreted as a transient signal per se, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagating through a waveguide or other transmission medium (e.g., a light pulse through a fiber optic cable), or an electrical signal transmitted through a wire.

[0119] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, optical fiber transmissions, wireless transmissions, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in the computer-readable storage medium in each computing / processing device.

[0120] The computer program instructions for performing the operation of the present application can be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, which can include object-oriented programming languages, such as Smalltalk, C++, etc., and conventional procedural programming languages, such as "C" language or similar programming languages. Computer-readable program instructions can be executed completely on a user's computer, partially on a user's computer, executed as an independent software package, partially on a user's computer, partially on a remote computer, or completely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (for example, using an Internet service provider to connect through the Internet). In some embodiments, by using the state information of a computer-readable program instruction to personalize an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA) or a programmable logic array (PLA), the electronic circuit can execute a computer-readable program instruction, thereby realizing various aspects of the present application.

[0121] Various aspects of the present application are described herein with reference to the flowcharts and / or block diagrams of the methods, devices (systems) and computer program products according to the embodiments of the present application. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer-readable program instructions.

[0122] These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so as to produce a machine, so that when these instructions are executed by the processor of the computer or other programmable data processing device, a device for implementing the functions / actions specified in one or more boxes in the flowchart and / or block diagram is generated. These computer-readable program instructions can also be stored in a computer-readable storage medium, and these instructions make the computer, programmable data processing device, and / or other equipment work in a specific manner, so that the computer-readable medium storing the instructions includes a manufactured product, which includes instructions for implementing various aspects of the functions / actions specified in one or more boxes in the flowchart and / or block diagram.

[0123] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operating steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to implement the functions / actions specified in one or more boxes in the flowchart and / or block diagram.

[0124] The flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the systems, methods and computer program products according to multiple embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of an instruction, and the module, a program segment or a part of an instruction contains one or more executable instructions for realizing the specified logical function. In some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or the flowchart, and the combination of the boxes in the block diagram and / or the flowchart can be implemented by a dedicated hardware-based system that performs the specified function or action, or can be implemented by a combination of dedicated hardware and computer instructions. It should be noted that it is equivalent to implement it by hardware, implement it by software, and implement it by combining software and hardware.

[0125] Technologies, methods, and equipment known to ordinary technicians in the relevant art may not be discussed in detail, but where appropriate, the above-mentioned technologies, methods, and equipment can be considered as part of the specification.

[0126] It should be noted that similar reference numerals and letters represent similar items in the drawings of the embodiments of the present application, and therefore, once an item is defined in one drawing, it may not need to be further discussed in subsequent drawings.

[0127] Although the operations or steps are described in a specific order in the drawings in the embodiments of the present application, it should not be understood that it is required to perform these operations or steps in the specific order shown or in a serial order, or to perform all the operations or steps shown to obtain the desired results. In the embodiments of the present application, these operations or steps can be performed in series; these operations or steps can also be performed in parallel; or some of these operations or steps can be performed.

[0128] In the description of the embodiments of the present application, unless otherwise specified, prefixes such as "first" and "second" are only used to distinguish different description objects and do not constitute any restrictions on the position, order, priority, quantity or content of the description objects. For the statement of the description objects, please refer to the description in the context of the claims or embodiments, and no unnecessary restrictions should be constituted due to the use of prefixes.

[0129] In the description of the embodiments of the present application, unless otherwise specified, "multiple" refers to two or more than two, and other quantifiers are similar thereto; "at least one item", "one item or multiple items" or similar expressions refer to any combination of these items, including any combination of singular items or plural items. For example, at least one a can represent any number of a; for another example, one or more items of a, b and c can represent: a, b, c, ab, ac, bc, or abc, where a, b, c can be single or multiple; "and / or" is a description of the association relationship of associated objects, indicating that three relationships can exist, for example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. The character " / " indicates that the objects associated before and after are in an "or" relationship.

[0130] In the description of the embodiments of the present application, unless otherwise specified, elements expressed in the singular form may be understood as singular expressions or plural expressions. For example, "a", "an", "the", "above", "said", "aforementioned", "this", etc. may mean "one and only one", or "one or more", "at least one", etc.

[0131] In the description of the embodiments of the present application, unless otherwise specified, terms such as "greater than", "greater than or equal to", "not less than", "more than", "more than or equal to", "not less than", "higher than", "higher than or equal to", "not lower than", and "above" may be replaced with each other, and terms such as "less than", "less than or equal to", "not greater than", "less than", "less than or equal to", "no more than", "lower than", "lower than or equal to", "not higher than", and "below" may be replaced with each other.

[0132] The embodiments of the present application have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and changes will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The choice of terms used herein is intended to best explain the principles of the embodiments, practical applications, or technical improvements to the technology in the market, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein. The scope of the present application is defined by the appended claims.

Claims

1. A configuration file synchronization method, characterized in that: The method is applied to a master node in a distributed test system, wherein the distributed test system further comprises a slave node connected to the master node. In the case where the first configuration file corresponding to the first version number currently used by the slave node needs to be synchronized, comparing the first version number with the second version number; wherein the second version number is the version number of the first configuration file of the slave node indicated by the mapping relationship in the master node; Determine, according to a comparison result of the first version number and the second version number, a third version number that needs to be sent to the slave node; Send the first configuration file corresponding to the second version number and the third version number to the slave node, so that the first configuration file corresponding to the first version number of the slave node is synchronized with the first configuration file corresponding to the second version number, and the first version number of the first configuration file of the slave node is synchronized with the third version number.

2. The method according to claim 1, characterized in that: The determining, based on the comparison result of the first version number and the second version number, that a third version number of the configuration file needs to be sent to the slave node comprises at least any one of the following: When the first version number is higher than the second version number, determining the third version number as an initial version number; When the first version number is lower than or equal to the second version number, determining the third version number to be the second version number; In the case where the first version number is a set version number, the third version number is determined to be the second version number; wherein the set version number indicates that the first configuration file is empty.

3. The method according to claim 1, characterized in that In the case where a first configuration file corresponding to a first version number currently used by the slave node needs to be synchronized, before comparing the first version number with the second version number, the method further includes: In response to the received online information reported by the slave node, obtaining a first version number of a first configuration file currently used by the slave node; Based on the first version number, it is determined that a first configuration file corresponding to the first version number needs to be synchronized.

4. The method according to claim 3, characterized in that The determining, based on the first version number, that a first configuration file corresponding to the first version number needs to be synchronized includes at least any one of the following: In the case where the first version number is a set version number, determining that a first configuration file corresponding to the first version number needs to be synchronized; wherein the set version number indicates that the first configuration file is empty; In the case where the first version number is an initial version number, determining that the first configuration file corresponding to the first version number needs to be synchronized according to the first content of the first configuration file corresponding to the first version number and the second content of the first configuration file corresponding to the second version number; When the first version number is a version number other than the initial version number and the set version number, it is determined that the first configuration file corresponding to the first version number needs to be synchronized based on at least one of a first comparison result between the first version number and the second version number and a second comparison result between the first content and the second content.

5. The method according to claim 1, characterized in that In the case where the first configuration file corresponding to the first version number currently used by the slave node needs to be synchronized, before comparing the first version number with the second version number, the method further includes at least any one of the following: In response to the second configuration file of the master node being modified, determining that the first configuration file corresponding to the first version number needs to be synchronized; In response to a synchronization instruction being triggered, a fourth version number of the second configuration file of the master node indicated by the mapping relationship in the master node is obtained; when the fourth version number is different from the target version number of the second configuration file stored in the master node, it is determined that the first configuration file corresponding to the first version number needs to be synchronized.

6. The method according to claim 5, characterized in that The determining that the first configuration file corresponding to the first version number needs to be synchronized includes: After updating the fourth version number to the target version number, incrementing the fifth version number of the first configuration file of the slave node indicated by the mapping relationship to the second version number, and synchronizing the first configuration file of the slave node with the fifth version number stored in the master node to the first configuration file with the second version number, determining that the first configuration file corresponding to the first version number needs to be synchronized; Among them, the second version number is one version higher than the fifth version number.

7. A configuration file synchronization method, characterized in that: The method is applied to a slave node in a distributed test system, wherein the distributed test system further comprises a master node connected to the slave node. The method comprises: Receive a first configuration file and a third version number corresponding to the second version number sent by the master node; wherein the third version number is a version number that needs to be sent to the slave node determined according to a comparison result between the first version number and the second version number, the first version number is a version number of the first configuration file currently used by the slave node, the second version number is a version number of the first configuration file of the slave node indicated by a mapping relationship in the master node, and the comparison result is a result obtained when the first configuration file corresponding to the first version number currently used by the slave node needs to be synchronized; The first configuration file corresponding to the first version number of the slave node is synchronized to the first configuration file corresponding to the second version number, and the first version number of the first configuration file is synchronized to the third version number.

8. A configuration file synchronization system, characterized in that: include: A master node and a plurality of slave nodes connected to the master node; The master node is used to perform the method according to any one of claims 1 to 6; The slave node is used to execute the method according to claim 7.

9. An electronic device, characterized in that: The electronic device comprises a memory and a processor, wherein the memory is used to store computer instructions, and the processor is used to call the computer instructions from the memory to execute the method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and when the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.