A multi-party SDH frame structure data comparison method based on JAVA language
Through a multi -party SDH frame structure data comparison method based on the Java language, the problem of does not support the SDH frame structure, multi -party comparison and deep -level contrast in the existing technology, and realizes the multi -party and deep comparison of the SDH frame structure, simplified The development process is provided with a simple API interface.
Patent Information
- Application Number
- CN202210463794.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-28
- Publication Date
- 2025-01-28
- Estimated Expiration
- 2042-04-28
AI Technical Summary
The existing data comparison methods do not support the comparison function specifically for SDH frame structure, do not support the comparison function of multiple parties, and do not support the deep comparison function of the tree structure.
It proposes a multi -party SDH frame structure data comparison method based on the Java language, including reading line data based on configuration information, restructuring frame structure data, comparing in accordance with the SDH frame structure protocol rules, and identifying inconsistent places to support deep -level updates.
The comparison of multi -party structures of the SDH frame structure, supporting the comparison of deep -seated tree structures, simplifying the user development process, providing a simple API interface, suitable for optical fiber transmission networks and other comparison scenes with or without hierarchical structures.
Smart Images

Figure CN114860210B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of data communication, and in particular to a multi-party SDH frame structure data comparison method based on JAVA language. Background Art
[0002] Most of the existing data comparison methods are based on records, and there is no comparison method specifically for the SDH line frame structure for components developed in any language. The existing background components have the following characteristics: providing a tree structure display function, being able to provide a maximum of two groups of record comparison methods, and providing an API interface for reading or writing data to the outside world; they have the following problems: they do not support a comparison function specifically for the SDH frame structure, do not support a multi-party comparison function, and do not support a deep comparison function for the tree structure.
[0003] Therefore, the prior art has defects and needs to be improved. Summary of the invention
[0004] The main purpose of the present invention is to propose a multi-party SDH frame structure data comparison method based on JAVA language, aiming to realize frame structure comparison in the process of data communication transmission, so as to facilitate users to do further analysis.
[0005] To achieve the above object, the present invention proposes a multi-party SDH frame structure data comparison method based on JAVA language, comprising the following steps:
[0006] S1: Read line data into the cache according to configuration information;
[0007] S2: Read the frame structure data from the line data according to the configuration information, and reorganize and cache the frame structure data according to the convention of the component memory structure;
[0008] S3: Compare the frame structure data according to the SDH frame structure protocol rules and identify the inconsistencies;
[0009] S4: Update the frame structure of a certain level to another level, and determine whether to perform a deep level update.
[0010] Preferably, in step S1, the configuration information includes data source configuration information, SQL statements of the line, and field mapping configuration information.
[0011] Preferably, in step S1, the line data is obtained according to the SQL statement for obtaining the line, and then mapped into the agreed data structure according to the field mapping configuration information.
[0012] Preferably, the self-agreed data structure is set as a key-value pair structure, which is responsible for storing the line data of multiple parties. Each key-value pair is composed of two parts, including an array structure and a key-value pair structure. The array structure is used to sequentially cache the line data of a specific party. At the same time, each line data will generate an ID value, and the key-value pair structure is used to store the serial number of the line array with the line ID as the primary key.
[0013] Preferably, in step S2, the component memory structure is set as a key-value pair data structure, in which the primary key is the line ID, the value is an unordered array, each array stores a frame structure object, and the attributes of the frame structure object include: electrical layer identification, signal type, transmission rate, electrical layer description, dynamic multiple sorting fields, and extension fields.
[0014] Preferably, in step S2, before reading the frame structure data, it is first determined whether there is line data in the line pool. If not, the specified line data is virtually generated according to the number of parties given by the user.
[0015] Preferably, in step S2, if the frame structure data is not read, a log is printed, and the user can initialize the frame structure data during the process of calling the comparison or update operation.
[0016] Preferably, in step S3, before comparing the SDH frame structure data, comparison parameters need to be obtained to determine whether it is legal, and the obtained comparison parameters include: line ID or name array, compared electrical layer rate, whether to fill in blank frame structure, and number of processing threads.
[0017] Preferably, in step S4, before updating, it is necessary to obtain update parameters and determine whether they are legal, and the obtained parameters include source line ID, target line ID, electrical layer identification, and whether it is a deep update;
[0018] If the user does not pass in the electrical layer identifier, it determines whether to perform a deep update. If so, all frame structures are updated from the source root node to the target node in a recursive manner;
[0019] If the user inputs the electrical layer identifier, the electrical layer identifier of the source is compared and the corresponding position is found, and it is updated to the same layer of the target node. At the same time, it will determine whether to perform a deep update.
[0020] Compared with the prior art, the present invention has the following beneficial effects:
[0021] The comparative analysis solution of this solution encapsulates the comparison process into an independently usable JAR package, which users can directly integrate into the code for use;
[0022] This solution directly encapsulates the frame structure comparison process into a directly usable component. Users do not need to care about the internal implementation logic, which simplifies user development.
[0023] This solution provides a concise API interface, which is clear to users;
[0024] This solution is not only applicable to the frame structure comparison of the optical fiber transmission network, but also applicable to any comparison process with or without a hierarchical structure, so that users can use it in a variety of scenarios. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the structures shown in these drawings without paying creative work.
[0026] Figure 1 It is a schematic diagram of the overall technical architecture of the present invention;
[0027] Figure 2 It is a schematic diagram of the processing flow of the multi-line management component of the present invention;
[0028] Figure 3 It is a schematic diagram of the processing flow of the SDH frame structure management component of the present invention;
[0029] Figure 4 It is a schematic diagram of the processing flow of the multi-threaded SDH frame structure comparison component of the present invention;
[0030] Figure 5 It is a schematic diagram of the processing flow of the SDH frame structure update component of the present invention;
[0031] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0032] This embodiment proposes a multi-party SDH frame structure data comparison method based on JAVA language. It should be noted that this technical solution is based on the implementation of the frame structure comparison function of the SDH line in the optical fiber. The frame structure comparison and update method is mainly used in the use scenarios of data communication transmission network. The SDH line frame structure comparison function provides users with an experience of automatically comparing frame structures. In some usage scenarios, users need to find out as quickly as possible which frame structures are different when the data of the same optical fiber line is collected at different times, so as to facilitate further analysis by users. Reference Figure 1 ,The architecture of this solution includes the following components: multi-party line management ,component, SDH frame structure management component, multi-threaded SDH frame structure comparison ,component, SDH frame structure update component, and frame structure extraction ,API interface.
[0033] Specifically, the various components work together to perform the following steps:
[0034] S1: The multi-party line management component reads line data into the cache according to the configuration information;
[0035] It should be noted that the multi-party line management component is responsible for managing the line information of SDH. It provides an API interface to the outside and is responsible for obtaining the optical fiber line data. Users can input the line information to be compared according to the API interface, or access different data sources through configuration to obtain line data; the multi-party line management component is a component provided to users to read the basic information of optical fiber lines. It is built on the basis of the SPRING development framework;
[0036] refer to Figure 2 ,When the system engineering is started, the multi-party line management component reads the line data into the cache according to the ,information of the configuration file to facilitate the use of subsequent ,components;
[0037] When the system project is started, the multi-party line component can be loaded normally if no data is read. It provides a corresponding API interface for users to pass in line data;
[0038] The configuration items provided by the multi-party line management component include data source configuration information (SPRING data source configuration information), SQL statements for obtaining lines, field mapping configuration, etc.; when the multi-party line management component is started, it will obtain line data according to the SQL statement for obtaining lines, and then map it into its own agreed data structure according to the field mapping configuration information; the self-agreed data structure is set as a key-value pair structure, which is responsible for storing the line data of multiple parties, and each key-value pair is composed of two parts, including an array structure and a key-value pair structure. The array structure is used to sequentially cache the line data of a specific party. At the same time, each line data will generate an ID value, and the key-value pair structure is used to store the serial number of the line array with the line ID as the primary key.
[0039] The multi-party line management component also provides users with an interface for initializing and querying line data. The data protocol transmitted by the interface is consistent with the agreed memory data structure.
[0040] S2: The SDH frame structure management component reads the frame structure data from the line data according to the configuration information, and reorganizes and caches the frame structure data according to the convention of the component memory structure;
[0041] It should be noted that the SDH frame structure management component is responsible for managing the SDH frame structure information. It provides an API interface to the outside and is responsible for obtaining the frame structure data of the optical fiber line. The user can pass in the frame structure information to be compared according to the API interface, or access different data sources through configuration to compare the structure information; the SDH frame structure management component is mainly responsible for caching the frame structure data. Specifically, refer to Figure 3 :
[0042] After the multi-party line management component is loaded, the SDH frame structure management component will first determine whether there is line data in the line pool. If there is no line data, it will virtually generate the specified line data according to the multi-party number given by the user;
[0043] After the SDH frame structure management component prepares the line data, it will try to read the frame structure data from the data source according to the configuration information;
[0044] After the SDH frame structure management component reads the frame structure data, it will reorganize and cache the frame structure according to the convention of the component memory structure;
[0045] The memory structure of the SDH frame structure management component is mainly a key-value pair data structure. Its primary key is the line ID, and the value is an unordered array. Each array stores a frame structure object. The object's attributes include: electrical layer identification, signal type, transmission rate, electrical layer description, dynamic multiple sorting fields, and extension fields.
[0046] If the SDH frame structure management component fails to obtain the frame structure data, it will print a log. The user can initialize the frame structure data during the comparison or update operation.
[0047] The SDH frame structure management component also provides a query interface, where users can obtain frame structure data sorted according to the dynamic sorting fields according to line name, line ID, electrical layer identification, signal type, transmission rate, and electrical layer description.
[0048] S3: The multi-threaded SDH frame structure comparison component compares the frame structure data according to the SDH frame structure protocol rules and identifies the inconsistencies;
[0049] It should be noted that the multi-threaded SDH frame structure comparison component is responsible for obtaining the data to be compared through the multi-party line management component and the SDH frame structure management component, and deeply compares the SDH frame structure through a multi-threaded manner. Specifically, refer to Figure 4 :
[0050] The multi-threaded SDH frame structure comparison component provides the user with an interface for comparison. The calling parameters include: line ID or name array, the electrical layer rate to be compared, whether to fill in the empty frame structure, and the number of processing threads. The line ID or name array parameter determines the number of parties to be compared; the electrical layer rate parameter to be compared must be selected from 10g, 2.5G, 622m, 155m, 45m, 6m, 2m, and 64k rates; the parameter of whether to fill in the empty frame structure refers to filling in empty time slots according to the SDH protocol rules. For example, when comparing 1-2VC4 with 1VC4 and 2VC4, fill in the empty space on the left to align the time slot structure; the parameter of the number of processing threads determines the number of threads in the multi-threaded comparison process;
[0051] After the multi-threaded SDH frame structure comparison component verifies the legality of the parameters according to the above logic, it enters the comparison logic processing:
[0052] First, initialize the thread pool according to the number of threads;
[0053] Determine whether the frame structure to be compared is an overall signal or whether there is a 155M time slot;
[0054] If 155M exists, the number of 64 155Ms is evenly distributed to the number of threads according to the SDH protocol rules, and the signal type of the 155M time slot is compared respectively;
[0055] If the signal type of the 155M time slot is inconsistent, record the 155M time slot position;
[0056] If the signal type of the 155M time slot is consistent, determine whether the compared electrical layer rate parameters include 45M. If not, record the inconsistent position. If included, continue to compare 45M (and determine whether there is an idle thread in the thread pool. If so, divide the 45M time slot equally to the idle thread for processing according to the SDH protocol rules), and so on for the following time slots;
[0057] If the 155M time slot does not exist on one side, then there must be a continuous time slot signal on that side, and the component will handle it accordingly through the "whether to need to fill the blank frame structure" parameter. The same is true for other time slots.
[0058] Furthermore, when the main thread starts calling the multi-threaded comparison, it will asynchronously monitor the comparison results. If each thread is processed, it will merge the returned data into a frame structure according to the rules of the SDH frame structure; after the main thread of the component completes the merger, it will cache the comparison results for users to view.
[0059] S4: The SDH frame structure update component updates the frame structure of a certain layer to another layer, and determines whether to perform a deep update.
[0060] It should be noted that the SDH frame structure update component allows users to synchronize one frame structure to another. The frame structure at any level can be updated. Specifically, refer to Figure 5 :
[0061] The parameters received by the SDH frame structure update component include: source line ID (does not support multiple), target line ID (supports multiple), electrical layer identification, whether to update in depth (1 = yes, 0 = no);
[0062] If the user does not pass in the electrical layer identifier, the update component will determine whether the "deep update" parameter is 1. If it is equal to 1, all frame structures will be updated from the source root node to the target node in a recursive manner;
[0063] If the user passes in the electrical layer identifier, the update component will compare the electrical layer identifier of the source and find the corresponding position, update it to the same layer of the target node, and determine whether it is a "deep level" update.
[0064] Furthermore, the frame structure API interface provides users with REST service interfaces such as querying original frame structure data, frame structure comparison results, and frame structure update operations, including the following interfaces:
[0065] Get line information interface: Line information can be obtained through the multi-party line management component. The request parameters include line ID and line name;
[0066] Get frame structure information interface: The frame structure information of the corresponding line can be obtained through the SDH frame structure management component. The request parameters include line ID, line name, electrical layer identifier, whether to obtain recursively, and whether to obtain different frame structures (1 = yes, 0 = all);
[0067] Frame structure comparison interface: The comparison function can be processed through the multi-threaded SDH frame structure comparison component. The calling parameters include: line ID or name array, compared electrical layer rate, whether to fill in the blank frame structure, and the number of processing threads;
[0068] Frame structure update interface: The frame structure can be updated through the SDH frame structure update component. The request parameters include: source line ID (multiple is not supported), target line ID (multiple is supported), electrical layer identifier, and whether to update in depth (1=yes, 0=no).
[0069] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A multi-party SDH frame structure data comparison method based on JAVA language, comprising a multi-party line management component, an SDH frame structure management component, a multi-threaded SDH frame structure comparison component, and an SDH frame structure update component, characterized in that: The steps include: S1: The multi-party line management component reads line data into the cache according to the configuration information; S2: The SDH frame structure management component reads the frame structure data from the line data according to the configuration information, and reorganizes and caches the frame structure data according to the convention of the component memory structure; S3: The multi-threaded SDH frame structure comparison component compares the frame structure data according to the SDH frame structure protocol rules and identifies the inconsistencies; S4: The SDH frame structure update component updates the frame structure of a certain layer to another layer and determines whether to perform a deep update; In step S2, the component memory structure is set as a key-value pair data structure, where the primary key is the line ID, the value is an unordered array, each array stores a frame structure object, and the attributes of the frame structure object include: electrical layer identification, signal type, transmission rate, electrical layer description, dynamic multiple sorting fields, and extension fields; In step S3, the multi-threaded SDH frame structure comparison component provides a comparison interface to the user, and the calling parameters include: line ID or name array, compared electrical layer rate, whether to fill empty frame structure, and the number of processing threads; the line ID or name array parameter determines the number of parties to be compared; the electrical layer rate parameter to be compared is selected from 10G, 2.5G, 622M, 155M, 45M, 6M, 2M, and 64K rates; whether to fill empty frame structure parameter refers to filling empty time slots according to SDH protocol rules; the number of processing threads parameter determines the number of threads during multi-threaded comparison processing; First, initialize the thread pool according to the number of threads; Determine whether the frame structure to be compared is an overall signal or whether there is a 155M time slot; If there are 155M time slots, the number of 64 155M time slots is evenly distributed to the number of threads according to the SDH protocol rules, and the signal types of the 155M time slots are compared respectively; If the signal type of the 155M time slot is inconsistent, record the 155M time slot position; If the signal type of the 155M timeslot is consistent, determine whether the compared electrical layer rate parameters include the 45M timeslot. If not, record the inconsistent position. If included, continue to compare the 45M timeslot and determine whether there is an idle thread in the thread pool. If yes, divide the 45M timeslot equally to the idle threads for processing according to the SDH protocol rules. If the 155M time slot does not exist on one side, there must be a continuous time slot signal on this side. The component will handle it accordingly through the "whether to fill the blank frame structure" parameter, and the same applies to other time slots. When the main thread starts calling the multi-thread comparison, it will asynchronously monitor the comparison results. If each thread has completed the processing, it will merge the returned data into a frame structure according to the rules of the SDH frame structure. After the main thread of the component completes the merging, it will cache the comparison results. In step S4, before updating, it is necessary to obtain update parameters and determine whether they are legal. The obtained parameters include source line ID, target line ID, electrical layer identifier, and whether it is a deep update; If the user does not pass in the electrical layer identifier, it determines whether to perform a deep update. If so, all frame structures are updated from the source root node to the target node in a recursive manner; If the user inputs the electrical layer identifier, the electrical layer identifier of the source is compared and the corresponding position is found, and it is updated to the same layer of the target node. At the same time, it is determined whether to perform a deep update.
2. The multi-party SDH frame structure data comparison method based on JAVA language as claimed in claim 1, characterized in that: In step S1, the configuration information includes data source configuration information, SQL statements of the line, and field mapping configuration information.
3. The multi-party SDH frame structure data comparison method based on JAVA language as claimed in claim 2, characterized in that: In step S1, the line data is obtained according to the SQL statement for obtaining the line, and then mapped into a self-agreed data structure according to the field mapping configuration information; the self-agreed data structure is set as a key-value pair structure, which is responsible for storing the line data of multiple parties, and each key-value pair is composed of two parts, including an array structure and a key-value pair structure. The array structure is used to sequentially cache the line data of a specific party. At the same time, each line data will generate an ID value, and the key-value pair structure is used to store the serial number of the line array with the line ID as the primary key.
4. The multi-party SDH frame structure data comparison method based on JAVA language as claimed in claim 1, characterized in that: In step S2, before reading the frame structure data, it is first determined whether there is line data in the line pool. If not, the specified line data is virtually generated according to the number of parties given by the user.
5. The multi-party SDH frame structure data comparison method based on JAVA language as claimed in claim 1, characterized in that: In step S2, if the frame structure data is not read, the log is printed, and the user can initialize the frame structure data during the comparison or update operation.
6. The multi-party SDH frame structure data comparison method based on JAVA language as claimed in claim 1, characterized in that: In step S3, before comparing the SDH frame structure data, it is necessary to obtain comparison parameters to determine whether it is legal. The comparison parameters obtained include: line ID or name array, compared electrical layer rate, whether to fill in the blank frame structure, and the number of processing threads.
Citation Information
Patent Citations
Network protocol data checking method and device
CN112799673A