Communication method and device of light storage and charging equipment, electronic equipment and storage medium

By using dynamic matching of the functional roles of single-frequency WIFI modules and virtual logical interface binding technology, the problems of high hardware cost and complex configuration of optical storage and charging equipment have been solved, achieving low-cost, highly flexible, and highly reliable multi-channel communication that can adapt to complex electromagnetic environments.

CN122247925APending Publication Date: 2026-06-19SHANGHAI SIGE DIGITAL TECHNOLOGY CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SHANGHAI SIGE DIGITAL TECHNOLOGY CO LTD
Filing Date
2026-04-03
Publication Date
2026-06-19

AI Technical Summary

Technical Problem

In distributed optical energy storage and charging systems, the existing networking methods for optical energy storage and charging equipment have problems such as high hardware costs, difficult configuration and management, and complex communication. In particular, when using dual-frequency/dual-module equipment, the hardware costs and management difficulties are increased.

Method used

By using a single-band WIFI module, communication modes are dynamically matched through functional roles, and virtual logical interfaces at the software level are bound to independent channels to achieve multi-channel communication. This avoids the need for dual-band/dual-modules, reduces hardware costs, and simplifies configuration management.

Benefits of technology

It enables the completion of multiple network communication tasks, reduces the hardware cost and configuration management difficulty of optical storage and charging equipment, and improves the system's flexibility and reliability, while adapting to communication stability in complex electromagnetic environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122247925A_ABST
    Figure CN122247925A_ABST
Patent Text Reader

Abstract

This application provides a communication method, device, electronic device, and storage medium for an optical storage and charging device. It uses a single-frequency WIFI module to dynamically match the communication mode based on functional roles. It binds to an independent channel through a virtual logical interface at the software level. It can achieve multi-channel communication without relying on dual-frequency / dual-modules or network cables. This can reduce the hardware cost and configuration management difficulty of the optical storage and charging device, and can realize multi-network communication tasks.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of optical storage and charging system technology, and particularly relates to a communication method, device, electronic equipment and storage medium for optical storage and charging equipment. Background Technology

[0002] In a distributed optical storage and charging system, a large number of optical storage and charging devices need to form a wireless mesh network (MESH) via WiFi to achieve data interconnection. Finally, the gateway device connects the entire network data to the cloud platform or local monitoring system through a router. In this distributed optical storage and charging system, the optical storage and charging devices need to handle multiple network communication requirements, including uplink connections to routers and downlink connections to MESH devices or wireless sites. Routers and MESH devices are often on different channels. To achieve networking, related technologies provide two communication methods: one is to use wired networking to assist communication, but wired networking is complex to deploy and has high cabling costs; the other is to use dual-band / dual-module optical storage and charging devices for networking, which handle uplink and downlink data separately. However, using dual-band / dual-module optical storage and charging devices for networking increases the hardware cost and configuration management difficulty. Summary of the Invention

[0003] In view of this, embodiments of this application provide a communication method, apparatus, electronic device, and storage medium for optical storage and charging equipment. Using a single-frequency WIFI module, the communication mode is dynamically matched based on functional roles. It is bound to an independent channel through a virtual logical interface at the software level. It can achieve multi-channel communication without relying on dual-frequency / dual-modules or network cables, which can reduce the hardware cost and configuration management difficulty of optical storage and charging equipment, and can realize multi-network communication tasks.

[0004] In a first aspect, embodiments of this application provide a communication method for an optical storage and charging device, wherein the optical storage and charging device uses a single-frequency WIFI module for communication, including: Obtain the functional role of the optical storage and charging device in the network topology, wherein the functional role is determined based on the communication object of the optical storage and charging device; The target communication mode is determined based on the functional roles and the pre-established first correspondence, wherein the first correspondence includes: the correspondence between functional roles and communication modes; Determine the virtual logical interface corresponding to each target communication mode, wherein each virtual logical interface is bound to an independent network communication channel; Communicate with the communication object based on the virtual logical interface.

[0005] In some embodiments, communicating with the communication object based on the virtual logical interface includes: Obtain the working period corresponding to the target communication mode, wherein the working period is divided into multiple time slices, and each time slice corresponds to a virtual logical interface; The data of each virtual logical interface is processed in a poll within the time slice corresponding to each virtual logical interface.

[0006] In some embodiments, the method further includes: Obtain the packet data received by each virtual logical interface in the corresponding time slice; The time utilization rate of each time slice is calculated based on the packet data received in the time slice corresponding to each virtual logical interface and the total number of packets received in the work cycle. Based on the time utilization rate, the division ratio of each time slice in the work cycle is adjusted.

[0007] In some embodiments, communicating with the communication object based on the virtual logical interface includes: Data from each virtual logical interface is processed based on the communication priority of each virtual logical interface.

[0008] In some embodiments, the target communication mode includes at least one of: network node networking communication mode, near-end terminal communication mode, and router networking communication mode, wherein the communication corresponding to the network node networking communication mode has the highest priority, the router networking communication mode is used to connect to a router, the network node networking communication mode is used to network with other optical storage and charging devices, and the near-end terminal communication mode is used for near-end access.

[0009] In some embodiments, the first correspondence includes: a gateway role corresponding to a router networking communication mode and a network node networking communication mode; a regional gateway role corresponding to a dual network node networking communication mode; a near-end gateway role corresponding to a near-end terminal communication mode and a network node networking communication mode; and other device roles corresponding to a network node networking communication mode. The router networking communication mode is used to connect to a router, the network node networking communication mode is used to network with other optical storage and charging devices, and the near-end terminal communication mode is used for near-end access.

[0010] In some embodiments, when the optical storage and charging device acts as a gateway, the time slice corresponding to the router network communication mode is the first time slice, and the time slice corresponding to the network node networking communication mode is the second time slice, wherein the first time slice is shorter than the second time slice; when the optical storage and charging device acts as a regional gateway, the time slices corresponding to each network node networking communication mode are equal; when the optical storage and charging device acts as a near-end gateway, the time slice corresponding to the near-end terminal communication mode is the third time slice, and the time slice corresponding to the network node networking communication mode is the fourth time slice, wherein the third time slice is longer than the fourth time slice.

[0011] Secondly, embodiments of this application provide a communication device for an optical storage and charging equipment, comprising: The acquisition module is used to acquire the functional role of the optical storage and charging device in the network topology, wherein the functional role is determined based on the communication object of the optical storage and charging device; The first determining module is used to determine the target communication mode based on the functional role and a pre-established first correspondence relationship, wherein the first correspondence relationship includes: the correspondence relationship between the functional role and the communication mode; The second determining module is used to determine the virtual logical interface corresponding to each target communication mode, wherein each virtual logical interface is bound to an independent network communication channel. A communication module is used to communicate with the communication object based on the virtual logical interface.

[0012] Thirdly, embodiments of this application provide an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement any of the methods described above.

[0013] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements any of the methods described above.

[0014] Fifthly, embodiments of this application provide a computer program product that, when run on a terminal device, causes an electronic device to execute any of the methods described above.

