Communication channel establishment method and apparatus, storage medium, and electronic device

By receiving the identity and data frame length information of the device to be connected, the interface program of the fiber optic communication device is automatically modified, which solves the problem that the interface program of the fiber optic communication device needs to be manually modified in the existing technology, and realizes the establishment of an efficient and secure communication channel.

CN115766045BActive Publication Date: 2026-04-14CRRC ZHUZHOU ELECTRIC LOCOMOTIVE RESEARCH INSTITUTE CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CRRC ZHUZHOU ELECTRIC LOCOMOTIVE RESEARCH INSTITUTE CO LTD
Filing Date
2021-09-02
Publication Date
2026-04-14

AI Technical Summary

Technical Problem

In existing technologies, fiber optic communication equipment requires manual modification of the communication interface program to adapt to different types of slave devices, resulting in low efficiency and a high risk of errors, failing to meet the requirements for high-efficiency communication.

Method used

By receiving the identity information and data frame length information of the device to be connected, the system automatically modifies the data frame length parameter in the communication interface program, establishes a communication channel, and automatically establishes a communication channel with the device to be connected after successful authentication.

Benefits of technology

It enables the automatic, accurate, and secure establishment of communication channels between fiber optic communication devices, improving communication efficiency and avoiding errors and inefficiencies caused by manual modifications.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115766045B_ABST
    Figure CN115766045B_ABST
Patent Text Reader

Abstract

The application provides a communication channel establishment method and device, a storage medium and an electronic device, and relates to the technical field of communication. The method comprises the following steps: receiving an access request sent by a device to be accessed; wherein the access request comprises identity information of the device to be accessed and transmission data frame length information of the device to be accessed; verifying the identity information; after the identity information is verified, modifying a data frame length parameter in an existing communication interface program based on the transmission data frame length information to obtain a modified data frame length parameter; and establishing a communication channel between the device to be accessed based on the modified data frame length parameter. The technical scheme provided by the application can automatically and accurately establish a communication channel between communication devices without manually modifying a communication interface program, thereby improving communication efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of communication technology, and in particular to a communication channel establishment method, apparatus, storage medium, and electronic device. Background Technology

[0002] In fiber optic communication networks, devices using fiber optic communication, such as master and slave devices, transmit data frames of varying lengths. This necessitates the development of dedicated communication protocols for different device types and the determination of the amount of data to be transmitted between devices. Ultimately, this leads to a diversity of communication protocols among different fiber optic devices, causing certain differences in practical engineering applications and making it difficult to form a unified communication interface program code.

[0003] To address the aforementioned technical problems, existing technologies employ manual modification of the master device's communication interface program to adapt it to different slave devices, thereby establishing communication channels with various types of slave devices for fiber optic communication. Clearly, this method of manually modifying the communication interface program is not only cumbersome and inefficient but also prone to errors, failing to meet current demands for high-efficiency communication. Summary of the Invention

[0004] To address the problems in the prior art, this application proposes a communication channel establishment method, apparatus, storage medium, and electronic device that can automatically and accurately establish communication channels between communication devices without requiring manual modification of the communication interface program, thereby improving communication efficiency.

[0005] To achieve the above objectives, the technical solution of the present invention is implemented as follows:

[0006] In a first aspect, embodiments of the present invention provide a method for establishing a communication channel, the method comprising:

[0007] Receive an access request sent by a device to be accessed; wherein the access request includes: the identity information of the device to be accessed and the transmission data frame length information of the device to be accessed;

[0008] Verify the identity information;

[0009] After the identity information is verified, the data frame length parameter in the existing communication interface program is modified based on the transmitted data frame length information to obtain the modified data frame length parameter;

[0010] Based on the modified data frame length parameter, a communication channel is established with the device to be accessed.

[0011] Furthermore, the access request further includes: the key information of the device to be accessed; the method further includes:

[0012] Verify the key information;

[0013] After the identity information verification is successful, the data frame length parameter in the existing communication interface program is modified based on the transmitted data frame length information to obtain the modified data frame length parameter, which is then replaced with:

[0014] After both the identity information and the key information have been verified, the data frame length parameter in the existing communication interface program is modified based on the transmitted data frame length information to obtain the modified data frame length parameter.

[0015] Preferably, verifying the identity information includes:

[0016] Determine whether the identity information already exists in a pre-stored identity information table;

[0017] When the identity information already exists in the identity information table, the identity information verification is successful.

[0018] Preferably, the verification of the key information includes:

[0019] Determine whether the key information already exists in the identity information table;

[0020] When the key information already exists in the identity information table and the identity information has been verified, determine whether the key information is the key information corresponding to the identity information;

[0021] When the key information is the same as the identity information, the key information is verified.

[0022] Furthermore, after modifying the data frame length parameter in the existing communication interface program based on the transmitted data frame length information to obtain the modified data frame length parameter, the method further includes:

[0023] The modified data frame length parameter is sent to the device to be accessed so that the device to be accessed can confirm the correctness of the modified data frame length parameter;

[0024] Receive confirmation information from the device to be connected;

[0025] The step of establishing a communication channel with the device to be accessed based on the modified data frame length parameter includes:

[0026] When the confirmation information confirms that the modified data frame length parameter is correct, a communication channel is established with the device to be accessed based on the modified data frame length parameter.

[0027] Furthermore, before receiving the access request sent by the device to be accessed, the method further includes:

[0028] Polling information is sent for the device to be connected to receive; wherein, the polling information includes the device information to be connected to be obtained.

[0029] The information included in the access request is determined based on the required access device information in the polling information.

[0030] Preferably, sending polling information for the device to be accessed to receive includes:

[0031] The polling information is periodically sent in a broadcast format for the device to be connected to receive.

[0032] Secondly, embodiments of the present invention provide a communication channel establishment apparatus, the apparatus comprising:

[0033] A receiving unit is configured to receive an access request sent by a device to be accessed; wherein the access request includes: the identity information of the device to be accessed and the transmission data frame length information of the device to be accessed;

[0034] An identity verification unit is used to verify the identity information;

[0035] The modification unit is used to modify the data frame length parameter in the existing communication interface program based on the transmitted data frame length information after the identity information verification is passed, so as to obtain the modified data frame length parameter.

[0036] The communication channel establishment unit is used to establish a communication channel with the device to be accessed based on the modified data frame length parameter.

[0037] Thirdly, embodiments of the present invention provide a storage medium storing program code, which, when executed by a processor, implements the communication channel establishment method as described in any of the above embodiments.

[0038] Fourthly, embodiments of the present invention provide an electronic device, the electronic device including a memory and a processor, the memory storing program code executable on the processor, the program code being executed by the processor to implement the communication channel establishment method as described in any of the above embodiments.

[0039] This invention provides a communication channel establishment method, apparatus, storage medium, and electronic device. The method receives an access request from a device to be accessed, verifies the identity information of the device carried in the access request, and, after successful verification, modifies the data frame length parameter in an existing communication interface program based on the data frame length information carried in the access request. Based on the modified data frame length parameter, a communication channel is established with the device to be accessed. Therefore, the technical solution provided by this invention can automatically modify the data frame length parameter in the communication interface program, thereby automatically establishing a communication channel with the device to be accessed. Furthermore, because this solution first verifies the identity information of the device to be accessed, all accessed devices are trusted by the network system, preventing the accidental access to untrusted devices, thus ensuring the security and accuracy of the communication channel establishment process. Therefore, the technical solution provided by this invention eliminates the need for manual modification of the communication interface program, enabling automatic and accurate establishment of communication channels between communication devices, thereby improving communication efficiency. Attached Figure Description

[0040] The scope of this invention can be better understood by reading the following detailed description of exemplary embodiments in conjunction with the accompanying drawings. The accompanying drawings are:

[0041] Figure 1 This is a system architecture diagram illustrating the method described in the embodiments of the present invention.

[0042] Figure 2 The method flow of this invention embodiment Figure 1 ;

[0043] Figure 3 The method flow of this invention embodiment Figure 2 ;

[0044] Figure 4 The device structure of this invention is shown in the embodiment. Figure 1 ;

[0045] Figure 5 The device structure of this invention is shown in the embodiment. Figure 2 . Detailed Implementation

[0046] To make the objectives, technical solutions, and advantages of the present invention clearer, the implementation method of the present invention will be described in detail below with reference to the accompanying drawings and embodiments, so that the process of how the present invention uses technical means to solve technical problems and achieve technical effects can be fully understood and implemented accordingly.

