An optical module data access system, method and electronic device

By implementing hardware selection of storage pages through the optical module hardware controller, the problems of low efficiency and transaction atomicity violation in optical module data storage modules are solved, thereby improving data access efficiency.

CN121578959BActive Publication Date: 2026-03-27INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-01-29
Publication Date
2026-03-27

AI Technical Summary

Technical Problem

In existing technologies, the storage page selection efficiency of optical module data storage modules is low and access transactions are prone to atomicity corruption, which affects data access efficiency.

Method used

The optical module hardware controller is connected to the optical module through a preset data access link. The debugging tool component is used to obtain data access requirement information, select the target access interface, and write data access instructions to the control register of the optical module hardware controller through the controller driver to realize the hardware selection of storage pages.

Benefits of technology

It improves the efficiency of selecting storage pages, ensures that the atomicity of transactions is not violated, and enhances the data access efficiency of the optical module's data storage module.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121578959B_ABST
    Figure CN121578959B_ABST
Patent Text Reader

Abstract

The application discloses an optical module data access system and method and electronic equipment, and relates to the technical field of computers. The application realizes selection of a to-be-accessed storage page of a data storage module of a to-be-accessed optical module by using an optical module hardware controller, and obtains corresponding to-be-accessed data, that is, the selection of the storage page is realized by hardware, and the selection efficiency of the storage page is improved. Moreover, the hardware itself has the ability that transaction atomicity is not destroyed, so that the application can solve the problems of low storage page selection efficiency and easy atomicity destruction of an access transaction in the related art, and improve the data access efficiency of a data storage module of an optical module.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of computer, in particular to a kind of optical module data access system, method and electronic equipment. BACKGROUND

[0002] Network equipment such as switch is generally provided with optical module, and optical module is used for photoelectric signal conversion. Among them, optical module itself is provided with data storage module, for storing the configuration information, temperature, current and optical power of optical module and other running information, therefore, for better application of optical module, how to access the data storage module of optical module becomes the key research content.

[0003] In the related art, the data storage module usually stores the running information of the optical module in a paging storage manner. When a user needs to access the running data of the optical module, the software driver of the optical module usually selects the storage page to enable the user to obtain the required optical module running data. However, the software driver has the defect of low storage page selection efficiency, and the access transaction is prone to atomicity damage, which is not conducive to ensuring the data access efficiency of the user to the data storage module of the optical module. SUMMARY

[0004] The present application provides an optical module data access system, method and electronic equipment to at least solve the problems of low storage page selection efficiency and atomicity damage of access transaction in the related art.

[0005] The present application provides an optical module data access system, comprising: a debugging tool component, a controller driver and an optical module hardware controller; wherein the optical module hardware controller is connected to the optical module through a preset data access link;

[0006] The debugging tool component is used to obtain data access requirement information of the user to the optical module, select a target access interface in the controller driver according to a target access mode represented by the data access requirement information, and send the data access requirement information to the controller driver through the target access interface;

[0007] The controller driver is used to write corresponding data access instructions into the control register of the optical module hardware controller according to the data access requirement information;

[0008] The optical module hardware controller is used to select a to-be-accessed storage page of the data storage module of the to-be-accessed optical module according to the data access instructions written in the control register, to obtain to-be-accessed data in the to-be-accessed storage page.

[0009] The present application also provides an optical module data access method, comprising:

[0010] Obtain data access requirement information of the user to the optical module;

[0011] According to the target access mode characterized by the data access requirement information, a target access interface is selected in the controller driver to send the data access requirement information to the controller driver through the target access interface;

[0012] According to the data access requirement information, a corresponding data access instruction is written into a control register of the optical module hardware controller based on the controller driver;

[0013] According to the data access instruction written in the control register, a to-be-accessed storage page of a data storage module of the to-be-accessed optical module is selected based on the optical module hardware controller to obtain to-be-accessed data in the to-be-accessed storage page.

[0014] The application further provides an electronic device, including a memory for storing a computer program and a processor for executing the computer program to implement the steps of the optical module data access method.