[0015] This application provides a communication method for a photovoltaic energy storage and charging device. Using a single-frequency WIFI module, the communication mode is dynamically matched based on functional roles. It binds to an independent channel through a virtual logical interface at the software level. It can achieve multi-channel communication without relying on dual-frequency / dual-modules or network cables. This can reduce the hardware cost and configuration management difficulty of the photovoltaic energy storage and charging device, and can realize multi-network communication tasks. Attached Figure Description

[0016] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0017] Figure 1 A schematic diagram illustrating the implementation process of a communication method for an optical energy storage and charging device provided in an embodiment of this application; Figure 2 A schematic diagram of a time slice provided for an embodiment of this application; Figure 3 A schematic diagram illustrating a communication scenario provided in an embodiment of this application; Figure 4 A schematic diagram illustrating another communication scenario provided in an embodiment of this application; Figure 5 A schematic diagram of the structure of a communication device for an optical storage and charging equipment provided in this application embodiment; Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0018] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application may also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods have been omitted so as not to obscure the description of this application with unnecessary detail.

[0019] It should be understood that, when used in this application specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or a collection thereof.

[0020] It should also be understood that the term “and / or” as used in this application specification and the appended claims means any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.

[0021] As used in this application specification and the appended claims, the term "if" may be interpreted, depending on the context, as "when," "once," "in response to determination," or "in response to detection." Similarly, the phrases "if determined" or "if detected" may be interpreted, depending on the context, as "once determined," "in response to determination," "once detected," or "in response to detection."

[0022] Furthermore, in the description of this application and the appended claims, the terms "first," "second," "third," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.

[0023] References to "one embodiment" or "some embodiments" in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized.

[0024] Based on the problems in related technologies, this application provides a communication method for an optical storage and charging device that can be applied to the optical storage and charging device, wherein the optical storage and charging device uses a single-frequency WIFI module for communication.

[0025] Figure 1 This is a schematic diagram illustrating the implementation process of a communication method for an optical storage and charging device provided in an embodiment of this application, as shown below. Figure 1 As shown, the communication method of the optical storage and charging device includes: Step S101: Obtain the functional role of the optical storage and charging device in the network topology, wherein the functional role is determined based on the communication object of the optical storage and charging device.

[0026] In this embodiment, the photovoltaic-energy storage-charging device refers to an integrated device that combines photovoltaic, energy storage, and charging functions. It is a core hardware component in a distributed energy system and requires WiFi for data interaction, status uploading, and network control. A single-frequency WiFi module refers to a WiFi communication chip that supports only one WiFi frequency band and can only physically operate on one channel at a time. Network topology refers to the connection structure and hierarchical relationship of multiple photovoltaic-energy storage-charging devices, routers, and terminals in the network. Functional role refers to the functional positioning of a device in the topology, determined by which it needs to communicate with, such as: gateway role (connecting routers and MESH devices), area gateway (connecting two different channel MESHs), near-end gateway (connecting routers in Station Mode and MESH), and ordinary device (connecting only MESH). Communication object refers to the target that the device currently needs to communicate with, such as: routers, other photovoltaic-energy storage-charging MESH devices, near-end STAs (mobile phones, debugging equipment, etc.), etc.

[0027] In this embodiment, after the optical storage and charging device is powered on, it automatically scans the surrounding wireless communication environment, identifies target objects that can establish communication, and determines whether there is an uplink router, other optical storage and charging networking devices, or a near-end access request terminal. Based on the identified communication objects, it automatically determines its own functional role in the network topology. This step does not require manual intervention and can achieve adaptive matching of device roles, improve the flexibility of distributed system networking, and avoid the problems of tedious and error-prone manual configuration.

[0028] In some embodiments, the functional role of the optical storage and charging device in the network topology can be determined by the user's settings.

[0029] Step S102: Determine the target communication mode based on the functional roles and the pre-established first correspondence, wherein the first correspondence includes the correspondence between functional roles and communication modes.

[0030] In this embodiment, the first correspondence is a mapping table / configuration rule pre-written into the device. The first mapping relationship includes: the correspondence between functional roles and communication modes, for example: the gateway role corresponds to router networking mode and MESH networking mode. The target communication mode is the WiFi working mode to be used by the device based on the role, which may include one or more of the following: router networking mode (STA), network node networking mode (MESH), and near-end terminal communication mode (AP).

[0031] In this embodiment of the application, the device pre-stores a first correspondence between roles and modes. The first correspondence may include: gateway roles corresponding to STA + MESH, area gateways corresponding to MESH + MESH, near-end gateways corresponding to AP + MESH, and ordinary devices corresponding to MESH. Based on the obtained roles, the table is directly looked up to determine which communication modes need to be enabled.

[0032] Step S103: Determine the virtual logical interface corresponding to each target communication mode, wherein each virtual logical interface is bound to an independent network communication channel.

[0033] In this embodiment, the virtual logical interface is a virtual network port created at the software level, not physical hardware. The virtual logical interface makes a physical WiFi network appear as multiple independent network cards within the system. Independent network communication channels are bound to different channels for each virtual logical interface, for example: If1 → Channel 1; If2 → Channel 6; If3 → Channel 11. The physical hardware still operates on only one channel at a time, but achieves a multi-channel parallel effect through rapid switching.

[0034] In this embodiment, a virtual logical interface can be created for each communication mode, and an independent channel can be allocated to each virtual logical interface. The physical WiFi hardware switches to these channels in a time-sharing manner to serve different virtual logical interfaces respectively.

[0035] In this embodiment, a single-frequency hardware can simulate the effect of multiple network cards and multiple channels; without dual-frequency or dual-module, the hardware cost is greatly reduced; and the data of different channels are logically isolated, so there is no interference or conflict.

[0036] Step S104: Communicate with the communication object based on the virtual logical interface.

[0037] In this embodiment, each virtual interface processes data only for its corresponding mode. Continuing the example above, If1: communicates only with the router, If2: communicates only with the MESH device, and If3: communicates only with the near-end STA. The physical WiFi switches channels at different time slices to complete transmission and reception respectively.

[0038] The method provided in this application embodiment obtains the functional role of the optical storage and charging device in the network topology, wherein the functional role is determined based on the communication object of the optical storage and charging device; determines the target communication mode based on the functional role and a pre-established first correspondence, wherein the first correspondence includes: the correspondence between the functional role and the communication mode; determines the virtual logical interface corresponding to each target communication mode, wherein each virtual logical interface is bound to an independent network communication channel; and communicates with the communication object based on the virtual logical interface. This method overcomes the physical limitation that a single-frequency WiFi module cannot work on multiple channels simultaneously without increasing hardware costs, using dual-band / dual-modules, or relying on wired cabling. It enables a single optical storage and charging device to simultaneously access multiple networks such as routers, MESH networks, and near-end STAs, achieving low-cost, highly flexible, and highly reliable distributed optical storage and charging system wireless networking.

[0039] In some embodiments, step S104 can be implemented through the following steps: Step S1041: Obtain the working period corresponding to the target communication mode, wherein the working period is divided into multiple time slices, and each time slice corresponds to a virtual logical interface.

