Communication method, device, equipment and medium for quickly reading and writing parameter information of optical module

文档序号:1908643 发布日期:2021-11-30 浏览:19次 中文

阅读说明:本技术 快速读写光模块参数信息的通信方法、装置、设备及介质 (Communication method, device, equipment and medium for quickly reading and writing parameter information of optical module ) 是由 冯金军 舒伟峰 鲁范旗 于 2021-08-30 设计创作,主要内容包括:本公开提供一种快速读写光模块参数信息的通信方法、装置、设备及介质,方法包括:接收读取指令,所述读取指令用于获取光模块的标识信息;响应于所述读取指令,从所述光模块中获取所述光模块的标识信息;基于所述标识信息在光模块数据库中获取所述光模块对应的参数信息;其中,所述光模块数据库存储于本地设备或远端设备。根据本公开,通过将光模块的参数信息存储在本地或远端的光模块数据库中,仅从光模块中读取光模块的标识信息,进而根据该标识信息在光模块数据库中读取该标识信息对应的光模块的参数信息,提高了对光模块参数信息的读取操作的速度。(The present disclosure provides a communication method, apparatus, device and medium for quickly reading and writing parameter information of an optical module, wherein the method includes: receiving a reading instruction, wherein the reading instruction is used for acquiring identification information of an optical module; responding to the reading instruction, and acquiring identification information of the optical module from the optical module; acquiring parameter information corresponding to the optical module in an optical module database based on the identification information; and the optical module database is stored in local equipment or remote equipment. According to the method and the device, the parameter information of the optical module is stored in the local or remote optical module database, only the identification information of the optical module is read from the optical module, and then the parameter information of the optical module corresponding to the identification information is read from the optical module database according to the identification information, so that the speed of reading the parameter information of the optical module is improved.)

1. A communication method for quickly reading and writing parameter information of an optical module comprises the following steps:

receiving a reading instruction, wherein the reading instruction is used for acquiring identification information of an optical module;

responding to the reading instruction, and acquiring identification information of the optical module from the optical module;

acquiring parameter information corresponding to the optical module in an optical module database based on the identification information; and the optical module database is stored in local equipment or remote equipment.

2. The method of claim 1, wherein obtaining parameter information corresponding to the light module in a light module database based on the identification information comprises:

judging whether parameter information of the optical module is recorded in the optical module database or not based on the identification information;

if the parameter information of the optical module is recorded in the optical module database, reading the parameter information of the optical module from the optical module database;

and if the parameter information of the optical module is not recorded in the optical module database, storing the parameter information of the optical module into the optical module database.

3. The method of claim 2, wherein storing parameter information of the light module to the light module database comprises:

acquiring ID information of the optical module;

judging whether the key value of the optical module needs to be read again;

if the key information needs to be read again, generating the identification information of the optical module, and taking the identification information as the key information to be read again;

if the key information does not need to be read again, taking the ID information as the key information of the optical module;

and writing the information into the optical module database by taking the identification information of the optical module as a key and the parameter information currently stored in the optical module as a value.

4. The method of claim 1, further comprising:

judging whether parameter information corresponding to the optical module acquired from the optical module database is complete or not;

if the parameter information acquired from the optical module database is complete, returning the parameter information;

and if the parameter information acquired from the optical module database is incomplete, updating the corresponding parameter information in the optical module database based on the currently stored parameter information in the optical module.

5. The method of claim 4, wherein updating corresponding parameter information in the light module database based on currently stored parameter information in the light module comprises:

acquiring a data type of the light module, wherein the data type comprises: readable data, or read-writable data;

judging whether the data type is successfully acquired;

if the data is successfully acquired, reading readable and writable data in the optical module according to the data type; updating the parameter information of the optical module in the optical module database by taking the identification information of the optical module as a key and taking the current readable and writable data in the optical module as a value;

and if the acquisition is not successful, writing all current parameter information in the optical module into an optical module database.

6. The method of claim 1, further comprising:

judging whether the optical module has a writable area or not;

if the optical module has a writable area, generating the identification information based on the writable area;

and if the optical module does not have the writable area, newly generating the ID information and the manufacturer of the optical module into the identification information.

7. The method of claim 1, further comprising:

acquiring first parameter information from the optical module, and acquiring second parameter information corresponding to the optical module from the optical module database;

judging whether the first parameter information and the second parameter information have difference or not;

if the first parameter information and the second parameter information are different, judging the integrity of the second parameter information;

updating the first parameter information based on the second parameter information if the second parameter information is complete.

8. A communication device for quickly reading and writing parameter information of an optical module comprises:

the optical module is used for receiving and transmitting optical signals and realizing conversion between the optical signals and electrical signals;

