A method and device for verifying consistency of distributed edge cloud nodes
By preprocessing, comparing and merging the configuration files of distributed edge cloud nodes, the problem of inefficient manual verification is solved, automatic consistency verification is achieved, edge node deployment efficiency is improved and risks are reduced.
Patent Information
- Application Number
- CN202111424430.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-26
- Publication Date
- 2025-08-26
- Estimated Expiration
- 2041-11-26
AI Technical Summary
In the prior art, edge node configuration information verification of distributed edge cloud architectures relies on manual comparison, which is inefficient and error-prone, resulting in configuration update failure.
It provides a consistency verification method and device for distributed edge cloud edge nodes. By obtaining configuration files of edge nodes and central nodes for preprocessing, generating files to be compared and benchmark files, comparing and merging, outputting configuration differences, and realizing automatic consistency verification.
It improves the efficiency of edge node deployment and implementation, reduces project implementation risks, can promptly detect and correct configuration differences, and guides the management of complex distributed systems.
Smart Images

Figure CN114372025B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of communication technology, and in particular to a method and device for verifying the consistency of distributed edge cloud nodes. Background Art
[0002] The demand for efficient, high-performance communication processing of massive amounts of information is increasingly pressing. To meet the high bandwidth, low latency, and high reliability requirements of next-generation networks, traditionally, large data center architectures have been used to process massive amounts of data. However, new applications and services are exposing the limitations of centralized architectures. To meet the needs of existing customers and attract new ones, service providers must support cloud service applications that require extremely low latency and high bandwidth. To deliver these new services and optimize existing ones, service providers need to build edge cloud architectures to ensure that cloud resources are distributed closer to the end users connected to the network.
[0003] The challenge of distributed edge cloud architectures is operational complexity. While distributed edge clouds can address network issues such as latency and bandwidth, they are complex to manage, leading to increased operational costs. Because distributed edge cloud deployments can potentially include thousands of remote nodes in diverse geographic locations, service providers urgently need tools and methods for comprehensive, system-wide orchestration and coordination to successfully implement distributed edge cloud architectures and deliver new revenue-generating services.
[0004] Currently, these infrastructure management tasks are usually completed manually. When the configuration information of edge nodes needs to be changed due to node updates and upgrades, manual comparison is required one by one. When the number of nodes reaches a certain level, it is time-consuming and laborious for the personnel performing this task to compare one by one, and it is extremely easy to make mistakes, resulting in the failure of configuration verification and update. Summary of the Invention
[0005] The present invention provides a method and device for consistency verification of distributed edge cloud edge nodes, which are used to solve the defects of manual verification of edge node configuration information in the existing technology, which is prone to errors and inefficiency, realize automatic consistency verification of edge node configuration, and improve the efficiency of edge node deployment and implementation.
[0006] The present invention provides a method for verifying the consistency of distributed edge cloud nodes, comprising the following steps:
[0007] Obtaining a first configuration file of the edge node to be compared and a second configuration file of the central node, and preprocessing the first configuration file and the second configuration file to obtain a file to be compared and a reference file;
[0008] Comparing the file to be compared with the reference file to obtain a comparison result;
[0009] Merging the comparison result with the reference file to obtain a merged result file;
[0010] The merged result file is sent to the edge node to be compared.
[0011] According to the distributed edge cloud edge node consistency verification method provided by the present invention, the method of obtaining a first configuration file of the edge node to be compared and a second configuration file of the central node, preprocessing the first configuration file and the second configuration file to obtain the file to be compared and the reference file specifically includes the following steps:
[0012] Obtaining the first configuration file and the second configuration file; wherein the first configuration file and the second configuration file are both extensible markup language files, and the root nodes of the first configuration file and the second configuration file are consistent;
[0013] Performing a first preprocessing on the first configuration file to obtain a plurality of first extensible markup language lines and a first line tag type corresponding to each of the first extensible markup language lines; wherein the first preprocessing includes deleting extra spaces, blank lines, comments, and line breaks;
[0014] performing the first preprocessing on the second configuration file to obtain a plurality of second extensible markup language lines and a second line tag type corresponding to each of the second extensible markup language lines;
[0015] performing a second preprocessing on the first extensible markup language line according to the tag type of the first line to obtain the file to be compared; wherein the second preprocessing is deleting tab characters;
[0016] The second Extensible Markup Language line is subjected to second preprocessing according to the tag type of the second line to obtain the reference file.
[0017] According to the consistency verification method of the distributed edge cloud edge node provided by the present invention, the second preprocessing of the first extensible markup language line according to the first line label type to obtain the file to be compared specifically includes the following steps:
[0018] According to the tag type of the first line, obtaining a first level corresponding to the first extensible markup language line;
[0019] performing a bubble comparison on the first level of the first extensible markup language line;
[0020] When the first level of the first extensible markup language line in the current row is greater than the first level of the first extensible markup language line in the previous row, deleting a tab character in the first extensible markup language line in the current row;
[0021] When the first level of the first XML line in the current row is smaller than the first level of the first XML line in the previous row, adding a tab character to the first XML line in the current row;
[0022] Accordingly, according to the tag type of the second line, the second extensible markup language line is subjected to a second preprocessing to obtain the reference file, which specifically includes the following steps:
[0023] According to the tag type of the second line, obtaining a second level corresponding to the second extensible markup language line;
[0024] performing a bubble comparison on the second level of the second XML line;
[0025] When the second level of the second Extensible Markup Language line in the current row is greater than the second level of the second Extensible Markup Language line in the previous row, deleting a tab character in the second Extensible Markup Language line in the current row;
[0026] When the second level of the second XML line in the current row is smaller than the second level of the second XML line in the previous row, a tab character is added to the second XML line in the current row.
[0027] According to the consistency verification method of the distributed edge cloud edge node provided by the present invention, the comparison between the file to be compared and the reference file to obtain the comparison result specifically includes the following steps:
[0028] Performing path tracing on the first XML line and the second XML line to obtain a first backtracking path corresponding to each of the first XML lines and a second backtracking path corresponding to each of the second XML lines;
[0029] Comparing line contents of the first extensible markup language line and the second extensible markup language line, excluding line tag types, and line contents in the corresponding first backtracking path and the second backtracking path line by line to obtain a first comparison result;
[0030] The first extensible markup language line and the second extensible markup language line of line tag type are compared to obtain the second comparison result; wherein the first comparison result and the second comparison result constitute the comparison result.
[0031] According to the consistency verification method of the distributed edge cloud edge node provided by the present invention, the path tracing of the first extensible markup language line and the second extensible markup language line to obtain a first backtracking path corresponding to each first extensible markup language line and a second backtracking path corresponding to each second extensible markup language line specifically includes the following steps:
[0032] When the first level of the first extensible markup language line in the current row is greater than the first level of the first extensible markup language line in the previous row, adding a path point to the first extensible markup language line in the previous row;
[0033] When the first level of the first XML line in the current row is smaller than the first level of the first XML line in the previous row, deleting the last path point of the first XML line in the previous row;
[0034] When the second level of the second Extensible Markup Language line in the current row is greater than the second level of the second Extensible Markup Language line in the previous row, adding a path point to the second Extensible Markup Language line in the previous row;
[0035] When the second level of the second XML line in the current row is smaller than the second level of the second XML line in the previous row, the last path point of the second XML line in the previous row is deleted.
[0036] According to the consistency verification method of the distributed edge cloud edge node provided by the present invention, the comparison result is merged with the reference file to obtain a merged result file, which specifically includes the following steps:
[0037] Obtain the second extensible markup language line of the reference file that exceeds the second extensible markup language line of the file to be compared;
[0038] The extra second extensible markup language line is inserted into the comparison result to obtain the merged result file.
[0039] The present invention also provides a consistency verification device for a distributed edge cloud node, comprising:
[0040] A preprocessing module, configured to obtain a first configuration file of an edge node to be compared and a second configuration file of a central node, and preprocess the first configuration file and the second configuration file to obtain a file to be compared and a reference file;
[0041] A comparison module, configured to compare the file to be compared with the reference file to obtain a comparison result;
[0042] A merging module, configured to merge the comparison result with the reference file to obtain a merged result file;
[0043] The sending module is used to send the merged result file to the edge node to be compared.
[0044] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and runnable on the processor. When the processor executes the program, the steps of the consistency verification method of the distributed edge cloud edge node as described in any one of the above are implemented.
[0045] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the consistency verification method for distributed edge cloud edge nodes as described in any one of the above.
[0046] The present invention also provides a computer program product, comprising a computer program, which, when executed by a processor, implements the steps of consistency verification of the distributed edge cloud edge nodes as described in any of the above.
[0047] The consistency verification method and device of distributed edge cloud edge nodes provided by the present invention pre-process the first configuration file obtained by the edge cloud node and the second configuration file pre-stored by the central node, and then compare the file to be compared and the benchmark file obtained after the pre-processing to obtain a comparison result, and then merge the comparison result with the first configuration file and the second configuration file to form a first verification and merged result file, and finally send the merged result file to the corresponding edge node to be compared, so as to realize automatic consistency verification of the edge node configuration, compare and merge the configuration files of different edge nodes, and output the configuration differences of the edge nodes, thereby improving the deployment and implementation efficiency of the edge node, guiding the deployment and management of complex distributed systems such as edge cloud platforms and cluster systems, and being able to know the configuration differences of different edge nodes in advance, modify and send them in time, and reduce the risk of project implementation. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] In order to more clearly illustrate the technical solutions in the present invention or the prior art, a brief introduction is given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0049] Figure 1 This is a flow chart of the consistency verification method for distributed edge cloud edge nodes provided by the present invention;
[0050] Figure 2This is a specific flow chart of step S100 in the consistency verification method of the distributed edge cloud edge node provided by the present invention;
[0051] Figure 3 This is a specific flow chart of step S130 in the consistency verification method of the distributed edge cloud edge node provided by the present invention;
[0052] Figure 4 This is a specific flow chart of step S200 in the consistency verification method of the distributed edge cloud edge node provided by the present invention;
[0053] Figure 5 This is a specific flow chart of step S300 in the consistency verification method of the distributed edge cloud edge node provided by the present invention;
[0054] Figure 6 It is a structural diagram of the consistency verification device of the distributed edge cloud edge node provided by the present invention;
[0055] Figure 7 This is a schematic diagram of the specific structure of the preprocessing module in the consistency verification device for the distributed edge cloud edge node provided by the present invention;
[0056] Figure 8 This is a schematic diagram of the specific structure of the comparison module in the consistency verification device for the distributed edge cloud edge node provided by the present invention;
[0057] Figure 9 This is a schematic diagram of the specific structure of the merging module in the consistency verification device for the distributed edge cloud edge node provided by the present invention;
[0058] Figure 10 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0059] To make the objectives, technical solutions, and advantages of the present invention more clear, the technical solutions of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the embodiments described are only some of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts shall fall within the scope of protection of the present invention.
[0060] Currently, the management of distributed edge cloud architectures is usually done manually. When edge node configuration information needs to be changed due to node updates or upgrades, manual comparisons are required one by one. When the number of nodes reaches a certain level, it becomes time-consuming and laborious for programmers to perform these comparisons one by one, and errors are also very likely to occur, leading to configuration verification and update failures.
[0061] Therefore, in order to achieve rapid deployment and update of cloud computing and edge computing, a solution that can automatically verify the consistency of edge cloud node configurations is needed. This solution needs to be able to output the configuration differences of edge cloud nodes to improve the efficiency of edge node deployment and implementation.
[0062] The following combination Figure 1 The present invention describes a method for checking the consistency of distributed edge cloud edge nodes. The method can compare and merge configuration files of different edge cloud nodes, and provides the above-mentioned solution for automatically checking the consistency of edge cloud node configurations. Specifically, the method includes the following steps:
[0063] S100: Obtain a first configuration file of an edge node to be compared and a second configuration file of a central node, pre-process the first configuration file and the second configuration file to obtain a file to be compared and a reference file.
[0064] In this embodiment, the first configuration file and the second configuration file are both eXtensible Markup Language (XML) files, and the root nodes of the first configuration file and the second configuration file are the same, that is, the first configuration file and the second configuration file must have the same purpose.
[0065] In this embodiment, the preprocessing includes deleting extra spaces, blank lines, comments, line breaks, deleting tab characters, etc. Optionally, the tab character refers to a TAB character.
[0066] For a distributed edge cloud architecture, the edge node in this method is the edge cloud node, and the central node is the central cloud node. Furthermore, it is understood that the central cloud node is in communication with each of the distributed edge cloud nodes. Therefore, in this method, the first configuration file of each of the distributed edge cloud nodes can be collected by the central node.
[0067] In this embodiment, the IP address, account number, and password of each distributed edge cloud node, as well as the directory information of the relevant configuration files, can be obtained in advance, and the above information can be saved in the node information list file in the configuration server to obtain the corresponding first configuration file. The second configuration file can be pre-stored in the central cloud node and can be modified accordingly according to the specific situation.
[0068] S200: Compare the file to be compared with the reference file to obtain a comparison result.
[0069] In step S200, the comparison results are recorded based on the differences of the leaf nodes.
[0070] S300: Merge the comparison result with the reference file to obtain a merged result file.
[0071] S400: Send the merged result file to the edge node to be compared.
[0072] In step S400, the merged result file generated after comparison and merging of each edge node to be compared can be sent to the corresponding edge node to be compared through the central node. According to the merged result file, the deployment and management of complex distributed systems such as edge cloud platforms and cluster systems can be guided, and the configuration differences of different edge nodes can be known in advance, and timely modifications and distribution can be made to reduce the risk of project implementation.
[0073] Because both the first and second configuration files are XML files, this method is universally applicable. It's not specific to a particular business, but rather adapts to all XML files. It has multiple functions, meaning it can be used as an XML file standardization tool, an XML file comparison tool, and an XML merging tool. The output comparison results better demonstrate the XML document hierarchy, making it easier to read and understand. The comparison results are clear, showing both the correspondence between the lines in the two files and the differences and locations. It can be quickly expanded into an automated multi-node XML file merging tool, automatically distributed to each distributed edge cloud node.
[0074] The consistency verification method of the distributed edge cloud edge node of the present invention pre-processes the first configuration file obtained by the edge cloud node and the second configuration file pre-stored by the central node, and then compares the file to be compared and the benchmark file obtained after the pre-processing to obtain a comparison result, and then merges the comparison result with the first configuration file and the second configuration file to form a first verification and merged result file, and finally sends the merged result file to the corresponding edge node to be compared, thereby realizing automatic consistency verification of the edge node configuration, comparing and merging the configuration files of different edge nodes, and outputting the configuration differences of the edge nodes, thereby improving the efficiency of edge node deployment and implementation, and can guide the deployment and management of complex distributed systems such as edge cloud platforms and cluster systems, and can know the configuration differences of different edge nodes in advance, modify and send them in time, and reduce the risk of project implementation.
[0075] The following combination Figure 2 The consistency verification method of the distributed edge cloud edge node of the present invention is described. In this embodiment, step S100 specifically includes:
[0076] S110: Obtain a first configuration file and a second configuration file.
[0077] S120: Perform a first preprocessing on the first configuration file to obtain a plurality of first XML lines and a first line tag type corresponding to each first XML line. Also, perform a first preprocessing on the second configuration file to obtain a plurality of second XML lines and a second line tag type corresponding to each second XML line. In this method, the first preprocessing includes removing extra spaces, blank lines, comments, and line breaks.
[0078] In this embodiment, the row tag types include <? ? >, <! ---->, <>, <>, and , and the first XML row and the second XML row of the above row tag types are both in separate rows.
[0079] S130: Perform a second preprocessing on the first XML line according to the tag type of the first line to obtain a file to be compared, and perform a second preprocessing on the second XML line according to the tag type of the second line to obtain a reference file. In this method, the second preprocessing is to delete tab characters.
[0080] The purpose of step S100 is to standardize the obtained XML file to obtain a standardized XML file, that is, the file to be compared and the reference file, and then compare the file to be compared and the reference file. The standardized XML file has the following characteristics:
[0081] 1) “<??>” is on a separate line;
[0082] 2) “<!---->” is placed on a separate line;
[0083] 3) “<>” is placed on a separate line;
[0084] 4) "" is written on a separate line;
[0085] 5) “<>” is placed on a separate line;
[0086] 6) “” is written on a separate line;
[0087] 7) Delete blank lines;
[0088] 8) Delete extra spaces and separate text only by single spaces;
[0089] 9) The nodes are layered, and the lower nodes add a TAB tab on the basis of the upper nodes.
[0090] More specifically, during the first preprocessing step, features 1) through 6) are used to match the text in the first and second configuration files. The match closest to the beginning of the text is the target, and the line tag type is recorded. This process is repeated with the remaining text until all text is matched. After the first preprocessing step, the first and second configuration files can be standardized XML lines and line tag types.
[0091] The following combination Figure 3 The consistency verification method of the distributed edge cloud edge node of the present invention is described. In this embodiment, step S130 specifically includes the following steps:
[0092] S131. Obtain a first level corresponding to a first XML line according to a first line tag type, and obtain a second level corresponding to a second XML line according to a second line tag type.
[0093] The rules for obtaining the standardized XML row hierarchy of the row according to the row tag type are shown in Table 1.
[0094] Table 1 Hierarchical correspondence table
[0095]
[0096] S132: Perform bubble comparison on the first level of the first XML line, and perform bubble comparison on the second level of the second XML line.
[0097] S133. When the first level of the first XML line in this row is greater than the first level of the first XML line in the previous row, delete a TAB character in the first XML line in this row; and when the second level of the second XML line in this row is greater than the second level of the second XML line in the previous row, delete a TAB character in the second XML line in this row.
[0098] S134. When the first level of the first XML line in this row is smaller than the first level of the first XML line in the previous row, a TAB character is added to the first XML line in this row; and when the second level of the second XML line in this row is smaller than the second level of the second XML line in the previous row, a TAB character is added to the second XML line in this row.
[0099] It can be understood that when the first level of the first XML line in this row is equal to the first level of the first XML line in the previous row, it means that the number of TAB characters in the first XML line in this row and the first XML file in the previous row are the same, and there is no need to increase or decrease TAB characters; similarly, when the second level of the second XML line in this row is equal to the second level of the second XML line in the previous row, it means that the number of tab characters in the second XML line in this row and the second XML file in the previous row are the same, and there is no need to increase or decrease tab characters.
[0100] The following combination Figure 4 The consistency verification method of the distributed edge cloud edge node of the present invention is described. In this embodiment, step S200 specifically includes the following steps:
[0101] S210 , performing path tracing on the first XML line and the second XML line to obtain a first backtracking path corresponding to each first XML line and a second backtracking path corresponding to each second XML line.
[0102] According to the hierarchy corresponding to the standardized XML obtained in step S100 , a backtracking path corresponding to each standardized XML is obtained, and a hierarchical path from a node to a root node is found.
[0103] Specifically:
[0104] When the first level of the first XML line of this row is greater than the first level of the first XML line of the previous row, a path point (previous row sequence) is added to the first XML line of the previous row.
[0105] When the first level of the first XML line in this row is smaller than the first level of the first XML line in the previous row, the last path point of the first XML line in the previous row is deleted (the last path point is popped out from the path in the previous row).
[0106] When the second level of the second XML line of the current row is greater than the second level of the second XML line of the previous row, a path point (previous row sequence) is added to the second XML line of the previous row.
[0107] When the second level of the second XML line in this row is smaller than the second level of the second XML line in the previous row, the last path point of the second XML line in the previous row is deleted (the last path point is popped out from the path in the previous row).
[0108] It can be understood that when the first level of the first XML line in this row is equal to the first level of the first XML line in the previous row, no path point is added (consistent with the path point of the previous row); when the second level of the second XML line in this row is equal to the second level of the second XML line in the previous row, no path point is added (consistent with the path point of the previous row).
[0109] Each line of the path is recorded as follows: [rootno, next1no, next2no, ... nextnno], where rootno is the row number of the root node, next1no is the row number of the next node (the next level node of the root node), next2no is the row number of the next2 node (the next level node of the next1 node), and so on. Nextnno is the row number of the nextn node (the previous level node of the node being processed).
[0110] S220. Compare the row contents of the first XML row and the second XML row excluding the row tag type, and the row contents in the first backtracking path and the second backtracking path corresponding to the first XML row and the second XML row excluding the row tag type, row by row, to obtain a first comparison result.
[0111] In step S220, a line-by-line comparison is performed. First, the line contents of the first XML line and the second XML line excluding the line tag type are compared. If they are equal, the line contents in the first backtracking path and the second backtracking path corresponding to the first XML line and the second XML line excluding the line tag type are compared. If they are still equal, it means that the line in the standardized benchmark file and the standardized file to be compared are completely consistent, and the line number of this line in the two files is recorded.
[0112] If there is a difference, the comparison of the next line of the reference file and the standardized file to be compared will continue in the above manner until all comparisons are completed.
[0113] S230: Compare the first XML line and the second XML line of the line tag type to obtain a second comparison result. In this method, the first comparison result and the second comparison result constitute the comparison result.
[0114] The row label type backtracking path is incomplete because the row label type and its corresponding <> row label type are at the same level, but the row label type does not include the line number of the corresponding <> row label type. If the line content in the label backtracking path is compared, many identical label lines at the same level will appear. Therefore, the row label type is compared differently from other row label types. The comparison process for the first and second XML lines of the row label type is as follows:
[0115] a) In the standardized XML file row hierarchy list cmpResults, search from top to bottom for the row number of the row tag type. Once found, record the row of the row tag type as firstTagNo1. Then search the standardized XML file row hierarchy list from firstTagNo1 upwards to find the first row of the row tag type at the same level as the row of the row tag type, and record the row number as firstTagNo2.
[0116] b) In the standardized XML file row comparison list cmpResults, find the row number of firstTagNo2, that is, m in the cmpResults list [m, n], and record n as secondTagNo2, where secondTagNo2 is the row number of the row tag type in the file to be compared; if firstTagNo2 is not found, it means that there is no row tag type row in the file to be compared, and continue with step a);
[0117] c) In the file to be compared, search for lines with row tag type starting from line secondTagNo2, find the first line with row tag type, and record its line number as secondTagNo1;
[0118] d) Find the insertion position of [firstTagNo1, secondTagNo1] in the standardized XML file row-level list cmpResults (smaller than firstTagNo1 and below the row closest to firstTagNo1), and insert [firstTagNo1, secondTagNo1] into the correct position of the standardized XML file row-level list cmpResults.
[0119] After the comparison is completed, the comparison results are recorded in the standardized XML file row comparison list cmpResults. The content of the standardized XML file row comparison list cmpResults is as follows: [[1, 1], [2, 2], [3, 3][4, 10], [5, 11], … [m, n]], where m is the row number in the standardized reference file and n is the row number in the standardized file to be compared. Therefore, [m, n] means that the mth row in the standardized reference file is the nth row in the standardized file to be compared.
[0120] The following combination Figure 5 The consistency verification method of the distributed edge cloud edge node of the present invention is described. In this embodiment, step S300 specifically includes the following steps:
[0121] S310: Obtain the second XML line of the reference file that exceeds the second XML line of the file to be compared.
[0122] S320: Insert the extra second XML line into the comparison result to obtain a merged result file.
[0123] First, process the second extra XML line after preprocessing and insert it into the appropriate position in the comparison results. For example, if the line number is 15, insert "[15, -1]" before line 16. "-1" indicates that this line does not exist in the comparison file. Next, process the first extra XML line after preprocessing. First, obtain the extra line number, and then find the next closest line number in the comparison results. For example, if the line number is 17, find "[7, 18]" and insert "[-1, 17]" before it. "-1" indicates that this line does not exist in the reference file.
[0124] The consistency verification device of the distributed edge cloud edge node provided by the present invention is described below. The consistency verification device of the distributed edge cloud edge node described below and the consistency verification method of the distributed edge cloud edge node described above can be referenced to each other.
[0125] The following combination Figure 6The present invention describes a distributed edge cloud node consistency verification device, which can compare and merge configuration files of different edge cloud nodes, and provides a solution for automatic consistency verification of edge cloud node configurations. Specifically, the device includes:
[0126] The preprocessing module 100 is used to obtain a first configuration file of the edge node to be compared and a second configuration file of the central node, and preprocess the first configuration file and the second configuration file to obtain a file to be compared and a reference file.
[0127] In this embodiment, the first configuration file and the second configuration file are both XML files, and the root nodes of the first configuration file and the second configuration file are consistent, that is, the first configuration file and the second configuration file must have the same purpose.
[0128] In this embodiment, the preprocessing includes deleting extra spaces, blank lines, comments, line breaks, deleting tab characters, etc. Optionally, the tab character refers to a TAB character.
[0129] For a distributed edge cloud architecture, the edge nodes in the device are edge cloud nodes, and the central node is the central cloud node. Furthermore, it is understood that the central cloud node is in communication with each of the distributed edge cloud nodes. Therefore, the device can collect the first configuration files of each of the distributed edge cloud nodes through the central node.
[0130] In this embodiment, the IP address, account number, and password of each distributed edge cloud node, as well as the directory information of the relevant configuration files, can be obtained in advance, and the above information can be saved in the node information list file in the configuration server to obtain the corresponding first configuration file. The second configuration file can be pre-stored in the central cloud node and can be modified accordingly according to the specific situation.
[0131] The comparison module 200 is used to compare the file to be compared with the reference file to obtain a comparison result.
[0132] In the comparison module 200 , the comparison results are recorded based on the differences in the leaf nodes.
[0133] The merging module 300 is used to merge the comparison result with the reference file to obtain a merged result file.
[0134] The sending module 400 is used to send the merged result file to the edge node to be compared.
[0135] In the sending module 400, the merged result file generated after the comparison and merging of each edge node to be compared can be sent to the corresponding edge node to be compared through the central node. According to the merged result file, the deployment and management of complex distributed systems such as edge cloud platforms and cluster systems can be guided, and the configuration differences of different edge nodes can be known in advance, and timely modifications and distribution can be made to reduce the risk of project implementation.
[0136] Because both the first and second configuration files are XML files, the device is universally applicable. It is not an XML file for a specific business, but rather adapts to all XML files. It has multiple functions, meaning it can be used as an XML file standardization tool, an XML file comparison tool, and an XML merging tool. The output comparison results better demonstrate the XML document hierarchy, making it easier to read and understand. The comparison results are clear and concise, showing both the correspondence between the lines of the two files and the differences and locations of the lines. It can be quickly expanded into an automated multi-node XML file merging tool, automatically distributed to each distributed edge cloud node.
[0137] The consistency verification device of the distributed edge cloud edge node of the present invention pre-processes the first configuration file obtained by the edge cloud node and the second configuration file pre-stored by the central node, and then compares the file to be compared and the benchmark file obtained after the pre-processing to obtain a comparison result, and then merges the comparison result with the first configuration file and the second configuration file to form a first verification and merged result file, and finally sends the merged result file to the corresponding edge node to be compared, thereby realizing automatic consistency verification of the edge node configuration, comparing and merging the configuration files of different edge nodes, and outputting the configuration differences of the edge nodes, thereby improving the efficiency of edge node deployment and implementation, and can guide the deployment and management of complex distributed systems such as edge cloud platforms and cluster systems, and can know the configuration differences of different edge nodes in advance, modify and send them in time, and reduce the risk of project implementation.
[0138] The following combination Figure 7 The consistency checking device of the distributed edge cloud edge node of the present invention is described. In this embodiment, the preprocessing module 100 specifically includes:
[0139] The first acquiring unit 110 is configured to acquire a first configuration file and a second configuration file.
[0140] The first preprocessing unit 120 is configured to perform a first preprocessing on the first configuration file to obtain a plurality of first XML lines and a first line tag type corresponding to each first XML line, and to perform a first preprocessing on the second configuration file to obtain a plurality of second XML lines and a second line tag type corresponding to each second XML line. In this device, the first preprocessing includes removing extra spaces, blank lines, comments, and line breaks.
[0141] In this embodiment, the row tag types include <? ? >, <! ---->, <>, <>, and , and the first XML row and the second XML row of the above row tag types are both in separate rows.
[0142] The second preprocessing unit 130 is configured to perform a second preprocessing on the first XML line according to the tag type of the first line to obtain a file to be compared, and to perform a second preprocessing on the second XML line according to the tag type of the second line to obtain a reference file. In this device, the second preprocessing is to delete tab characters.
[0143] In this embodiment, the second pre-processing unit 130 specifically includes:
[0144] The second acquiring unit is configured to acquire a first level corresponding to the first XML line according to the tag type of the first line, and acquire a second level corresponding to the second XML line according to the tag type of the second line.
[0145] The bubble comparison unit is configured to perform a bubble comparison on the first level of the first XML line and to perform a bubble comparison on the second level of the second XML line.
[0146] The deletion unit is used to delete a TAB character in the first XML line of the current row when the first level of the first XML line of the current row is greater than the first level of the first XML line of the previous row, and to delete a TAB character in the second XML line of the current row when the second level of the second XML line of the current row is greater than the second level of the second XML line of the previous row.
[0147] An adding unit is used to add a TAB character in the first XML line of this row when the first level of the first XML line of this row is less than the first level of the first XML line of the previous row, and to add a TAB character in the second XML line of this row when the second level of the second XML line of this row is less than the second level of the second XML line of the previous row.
[0148] It can be understood that when the first level of the first XML line in this row is equal to the first level of the first XML line in the previous row, it means that the number of TAB characters in the first XML line in this row and the first XML file in the previous row are the same, and there is no need to increase or decrease TAB characters; similarly, when the second level of the second XML line in this row is equal to the second level of the second XML line in the previous row, it means that the number of tab characters in the second XML line in this row and the second XML file in the previous row are the same, and there is no need to increase or decrease tab characters.
[0149] The following combination Figure 8 The consistency checking device of the distributed edge cloud edge node of the present invention is described. In this embodiment, the comparison module 200 specifically includes:
[0150] The tracing unit 210 is configured to perform path tracing on the first XML line and the second XML line to obtain a first tracing path corresponding to each first XML line and a second tracing path corresponding to each second XML line.
[0151] According to the hierarchy corresponding to the standardized XML obtained in the pre-processing module 100 , a backtracking path corresponding to each standardized XML is obtained, and a hierarchical path from a node to a root node is found.
[0152] Specifically:
[0153] When the first level of the first XML line of this row is greater than the first level of the first XML line of the previous row, a path point (previous row sequence) is added to the first XML line of the previous row.
[0154] When the first level of the first XML line in this row is smaller than the first level of the first XML line in the previous row, the last path point of the first XML line in the previous row is deleted (the last path point is popped out from the path in the previous row).
[0155] When the second level of the second XML line of the current row is greater than the second level of the second XML line of the previous row, a path point (previous row sequence) is added to the second XML line of the previous row.
[0156] When the second level of the second XML line in this row is smaller than the second level of the second XML line in the previous row, the last path point of the second XML line in the previous row is deleted (the last path point is popped out from the path in the previous row).
[0157] It can be understood that when the first level of the first XML line in this row is equal to the first level of the first XML line in the previous row, no path point is added (consistent with the path point of the previous row); when the second level of the second XML line in this row is equal to the second level of the second XML line in the previous row, no path point is added (consistent with the path point of the previous row).
[0158] The first comparison unit 220 is used to compare the row contents of the first XML row and the second XML row excluding the row tag type, and the row contents in the first backtracking path and the second backtracking path corresponding to the first XML row and the second XML row excluding the row tag type, to obtain a first comparison result.
[0159] The second comparison unit 230 is used to compare the first XML line and the second XML line of the line tag type to obtain a second comparison result. In this device, the first comparison result and the second comparison result constitute the comparison result.
[0160] The following combination Figure 9 The consistency checking device of the distributed edge cloud edge node of the present invention is described. In this embodiment, the merging module 300 specifically includes:
[0161] The third obtaining unit 310 is configured to obtain a second XML line of the reference file that is greater than the second XML line of the file to be compared.
[0162] The merging unit 320 is configured to insert the extra second XML line into the comparison result to obtain a merged result file.
[0163] Figure 10 An example of a physical structure diagram of an electronic device is shown below. Figure 10 As shown, the electronic device may include: a processor 810, a communication interface 820, a memory 830, and a communication bus 840, wherein the processor 810, the communication interface 820, and the memory 830 communicate with each other through the communication bus 840. The processor 810 may call the logic instructions in the memory 830 to execute the consistency verification method of the distributed edge cloud edge node, which includes the following steps:
[0164] S100: Obtain a first configuration file of an edge node to be compared and a second configuration file of a central node, and preprocess the first configuration file and the second configuration file to obtain a file to be compared and a reference file;
[0165] S200, comparing the file to be compared with the reference file to obtain a comparison result;
[0166] S300, merging the comparison result with the reference file to obtain a merged result file;
[0167] S400: Send the merged result file to the edge node to be compared.
[0168] In addition, the logic instructions in the above-mentioned memory 830 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when sold or used as an independent product. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0169] On the other hand, the present invention further provides a computer program product, which includes a computer program. The computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can perform the consistency verification method of the distributed edge cloud edge node provided by the above methods, and the method includes the following steps:
[0170] S100: Obtain a first configuration file of an edge node to be compared and a second configuration file of a central node, and preprocess the first configuration file and the second configuration file to obtain a file to be compared and a reference file;
[0171] S200, comparing the file to be compared with the reference file to obtain a comparison result;
[0172] S300, merging the comparison result with the reference file to obtain a merged result file;
[0173] S400: Send the merged result file to the edge node to be compared.
[0174] In another aspect, the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the consistency verification method of the distributed edge cloud edge node provided by the above methods is implemented, and the method includes the following steps:
[0175] S100: Obtain a first configuration file of an edge node to be compared and a second configuration file of a central node, and preprocess the first configuration file and the second configuration file to obtain a file to be compared and a reference file;
[0176] S200, comparing the file to be compared with the reference file to obtain a comparison result;
[0177] S300, merging the comparison result with the reference file to obtain a merged result file;
[0178] S400: Send the merged result file to the edge node to be compared.
[0179] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, i.e., they may be located in one location or distributed across multiple network units. Some or all of the modules may be selected based on actual needs to achieve the objectives of the present embodiment. Persons of ordinary skill in the art will be able to understand and implement the present invention without inventive effort.
[0180] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a necessary general hardware platform, or of course, by hardware. Based on this understanding, the essence of the above technical solution or the part that contributes to the existing technology can be embodied in the form of a software product. The computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a magnetic disk, an optical disk, etc., and includes a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or certain parts of the embodiments.
[0181] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present invention.
Claims
1. A consistency verification method for distributed edge cloud edge nodes, characterized in that: The following steps are involved: Obtaining a first configuration file of an edge node to be compared and a second configuration file of a central node, and preprocessing the first configuration file and the second configuration file to obtain a file to be compared and a reference file; wherein obtaining the first configuration file of an edge node to be compared and the second configuration file of the central node, and preprocessing the first configuration file and the second configuration file to obtain a file to be compared and a reference file includes: Obtaining the first configuration file and the second configuration file; wherein the first configuration file and the second configuration file are both extensible markup language files, and the root nodes of the first configuration file and the second configuration file are consistent; Performing a first preprocessing on the first configuration file to obtain a plurality of first extensible markup language lines and a first line tag type corresponding to each of the first extensible markup language lines; wherein the first preprocessing includes deleting redundant spaces, blank lines, comments, and line breaks; performing the first preprocessing on the second configuration file to obtain a plurality of second extensible markup language lines and a second line tag type corresponding to each of the second extensible markup language lines; performing a second preprocessing on the first extensible markup language line according to the tag type of the first line to obtain the file to be compared; wherein the second preprocessing is deleting tab characters; performing a second preprocessing on the second extensible markup language line according to the tag type of the second line to obtain the reference file; Comparing the file to be compared with the reference file to obtain a comparison result; Merging the comparison result with the reference file to obtain a merged result file; The merged result file is sent to the edge node to be compared.
2. The consistency verification method of the distributed edge cloud edge node according to claim 1 is characterized in that: The performing second preprocessing on the first XML line according to the tag type of the first line to obtain the file to be compared specifically includes the following steps: According to the tag type of the first line, obtaining a first level corresponding to the first extensible markup language line; performing a bubble comparison on the first level of the first extensible markup language line; When the first level of the first extensible markup language line in the current row is greater than the first level of the first extensible markup language line in the previous row, deleting a tab character in the first extensible markup language line in the current row; When the first level of the first XML line in the current row is smaller than the first level of the first XML line in the previous row, adding a tab character to the first XML line in the current row; Accordingly, according to the tag type of the second line, the second extensible markup language line is subjected to a second preprocessing to obtain the reference file, which specifically includes the following steps: According to the tag type of the second line, obtaining a second level corresponding to the second extensible markup language line; performing a bubble comparison on the second level of the second XML line; When the second level of the second Extensible Markup Language line in the current row is greater than the second level of the second Extensible Markup Language line in the previous row, deleting a tab character in the second Extensible Markup Language line in the current row; When the second level of the second XML line in the current row is smaller than the second level of the second XML line in the previous row, a tab character is added to the second XML line in the current row.
3. The consistency verification method of the distributed edge cloud edge node according to claim 2 is characterized in that: Comparing the file to be compared with the reference file to obtain a comparison result specifically includes the following steps: Performing path tracing on the first XML line and the second XML line to obtain a first backtracking path corresponding to each of the first XML lines and a second backtracking path corresponding to each of the second XML lines; Comparing line contents of the first extensible markup language line and the second extensible markup language line, excluding line tag types, and line contents in the corresponding first backtracking path and the second backtracking path line by line to obtain a first comparison result; The first extensible markup language line and the second extensible markup language line of line tag type are compared to obtain a second comparison result; wherein the first comparison result and the second comparison result constitute the comparison result.
4. The consistency verification method of the distributed edge cloud edge node according to claim 3 is characterized in that: The performing path tracing on the first XML line and the second XML line to obtain a first backtracking path corresponding to each first XML line and a second backtracking path corresponding to each second XML line specifically includes the following steps: When the first level of the first extensible markup language line in the current row is greater than the first level of the first extensible markup language line in the previous row, adding a path point to the first extensible markup language line in the previous row; When the first level of the first XML line in the current row is smaller than the first level of the first XML line in the previous row, deleting the last path point of the first XML line in the previous row; When the second level of the second Extensible Markup Language line in the current row is greater than the second level of the second Extensible Markup Language line in the previous row, adding a path point to the second Extensible Markup Language line in the previous row; When the second level of the second XML line in the current row is smaller than the second level of the second XML line in the previous row, the last path point of the second XML line in the previous row is deleted.
5. The consistency verification method of distributed edge cloud edge nodes according to claim 1 is characterized in that: Merging the comparison result with the reference file to obtain a merged result file specifically includes the following steps: Obtain the second extensible markup language line of the reference file that exceeds the second extensible markup language line of the file to be compared; The extra second extensible markup language line is inserted into the comparison result to obtain the merged result file.
6. A consistency verification device for distributed edge cloud edge nodes, characterized in that: include: A preprocessing module is configured to obtain a first configuration file of an edge node to be compared and a second configuration file of a central node, and preprocess the first and second configuration files to obtain a file to be compared and a reference file. The preprocessing module specifically comprises: obtaining the first and second configuration files; wherein both the first and second configuration files are XML files, and the root nodes of the first and second configuration files are the same; performing a first preprocessing on the first configuration file to obtain a plurality of first XML lines and a first line tag type corresponding to each of the first XML lines; wherein the first preprocessing includes removing redundant spaces, blank lines, comments, and line breaks; performing the first preprocessing on the second configuration file to obtain a plurality of second XML lines and a second line tag type corresponding to each of the second XML lines; performing a second preprocessing on the first XML line based on the first line tag type to obtain the file to be compared; wherein the second preprocessing includes removing tab characters; and performing a second preprocessing on the second XML line based on the second line tag type to obtain the reference file. A comparison module, configured to compare the file to be compared with the reference file to obtain a comparison result; A merging module, configured to merge the comparison result with the reference file to obtain a merged result file; The sending module is used to send the merged result file to the edge node to be compared.
7. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the steps of the consistency verification method of the distributed edge cloud edge node as described in any one of claims 1 to 5 are implemented.
8. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the consistency verification method of the distributed edge cloud edge node as described in any one of claims 1 to 5 are implemented.
9. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the consistency verification method of the distributed edge cloud edge node as described in any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
File configuration method and device based on distributed file edge nodes
CN112286898A