[0015] The application further provides a computer readable storage medium, and the computer readable storage medium stores a computer program, wherein the computer program is executed by a processor to implement the steps of the optical module data access method.

[0016] The application further provides a computer program product, including a computer program, and the computer program is executed by a processor to implement the steps of the optical module data access method.

[0017] Through the application, the to-be-accessed storage page of the data storage module of the to-be-accessed optical module is selected by the optical module hardware controller, and the corresponding to-be-accessed data is obtained, that is, the selection of the storage page is realized by hardware, the selection efficiency of the storage page is improved, and the hardware itself has the ability that the transaction atomicity is not damaged, so that the application can solve the problems of low storage page selection efficiency and easy atomicity damage of the access transaction in the related art, and the data access efficiency of the data storage module of the optical module is improved. BRIEF DESCRIPTION OF DRAWINGS

[0018] In order to more clearly illustrate the embodiments of the application, the drawings needed in the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the application, and other drawings can be obtained by those skilled in the art without creative labor.

[0019] Figure 1 An interaction flow diagram of the optical module data access system provided by the embodiments of the application;

[0020] Figure 2 A structure diagram of the optical module data access system provided by the embodiments of the application;

[0021] Figure 3 A schematic diagram of an exemplary transaction linked list provided for embodiments of this application;

[0022] Figure 4 A schematic diagram of the data structure of an exemplary node provided in an embodiment of this application;

[0023] Figure 5 A schematic diagram of another optical module data access system provided in this application embodiment;

[0024] Figure 6 A flowchart illustrating the optical module data access method provided in an embodiment of this application;

[0025] Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0026] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the protection scope of this application.

[0027] It should be noted that, in the description of this application, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. The terms "first," "second," etc., in this application are used to distinguish similar objects and are not used to describe a specific order or sequence.

[0028] One of the key tasks of the management plane in current white-box switches is the management of optical modules, which are characterized by their large number and complex management content. The current main management bus protocol is based on the Inter-Integrated Circuit (I2C) protocol, but with an extended access address space, utilizing indirect address access. Specifically, the optical module's storage access address is divided into multiple pages (data storage modules), with each page containing 128 registers. The traditional operating mode involves the hardware controller only providing basic I2C operations, with the page ID selection implemented by the optical module driver—a driver-driven page-splitting action that suffers from inefficiency.

[0029] In related technologies, optical modules are typically managed as standard I2C devices, with the page-switching action during optical module access implemented by the device driver on the optical module side. Essentially, this software-based page-switching during optical module access presents an obvious problem: access efficiency.

[0030] The software driver handles the page-splitting action, which is essentially an I2C write operation. This incurs additional time overhead, and efficiency becomes an issue as the number of optical modules increases and the number of pages within each module grows. Furthermore, when the system design uses channel expansion devices like the PCA9548 chip to expand the I2C controller, the PCA9548 essentially uses time-sharing multiplexing to expand the I2C controller. When this is the case, the atomicity of optical module driver operations can be compromised. Specifically, the optical module driver assumes that if a register (data storage module) is being read, then initiating a page-splitting action and the read operation constitutes a complete and uninterrupted transaction. Device locks are used to achieve this transaction integrity. However, if the PCA9548 chip is used to expand the I2C controller, it means that a single I2C controller is effectively expanded into an 8-channel I2C controller, each channel being time-shared. When application layer programming starts threads on a port-by-port basis, threads will compete for the controller. The end result is that the physical I2C controller will sometimes serve the management of optical module 1 and sometimes optical module 2. For a specific optical module, the atomicity of access transactions will be broken. This will cause some abnormal phenomena, such as an optical module requesting to write to register 1 and then to register 2 within 3ms, which cannot be guaranteed due to thread preemption.