[0047] Many specific details are set forth in the following description in order to provide a full understanding of the invention. However, the invention may also be practiced in other ways different from those described herein, and therefore the scope of protection of the invention is not limited to the specific embodiments disclosed below.

[0048] Example 1

[0049] This invention provides a novel identity authentication communication protocol architecture. It establishes an adaptive identification method between devices that need to communicate via fiber optics, enabling the master device to quickly identify the sub-devices and thus establish a communication channel quickly and accurately. This eliminates the need to manually modify the master device's communication interface program to use different types of sub-devices, thus solving the technical problem of existing technologies that cannot automatically establish communication channels between communication devices.

[0050] Fiber optic communication is characterized by its large communication capacity, long transmission distance, low signal interference, good confidentiality, resistance to electromagnetic interference, excellent transmission quality, small size, light weight, abundant material sources, good environmental protection, and its advantages such as saving non-ferrous metal copper, no radiation, strong adaptability, and long lifespan. Modern industrial control equipment has gradually built a distributed control system based on fiber optics and adopted fiber optic communication medium as the information transmission method between multiple devices.

[0051] The principle of optical fiber communication is that at the transmitting end, the information to be transmitted is first converted into an electrical signal, and then modulated onto the laser beam emitted by the laser, so that the intensity of the light changes with the amplitude or frequency of the electrical signal, and is then transmitted through the optical fiber; at the receiving end, the detector receives the optical signal, converts it into an electrical signal, and then recovers the original information after demodulation.

[0052] The method described in the embodiments of the present invention is applied to, for example, Figure 1 In the system architecture shown. In Figure 1 In this system, a master device includes multiple communication interfaces, each containing a fiber optic transmitter and a fiber optic receiver. Each communication interface is used to connect to a slave device; that is, a master device can connect to multiple slave devices through multiple communication interfaces. Correspondingly, each slave device also has a fiber optic transmitter and a fiber optic receiver, and the master device and slave devices are connected via a fiber optic transmission medium.

[0053] According to embodiments of the present invention, a communication channel establishment method is provided for automatically establishing a communication channel between a master device and a slave device without manually modifying the communication interface program of the master device. Figure 2 As shown, the method described in this embodiment includes:

[0054] Step S101: Receive an access request sent by the device to be accessed; wherein the access request includes: the identity information of the device to be accessed and the transmission data frame length information of the device to be accessed;

[0055] In this embodiment, the device to be accessed is specifically a slave device seeking to connect to a master device. When one or more slave devices wish to connect to the master device and communicate with it, they send an access request to the master device. This access request includes the identity information of the device to be accessed and the transmission data frame length information of the device to be accessed. The identity information is used by the master device to authenticate the slave device, verifying whether it is a trusted device of the master device, thereby ensuring the security and accuracy of the communication channel establishment process. The transmission data frame length information represents the length of data frames that the slave device can send in a single communication. The master device modifies the parameters in the corresponding communication interface program based on this transmission data frame length information to establish a communication channel between the master device and the slave device.

[0056] In this embodiment, the identity information of the device to be accessed may specifically include: the identifier and type of the device to be accessed, wherein the identifier of the device to be accessed is a unique identifier that distinguishes the device from other devices.

[0057] To further verify the legitimacy of the device to be accessed and to further ensure that the device to be accessed is a trusted device, in this embodiment, the access request may further include: the key information of the device to be accessed. This key information is used by the master device to further authenticate the slave device, thereby further ensuring the security and accuracy of the communication channel establishment process.

[0058] Of course, other information can be added to the access request according to the actual application situation, and this embodiment does not limit this.

[0059] Before receiving the access request sent by the device to be accessed in step S101 above, the method in this embodiment further includes: sending polling information for the device to be accessed to receive. The polling information includes the required information about the device to be accessed.