[0040] In this embodiment, the working cycle refers to the complete time for a single-frequency WIFI module to complete one round of data processing for all virtual logic interfaces. It is a preset fixed cycle duration that can be finely adjusted according to the device's communication needs and is the basic time unit for realizing time-division communication. A time slice is an independent sub-time period obtained by splitting a single working cycle. The duration of each time slice is independent and does not overlap. It is specifically allocated to a single virtual logic interface for use in realizing time-division communication scheduling for a single radio frequency circuit.

[0041] In this embodiment, the device control system retrieves the preset working cycle duration according to the target communication mode that has been matched. At the same time, according to the number of virtual logical interfaces, the complete working cycle is divided into a corresponding number of time slices either equally or according to rules. A unique binding relationship is established between a single time slice and a single virtual logical interface to ensure that only one virtual logical interface is scheduled in a time slice.

[0042] Step S1042: Poll and process the data of the corresponding virtual logical interface within the time slice of each virtual logical interface.

[0043] In this embodiment, the polling process involves scheduling virtual logical interfaces sequentially within their respective time slices according to a preset order to complete communication processes such as data reception, transmission, and verification. This is an orderly processing method without data conflicts or cross-scheduling.

[0044] In this embodiment, the communication channel of the single-frequency WIFI module can be switched cyclically according to the time slice sequence. Within the corresponding time slice, only the bound virtual logical interface is activated to complete the data reception, transmission, and transmission verification of that interface. After the current time slice ends, the system immediately switches to the virtual logical interface corresponding to the next time slice, and this process is repeated cyclically. Figure 2 A schematic diagram of a time slice provided in an embodiment of this application, such as... Figure 2 As shown, there are three time slices in a period T: T1, T2, and T3. T1 corresponds to the AP channel, T2 corresponds to the STA channel, and T3 corresponds to the MESH channel, and they cycle in sequence.

[0045] The method provided in this application relies on a time-division polling mechanism to simulate the effect of multi-channel parallel communication without changing the single-frequency WIFI hardware structure. This solves the problem of data transmission conflicts between different channels without increasing hardware costs, while ensuring the orderly transmission of various types of communication data and improving the stability and reliability of data transmission.

[0046] In some embodiments, the method further includes: Step S105: Obtain the packet reception data of each virtual logical interface in the corresponding time slice.

[0047] In this embodiment, the received data refers to the number of network data packets actually received by the single-frequency WIFI module through the virtual logical interface within a specific time slice. The received data directly reflects the service traffic load of the communication mode (such as uplink STA, downlink MESH, or AP) corresponding to that time slice at the current moment.

[0048] In this embodiment, at the end of each time slot, the internal driver of the single-frequency WIFI module automatically counts the number of data packets (Rx1, Rx2, ...) received by the interface at that instant. The statistical results are temporarily stored in the device's memory cache, awaiting the next stage of calculation and analysis.

[0049] Step S106: Calculate the time utilization rate corresponding to each time slice based on the packet reception data of each virtual logical interface corresponding to the time slice and the total number of packets received in the work cycle.

[0050] In this embodiment, the total number of packets received in a work cycle refers to the total number of data packets received by all virtual logical interfaces (such as If1, If2, If3) within a complete work cycle. Time utilization rate characterizes the matching degree between data transmission efficiency and time allocation ratio within a single time slice. Time utilization rate reflects whether the duration of the allocated time slice is "reasonable." Low utilization rate occurs if a large number of time slices are allocated but few packets are received (idle), or if the time slices are too short, leading to data packet overflow (congestion).

[0051] In this embodiment of the application, the received packet data of all interfaces within the same period can be summed to obtain the total number of received packets.

[0052] For the i-th virtual logical interface, the time utilization Ui is calculated using the following formula: ; in, Let be the percentage of traffic to the i-th virtual logical interface in the total traffic. This represents the proportion (allocation) of the time slice within the total period.

[0053] In this embodiment, the closer Ui is to 1, the better the time slice allocation matches the traffic load; the smaller Ui is, the more wasted the time slice allocation is; and the larger Ui is, the more congestion there is.

[0054] Step S107: Based on the time utilization rate, adjust the division ratio of each time slice in the work cycle.

[0055] In this embodiment of the application, the time slice division ratio refers to the proportion of the time slice length corresponding to each virtual logical interface within a single working cycle.

[0056] In this embodiment, time utilization can be calculated continuously for multiple cycles, and trend analysis can be performed based on the average value of historical data. If a certain interface (such as a MESH network) has a huge amount of data, but the time slice allocation is too small, resulting in low utilization, the system automatically increases the time slice ratio of that interface. If a certain interface (such as an uplink STA) is usually idle, but is allocated a large block of time slices, the system automatically reduces the time slice ratio of that interface. The adjusted time slice ratio is written to the scheduling register and applied to the next working cycle.

[0057] The method provided in this application can dynamically sense traffic changes through utilization calculation. When the data fluctuation of the photovoltaic energy storage and charging system is large (such as during peak charging periods or off-peak hours at night), it can real-time reallocate bandwidth to ensure that core services (such as MESH network control) receive priority time slices, significantly improving the channel utilization of single-frequency WIFI modules. When a large number of STA connections cause data packet backlog on a virtual interface (such as the AP interface of a near-end gateway), the system can immediately sense and expand the time slice of that interface to prevent data packet loss caused by queue overflow and ensure communication stability. For ordinary device roles (MESH only) or nighttime gateway roles, data traffic is extremely low. The system can automatically reduce its time slice proportion, and the single-frequency WIFI module can enter a low-power sleep mode during unallocated time slices, significantly reducing the operating power consumption of distributed photovoltaic energy storage and charging equipment, which is particularly suitable for battery-powered or solar-powered outdoor equipment. By indirectly feeding back channel quality through received data (the packet loss rate is implied in the number of received packets), the system can automatically adjust the time slice strategy (such as increasing the retry time slice when there is heavy interference), improving the system's anti-interference capability and fault tolerance in complex electromagnetic environments.

[0058] In some embodiments, step S104 can be implemented through the following steps: Step S1043: Process the data of the corresponding virtual logical interface based on the communication priority of each virtual logical interface.

[0059] In this embodiment, communication priority refers to a pre-defined data processing order based on the importance of the communication link corresponding to the virtual logical interface and the real-time requirements of the service. This order distinguishes the execution sequence of different communication tasks and ensures that core communication services are processed first. Data processing involves a series of operations such as receiving, buffering, verifying, sending, and forwarding the communication data carried by the virtual logical interface. It is the core execution link for completing device communication.

[0060] In this embodiment, the internal control system of the device pre-stores the priority levels corresponding to each communication mode. When processing data, it prioritizes retrieving data from the virtual logical interface with higher priority and prioritizes executing the data transmission, verification, and forwarding operations of that interface. If there is no data to be processed on the high-priority interface, the data of the low-priority virtual logical interface is then scheduled for processing. Only a single interface data is processed at any given time, avoiding multiple links from competing for communication resources. The priority determination and scheduling are automatically executed by the system without manual intervention.