[0031] To address the aforementioned technical problems, this application provides an optical module data access system, method, and electronic device. The system includes: a debugging tool component, a controller driver, and an optical module hardware controller. The optical module hardware controller connects to the optical module via a preset data access link. The debugging tool component acquires user data access requirements for the optical module and, based on the target access mode represented by the data access requirements, selects a target access interface in the controller driver to send the data access requirements to the controller driver via the target access interface. The controller driver writes corresponding data access instructions into the control register of the optical module hardware controller according to the data access requirements. The optical module hardware controller selects the storage page to be accessed from the data storage module of the optical module to be accessed according to the data access instructions written in the control register, thereby obtaining the data to be accessed from the storage page. The system provided by the above solution improves the efficiency of page selection by utilizing the optical module hardware controller to select the storage page to be accessed from the data storage module of the optical module to be accessed and obtain the corresponding data to be accessed. In other words, it implements the selection of storage pages through hardware, which improves the efficiency of page selection. Furthermore, the hardware itself has the ability to ensure that the atomicity of transactions is not violated. Therefore, this application can solve the problems of low efficiency of storage page selection and easy atomicity violation of access transactions in related technologies, and improve the efficiency of users accessing data from the data storage module of the optical module.

[0032] To enable those skilled in the art to better understand the present application, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0033] This application provides an optical module data access system for selecting storage pages and accessing data in the data storage module of an optical module. This system can be applied to network devices such as switches.

[0034] like Figure 1 The diagram shown is an interactive flow diagram of the optical module data access system provided in this application embodiment. The system includes: a debugging tool component, a controller driver, and an optical module hardware controller; wherein, the optical module hardware controller is connected to the optical module through a preset data access link.

[0035] The debugging tool component is used to obtain the user's data access requirements for the optical module. Based on the target access mode represented by the data access requirements, it selects the target access interface in the controller driver and sends the data access requirements to the controller driver through the target access interface. The controller driver is used to write the corresponding data access instructions into the control register of the optical module hardware controller according to the data access requirements. The optical module hardware controller is used to select the storage page to be accessed in the data storage module of the optical module to be accessed according to the data access instructions written in the control register, so as to obtain the data to be accessed in the storage page.

[0036] It should be noted that the optical module hardware controller can be implemented based on a Field Programmable Gate Array (FPGA). In addition to the original I2C controller functionality, the optical module hardware controller adds the ability to select the memory page to be accessed from the data storage module of the optical module being accessed. The optical module hardware controller contains one or more control registers. The driver programs the optical module hardware controller by writing specifically formatted instructions (data access instructions) to these registers. The optical module hardware controller responds to the data access instructions and executes the complete data access process.

[0037] Specifically, the debugging tool component acquires the user's data access request information for the optical module. By analyzing this information, it determines the user's target access mode and then selects the target access interface in the controller driver that matches the target access mode to transmit the request, thus achieving rational utilization of the controller driver's interface resources. The controller driver converts the data access request information into specific data access instructions and writes them into the control register of the hardware controller. The data access instructions include at least the target optical module address (I2C address), page address, register offset, and the length of the data to be accessed. When the optical module hardware controller detects that the control register has been written, it initiates the corresponding data access process. The optical module hardware controller first selects (splits) the memory page to be accessed and then retrieves the data to be accessed from that page. This data includes information such as the optical module's configuration, temperature, current, and optical power.

[0038] The system provided in this application embodiment replaces the page-slicing action, which originally required software execution, with hardware (optical module hardware controller) performing the action, thus achieving efficient access to the optical module's data storage module. Furthermore, since the entire process is completed by the hardware controller in a continuous, uninterrupted operation, the atomicity of the transaction is ensured. Even in a multi-optical module environment, the access sequence of a single optical module will not be interrupted by other access requests, thereby avoiding the atomicity violation problem caused by I2C multiplexers in traditional software solutions and improving the reliability of optical module access.

[0039] Specifically, in one embodiment, such as Figure 2 This is a schematic diagram of the structure of an optical module data access system provided in an embodiment of this application. The access interface driven by the controller is divided into at least three types: standard interface, driver programming interface and configuration interface.