a communication module connected with at least one optical module for realizing the transmission of the electrical signal with the optical module, and performing read-write operation on the optical module based on the method as claimed in any one of claims 1 to 7.

9. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the method of any one of claims 1 to 7 when executing the program.

10. A non-transitory computer readable storage medium storing computer instructions for causing a computer to perform the method of any one of claims 1 to 7.

Technical Field

The present disclosure relates to the field of network technologies, and in particular, to a communication method, apparatus, device, and medium for quickly reading and writing parameter information of an optical module.

Background

In data communication networks, especially in high-speed large network switching devices, optical modules are used in large quantities as physical layers to complete data transmission. For example, the total number of interfaces in some switches exceeds 256, that is, there are at most 256 optical modules for the CPU to read the optical module EEPROM information therein. In the prior art, optical modules generally adopt a slow I2C bus to read, when the total number of optical modules is small, for example, only a few optical modules are available, the defect in reading speed is not obvious, but when the number of optical modules in the system reaches hundreds, it takes a long time to read all the technical parameters and other data of the optical modules, which is usually not allowed in an actual application scenario, for example, a scenario of fast restart. The reading speed of the optical module parameters is reduced, the service interruption time is obviously prolonged, and the overall communication efficiency is reduced.

Disclosure of Invention

In view of this, an object of the present disclosure is to provide a communication method, device and medium for quickly reading and writing parameter information of an optical module.

According to a first aspect of the present disclosure, a communication method for quickly reading and writing parameter information of an optical module is provided, including:

receiving a reading instruction, wherein the reading instruction is used for acquiring identification information of an optical module;

responding to the reading instruction, and acquiring identification information of the optical module from the optical module;

acquiring parameter information corresponding to the optical module in an optical module database based on the identification information; and the optical module database is stored in local equipment or remote equipment.

Optionally, acquiring parameter information corresponding to the optical module in an optical module database based on the identification information includes:

judging whether parameter information of the optical module is recorded in the optical module database or not based on the identification information;

reading parameter information of the optical module from the optical module database if the parameter information of the optical module is recorded in the optical module database;

and if the parameter information of the optical module is not recorded in the optical module database, storing the parameter information of the optical module into the optical module database.

Optionally, storing the parameter information of the light module to the light module database includes:

acquiring ID information of the optical module;

judging whether the key value of the optical module needs to be read again;

if the key information needs to be read again, generating the identification information of the optical module, and taking the identification information as the key information to be read again;

if the key information does not need to be read again, taking the ID information as the key information of the optical module;

and writing the information into the optical module database by taking the identification information of the optical module as a key and the parameter information currently stored in the optical module as a value.

Optionally, the method further comprises:

judging whether parameter information corresponding to the optical module acquired from the optical module database is complete or not;

if the parameter information acquired from the optical module database is complete, returning the parameter information;

and if the parameter information acquired from the optical module database is incomplete, updating the corresponding parameter information in the optical module database based on the currently stored parameter information in the optical module.

Optionally, updating the corresponding parameter information in the light module database based on the currently stored parameter information in the light module includes:

acquiring a data type of the light module, wherein the data type comprises: readable data, or read-writable data;

judging whether the data type is successfully acquired;

if the data is successfully acquired, reading readable and writable data in the optical module according to the data type; updating the parameter information of the optical module in the optical module database by taking the identification information of the optical module as a key and taking the current readable and writable data in the optical module as a value;

and if the acquisition is not successful, writing all current parameter information in the optical module into an optical module database.

Optionally, the method further comprises:

judging whether the optical module has a writable area or not;

if the optical module has a writable area, generating the identification information based on the writable area;

and if the optical module does not have the writable area, newly generating the ID information and the manufacturer of the optical module into the identification information.

Optionally, the method further comprises:

acquiring first parameter information from the optical module, and acquiring second parameter information corresponding to the optical module from the optical module database;

judging whether the first parameter information and the second parameter information have difference or not;

if the first parameter information and the second parameter information are different, judging the integrity of the second parameter information;

updating the first parameter information based on the second parameter information if the second parameter information is complete.

According to a second aspect of the present disclosure, a communication device for quickly reading and writing parameter information of an optical module is provided, which includes:

the optical module is used for receiving and transmitting optical signals and realizing conversion between the optical signals and electrical signals;

a communication module, connected to at least one of the optical modules, configured to implement transmission of the electrical signal with the optical module, and based on the method of the first aspect, perform read-write operation on the optical module.

Optionally, the communication module is further configured to: acquiring parameter information corresponding to the optical module from an optical module database stored in remote equipment, or storing the parameter information corresponding to the optical module in the optical module database of the remote equipment.

According to a third aspect of the present disclosure, there is provided an electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the method according to the first aspect when executing the program.