[0061] The method provided in this application introduces a communication priority scheduling mechanism to further optimize the data processing logic of the single-frequency WIFI module. Addressing the differences in importance among different communication services within the distributed optical energy storage and charging system, it prioritizes core communication services, preventing non-core data from occupying critical communication resources. Without adding hardware modules, it still relies on the single-frequency WIFI module to achieve hierarchical communication. This ensures the real-time performance and stability of core services such as device networking and remote control, preventing data congestion and transmission delays, while also accommodating various non-core communication services, improving the communication fluency and operational reliability of the entire distributed optical energy storage and charging system. Furthermore, the hierarchical scheduling logic is simple, does not increase the difficulty of system configuration and management, adapts to various distributed optical energy storage and charging networking scenarios, and further improves the stability of multi-network parallel communication of the single-frequency WIFI device.

[0062] In some embodiments, the target communication mode includes at least one of: network node networking communication mode, near-end terminal communication mode, and router networking communication mode, wherein the communication corresponding to the network node networking communication mode has the highest priority, the router networking communication mode is used to connect to a router, the network node networking communication mode is used to network with other optical storage and charging devices, and the near-end terminal communication mode is used for near-end access.

[0063] In this embodiment, the Wireless Mesh Network Mode (MESH) refers to a communication mode in which the optical storage and charging device acts as a node in a distributed network, establishing multi-hop wireless mesh connections with other optical storage and charging devices in the same group. The MESH mode is responsible for building and maintaining local communication links between devices, enabling data exchange, status synchronization, and command forwarding between devices, and is the foundation for collaborative operation of the distributed system. The Access Point Mode (AP Mode), also known as the wireless access point mode, refers to a communication mode in which the optical storage and charging device acts as an access point for a wireless local area network (WLAN), allowing near-end wireless terminals (such as debugging equipment, monitoring panels, and mobile apps) to initiate connections. It supports local near-field configuration, parameter reading, device debugging, and real-time monitoring, facilitating direct operation of the equipment by maintenance personnel. The Station Mode (STA Mode) can also be called the wireless station mode. Router networking communication mode refers to a communication mode in which the optical storage and charging equipment acts as a client, actively connects to an external uplink router, and thus accesses the Internet or local area network. It is responsible for uploading network data (such as monitoring logs, equipment fault alarms, and operation statistics) to the cloud platform or local monitoring system, and is the "uplink channel" for realizing remote management.

[0064] In this embodiment, the internal control system of the device pre-defines a priority ranking rule, specifically as follows: Network Node Network Communication Mode > Router Network Communication Mode ≥ Near-End Terminal Communication Mode. When the single-band WiFi module performs data scheduling, the system must strictly adhere to this priority order: when the Network Node Network Communication Mode (MESH) has data to transmit, regardless of whether other modes have data, all other modes must be paused, and MESH data must be processed first. If there is no MESH data, then the data from the Router Network Communication Mode (STA) is processed. If neither of the above modes has data, then the data from the Near-End Terminal Communication Mode (AP) is processed last.

[0065] In distributed optical storage and charging systems, inter-device mesh communication is the cornerstone of system operation. If uplink data (STA) or local debugging (AP) consumes too many resources, leading to lost mesh signaling or delayed data synchronization, it can cause network topology chaos, device disconnection, or even system paralysis. The method provided in this application sets the mesh communication mode of network nodes to the highest priority, ensuring that under any circumstances, inter-device collaborative communication, heartbeat detection, and status synchronization receive the highest priority resource guarantees. This greatly improves the anti-interference capability and operational robustness of the entire distributed system, preventing "network collapse" caused by communication resource contention. Traditional single-band WiFi, under high load, is prone to non-core data (such as local debugging logs and non-real-time monitoring data) being "starved" by core data or experiencing extremely high latency, affecting the operational experience. This method clarifies the secondary priority status of router networking (STA) and near-end terminals (AP). While ensuring network stability, the system can still handle remote data reporting and local operation and maintenance normally, achieving a balance between ensuring core business operations remain uninterrupted and non-core business operations are available, thus taking into account both the reliability and usability of the system.

[0066] In some embodiments, the first correspondence includes: a gateway role corresponding to a router networking communication mode and a network node networking communication mode; a regional gateway role corresponding to a dual network node networking communication mode; a near-end gateway role corresponding to a near-end terminal communication mode and a network node networking communication mode; and other device roles corresponding to a network node networking communication mode. The router networking communication mode is used to connect to a router, the network node networking communication mode is used to network with other optical storage and charging devices, and the near-end terminal communication mode is used for near-end access.

[0067] In this embodiment, the gateway role, through a STA+MESH combination, perfectly resolves the core conflict of simultaneously connecting to uplink routers and downlink networking, achieving data aggregation and forwarding. The regional gateway role, through a dual-MESH mode, effectively solves the problem of cross-channel communication and optimizes the network topology. The near-end gateway role, through an AP+MESH combination, balances local maintenance convenience with global network connectivity. The ordinary device role, through a single-MESH mode, simplifies the device structure, reduces hardware costs, and ensures stable data upload. This layered design precisely covers various application scenarios of distributed optical storage and charging systems, enabling each device to perform its specific function and ensuring orderly system operation.

[0068] In this embodiment, after the device powers on and completes a network environment scan, it identifies the communication object and automatically determines its own functional role: if an uplink router is detected and networking is required, it is determined to be a gateway. If two MESH networks with different channels need to be connected, it is determined to be a regional gateway. If a near-end terminal access request is detected and networking is required, it is determined to be a near-end gateway. If only surrounding MESH devices are detected, it is determined to be another device. Based on the determination result, the device directly looks up a table (first correspondence relationship) and automatically activates the matching communication mode combination.

[0069] In some embodiments, when the optical storage and charging device acts as a gateway, the time slice corresponding to the router network communication mode is the first time slice, and the time slice corresponding to the network node networking communication mode is the second time slice, wherein the first time slice is shorter than the second time slice; when the optical storage and charging device acts as a regional gateway, the time slices corresponding to each network node networking communication mode are equal; when the optical storage and charging device acts as a near-end gateway, the time slice corresponding to the near-end terminal communication mode is the third time slice, and the time slice corresponding to the network node networking communication mode is the fourth time slice, wherein the third time slice is longer than the fourth time slice.

[0070] In this embodiment, the first time slice specifically refers to the independent sub-time period allocated to the router network communication mode (STA mode) when the optical storage and charging device is a gateway. It is a component of the work cycle and is used only to process data related to router network communication. Its duration is preset by the system according to the role characteristics and can be dynamically adjusted in conjunction with time utilization. The second time slice specifically refers to the independent sub-time period allocated to the network node networking communication mode (MESH mode) when the optical storage and charging device is a gateway. It belongs to the same work cycle as the first time slice and is specifically used to process data related to inter-device networking communication. Its duration is longer than the first time slice to ensure the resource supply for networking communication. The third time slice specifically refers to the independent sub-time period allocated to the near-end terminal communication mode (AP mode) when the optical storage and charging device is a near-end gateway. It is used to process data related to near-end terminal access (such as local debugging, parameter configuration, etc.) and its duration is longer than the fourth time slice under the same role. The fourth time slice specifically refers to the independent sub-time period allocated to the network node networking communication mode (MESH mode) when the optical storage and charging equipment acts as a near-end gateway. It works in conjunction with the third time slice to ensure network connectivity between the near-end gateway and other optical storage and charging equipment, and its duration is shorter than the third time slice. Equal time slices mean that when the optical storage and charging equipment acts as a regional gateway, the time slice durations allocated to its two corresponding network node networking communication modes (connecting two MESH subnets on different channels) are completely identical, ensuring data transmission fairness between the two subnets and avoiding data congestion or resource idleness in a single subnet.