[0040] The standard interface is applicable to the standard access mode. In the standard access mode, the optical module data access system responds to the user's data access request and provides the user with the data to be accessed. The driver programming interface is applicable to the driver programming mode. In the driver programming mode, the controller driver provides the user with access resources to the control registers, allowing the user to program data access instructions to the control registers through the controller driver. The configuration interface is applicable to the configuration mode. In the configuration mode, the user can modify the data to be accessed to modify the configuration of the optical module.

[0041] The target access mode includes standard access mode, driver programming mode, or configuration mode.

[0042] It's important to note that the standard interface, also known as the / dev / sfp0 interface, is a primary method for providing a programming interface to the application layer. It implements the sfp_get_data (data read), sfp_set_data (data write), and sfp_transfer_datas (data transfer) interfaces. The driver programming interface, also known as the UIO driver programming interface, is mainly used to encapsulate the process of manipulating registers in user space. This reduces the difficulty of debugging, as it involves applications and allows the use of common debugging methods to troubleshoot and resolve online issues. The configuration interface, also known as the Sysfs interface, primarily provides access to and settings for the optical module hardware controller's attributes. The focus is on differences in initialization configuration and its use in debugging.

[0043] UIO (User-Space I / O) is a lightweight driver framework in the Linux kernel that allows user-space programs to directly access physical device resources, such as memory, interrupts, and DMA channels. The main goal of UIO is to provide a simple and flexible way for user-space programs to interact directly with hardware devices without going through traditional kernel-space drivers. This model is particularly suitable for scenarios requiring high performance, low latency, or special hardware access.

[0044] Specifically, the standard access mode is a system call-based access mode strictly controlled by the kernel. In Linux systems, its implementation typically involves creating a character device file (such as / dev / sfp0), which applications interact with through standard file operation interfaces. First, the user (through debugging tools) initiates a data access request, which triggers a system call. The host CPU switches from user mode to kernel mode, handing control to the operating system kernel. The controller driver in the kernel receives the request and performs a series of operations: parameter validation, permission checks, and concurrency control. It then translates the valid request into operations on hardware control registers. Finally, the driver retrieves the data returned by the hardware and returns it to the user-space application via a system call.

[0045] Specifically, driver programming is a user-space I / O technique where the driver maps the physical address space of the hardware controller's registers into the virtual address space of the user process. This allows user-mode programs to directly read and write hardware registers as if they were accessing ordinary memory, without needing to execute a system call each time. During driver initialization, the hardware controller's register addresses are exposed to user space through the UIO framework. The application then maps these addresses into its own memory space using the mmap() system call. Afterward, the application can directly program the control registers and issue data access instructions through a memory pointer, and the hardware controller directly responds to these register read and write operations from user space.

[0046] Specifically, the configuration mode is a lightweight interactive method based on a virtual file system. The driver creates a series of file nodes in the / sys / directory, each file representing an attribute or state of the hardware controller. Users manipulate these files through file read and write commands. A read operation on a file triggers the corresponding display function in the driver, which reads the hardware state and returns a string. A write operation on a file triggers the driver's store function, which translates the value into a configuration command for the controller, and the driver function immediately executes the corresponding hardware configuration modification.

[0047] The system provided in this application can flexibly adapt to all scenarios, from stable operation in production environments (standard interface) to in-depth development and high-performance applications (driver programming interface) to system operation and maintenance and rapid configuration (configuration interface). It uses the standard interface in scenarios requiring kernel-guaranteed security and stability, and the driver programming interface in scenarios prioritizing performance and debugging convenience, thus achieving a balance between security and performance.

[0048] Based on the above embodiments, as one implementable approach, in one embodiment, the debugging tool component (sfptools tool) includes:

[0049] The detection tool is used to detect all optical modules connected to the optical module hardware controller in order to obtain the address and attribute information of each optical module.

[0050] Specifically, the detection tool instructs the hardware controller to send probe signals within a preset range of I2C slave device addresses. When a device (optical module) responds with an acknowledgment signal at an address, it is determined that a valid device exists at that address, i.e., an optical module is connected there, and the address and attribute information of all optical modules connected to it is obtained. The address information includes at least the I2C address, and the attribute information includes identification information such as the optical module type and manufacturer name.