According to a fourth aspect of the present disclosure, there is provided a non-transitory computer readable storage medium storing computer instructions for causing a computer to perform the method of the first aspect.

As can be seen from the foregoing, according to the communication method, device, and medium for quickly reading and writing parameter information of an optical module provided by the present disclosure, parameter information of an optical module is stored in a local or remote optical module database, only identification information of the optical module is read from the optical module, and then parameter information of the optical module corresponding to the identification information is read from the optical module database according to the identification information, so that the speed of reading operation on the parameter information of the optical module is increased.

Drawings

In order to more clearly illustrate the technical solutions in the present disclosure or related technologies, the drawings needed to be used in the description of the embodiments or related technologies are briefly introduced below, and it is obvious that the drawings in the following description are only embodiments of the present disclosure, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.

Fig. 1 is a schematic diagram of a communication apparatus for quickly reading and writing parameter information of an optical module according to an embodiment of the present disclosure;

fig. 2 is a schematic flow chart of a communication method for quickly reading and writing parameter information of an optical module according to an embodiment of the present disclosure;

FIG. 3 is a schematic flow chart diagram of building a database of optical modules according to an embodiment of the present disclosure;

FIG. 4 is a schematic flow chart diagram of building a database of optical modules according to an embodiment of the present disclosure;

fig. 5 is a schematic example of a communication method for quickly reading parameter information of an optical module according to an embodiment of the present disclosure;

fig. 6 is a schematic example of a communication method for quickly writing optical module parameter information according to an embodiment of the present disclosure;

fig. 7 is a schematic diagram of an apparatus for quickly reading and writing parameter information of an optical module according to an embodiment of the present disclosure;

fig. 8 is a schematic block diagram of an electronic device of an embodiment of the disclosure.

Detailed Description

For the purpose of promoting a better understanding of the objects, aspects and advantages of the present disclosure, reference is made to the following detailed description taken in conjunction with the accompanying drawings.

It is to be noted that technical terms or scientific terms used in the embodiments of the present disclosure should have a general meaning as understood by those having ordinary skill in the art to which the present disclosure belongs, unless otherwise defined. The use of "first," "second," and similar terms in the embodiments of the disclosure is not intended to indicate any order, quantity, or importance, but rather to distinguish one element from another. The word "comprising" or "comprises", and the like, means that the element or item listed before the word covers the element or item listed after the word and its equivalents, but does not exclude other elements or items. The terms "connected" or "coupled" and the like are not restricted to physical or mechanical connections, but may include electrical connections, whether direct or indirect.

In order to describe the technical parameters of the optical module and other information, a common manufacturer needs to store the parameters in an EEPROM built in the optical module. In order to unify the content standards in EEPROM, the global network storage industry association defines a specific format SFP, QSFP/QSFP +/QSFP-DD, XFP (SFF-8477). According to these standards, the capacity of an EEPROM is up to several kilobytes. With the increase of the number of optical modules in the system, when the number of the optical modules reaches more than hundreds, the defect that the reading speed of the optical modules is slow appears. Taking the size of the EEPROM of most optical module modules at present in 1024 bytes 1K as an example, the I2C bus with the frequency of 100K is used for reading, and it takes approximately 1 minute at least to finish reading all data. This is not usually allowed in practical application scenarios, such as fast restart scenarios, due to the long read time.

According to the existing standard, the optical module generally adopts an I2C bus to read, and uses a CPU to operate the content in the EEPROM in a synchronous or asynchronous mode. Some advanced devices are configured with multiple I2C buses, so that the optical module can be operated by multiple I2C buses simultaneously to speed up the operation of the optical module. However, the present disclosure recognizes that the increase of the time and speed by adding a plurality of I2C buses or increasing the speed of I2C buses, etc., not only increases the design cost of hardware, but also the cost is increased sharply especially when the number of optical modules increases dramatically, for example, the number of optical modules increases to 256 or more; and increasing the speed of I2C increases the reading instability of the optical module. In addition, the EEPROM of the optical module has its own timing, and only by simply increasing the speed of I2C, it is possible to reduce the data transmission time, and it is not possible to reduce the data writing and reading time. Therefore, it is not desirable to simply increase the reading speed of the optical module by increasing hardware, and a technology for increasing the reading speed of the optical module without increasing the cost is urgently needed.

In view of this, the embodiments of the present disclosure provide a communication method, apparatus, device, and medium for quickly reading and writing optical module parameter information, which improve the speed of reading the optical module parameter information on the premise that hardware is not changed. Referring to fig. 1, fig. 1 shows a schematic diagram of a communication apparatus for quickly reading and writing parameter information of an optical module according to an embodiment of the present disclosure. Referring to fig. 1, a communication apparatus 100 includes:

at least one optical module 110 for receiving and transmitting optical signals and implementing conversion between the optical signals and electrical signals;

and a communication module 120 connected to at least one of the optical modules 110, and configured to implement transmission of the electrical signal with the optical module 110.

In some embodiments, the light module 110 and the communication module 120 communicate by way of a bus. Further, data transfer may be accomplished via the I2C bus.

In some embodiments, the light modules 110 store their own identification information. Further, the identification information is stored in a memory (EEPROM) of the optical module 110. In some embodiments, the memory of the light module 110 may also store its own parameter information. The parameter information may refer to information required by the optical module 110 to implement data transmission in the physical layer, such as a transmission rate, a transmission distance, a center wavelength, an optical fiber type, an optical port type, an operating temperature range, a maximum power consumption, and the like.

In some embodiments, the communication module 120 stores a light module database locally. The optical module database may include mapping between identification information of an optical module and parameter information of the optical module, and the parameter information corresponding to the optical module may be found according to the identification information of one optical module.

In some embodiments, the communications apparatus 100 may also communicate with the remote device 130 over a network. Further, the remote device 130 may also store the light module database. In this way, the communication apparatus 100 may obtain the parameter information of the optical module 110 from a local optical module database or an optical module database of the remote device 130, or store the parameter information corresponding to the optical module in the local optical module database or the optical module database of the remote device 130. In some embodiments, the communication apparatus 100 and the remote device 130 communicate with each other in a wired or wireless manner. Therefore, by using the optical module database built at the far end, the sharing of the optical module data among different devices can be realized, and the system overhead for building the optical module database for the first time is further reduced.

Referring to fig. 2, fig. 2 is a schematic flow chart illustrating a communication method for quickly reading and writing parameter information of an optical module according to an embodiment of the present disclosure. As shown in fig. 2, a communication method 200 for quickly reading and writing parameter information of an optical module may include:

step S210, receiving a reading instruction, wherein the reading instruction is used for acquiring identification information of an optical module;

step S220, in response to the reading instruction, acquiring identification information of the optical module from the optical module;

step S230, acquiring parameter information corresponding to the optical module from an optical module database based on the identification information; and the optical module database is stored in local equipment or remote equipment.

The parameter information of the optical module is stored in a local or remote optical module database, only the identification information of the optical module is read from the optical module, and then the parameter information of the optical module corresponding to the identification information is read from the optical module database according to the identification information, so that the speed of reading the parameter information of the optical module is increased on the premise of keeping hardware unchanged, and the restarting speed of equipment is increased. Compared with a mode of reading parameter information from the optical module in the traditional method, the method does not need to read the information from the optical module every time, reduces the limitation caused by the slow reading speed of the I2C bus, improves the reading speed of the optical module, and avoids the problem of cost increase caused by increasing hardware to speed up. It should be appreciated that methods according to embodiments of the present disclosure may be deployed in a network device, such as a device at a network node.

According to an embodiment of the present disclosure, before step S210, the method 200 may further include:

judging whether the optical module has a writable area or not;

and if the optical module has a writable area, generating the identification information based on the writable area.

In some embodiments, generating the identification information of the light module based on the ID information may further include:

and if the optical module does not have the writable area, newly generating the ID information and the manufacturer of the optical module into the identification information.

In some embodiments, the ID information may be a Serial Number (SN) of the optical module.

The identification information of the optical module is information that can uniquely identify the optical module. The optical module may directly employ ID information as identification information, e.g. a serial number. However, since there are many manufacturers of optical modules, there may be a problem that ID information is duplicated, and at this time, identification information capable of uniquely identifying an optical module may be regenerated for the optical module. If the optical module has a writable area, a global UUID (Universal Unique Identifier) can be defined as Unique identification information by using the writable area of the optical module EEPROM; if the light module does not have a writable area, an identification information can be regenerated based on the ID information and the vendor information, for example: the identification information may be a manufacturer code + ID information, for example 01123456789, 01 may be a manufacturer code indicating manufacturer a (the manufacturer code may also be abbreviated by using a manufacturer name letter, and the like, without limitation), and 123456789 is an SN of the optical module. It should be understood that the above description is only for illustration and not intended to limit the identification information, and the identification information may also take other forms according to practical situations, and is not limited herein.

According to an embodiment of the present disclosure, before step S210, the method 200 may further include: and establishing the optical module database based on the parameter information and the identification information of the optical module.

In some embodiments, referring to fig. 3, fig. 3 shows a schematic flow diagram of building a light module database according to an embodiment of the present disclosure. As shown in fig. 3, establishing the optical module database based on the parameter information of the optical module and the identification information may include:

step S310, obtaining ID information in an optical module memory; for example, the bottom layer driver can be called to read SN data in the optical module EEPROM; step S320 is performed.

Step S320, judging whether the key value needs to be read again; for example, it may be determined whether there is duplicate of the ID information;

if the key information needs to be read again, executing step S330;

if the key information does not need to be read again, taking the ID information as the key information of the optical module; step S340 is performed.

Step S330, generating the identification information of the module, and reading the identification information again as key information; for example, it may be continuously determined whether the optical module has a writable area; if the optical module has a writable area, defining a global unique identification information based on the writable area; if the optical module does not have the writable area, newly generating identification information by the ID information and a manufacturer; step S340 is performed.

Step S340, determining whether parameter information of the optical module has been recorded in an optical module database (which may be local or remote device); for example, it may be determined whether key information (or identification information) of the optical module exists in the optical module database;

if the parameter information of the optical module is already recorded in the optical module database, executing step S350; if the parameter information of the optical module is not recorded in the optical module database, step S360 is executed.

Step S350, judging whether the parameter information of the optical module needs to be read forcibly; if not, ending; if necessary, step S360 is performed.

Step S360, reading the parameter information currently stored in the optical module EEPROM; step S370 is performed.

Step S370, writing the identification information of the optical module as a key and the parameter information currently stored in the EEPROM of the optical module as a value into the optical module database.

In practical applications, the parameter information stored in the optical module EEPROM may include different read-write characteristics, some data is readable, the part of data is generally not changed and changed, and some data is readable and writable, and the part of data may be changed. After the optical module database is established, when the parameter information of the optical module with changed parameters needs to be updated, only the readable and writable part can be updated, and all the parameter information of the optical module does not need to be read again, so that the establishment of the optical module database can be accelerated, and the establishment efficiency of the optical module database is improved.

In some embodiments, referring to fig. 4, fig. 4 shows a schematic flow diagram of building a light module database according to an embodiment of the present disclosure. As shown in fig. 4, establishing the optical module database based on the parameter information of the optical module and the identification information may further include:

step S410, obtaining ID information in an optical module memory; for example, the bottom layer driver can be called to read SN data in the optical module EEPROM; step S420 is performed.

Step S420, judging whether the key value needs to be read again; for example, it may be determined whether there is duplicate of the ID information;

if the key information needs to be read again, performing step S430;

if the key information does not need to be read again, taking the ID information as the key information of the optical module; step S440 is performed.

Step S430, generating the identification information of the module, and reading the identification information again as key information; for example, it may be continuously determined whether the optical module has a writable area; if the optical module has a writable area, defining a global unique identification information based on the writable area; if the optical module does not have the writable area, newly generating identification information by the ID information and a manufacturer; step S440 is performed.

Step S440, determining whether parameter information of the optical module has been recorded in an optical module database (which may be local or remote device); for example, it may be determined whether key information (or identification information) of the optical module exists in the optical module database;

if the parameter information of the optical module is already recorded in the optical module database, executing step S450; if the parameter information of the optical module is not recorded in the optical module database, step S480 is executed.

Step S450, acquiring the data type of the optical module; the data types include: readable data, or read-writable data; step S460 is performed.

Step S460, judging whether the data type is successfully acquired; if the acquisition is successful, step S470 is executed; if the acquisition is not successful, step S480 is performed.

Step 470, reading the readable and writable data in the optical module according to the data type; and then, updating the parameter information of the optical module in an optical module database by taking the identification information of the optical module as a key and taking the current readable and writable data in the EEPROM of the optical module as a value.

Step S480, writing all current parameter information in the optical module EEPROM into the optical module database. For example, at least some of the steps shown in FIG. 3 may be employed.

According to the embodiment of the present disclosure, in step S210, a reading instruction is received, where the reading instruction is used to acquire parameter information of an optical module.

The reading instruction may be an instruction sent by a user through an input device, for example, a user sends out through a program instruction; or the instruction may be an instruction automatically issued after the network device is powered on, for example, the parameter information of the optical module is automatically read after the network device is restarted. As shown in fig. 1, the communication device 100 may generate a reading instruction after powering on, and acquire parameter information of the optical module 110 via the communication module 120.

According to the embodiment of the present disclosure, in step S220, in response to the reading instruction, the identification information of the optical module is acquired from the optical module.

As shown in fig. 1, the communication module 120 may obtain identification information of the optical module 110 from the optical module in response to the read instruction. After receiving the reading instruction, the communication module 120 may send an acquisition instruction to the optical module 110 through the I2C bus to acquire the identification information, and after receiving the acquisition instruction, the optical module 110 returns the identification information of the optical module 110 to the communication module 120 through the I2C bus.