[0071] In this embodiment, if a gateway role allocates a first time slice for router networking communication mode and a second time slice for network node networking communication mode, the system presets the duration of the first time slice to be shorter than the second time slice (e.g., the first time slice is 200ms and the second time slice is 300ms) to ensure that networking communication obtains more resources. If a regional gateway role is used, time slices of equal duration (e.g., both are 250ms) are allocated to its two corresponding network node networking communication modes (connected to different channel MESH subnets) to ensure the fairness and stability of data transmission between the two subnets. If a near-end gateway role is used, a third time slice is allocated for near-end terminal communication mode and a fourth time slice is allocated for network node networking communication mode. The system presets the duration of the third time slice to be longer than the fourth time slice (e.g., the third time slice is 300ms and the fourth time slice is 200ms) to prioritize the access needs of local near-end terminals. Time slice collaborative scheduling and dynamic adaptation: After time slice allocation, combined with a polling mechanism, data of the corresponding communication mode is processed within the corresponding time slice.

[0072] In some embodiments, if the time utilization rate of a certain communication mode is consistently high (data congestion) or low (resource idleness), the system will fine-tune the specific duration of each time slice while keeping the "time slice priority relationship corresponding to the role" unchanged (e.g., the gateway role always keeps the first time slice < the second time slice) to ensure that the time slice allocation matches the actual business traffic.

[0073] The method provided in this application implements differentiated time-slice allocation to accurately match the business needs of different roles. Differentiated time-slice allocation rules are designed for the different communication responsibilities of three core roles: gateway, regional gateway, and near-end gateway. This solves the problem of "insufficient core business resources and wasted non-core business resources" caused by static equal allocation of time slices in existing technologies. For example, the gateway role prioritizes network communication (with a longer second time slice), aligning with the core requirement of "network priority" in distributed optical storage and charging systems; the near-end gateway role prioritizes local terminal access (with a longer third time slice), adapting to actual operation and maintenance scenarios; and the regional gateway role uses equal time slices to ensure fairness in cross-subnet communication, achieving precise matching between time-slice allocation and business needs.

[0074] In some embodiments, the communication quality (including signal strength, packet loss rate, and latency) of the channels bound to each virtual logical interface can be monitored in real time. By combining communication priority and time utilization, the channel binding relationship of the virtual logical interface can be dynamically adjusted, and the time slice allocation ratio can be optimized simultaneously to achieve triple collaborative optimization of "channel quality-time slice-priority".

[0075] In this embodiment, channel quality is used to measure the communication performance of channels bound to virtual logical interfaces. Core evaluation indicators include signal strength index (RSSI), packet loss rate, and transmission delay. Channels with signal strength ≥ -60dBm, packet loss rate < 1%, and delay < 50ms are considered high-quality channels, while those with signal strength < -80dBm, packet loss rate ≥ 5%, and delay ≥ 100ms are considered low-quality channels. Dynamic channel switching refers to the system monitoring channel quality in real time. When the quality of a channel bound to a virtual logical interface deteriorates, the system automatically switches to an available high-quality channel within the same frequency band, rebinding the virtual logical interface to the new channel. Simultaneously, the scheduling parameters for the corresponding time slice are adjusted to ensure uninterrupted communication.

[0076] In this embodiment, a 10ms detection time slice can be reserved in each working cycle to perform quality detection on all channels bound to virtual logical interfaces, collecting signal strength, packet loss rate, and latency data, and establishing a channel quality scoring model (score = signal strength weight × 40% + packet loss rate weight × 30% + latency weight × 30%). A score ≥ 80 is considered a high-quality channel, 60-79 is considered a qualified channel, and < 60 is considered a poor-quality channel. If the score of a channel bound to a certain virtual logical interface is < 60 for three consecutive working cycles (poor-quality channel), and there is an idle high-quality channel in the same frequency band (not occupied by other devices and without significant interference), then dynamic channel switching is triggered; if there is no idle high-quality channel, then the time slice duration corresponding to the virtual logical interface is temporarily increased (the increase ratio does not exceed 30%) to compensate for the decrease in transmission efficiency caused by channel quality degradation. After the channel switch is completed, the system rebinds the virtual logical interface to the new channel. At the same time, based on the current time utilization, the duration of the corresponding time slice is fine-tuned. The time slice for high-quality channels can be appropriately shortened (not less than 80% of the initial duration) to reduce resource waste; qualified channels maintain the original time slice duration; and the time slice duration for low-quality channels (when there is no alternative channel) is appropriately extended to ensure data transmission integrity.

[0077] During the channel switching process, the channel switching and parameter configuration are completed after the current time slice ends and before the next time slice begins to avoid data packet loss. After the switching is completed, the quality of the new channel is monitored in real time to ensure stable communication, and then the new channel binding relationship and time slice allocation parameters are fixed.

[0078] The method provided in this application, through real-time detection and dynamic switching, avoids inferior channels, ensuring the continuity and reliability of communication for optical storage and charging equipment in complex scenarios such as industrial interference, multiple device superposition, and signal obstruction, and is suitable for complex deployment environments such as outdoors and industrial parks. By deeply binding channel quality with time slice allocation, high-quality channels can achieve efficient transmission without occupying too many time slices, while inferior channels ensure transmission quality through time slice compensation, avoiding the problems of "wasting high-quality channel resources and causing congestion on inferior channels," and maximizing the communication potential of single-frequency WiFi modules.

[0079] In some embodiments, the data service type transmitted by each virtual logical interface can be identified in real time, and the communication priority of the corresponding virtual logical interface can be dynamically adjusted according to the urgency of the service type.

[0080] In this embodiment, the service type refers to the data type transmitted during the communication process of the optical storage and charging equipment. Based on the actual application scenarios of the optical storage and charging system, it is divided into three categories: emergency services (equipment fault alarms, overload protection commands, network interruption recovery commands), core services (equipment operating parameter collection, charging and discharging control commands, MESH networking signaling), and ordinary services (non-real-time maintenance logs, parameter configuration feedback, historical data uploads). Dynamic priority adjustment means that the system does not fix the priority of each virtual logical interface, but adjusts the priority level in real time according to the urgency of the currently transmitted service type. The priority of the virtual logical interface corresponding to an emergency service can be temporarily higher than the original fixed priority, and the original priority is automatically restored after the service is processed.