[0051] Specifically, in one embodiment, the optical module hardware controller is further configured to, after obtaining the data to be accessed in the storage page to be accessed, write the data to be accessed into the control register according to the target access address corresponding to the data to be accessed, so that the debugging tool component obtains the data to be accessed through the access control register and feeds back the data to be accessed to the user.

[0052] The target access address includes at least the address information of the optical module to be accessed, the storage page to be accessed, and the offset and length of the data to be accessed within the storage page.

[0053] Specifically, after the optical module hardware controller selects the memory page to be accessed and accesses the target register inside the optical module, it temporarily stores the read raw data in a designated location in the control register. This designated location can be a memory buffer mapped via DMA in the controller. After completing the read operation, the hardware controller fills the data into this area, specifically writing the data to the designated location in the control register according to the target access address information corresponding to this operation. The driver polls to detect changes in the control register's status. When data readiness is detected, the driver retrieves the data to be accessed from the hardware-specified location (DMA buffer) based on the index of the target access address. The debugging tool component retrieves the data to be accessed from the driver through its selected target access interface and provides feedback to the user.

[0054] Accordingly, in one embodiment, the debugging tool component includes a register read tool and a register write tool.

[0055] The register read tool is used to read the control register according to the target access address of the optical module to be accessed, so as to obtain the data to be accessed from the control register; the register write tool is used to modify the data to be accessed in the control register according to the target access address of the optical module to be accessed, so that the controller driver can make corresponding configuration modifications to the optical module.

[0056] Specifically, for the register read tool, the user specifies the target access address by issuing a command. The register read tool converts this request into a standard format and issues it through the driver's target access interface. The driver first translates the request into hardware instructions and writes them into the hardware controller's control register, enabling the hardware controller to retrieve data from the specified location on the optical module. The hardware controller then places the read data into the specified location (DMA buffer). The register read tool then reads the specified location in the control register through the target access interface to obtain the data to be accessed. In other words, the register read tool is used to specify the page on the specified optical module and the value of the offset register.

[0057] Accordingly, for the register write tool, the user specifies the target access address and the data value to be written by issuing a command. The register write tool sends this write request (data access request) through the driver. The driver writes the corresponding hardware instructions into the control register of the hardware controller, so that the hardware controller can obtain data from the specified location of the optical module and write the data value to be written into the register at the specified address of the optical module, thereby modifying the data to be accessed. The microcontroller inside the optical module will recognize the change in the value of the configuration register and adjust the working state of its internal circuitry accordingly to modify the configuration of the optical module, such as adjusting the transmit optical power. In other words, the register write tool is used to write a specified value into the specified page and offset register of a specified optical module.

[0058] Accordingly, in one embodiment, the debugging tool component also includes transaction tools.

[0059] The transaction tool is used to create a transaction list according to the user's data access requirements for the optical module, and send the transaction list to the controller driver so that the controller driver writes the transaction list into the control register list, so that the optical module hardware controller continuously executes all data access instructions of the entire control register list.

[0060] It should be noted that the transaction tool, also known as sfptransfer, is used to implement a transaction transfer, which can be a continuous read or write, or a combination of read and write.

[0061] Specifically, transaction tools, based on complex user operational needs, sequentially assemble one or more data access commands into a single unit, known as a transaction linked list. For example... Figure 3 The diagram shown is a schematic representation of an exemplary transaction linked list provided in an embodiment of this application. The transaction linked list includes multiple nodes, such as... Figure 4 The diagram shown is a schematic of the data structure of an exemplary node provided in an embodiment of this application. Each node in the transaction chain contains a complete operation description, which includes the target optical module address (I2C address), page address, register offset, and length of data to be accessed.