According to the embodiment of the present disclosure, in step S230, parameter information corresponding to the optical module is acquired in an optical module database based on the identification information; and the optical module database is stored in local equipment or remote equipment.

As shown in fig. 1, based on an optical module database established in a local or remote device, parameter information of the optical module 110 may be found according to the identification information of the optical module 110, and read. In this way, in the data transmission between the communication module 120 and the optical module 110, a large amount of parameter information is changed into a small amount of identification information, and then the corresponding parameter information is read from the optical module database, so that the reading speed of the parameter information of the optical module is increased, and the problem of slow reading speed of the content of the EEPROM in a large amount of optical modules is solved.

In some embodiments, obtaining, in a light module database, parameter information corresponding to the light module based on the identification information includes:

judging whether parameter information of the optical module is recorded in the optical module database or not based on the identification information;

if the parameter information of the optical module is recorded in the optical module database, reading the parameter information of the optical module from the optical module database;

and if the parameter information of the optical module is not recorded in the optical module database, storing the parameter information of the optical module into the optical module database.

In some embodiments, storing parameter information of the light module to the light module database comprises:

acquiring ID information of the optical module;

judging whether the key value of the optical module needs to be read again;

if the key information needs to be read again, generating the identification information of the optical module, and taking the identification information as the key information to be read again;

if the key information does not need to be read again, taking the ID information as the key information of the optical module;

and writing the information into the optical module database by taking the identification information of the optical module as a key and the parameter information currently stored in the optical module as a value.

In some embodiments, the method 200 may further include:

judging whether parameter information corresponding to the optical module acquired from the optical module database is complete or not;

if the parameter information acquired from the optical module database is complete, returning the parameter information;

and if the parameter information acquired from the optical module database is incomplete, updating the corresponding parameter information in the optical module database based on the currently stored parameter information in the optical module.

In some embodiments, determining whether parameter information corresponding to the optical module obtained from the optical module database is complete may include:

judging whether the parameter information corresponding to the optical module obtained from the optical module database has an integrity mark;

if the parameter information acquired from the optical module database has the integrity mark, the parameter information acquired from the optical module database is complete;

if the parameter information acquired from the optical module database does not have the integrity mark, the parameter information acquired from the optical module database is incomplete.

Wherein the integrity indicator may comprise a data fingerprint identifying whether the data is complete. Due to the limited space of the optical module EEPROM and the influence of the writing or reading speed, the integrity flag is generally generated by using an algorithm with a small number of bytes.

In some embodiments, the integrity indicator may be generated based on CRC32, MD5, SM2, or SHA algorithms.

In some embodiments, updating the corresponding parameter information in the light module database based on currently stored parameter information in the light module comprises:

acquiring a data type of the light module, wherein the data type comprises: readable data, or read-writable data;

judging whether the data type is successfully acquired;

if the data is successfully acquired, reading readable and writable data in the optical module according to the data type; updating the parameter information of the optical module in the optical module database by taking the identification information of the optical module as a key and taking the current readable and writable data in the optical module as a value;

and if the acquisition is not successful, writing all current parameter information in the optical module into an optical module database.

In some embodiments, referring to fig. 5, fig. 5 shows a schematic example of a communication method for quickly reading parameter information of a light module according to an embodiment of the present disclosure. As shown in fig. 5, a communication method 500 for quickly reading parameter information of a light module may include:

step S510, acquiring ID information in an optical module memory; for example, the bottom layer driver can be called to read SN data in the optical module EEPROM; step S520 is performed.

Step S520, judging whether the key value needs to be read again; for example, it may be determined whether there is duplicate of the ID information;

if the key information needs to be read again, performing step S530;

if the key information does not need to be read again, taking the ID information as the key information of the optical module; step S540 is performed.

Step S530, generating the identification information of the module, and reading the identification information again as key information; for example, it may be continuously determined whether the optical module has a writable area; if the optical module has a writable area, defining a global unique identification information based on the writable area; if the optical module does not have the writable area, newly generating identification information by the ID information and a manufacturer; step S340 is performed.

Step S540, determining whether parameter information of the optical module has been recorded in an optical module database (which may be local or remote device); for example, it may be determined whether key information (or identification information) of the optical module exists in the optical module database;

if the parameter information of the optical module has been recorded in the optical module database, step S550 is executed; if the parameter information of the optical module is not recorded in the optical module database, step S560 is executed.

Step S550, reading the parameter information of the optical module from the optical module database, and judging the integrity of the read parameter information; for example, the parameter information a read from the optical module database for the optical module and the parameter information B currently stored in the optical module EEPROM may be compared, if the parameter information a is consistent with the parameter information B, it indicates that the read parameter information is complete, otherwise, it indicates that the read parameter information is incomplete;