[0081] In this embodiment, when processing data from each virtual logical interface, the system automatically identifies the service type corresponding to the data through the identifier field in the data frame header, and establishes a temporary mapping rule between service type and priority: Emergency Service > Core Service > Normal Service, where core service corresponds to the original fixed priority by default (network node networking communication mode is core service). When a virtual logical interface transmits emergency service data (such as a device fault alarm), the system temporarily raises the priority of that virtual logical interface to the highest level, prioritizes the use of time slices to process the emergency service, and suspends the data processing of currently low-priority services; after the emergency service is processed, the system automatically restores the priority of the virtual logical interface to its original level and resumes normal polling scheduling. If multiple virtual logical interfaces transmit emergency services simultaneously, the system further sorts them according to the urgency of the services (such as device overload protection command > fault alarm > network recovery command), and processes them sequentially; if an emergency service is not processed within the corresponding time slice, the system caches the remaining data and prioritizes allocating the next idle time slice for further processing, ensuring that no emergency service is missed.

[0082] Dynamic priority adjustment does not change the original time slice allocation rules for the roles. It only prioritizes high-urgency business during the time slice scheduling process. At the same time, it is linked to the time utilization adjustment mechanism. If a certain type of urgent business occurs frequently, the system will automatically and appropriately increase the time slice ratio of the corresponding virtual logical interface to adapt to changes in business traffic.

[0083] The method provided in this application addresses the issue that the original fixed priority system cannot handle urgent services. It ensures that instructions for emergencies such as equipment failure and overload can be transmitted and processed quickly and promptly, avoiding safety hazards caused by priority restrictions and improving the operational safety and emergency response capabilities of the optical storage and charging system. By differentiating the real-time requirements of different types of services, it prevents ordinary services from occupying the communication resources of urgent and core services, while ensuring the basic priority of core services. This achieves refined scheduling of "prioritizing the processing of urgent services, ensuring the stability of core services, and orderly transmission of ordinary services," thereby improving the overall communication efficiency of the system.

[0084] In some embodiments, the gateway device acts as the synchronization master node, which coordinates the working cycle and time slice scheduling sequence of all devices in the network, avoids signal interference caused by multiple devices switching channels at the same time, realizes network-wide time slice synchronization scheduling, and improves the overall network communication efficiency and stability.

[0085] In this embodiment, the synchronization master node refers to the gateway role device (core hub) within the network, responsible for generating a unified working cycle timing signal for the entire network, synchronously distributing it to all optical storage and charging devices within the network, coordinating the time slice scheduling rhythm of each device, and ensuring that the time slice switching timing of each device does not conflict. Time slice synchronization scheduling means that all devices within the network synchronously start their working cycles and synchronously switch time slices according to the timing signal distributed by the master node, ensuring that at the same time, the virtual logical interfaces of different devices switch to different channels, avoiding signal interference and data conflicts caused by multiple devices occupying the same channel simultaneously.

[0086] In some embodiments, the method further includes: collecting environmental state parameters of each virtual logic interface and constructing an environmental state vector; the reinforcement learning agent predicting the value of each time slice adjustment action based on the environmental state vector, selecting the optimal adjustment action and executing it; calculating the reward value based on the communication effect after the action is executed, and updating the decision strategy of the reinforcement learning agent; repeating the above steps to achieve adaptive optimization of the time slice division ratio, while maintaining the time slice duration relationship of each role unchanged.

[0087] In this embodiment, after each work cycle, the device collects the time utilization rate, channel quality score, service traffic burst rate, and its own functional role identifier for each virtual logical interface. All parameters are normalized (mapped to the [0,1] interval) to construct an environment state vector. A reinforcement learning agent is deployed in the device control system, with a built-in deep neural network. Based on the current environment state vector, it predicts the Q-value (action value) of each time-slice adjustment action and selects the action with the highest Q-value for execution. During action execution, the time slice duration relationship corresponding to each role is strictly followed, with a value set at 5%-10% of the total work cycle duration to avoid excessive adjustment leading to communication interruption. After action execution, the system collects current communication performance data (packet loss rate, transmission delay, channel utilization rate) and calculates the reward value based on a preset reward function. Experience samples are stored in an experience replay pool. Every 5 work cycles, the agent randomly samples batches of samples from the replay pool and updates the deep neural network parameters through backpropagation to optimize subsequent action decision-making strategies. For three different roles of devices—gateway, near-end gateway, and regional gateway—dedicated reinforcement learning models are trained. In the initial stage (the first 100 working cycles), the agent's time slice allocation rule serves as the baseline strategy. As the running data accumulates, the algorithm gradually shifts to an autonomous learning strategy. When the reward value fluctuation range is less than 5% for 20 consecutive working cycles, the algorithm is considered to have converged, maintaining the current decision-making strategy while continuously collecting environmental status data to achieve dynamic adaptation.

[0088] In some embodiments, the distributed optical storage and charging system can be modeled as a communication graph, collecting channel quality and interference relationship data of each device in the network, and generating the optimal channel allocation strategy for the entire network through graph neural network reasoning; the gateway device acts as the synchronization master node and distributes the optimal channel allocation strategy to all devices in the network to achieve multi-device channel collaborative interference avoidance; In this embodiment, channel interference changes can be monitored in real time, triggering local graph neural network inference to dynamically adjust the channel configuration of the interfered device.

[0089] Based on the foregoing embodiments, this application provides a communication method for optical storage and charging devices, applied to an optical storage and charging system. Within this system, two or more optical storage and charging devices may exist with inconsistent Wi-Fi communication channels. The optical storage and charging device refers to the core hardware of an integrated optical storage and charging system, which can communicate via Wi-Fi or form a Wi-Fi-MESH network. Within a photovoltaic energy storage and charging system, there can be two or more photovoltaic energy storage and charging devices that do not share the same WiFi communication channel as the router. The single-frequency WiFi communication photovoltaic energy storage and charging devices support multiple communication modes, including: STA mode, used to connect to the router and join the network; AP mode, used for near-end STA access, configuration distribution, information reading, etc.; MESH mode, using the 802.11 protocol, used to network with other photovoltaic energy storage and charging devices.

[0090] In this embodiment of the application, the time-division multiplexing method for a single-frequency WiFi communication optical storage and charging device includes: Different communication modes are configured for the optical storage and charging equipment, and multiple logical interfaces are created and bound to each communication mode to access their respective networks. A logical interface is a virtual network interface created at the software level for receiving and sending data.

[0091] In this embodiment, each logical interface can be bound to an independent communication channel, thereby enabling multi-channel synchronous transmission and reception of data. Time slices can be divided into time slots for the communication cycle through preset rules or real-time adjustment mechanisms. Priority preemption or fixed-time-slice round-robin scheduling methods can be used to process the data streams of each interface.