[0062] Furthermore, the transaction list is submitted to the optical module hardware controller through the driver layer (controller driver). The optical module hardware controller executes all instructions in the transaction list as an atomic unit continuously. That is, the optical module hardware controller continuously executes all data access instructions in the entire control register list, such as reading data from a specified register of a specified page and then writing data to the specified register. These two actions achieve the continuity and atomicity of the transaction. This operation will not be interrupted or have new tasks inserted, ensuring the continuity and atomicity requirements of the entire complex operation process.

[0063] Based on the above embodiments, such as Figure 5 The diagram below illustrates the structure of another optical module data access system provided in this application embodiment. As an implementable approach, in one embodiment, the preset data access link includes a channel expansion device, which may be a PCA9548 chip (I2C bus multiplexer), etc.

[0064] Among them, the channel expansion device is used to expand the channels of the optical module hardware controller, so that the optical module hardware controller can access data from multiple optical modules based on the expanded channels.

[0065] Specifically, the optical module hardware controller (FPGA) here is equivalent to an I2C controller, providing a raw physical channel. After the PCA9548 chip connects to this channel, it can internally switch the upstream I2C bus to any one of the eight independent downstream channels (extension channels 0 to 7). That is, through this channel expansion device, a physical SFP controller port is expanded to logically address and manage eight independent optical modules (optical module 1 to optical module 8), and each optical module has an independent optical module hardware controller (SFP 1 to SFP 8). The essence of channel expansion is time-division multiplexing; multiple optical modules are not accessed simultaneously, but are accessed in turn within a very short period of time. When optical module 3 needs to be accessed, the optical module hardware controller will first send a command to the PCA9548 chip through the raw physical channel to switch the internal switch to extension channel 2. At this point, the link between the original physical channel and optical module 3 is occupied, and the controller can communicate with optical module 3. After completing the operation of optical module 3, the controller sends a command to switch PCA9548 to extended channel 3 to access optical module 4, and so on.

[0066] This time-sharing mechanism can disrupt the atomicity of a single optical module access transaction. If the controller finishes a page-splitting operation for optical module 1 and is about to read data, and the system schedules service to optical module 2, the page state of optical module 1 will be altered, leading to incorrect data reading. Therefore, this embodiment uses an optical module hardware controller to implement the page-splitting operation. The hardware controller can treat multiple data access operations for a single optical module as a single operation, completing them continuously during a single extended channel occupancy period. This avoids interruption by access requests from other channels, thus preventing the disruption of transaction atomicity.

[0067] Specifically, in one embodiment, the optical module hardware controller is connected to the host (CPU); the host is equipped with debugging tool components and a controller driver; a command transmission link and a data transmission link are provided between the optical module hardware controller and the host; the host writes the corresponding data access instruction to the control register of the optical module hardware controller based on the command transmission link; the optical module hardware controller transmits the data to be accessed in the obtained memory page to the host based on the data transmission link.

[0068] The command transmission link can use a PCIe bus, and the data transmission link can use a Direct Memory Access (DMA) link. The optical module hardware controller (FPGA) uses DMA technology to feed back the data to be accessed to the host. That is, the FPGA writes the data of the optical module directly into the host memory through the DMA engine. When the data transmission is completed, the CPU is notified by a Message Signaled Interrupt (MSI). The whole process does not require the CPU to participate, thereby improving the management efficiency of the optical module by the host.

[0069] Specifically, in one embodiment, the optical module hardware controller can be equipped with an embedded lightweight intelligent inference engine. The controller includes a diagnostic data acquisition circuit capable of synchronously acquiring timing data of the following monitoring parameters of the optical module at a preset sampling frequency. These monitoring parameters include laser bias current, transmit / receive power, operating temperature, supply voltage, and alarm status of the digital diagnostic chip. The intelligent inference engine performs intelligent analysis on the timing data of the monitoring parameters to determine the optical module's health score and remaining lifespan prediction. Based on these scores, it provides safety warnings for the optical module, avoiding emergency replacement in case of failure and improving maintenance efficiency.