if the read parameter information is not complete, performing step S570; if the read parameter information is complete, step S580 is performed.

Step S560, storing the parameter information of the optical module in an optical module database, for example, at least some of the steps described in fig. 3 may be adopted; step S540 is performed.

Step S570, updating the parameter information corresponding to the optical module in the optical module database based on the parameter information currently stored in the optical module EEPROM; for example, parameter information a of the optical module in the optical module database may be replaced or updated with parameter information B currently stored in the optical module EEPROM; wherein, when updating, the readable and writable data can be updated, and at least part of the steps described in fig. 4 can be adopted; step S580 is performed.

Step S580, returning the parameter information of the optical module read from the current optical module database; for example, the parameter information read in step S550 may be used, or the parameter information read in the updated optical module database in step S570 may be used.

According to an embodiment of the present disclosure, the method 200 may further include:

acquiring first parameter information from the optical module, and acquiring second parameter information corresponding to the optical module from the optical module database;

judging whether the first parameter information and the second parameter information have difference or not;

if the first parameter information and the second parameter information are different, judging the integrity of the second parameter information;

updating the first parameter information based on the second parameter information if the second parameter information is complete.

In some embodiments, updating the first parameter information based on the second parameter information may include:

comparing the second parameter information with the first parameter information to obtain difference information;

and writing the difference information into the optical module to update the first parameter information.

The difference information may refer to a place where the second parameter information is different from the first parameter information, that is, the first parameter information is updated based on the second parameter information.

When the parameter information in the optical module database is complete and the parameter information in the optical module memory EEPROM is incomplete, the parameter information in the optical module memory can be supplemented based on the parameter information in the optical module database to ensure the integrity of the parameter information in the optical module memory EEPROM. When data are written into the memory EEPROM of the optical module, differentiated data are written into the data, not all the data, so that the frequency of writing operation of the memory EEPROM of the optical module is reduced to the maximum extent.

In some embodiments, if there is no difference between the first parameter information and the second parameter information, or the second parameter information is incomplete, then ending.

In some embodiments, referring to fig. 6, fig. 6 shows a schematic example of a communication method for fast writing light module parameter information according to an embodiment of the present disclosure. As shown in fig. 6, a communication method 600 for fast writing parameter information of a light module may include:

step S610, acquiring first parameter information in an EEPROM (electrically erasable programmable read-only memory) of an optical module and second parameter information of the optical module in an optical module database; step S620 is performed.

Step S620, comparing the first parameter information with the second parameter information; step S630 is performed.

Step S630, determining whether the first parameter information and the second parameter information are different, if yes, executing step S640; if there is no difference, it ends.

Step S640, determining whether the second parameter information is complete, for example, updating the database, and calculating the integrity of the second parameter information; if the second parameter information is complete, step S650 is performed, otherwise, it ends.

In step S650, the first parameter information is updated based on the difference information between the second parameter information and the first parameter information, for example, the difference information is written into the optical module memory EEPROM.

It should be noted that the method of the embodiments of the present disclosure may be executed by a single device, such as a computer or a server. The method of the embodiment can also be applied to a distributed scene and completed by the mutual cooperation of a plurality of devices. In such a distributed scenario, one of the devices may only perform one or more steps of the method of the embodiments of the present disclosure, and the devices may interact with each other to complete the method.

It should be noted that the above describes some embodiments of the disclosure. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims may be performed in a different order than in the embodiments described above and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing may also be possible or may be advantageous.

According to the embodiment of the disclosure, corresponding to the method of any embodiment, the disclosure further provides a device for quickly reading and writing parameter information of an optical module. Referring to fig. 7, the communication apparatus for quickly reading and writing parameter information of an optical module includes:

the receiving module is used for receiving a reading instruction, and the reading instruction is used for acquiring the identification information of the optical module;

the acquisition module is used for responding to the reading instruction and acquiring the identification information of the optical module from the optical module; acquiring parameter information corresponding to the optical module in an optical module database based on the identification information; and the optical module database is stored in local equipment or remote equipment.

For convenience of description, the above devices are described as being divided into various modules by functions, and are described separately. Of course, the functionality of the various modules may be implemented in the same one or more software and/or hardware implementations of the present disclosure.

The apparatus of the foregoing embodiment is used to implement the corresponding communication method for quickly reading and writing parameter information of an optical module in any of the foregoing embodiments, and has the beneficial effects of the corresponding method embodiment, which are not described herein again.

According to an embodiment of the present disclosure, corresponding to any of the above-mentioned embodiments, the present disclosure further provides an electronic device, including a memory, a processor, and a computer program stored in the memory and running on the processor, where when the processor executes the program, the communication method for quickly reading and writing parameter information of the optical module according to any of the above-mentioned embodiments is implemented.