[0092] Single-frequency WiFi communication optical storage and charging devices access different networks through role-based classification: In a network, each device undertakes different specific tasks. Therefore, the system assigns different functional roles to devices, which are typically determined through preset configurations or competitive negotiation mechanisms. The gateway role refers to an optical storage and charging device in the network topology that is used to access the router and simultaneously network with other optical storage and charging devices via WiFi-MESH, using the STA+MESH communication mode. The area gateway role refers to an optical storage and charging device in the network topology that is used to simultaneously access two optical storage and charging devices operating on different channel MESH networks, using the MESH+MESH communication mode. The near-end gateway role refers to an optical storage and charging device in the network topology that is used for STA terminal access and simultaneously network with other optical storage and charging devices via WiFi-MESH, using the AP+MESH communication mode. Other device roles refer to optical storage and charging devices in the network topology that only network with other optical storage and charging devices via WiFi-MESH, using the MESH communication mode.

[0093] In this embodiment, when the device starts up, time slices are allocated according to a preset rule: T = T1 + T2 + T3, where T is a working cycle, and T1, T2, and T3 are working time slices under different channels; the packet reception status within the cycle is statistically analyzed: Rx = Rx1 + Rx1 + Rx2, where Rx is the total number of packets received by the three interfaces, and Rx1, Rx1, and Rx2 are the packets received by different channels in time slices T1, T2, and T3, respectively; the utilization rate of time slices is measured based on the packet reception ratio and time slice ratio within the cycle; and the time slice allocation strategy for subsequent cycles is dynamically adjusted based on the utilization statistics of multiple consecutive cycles.

[0094] The following is an example of communication in an optical storage and charging device based on an embodiment of this application, including: Example 1: Communication scenario of optical storage and charging equipment with single-frequency WiFi communication. Figure 3 This is a schematic diagram illustrating a communication scenario provided in an embodiment of this application. Figure 4 A schematic diagram of another communication scenario provided in the embodiments of this application, such as... Figures 3 to 4 As shown, it includes: TA mode, connecting to the router and joining the network; AP mode, accessing the terminal and sending and reading device information; MESH mode, forming a MESH network with other optical storage and charging devices via WIFI; and multiple modes can be enabled simultaneously to connect to two different networks, uplink and downlink.

[0095] Example 2: A time-division multiplexing method for a single-frequency WiFi communication optical energy storage and charging device: The optical storage and charging device A1 is preset with three modes: AP, STA, and MESH. At the software level, the device creates three virtual network interfaces, If1, If2, and If3, corresponding to the AP, STA, and MESH modes. These three interfaces are used for message transmission and reception in the three modes. Each interface is bound to a different channel and time slices are divided according to rules. Each interface works within its corresponding time slice. When If1, If2, and If3 all have data to send, a priority preemption or fixed time slice round-robin scheduling method is used to process the data flow of each interface. Example 3: A method for dynamically adjusting time slices in a single-frequency WiFi communication optical storage and charging device; The optical storage and charging equipment A1 is configured with three preset modes: AP, STA, and MESH. It creates corresponding logical interfaces If1, If2, and If3 and binds them to channels. Initially, each interface operates according to a preset time slice: T = T1 + T2 + T3, where T is a working cycle, and T1, T2, and T3 are the working time slices for interfaces If1, If2, and If3, respectively. Packet reception within the cycle is statistically analyzed: Rx = Rx1 + Rx1 + Rx2, where Rx is the total number of packets received by the three interfaces, and Rx1, Rx1, and Rx2 are the packets received by interfaces If1, If2, and If3 in time slices T1, T2, and T3, respectively. Based on the percentage of packets received within the cycle and the percentage of time slices, the time utilization rate is calculated, as shown in the formula U = Σ[(Rx1 / Rx) × (T1 / T)]. The time utilization rate of each interface is statistically analyzed over multiple cycles to adjust the time slice allocation. Example 4: Time slice division for different roles in optical storage and charging equipment: Gateway role: The optical storage and charging device uses both STA and MESH modes, creating corresponding logical interfaces If1 and If2 and binding them to channels; T = T1 + T2, where T is a working cycle, and T1 and T2 are the working time slices of interfaces If1 and If2, respectively; as a gateway, the device's message exchange frequency with the router will be lower than the message exchange frequency of MESH networking; the time slices are dynamically adjusted, with T1 being less than T2; Regional gateway role: The optical storage and charging equipment uses both MESH and MESH modes, and will create corresponding logical interfaces If1 and If2 and bind them to different channels; T = T1 + T2, where T is a working cycle, and T1 and T2 are the working time slices of interfaces If1 and If2, respectively; As a regional gateway, the device has the same interaction frequency with the two regional MESH messages, and the time slice is dynamically adjusted, T1 = T2.

[0096] Near-end gateway role: The optical storage and charging device uses three modes: AP, MESH, and creates corresponding logical interfaces If1 and If2 and binds them to different channels; T = T1 + T2, where T is a working cycle, and T1 and T2 are the working time slices of interfaces If1 and If2, respectively; As a near-end gateway, the device's message exchange frequency with STA terminals will be higher than the message exchange frequency of MESH networking; The time slices are dynamically adjusted, with T1 being greater than T2.

[0097] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.

[0098] According to the foregoing embodiments, this application provides a communication device for an optical storage and charging device. The various modules and units included in the device can be implemented by a processor in a computer device; of course, they can also be implemented by specific logic circuits. In the implementation process, the processor can be a central processing unit (CPU), a microprocessor (MPU), a digital signal processor (DSP), or a field programmable gate array (FPGA), etc.

[0099] This application provides a communication device for an optical storage and charging equipment. Figure 5 This is a schematic diagram of the structure of a communication device for an optical storage and charging equipment provided in an embodiment of this application, as shown below. Figure 5 As shown, the communication device 500 of the optical storage and charging equipment includes: The acquisition module 501 is used to acquire the functional role of the optical storage and charging device in the network topology, wherein the functional role is determined based on the communication object of the optical storage and charging device; The first determining module 502 is used to determine the target communication mode based on the functional role and the pre-established first correspondence relationship, wherein the first correspondence relationship includes: the correspondence relationship between the functional role and the communication mode; The second determining module 503 is used to determine the virtual logical interface corresponding to each target communication mode, wherein each virtual logical interface is bound to an independent network communication channel. The communication module 504 is used to communicate with the communication object based on the virtual logical interface.

[0100] In some embodiments, the communication module includes: The first acquisition unit is used to acquire the working period corresponding to the target communication mode, wherein the working period is divided into multiple time slices, and each time slice corresponds to a virtual logical interface. The first processing unit is used to poll and process the data of the corresponding virtual logical interface within the time slice of each virtual logical interface.

[0101] In some embodiments, the communication device 500 of the optical storage and charging device includes: The data acquisition module is used to acquire the packet data received by each virtual logical interface in the corresponding time slice; The calculation module is used to calculate the time utilization rate corresponding to each time slice based on the packet receiving data of each virtual logical interface corresponding to the time slice and the total number of packets received in the work cycle; The partitioning module is used to adjust the partitioning ratio of each time slice in the work cycle based on the time utilization rate.

[0102] In some embodiments, the communication module includes: The second processing unit is used to process the data of the corresponding virtual logical interface based on the communication priority of each virtual logical interface.