[0070] The optical module data access system provided in this application includes: a debugging tool component, a controller driver, and an optical module hardware controller. The optical module hardware controller is connected to the optical module via a preset data access link. The debugging tool component acquires user data access requirements for the optical module and, based on the target access mode represented by the data access requirements, selects a target access interface in the controller driver to send the data access requirements to the controller driver through the target access interface. The controller driver writes corresponding data access instructions into the control register of the optical module hardware controller according to the data access requirements. The optical module hardware controller selects the storage page to be accessed from the data storage module of the optical module to be accessed according to the data access instructions written in the control register, thereby obtaining the data to be accessed from the storage page. The system provided by the above solution improves the efficiency of storage page selection by utilizing the optical module hardware controller to select the storage page to be accessed from the data storage module of the optical module to be accessed and obtaining the corresponding data to be accessed. This is achieved through hardware-based storage page selection, and the hardware itself possesses the capability to maintain transaction atomicity. Therefore, this application can solve the problems of low storage page selection efficiency and easy atomicity corruption in access transactions in related technologies, thereby improving the efficiency of user data access to the data storage module of the optical module. Furthermore, a dedicated controller (optical module hardware controller) for managing optical modules was implemented using FPGA. This dedicated controller improves access efficiency and stability. A complete set of drivers and tool components are also provided to adapt to this dedicated controller, further enhancing the management efficiency and stability of the optical modules.

[0071] Through the above description of the embodiments, those skilled in the art can clearly understand that the system according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platform, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method.

[0072] The embodiments of this application also provide an optical module data access method, applied to the optical module data access system provided in the above embodiments.

[0073] like Figure 6 The diagram shown is a flowchart illustrating the optical module data access method provided in an embodiment of this application. The method includes:

[0074] Step 601: Obtain user data access requirements for the optical module;

[0075] Step 602: Based on the target access mode represented by the data access requirement information, select the target access interface in the controller driver to send the data access requirement information to the controller driver through the target access interface.

[0076] Step 603: Based on the controller driver, write the corresponding data access instruction into the control register of the optical module hardware controller according to the data access requirement information.

[0077] Step 604: Based on the optical module hardware controller, according to the data access instruction written in the control register, select the storage page to be accessed in the data storage module of the optical module to be accessed, so as to obtain the data to be accessed in the storage page to be accessed.

[0078] For a description of the features in the embodiment corresponding to the optical module data access method, please refer to the relevant description of the embodiment corresponding to the optical module data access system, which will not be repeated here.

[0079] Embodiments of this application also provide an electronic device, such as... Figure 7 The diagram shown is a schematic diagram of the structure of an electronic device provided in an embodiment of this application, including a processor 10 and a memory 20. The memory 20 stores a computer program, and the processor 10 is configured to run the computer program to execute the steps in any of the above-described optical module data access method embodiments.

[0080] Embodiments of this application also provide a computer-readable storage medium storing a computer program, wherein the computer program is configured to execute the steps in any of the above-described embodiments of the optical module data access method when running.

[0081] In one exemplary embodiment, the aforementioned computer-readable storage medium may include, but is not limited to, various media capable of storing computer programs, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard disk, magnetic disk, or optical disk.

[0082] The embodiments of this application also provide a computer program product, which includes a computer program that, when executed by a processor, implements the steps in any of the above embodiments of the optical module data access method.

[0083] Embodiments of this application also provide another computer program product, including a non-volatile computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps in any of the above-described embodiments of the optical module data access method.

[0084] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0085] The foregoing has provided a detailed description of an optical module data access system, method, and electronic device provided in this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the embodiments above are only intended to aid in understanding the method and core ideas of this application. It should be noted that those skilled in the art can make various improvements and modifications to this application without departing from its principles, and these improvements and modifications also fall within the protection scope of the claims of this application.

Claims