[0060] Specifically, after the master and slave devices are powered on, before the slave device connects, the master device periodically sends polling information in a broadcast manner for the slave device to receive. The polling information sent by the master device is actually 3 bytes of polling data. This polling information specifically includes the information that the slave device needs to upload to the master device. This information is the information included in the access request sent by the slave device, specifically: the identity information of the slave device, the transmission data frame length information of the slave device, and the key information of the slave device. That is, in this embodiment, the information included in the access request is determined based on the required information of the slave device in the polling information. Each type of information occupies 1 byte, for a total of 3 bytes. Preferably, the master device sends this 3-byte polling data at a fixed baud rate and then waits for the data feedback information from the slave device (i.e., the slave device's access request). Of course, the master device can also send this 3-byte polling data at different baud rates, which can be determined according to actual needs; no specific limitation is made here.

[0061] It should be noted that when multiple slave devices need to connect to the master device at the same time, the multiple slave devices send access requests to the master device simultaneously, and the master device processes each of the multiple access requests separately.

[0062] Step S102: Verify the identity information;

[0063] In this embodiment, the purpose of verifying the identity information is to ensure that all connected devices are trusted devices. Verifying the identity information includes: determining whether the identity information already exists in a pre-stored identity information table; if the identity information already exists in the identity information table, the identity information verification is successful.

[0064] Specifically, the master device pre-stores an identity information table, which lists all trusted slave devices. When the master device receives an access request, it determines whether the identity information carried in the access request already exists in the identity information table. If the master device determines that the identity information already exists in the identity information table, it indicates that the slave device corresponding to the identity information is a trusted device, and the identity information verification is successful.

[0065] Furthermore, when the access request received in step S101 also includes key information of the device to be accessed, the key information also needs to be verified. In this embodiment, verifying the key information includes: determining whether the key information already exists in the identity information table; when the key information already exists in the identity information table and the identity information has been verified, determining whether the key information is the key information corresponding to the identity information; when the key information is the key information corresponding to the identity information, the key information verification is successful.

[0066] Specifically, the aforementioned identity information table further stores key information corresponding to each identity information. When the master device receives an access request, it first verifies the identity information carried in the access request. After the identity information is verified, it determines whether the key information carried in the access request already exists in the identity information table. If the key information already exists in the identity information table, it further determines whether the key information corresponds to the aforementioned verified identity information in the identity information table. If the two correspond, it indicates that the key information is the key of the slave device corresponding to the identity information, and the key information verification is successful.

[0067] Step S103: After the identity information is verified, modify the data frame length parameter in the existing communication interface program based on the transmitted data frame length information to obtain the modified data frame length parameter.

[0068] In this embodiment, when the access request received in step S101 also includes the key information of the device to be accessed, the key information also needs to be verified. Therefore, the method described in step S103 is replaced by:

[0069] After both the identity information and the key information have been verified, the data frame length parameter in the existing communication interface program is modified based on the transmitted data frame length information to obtain the modified data frame length parameter.

[0070] In this embodiment, the communication interface program is an existing program in the master device. The communication interface program includes a data frame length parameter. By modifying the data frame length parameter, the master device can adapt to different types of slave devices, thereby realizing communication with different types of slave devices.

[0071] Specifically, after verifying the identity and key information of the slave device to be accessed, the master device modifies the value of the data frame length parameter in the communication interface program to the value represented by the transmission data frame length information carried in the access request, so that the master device and the slave device can communicate smoothly and establish a communication channel between them.

[0072] Step S104: Based on the modified data frame length parameter, establish a communication channel with the device to be accessed.

[0073] To ensure the correctness of parameter modification and thus the accuracy of communication channel establishment, after modifying the data frame length parameter in the existing communication interface program based on the transmitted data frame length information to obtain the modified data frame length parameter, the method in this embodiment further includes: sending the modified data frame length parameter to the device to be accessed so that the device to be accessed can confirm the correctness of the modified data frame length parameter; and receiving confirmation information from the device to be accessed, which is used to confirm whether the modified data frame length parameter is correct.

[0074] Therefore, establishing a communication channel with the device to be accessed based on the modified data frame length parameter includes: when the confirmation information confirms that the modified data frame length parameter is correct, establishing a communication channel with the device to be accessed based on the modified data frame length parameter.

[0075] Specifically, after modifying the data frame length parameter, the master device sends the modified data frame length parameter to the slave device to be connected, and the slave device confirms the correctness of the parameter. The slave device compares the modified data frame length parameter with the transmission data frame length information sent to the master device in step S101, and sends a confirmation message back to the master device, informing the master device whether the modified data frame length parameter is correct or incorrect.

[0076] When the confirmation message confirms that the modified data frame length parameter is correct, the slave device begins sending arbitrary data to the master device according to the data frame length. After the master device receives the data, it indicates that the communication channel between the master and slave devices has been established. When the confirmation message confirms that the modified data frame length parameter is incorrect, the master device modifies the data frame length parameter in the communication interface program and sends it to the slave device for further confirmation. Alternatively, the slave device waiting to access the network resends the access request to the master device, repeating the above steps S101 to S103. The master device resends the modified data frame length parameter to the slave device for confirmation until the slave device confirms that the modified data frame length parameter is correct. After that, the slave device begins sending arbitrary data to the master device according to the correct data frame length. After the master device receives the data, it indicates that the communication channel between the master and slave devices has been established.

[0077] The following section further illustrates the communication channel establishment method described in this embodiment using the interaction process between master and slave devices, such as... Figure 3 As shown, the method includes:

[0078] Step 1: The master device periodically sends 3 bytes of polling data in a broadcast manner at a fixed baud rate. The 3 bytes of polling data are the identity information, data frame length information, and key information of the slave device to which communication needs to be established (i.e., the slave device to be connected), and then waits for the data feedback information (i.e., the slave device's access request) from the slave device.

[0079] Step 2: After receiving the polling data sent by the master device at the same baud rate, the slave device sends an access request to the master device. The access request contains 3 bytes of information related to the slave device, including identity information, transmission data frame length information and key information. The slave device then sends the request back to the master device at the same baud rate.

[0080] Step 3: After receiving the slave device's identity information, transmission data frame length information, and key information, the master device first verifies the identity information. After the identity information is verified, the key information is verified. After both the identity information and the key information are verified, the master device automatically modifies the data frame length parameter in the communication interface program based on the transmission data frame length information and sends the modified data frame length parameter to the slave device for confirmation.

[0081] Step 4: After receiving the modified data frame length parameter sent by the master device, the device compares it with the transmission data frame length information sent to the master device in Step 2. After confirming that there is no error, the device starts sending data to the master device according to the data frame length.

[0082] Step 5: After receiving the data sent by the slave device, the master device establishes a communication relationship with the slave device, that is, establishes a communication channel with the slave device, and performs data interaction and transmission with the slave device based on the communication channel.

[0083] This invention provides a method for establishing a communication channel. It receives an access request from a device to be accessed, verifies the identity information of the device carried in the access request, and after successful verification, modifies the data frame length parameter in an existing communication interface program based on the data frame length information carried in the access request. Based on the modified data frame length parameter, a communication channel is established with the device to be accessed. Therefore, the technical solution provided by this invention can automatically modify the data frame length parameter in the communication interface program, thereby automatically establishing a communication channel with the device to be accessed. Furthermore, because this solution first verifies the identity information of the device to be accessed, all accessed devices are trusted by the network system, preventing the accidental access to untrusted devices, thus ensuring the security and accuracy of the communication channel establishment process. Therefore, the technical solution provided by this invention eliminates the need for manual modification of the communication interface program, enabling automatic and accurate establishment of communication channels between communication devices, thereby improving communication efficiency.

[0084] Example 2

[0085] Corresponding to the above method embodiments, the present invention also provides a communication channel establishment apparatus, such as... Figure 4 As shown, the device includes:

[0086] The receiving unit 201 is configured to receive an access request sent by a device to be accessed; wherein the access request includes: the identity information of the device to be accessed and the transmission data frame length information of the device to be accessed;

[0087] The identity verification unit 202 is used to verify the identity information;

[0088] Modification unit 203 is used to modify the data frame length parameter in the existing communication interface program based on the transmitted data frame length information after the identity information is verified, so as to obtain the modified data frame length parameter.

[0089] The communication channel establishment unit 204 is used to establish a communication channel with the device to be accessed based on the modified data frame length parameter.

[0090] Furthermore, the access request also includes: the key information of the device to be accessed, such as... Figure 5 As shown, the apparatus described in this embodiment further includes:

[0091] The key verification unit 205 is used to verify the key information;

[0092] Then, the modification unit 203 is further configured to modify the data frame length parameter in the existing communication interface program based on the transmission data frame length information after the identity information and the key information have been verified, so as to obtain the modified data frame length parameter.

[0093] In this embodiment, the identity verification unit 202 verifies the identity information in the following manner:

[0094] Determine whether the identity information already exists in a pre-stored identity information table;

[0095] When the identity information already exists in the identity information table, the identity information verification is successful.

[0096] In this embodiment, the key verification unit 205 verifies the key information in the following manner:

[0097] Determine whether the key information already exists in the identity information table;

[0098] When the key information already exists in the identity information table and the identity information has been verified, determine whether the key information is the key information corresponding to the identity information;

[0099] When the key information is the same as the identity information, the key information is verified.

[0100] Furthermore, such as Figure 5 As shown, the apparatus described in this embodiment further includes:

[0101] The sending unit 206 is used to modify the data frame length parameter in the existing communication interface program based on the transmitted data frame length information, and after obtaining the modified data frame length parameter, send the modified data frame length parameter to the device to be accessed, so that the device to be accessed can confirm the correctness of the modified data frame length parameter.

[0102] Then, the receiving unit 201 is further configured to receive confirmation information fed back by the device to be accessed, which is used to confirm whether the modified data frame length parameter is correct.

[0103] Then, the communication channel establishment unit 204 is further configured to establish a communication channel with the device to be accessed based on the modified data frame length parameter when the confirmation information confirms that the modified data frame length parameter is correct.

[0104] Furthermore, the sending unit 206 is also configured to send polling information before receiving an access request sent by the device to be accessed, for the device to be accessed to receive. The polling information includes information about the device to be accessed that needs to be obtained; the information included in the access request is determined based on the information about the device to be accessed that needs to be obtained in the polling information.

[0105] In this embodiment, the sending unit 206 sends polling information in the following manner for the device to be accessed to receive: the polling information is sent periodically in the form of broadcast for the device to be accessed to receive.

[0106] For details regarding the working principle, workflow, and specific implementation methods of the aforementioned device, please refer to the specific implementation methods of the communication channel establishment method provided by this invention. The same technical content will not be described in detail here.

[0107] This invention provides a communication channel establishment apparatus that receives an access request sent by a device to be accessed, verifies the identity information of the device to be accessed carried in the access request, and, after successful verification, modifies the data frame length parameter in the existing communication interface program based on the data frame length information carried in the access request. Based on the modified data frame length parameter, a communication channel is established with the device to be accessed. Therefore, the technical solution provided by this invention can automatically modify the data frame length parameter in the communication interface program, thereby automatically establishing a communication channel with the device to be accessed. Furthermore, because this solution first verifies the identity information of the device to be accessed, all accessed devices are trusted by the network system, preventing the accidental access to untrusted devices, thus ensuring the security and accuracy of the communication channel establishment process. Therefore, the technical solution provided by this invention does not require manual modification of the communication interface program and can automatically and accurately establish communication channels between communication devices, thereby improving communication efficiency.

[0108] Example 3

[0109] According to an embodiment of the present invention, a storage medium is also provided, wherein program code is stored on the storage medium, and when the program code is executed by a processor, the communication channel establishment method as described in any of the above embodiments is implemented.

[0110] Example 4

[0111] According to an embodiment of the present invention, an electronic device is also provided, the electronic device including a memory and a processor, wherein the memory stores program code that can run on the processor, and when the program code is executed by the processor, it implements the communication channel establishment method as described in any of the above embodiments.

[0112] This invention provides a communication channel establishment method, apparatus, storage medium, and electronic device. The method receives an access request from a device to be accessed, verifies the identity information of the device carried in the access request, and, after successful verification, modifies the data frame length parameter in an existing communication interface program based on the data frame length information carried in the access request. Based on the modified data frame length parameter, a communication channel is established with the device to be accessed. Therefore, the technical solution provided by this invention can automatically modify the data frame length parameter in the communication interface program, thereby automatically establishing a communication channel with the device to be accessed. Furthermore, because this solution first verifies the identity information of the device to be accessed, all accessed devices are trusted by the network system, preventing the accidental access to untrusted devices, thus ensuring the security and accuracy of the communication channel establishment process. Therefore, the technical solution provided by this invention eliminates the need for manual modification of the communication interface program, enabling automatic and accurate establishment of communication channels between communication devices, thereby improving communication efficiency.

[0113] This invention, without altering the existing physical layer link of fiber optic communication, employs a novel software communication interface method to achieve adaptive identification of devices accessing the fiber optic network and the communication link. Using this method, users no longer need to manually modify the communication interface program for different slave device types. Instead, a universal interface software can automatically adjust the data frame length of the communication interface program by confirming device information before communication is established. This solves the technical problems of needing to call different communication interface programs for different slave devices and the need for manual modification of the communication interface program, significantly improving communication efficiency.

[0114] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative. For instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed.

[0115] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of the embodiments of the present invention, depending on actual needs.

[0116] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0117] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause an electronic device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0118] While the embodiments disclosed in this invention are as described above, the content is merely for the purpose of facilitating understanding of the invention and is not intended to limit the invention. Any person skilled in the art to which this invention pertains may make any modifications and changes in form and detail of the implementation without departing from the spirit and scope disclosed herein; however, the scope of protection of this invention shall still be determined by the scope defined in the appended claims.