[0103] In some embodiments, the target communication mode includes at least one of: network node networking communication mode, near-end terminal communication mode, and router networking communication mode, wherein the communication corresponding to the network node networking communication mode has the highest priority, the router networking communication mode is used to connect to a router, the network node networking communication mode is used to network with other optical storage and charging devices, and the near-end terminal communication mode is used for near-end access.

[0104] In some embodiments, the first correspondence includes: a gateway role corresponding to a router networking communication mode and a network node networking communication mode; a regional gateway role corresponding to a dual network node networking communication mode; a near-end gateway role corresponding to a near-end terminal communication mode and a network node networking communication mode; and other device roles corresponding to a network node networking communication mode. The router networking communication mode is used to connect to a router, the network node networking communication mode is used to network with other optical storage and charging devices, and the near-end terminal communication mode is used for near-end access.

[0105] In some embodiments, when the optical storage and charging device acts as a gateway, the time slice corresponding to the router network communication mode is the first time slice, and the time slice corresponding to the network node networking communication mode is the second time slice, wherein the first time slice is shorter than the second time slice; when the optical storage and charging device acts as a regional gateway, the time slices corresponding to each network node networking communication mode are equal; when the optical storage and charging device acts as a near-end gateway, the time slice corresponding to the near-end terminal communication mode is the third time slice, and the time slice corresponding to the network node networking communication mode is the fourth time slice, wherein the third time slice is longer than the fourth time slice.

[0106] It should be noted that the information interaction and execution process between the above-mentioned devices / units are based on the same concept as the method embodiments of this application. For details on their specific functions and technical effects, please refer to the method embodiments section, and they will not be repeated here.

[0107] In addition, the communication device of the optical storage and charging equipment shown above can be a software unit, a hardware unit, or a combination of software and hardware. It can also be integrated into electronic devices as an independent component, or exist as an independent terminal device.

[0108] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0109] Figure 6This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Figure 6 As shown, the electronic device of this embodiment may include: at least one processor 30 ( Figure 6 Only one processor 30, memory 31, and computer program 32 stored in memory 31 and executable on at least one processor 30 are shown. When the processor 30 executes the computer program 32, it implements the steps in any of the above method embodiments, or the processor 30 executes the computer program 32 to implement the functions of each module / unit in the above device or system embodiments.

[0110] For example, computer program 32 may be divided into one or more modules / units, one or more of which are stored in memory 31 and executed by processor 30 to complete this application. One or more modules / units may be a series of computer program 32 instruction segments capable of performing a specific function, which describe the execution process of computer program 32 in an electronic device.

[0111] This application also provides a computer-readable storage medium storing a computer program 32, which, when executed by a processor 30, implements the steps described in the above-described method embodiments.

[0112] This application provides a computer program product that, when run on an electronic device, enables the electronic device to perform the steps described in the various method embodiments above.

[0113] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments of this application can be implemented by a computer program 32 instructing related hardware. The computer program 32 can be stored in a computer-readable storage medium, and when executed by the processor 30, it can implement the steps of the various method embodiments described above. The computer program 32 includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include at least: any entity or device capable of carrying computer program code to a terminal, a recording medium, a computer memory, a read-only memory (ROM), a random access memory (RAM), electrical carrier information, telecommunication information, and a software distribution medium. Examples include USB flash drives, portable hard drives, magnetic disks, or optical disks.

[0114] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0115] Those skilled in the art will 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, or a combination of computer software and electronic hardware. 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.

[0116] In the embodiments provided in this application, it should be understood that the disclosed apparatus / network devices and methods can be implemented in other ways. For example, the apparatus / network device embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.

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

[0118] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.

Claims

1. A communication method for an optical storage and charging device, characterized in that, The optical storage and charging equipment uses a single-frequency WIFI module for communication, including: Obtain the functional role of the optical storage and charging device in the network topology, wherein the functional role is determined based on the communication object of the optical storage and charging device; The target communication mode is determined based on the functional roles and the pre-established first correspondence, wherein the first correspondence includes: the correspondence between functional roles and communication modes; Determine the virtual logical interface corresponding to each target communication mode, wherein each virtual logical interface is bound to an independent network communication channel; Communicate with the communication object based on the virtual logical interface.

2. The method according to claim 1, characterized in that, The communication with the communication object based on the virtual logical interface includes: Obtain the working period corresponding to the target communication mode, wherein the working period is divided into multiple time slices, and each time slice corresponds to a virtual logical interface; The data of each virtual logical interface is processed in a poll within the time slice corresponding to each virtual logical interface.

3. The method according to claim 2, characterized in that, The method further includes: Obtain the packet data received by each virtual logical interface in the corresponding time slice; The time utilization rate of each time slice is calculated based on the packet data received in the time slice corresponding to each virtual logical interface and the total number of packets received in the work cycle. Based on the time utilization rate, the division ratio of each time slice in the work cycle is adjusted.

4. The method according to claim 1, characterized in that, The communication with the communication object based on the virtual logical interface includes: Data from each virtual logical interface is processed based on the communication priority of each virtual logical interface.

5. The method according to claim 4, characterized in that, The target communication mode includes at least one of the following: network node networking communication mode, near-end terminal communication mode, and router networking communication mode. Among them, the communication corresponding to the network node networking communication mode has the highest priority. The router networking communication mode is used to connect to the router, the network node networking communication mode is used to network and communicate with other optical storage and charging devices, and the near-end terminal communication mode is used for near-end access.

6. The method according to claim 3, characterized in that, The first correspondence includes: the gateway role corresponds to the router network communication mode and the network node networking communication mode; the regional gateway role corresponds to the dual network node networking communication mode; the near-end gateway role corresponds to the near-end terminal communication mode and the network node networking communication mode; and other device roles correspond to the network node networking communication mode. The router network communication mode is used to connect to the router, the network node networking communication mode is used to network with other optical storage and charging devices, and the near-end terminal communication mode is used for near-end access.

7. The method according to claim 6, characterized in that, When the optical storage and charging device acts as a gateway, the time slice corresponding to the router network communication mode is the first time slice, and the time slice corresponding to the network node networking communication mode is the second time slice, with the first time slice being shorter than the second time slice. When the optical storage and charging device acts as a regional gateway, the time slices corresponding to the networking communication modes of each network node are equal. When the optical storage and charging device acts as a near-end gateway, the time slice corresponding to the near-end terminal communication mode is the third time slice, and the time slice corresponding to the network node networking communication mode is the fourth time slice, with the third time slice being longer than the fourth time slice.

8. A communication device for an optical storage and charging equipment, characterized in that, The optical storage and charging equipment uses a single-frequency WIFI module for communication, including: The acquisition module is used to acquire the functional role of the optical storage and charging device in the network topology, wherein the functional role is determined based on the communication object of the optical storage and charging device; The first determining module is used to determine the target communication mode based on the functional role and a pre-established first correspondence relationship, wherein the first correspondence relationship includes: the correspondence relationship between the functional role and the communication mode; The second determining module is used to determine the virtual logical interface corresponding to each target communication mode, wherein each virtual logical interface is bound to an independent network communication channel. A communication module is used to communicate with the communication object based on the virtual logical interface.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the method as described in any one of claims 1 to 7.

10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1 to 7.