1. A data access system for an optical module, characterized in that, include: The system includes a debugging tool component, a controller driver, and an optical module hardware controller; wherein the optical module hardware controller is connected to the optical module via a preset data access link. The debugging tool component is used to obtain the user's data access requirement information for the optical module, and select the target access interface in the controller driver according to the target access mode represented by the data access requirement information, so as to send the data access requirement information to the controller driver through the target access interface. The controller driver is used to write corresponding data access instructions into the control register of the optical module hardware controller according to the data access requirement information; The optical module hardware controller is used to select the storage page to be accessed in the data storage module of the optical module to be accessed according to the data access instruction written in the control register, so as to obtain the data to be accessed in the storage page to be accessed.

2. The optical module data access system according to claim 1, characterized in that, The access interface of the controller driver is divided into at least three types: standard interface, driver programming interface, and configuration interface; The standard interface is applicable to the standard access mode; wherein, in the standard access mode, the optical module data access system responds to the data access request initiated by the user and provides the user with the data to be accessed; The driver programming interface is applicable to the driver programming mode; wherein, in the driver programming mode, the controller driver provides the user with access resources for the control register, so that the user can program the control register by performing data access instructions through the controller driver; The configuration interface is applicable to the configuration mode; wherein, in the configuration mode, the user is allowed to modify the data to be accessed in order to modify the configuration of the optical module; The target access mode includes the standard access mode, driver programming mode, or configuration mode.

3. The optical module data access system according to claim 1, characterized in that, The debugging tool component includes: A detection tool is used to detect all optical modules connected to the optical module hardware controller in order to obtain the address information and attribute information of each optical module.

4. The optical module data access system according to claim 1, characterized in that, The optical module hardware controller is also used for: After obtaining the data to be accessed in the storage page to be accessed, the data to be accessed is written into the control register according to the target access address corresponding to the data to be accessed, so that the debugging tool component can obtain the data to be accessed by accessing the control register and feed the data to be accessed back to the user; The target access address includes at least the address information of the optical module to be accessed, the storage page to be accessed, and the offset and data length of the data to be accessed within the storage page.

5. The optical module data access system according to claim 4, characterized in that, The debugging tool component includes: A register read tool is used to read the control register according to the target access address of the optical module to be accessed, so as to obtain the data to be accessed from the control register; The register write tool is used to modify the data to be accessed in the control register according to the target access address of the optical module to be accessed, so that the controller driver can make corresponding configuration modifications to the optical module.

6. The optical module data access system according to claim 5, characterized in that, The debugging tool component also includes: A transaction tool is used to create a transaction list according to the user's data access requirements for the optical module, and send the transaction list to the controller driver so that the controller driver writes the transaction list into the control register list, so that the optical module hardware controller continuously executes all data access instructions of the entire control register list.

7. The optical module data access system according to claim 1, characterized in that, The preset data access link includes a channel expansion device; The channel expansion device is used to expand the channels of the optical module hardware controller, so that the optical module hardware controller can access data from multiple optical modules based on the expanded channels.

8. The optical module data access system according to claim 1, characterized in that, The optical module hardware controller is connected to the host computer; the host computer is equipped with the debugging tool components and the controller driver. The optical module hardware controller and the host are connected by a command transmission link and a data transmission link; The host writes the corresponding data access instruction to the control register of the optical module hardware controller based on the command transmission link. The optical module hardware controller transmits the data to be accessed data from the obtained storage page to the host based on the data transmission link.

9. A method for accessing data from an optical module, characterized in that, include: Obtain information about the user's data access requirements for the optical module; Based on the target access pattern represented by the data access requirement information, a target access interface is selected in the controller driver so as to send the data access requirement information to the controller driver through the target access interface; Based on the controller driver, according to the data access requirement information, the corresponding data access instruction is written into the control register of the optical module hardware controller. Based on the optical module hardware controller, according to the data access instruction written in the control register, the data storage module of the optical module to be accessed selects the storage page to be accessed, so as to obtain the data to be accessed in the storage page to be accessed.

10. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor, configured to implement the steps of the optical module data access method as described in claim 9 when executing the computer program.

Citation Information

Patent Citations

  • Heterogeneous acceleration method of database, electronic equipment, storage medium and program product

    CN120561153A

  • Kernel protection method and apparatus, and system

    US20240320317A1