Claims

1. A method for establishing a communication channel, characterized in that, The method, applied to a main device in optical fiber communication, includes: The system receives an access request sent by a device to be accessed; wherein the access request includes: the identity information of the device to be accessed and the transmission data frame length information of the device to be accessed; the access request also includes: the key information of the device to be accessed; the device to be accessed and the master device are connected via an optical fiber transmission medium; Verify the identity information; Verify the key information; After both the identity information and the key information have been verified, the data frame length parameter in the existing communication interface program is modified based on the transmitted data frame length information to obtain the modified data frame length parameter. Based on the modified data frame length parameter, a communication channel is established with the device to be accessed.

2. The communication channel establishment method according to claim 1, characterized in that, The verification of the identity information includes: Determine whether the identity information already exists in a pre-stored identity information table; When the identity information already exists in the identity information table, the identity information verification is successful.

3. The communication channel establishment method according to claim 2, characterized in that, The verification of the key information includes: Determine whether the key information already exists in the identity information table; When the key information already exists in the identity information table and the identity information has been verified, determine whether the key information is the key information corresponding to the identity information; When the key information is the same as the identity information, the key information is verified.

4. The communication channel establishment method according to claim 1, characterized in that, After modifying the data frame length parameter in the existing communication interface program based on the transmitted data frame length information to obtain the modified data frame length parameter, the method further includes: The modified data frame length parameter is sent to the device to be accessed so that the device to be accessed can confirm the correctness of the modified data frame length parameter; Receive confirmation information from the device to be connected; The step of establishing a communication channel with the device to be accessed based on the modified data frame length parameter includes: When the confirmation information confirms that the modified data frame length parameter is correct, a communication channel is established with the device to be accessed based on the modified data frame length parameter.