Fig. 8 shows a schematic block diagram of an electronic device of an embodiment of the disclosure. The apparatus may include: a processor 810, a memory 820, an input/output interface 830, a communication interface 840, and a bus 850. Wherein processor 810, memory 820, input/output interface 830, and communication interface 840 are communicatively coupled to each other within the device via bus 850.

The processor 810 may be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an Application Specific Integrated Circuit (ASIC), or one or more Integrated circuits, and is configured to execute related programs to implement the technical solutions provided in the embodiments of the present specification.

The Memory 820 may be implemented in the form of a ROM (Read Only Memory), a RAM (Random Access Memory), a static storage device, a dynamic storage device, or the like. The memory 820 may store an operating system and other application programs, and when the technical solution provided by the embodiments of the present specification is implemented by software or firmware, the relevant program codes are stored in the memory 820 and called to be executed by the processor 810.

The input/output interface 830 is used for connecting an input/output module to realize information input and output. The i/o module may be configured as a component in a device (not shown) or may be external to the device to provide a corresponding function. The input devices may include a keyboard, a mouse, a touch screen, a microphone, various sensors, etc., and the output devices may include a display, a speaker, a vibrator, an indicator light, etc.

The communication interface 840 is used for connecting a communication module (not shown in the figure) to realize communication interaction between the device and other devices. The communication module can realize communication in a wired mode (such as USB, network cable and the like) and also can realize communication in a wireless mode (such as mobile network, WIFI, Bluetooth and the like).

Bus 850 includes a pathway for communicating information between various components of the device, such as processor 810, memory 820, input/output interface 830, and communication interface 840.

It should be noted that although the above-mentioned device only shows the processor 810, the memory 820, the input/output interface 830, the communication interface 840 and the bus 850, in a specific implementation, the device may also include other components necessary for normal operation. In addition, those skilled in the art will appreciate that the above-described apparatus may also include only those components necessary to implement the embodiments of the present description, and not necessarily all of the components shown in the figures.

The electronic device of the above embodiment is used to implement the corresponding communication method for quickly reading and writing parameter information of the optical module in any of the foregoing embodiments, and has the beneficial effects of the corresponding method embodiment, which are not described herein again.

According to an embodiment of the present disclosure, corresponding to any of the above-mentioned embodiment methods, the present disclosure further provides a non-transitory computer-readable storage medium storing computer instructions for causing the computer to execute the communication method for quickly reading and writing parameter information of an optical module according to any of the above-mentioned embodiments.

Computer-readable media of the present embodiments, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device.

The computer instructions stored in the storage medium of the foregoing embodiment are used to enable the computer to execute the communication method for quickly reading and writing parameter information of an optical module according to any of the foregoing embodiments, and have the beneficial effects of corresponding method embodiments, which are not described herein again.

Those of ordinary skill in the art will understand that: the discussion of any embodiment above is meant to be exemplary only, and is not intended to intimate that the scope of the disclosure, including the claims, is limited to these examples; within the idea of the present disclosure, also technical features in the above embodiments or in different embodiments may be combined, steps may be implemented in any order, and there are many other variations of the different aspects of the embodiments of the present disclosure as described above, which are not provided in detail for the sake of brevity.

In addition, well-known power/ground connections to Integrated Circuit (IC) chips and other components may or may not be shown in the provided figures for simplicity of illustration and discussion, and so as not to obscure the embodiments of the disclosure. Furthermore, devices may be shown in block diagram form in order to avoid obscuring embodiments of the present disclosure, and this also takes into account the fact that specifics with respect to implementation of such block diagram devices are highly dependent upon the platform within which the embodiments of the present disclosure are to be implemented (i.e., specifics should be well within purview of one skilled in the art). Where specific details (e.g., circuits) are set forth in order to describe example embodiments of the disclosure, it should be apparent to one skilled in the art that the embodiments of the disclosure can be practiced without, or with variation of, these specific details. Accordingly, the description is to be regarded as illustrative instead of restrictive.

While the present disclosure has been described in conjunction with specific embodiments thereof, many alternatives, modifications, and variations of these embodiments will be apparent to those of ordinary skill in the art in light of the foregoing description. For example, other memory architectures (e.g., dynamic ram (dram)) may use the discussed embodiments.

The disclosed embodiments are intended to embrace all such alternatives, modifications and variances which fall within the broad scope of the appended claims. Therefore, any omissions, modifications, equivalents, improvements, and the like that may be made within the spirit and principles of the embodiments of the disclosure are intended to be included within the scope of the disclosure.

21页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种肿瘤药理检测用信号传输系统及其使用方法

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类