5. The communication channel establishment method according to claim 1, characterized in that, Before receiving the access request sent by the device to be accessed, the method further includes: Polling information is sent for the device to be connected to receive; wherein, the polling information includes the device information to be connected to be obtained. The information included in the access request is determined based on the required access device information in the polling information.

6. The communication channel establishment method according to claim 5, characterized in that, The sending of polling information for the device to be connected to receive includes: The polling information is periodically sent in a broadcast format for the device to be connected to receive.

7. A communication channel establishment device, characterized in that, The main equipment used in optical fiber communication includes: A receiving unit is configured to receive an access request sent by a device to be accessed; wherein the access request includes: the identity information of the device to be accessed and the transmission data frame length information of the device to be accessed; the access request also includes: the key information of the device to be accessed; the device to be accessed and the master device are connected via an optical fiber transmission medium; An identity verification unit is used to verify the identity information; A key verification unit is used to verify the key information; The modification unit is used to modify the data frame length parameter in the existing communication interface program based on the transmitted data frame length information after both the identity information and the key information have been verified, so as to obtain the modified data frame length parameter. The communication channel establishment unit is used to establish a communication channel with the device to be accessed based on the modified data frame length parameter.

8. A storage medium storing program code, characterized in that, When the program code is executed by the processor, it implements the communication channel establishment method as described in any one of claims 1 to 6.

9. An electronic device, characterized in that, The electronic device includes a memory and a processor. The memory stores program code that can run on the processor. When the program code is executed by the processor, it implements the communication channel establishment method as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Virtual private network networking method, communication system and related equipment

    CN101697522A

  • Frame configuration method, device and system

    CN104079397A

  • Adaptation method in use for syncretizing Ethernet and plesiochronous digital hierarchy

    CN1728717A