An interactive configuration device, an electronic device, and a distributed system

By providing interactive configuration devices in the microgrid system, the problem that local resources of the equipment are difficult to support new functions is solved, data interaction and resource sharing between devices are realized, and the stability and flexibility of the system are improved.

CN119363585BActive Publication Date: 2025-06-27YONG LIAN KE JI (CHANG SHU) YOU XIAN GONG SI
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411934856.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-26
Publication Date
2025-06-27
Estimated Expiration
2044-12-26

AI Technical Summary

Technical Problem

The local resources of some devices in the microgrid system are difficult to support new functions, which makes it difficult to expand functions.

Method used

An interactive configuration device is provided to connect the device through a communication link to realize data interaction and resource sharing. The device includes a communication module, a memory module and a resource module, which is used to configure communication management mode, shared memory and resource allocation, and supports data protocol construction and resource call between devices.

Benefits of technology

Through the interactive configuration device, data interaction and resource sharing of various electronic devices are realized, hardware cost investment is reduced, protocol formulation and development time is saved, and the stability and flexibility of the microgrid system is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119363585B_ABST
    Figure CN119363585B_ABST
Patent Text Reader

Abstract

The present disclosure provides an interaction configuration device, an electronic device, and a distributed system, including a first communication module, a first memory module, and a first resource module; the first communication module is configured to configure a first communication management mode of a first device according to at least one of first device information of the first device and first link information of a communication link; the first memory module is configured to determine a first shared memory of the first device according to a first preset relationship, and the first shared memory is accessible by the first device and a second device; the first resource module is configured to allocate a first shared resource of the first device, and the first shared resource is callable by the second device. Through the first communication module, the construction of a data protocol inside the microgrid system can be quickly realized, and the first device provides shared resources for the second device to call, improving the stability of the microgrid system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of communication technologies, and in particular, to an interaction configuration device, an electronic device, and a distributed system. Background Art

[0002] With the improvement of production and living standards, the social demand for electricity is also increasing, and power cuts have occurred in some areas due to insufficient power supply. Since the microgrid system can integrate various energy resources and loads and achieve efficient utilization of energy, it has developed rapidly.

[0003] However, in the microgrid system, devices communicate with each other through various peripheral communication buses, and each device is independent of each other. When expanding the functions of the devices in the microgrid system, the existing local resources of some devices are difficult to support the new functions. Summary of the Invention

[0004] To solve the problem that the existing local resources of some devices in the microgrid system are difficult to support new functions in the prior art, the present invention provides an interaction configuration device, an electronic device, and a distributed system.

[0005] In a first aspect, an embodiment of the present disclosure provides an interaction configuration device, which is applied to a first device. The first device establishes a connection with a second device through a communication link. The device includes a first communication module, a first memory module, and a first resource module;

[0006] The first communication module is configured to configure a first communication management mode of the first device according to at least one of first device information of the first device and first link information of the communication link;

[0007] The first memory module is configured to determine a first shared memory of the first device according to a first preset relationship. The first shared memory is accessible to the first device and the second device;

[0008] The first resource module is configured to allocate a first shared resource of the first device for the second device to call.

[0009] In some possible embodiments, the first device information includes a first device frame format, and the first link information includes a first link frame format;

[0010] The first communication module is configured to configure the first communication management mode of the first device to include a first format conversion mode according to the first device frame format and the first link frame format. The first format conversion mode includes converting the data frame format of the data to be sent into the first link frame format, or converting the data frame format of the data to be received into the first device frame format.

[0011] In some possible embodiments, the first link information includes the first peripheral type;

[0012] The first communication module is configured to, when the first peripheral type meets the first preset condition, configure the first communication management mode of the first device to include a first interaction mode, and the first interaction mode includes sending data to the communication link at a first preset frequency or receiving data from the communication link at a first preset frequency.

[0013] In some possible embodiments, the first communication module is configured to configure the first communication management mode of the first device to include a first monitoring mode, and the first monitoring mode includes determining whether the connection of the communication link is normal according to the data received from the communication link.

[0014] In some possible embodiments, the first shared memory includes at least one first register, and the first preset relationship indicates that there is a one-to-one correspondence between at least one first preset data and at least one first register;

[0015] The first memory module is configured to allocate a corresponding first register for each first preset data in at least one first preset data according to the first preset relationship.

[0016] In some possible embodiments, the first shared resource includes a first storage resource;

[0017] The first resource module is configured to:

[0018] Obtain the first stored data sent by the second device;

[0019] Allocate a first storage space for the first stored data in the first storage resource according to the first data type of the first stored data.

[0020] In some possible embodiments, the first shared resource includes a first computing power resource;

[0021] The first resource module is configured to:

[0022] Obtain the first algorithm identifier and the first input parameter sent by the second device;

[0023] Determine the corresponding first algorithm from the first computing power resource according to the first algorithm identifier;

[0024] Input the first input parameter into the first algorithm for operation to obtain a first operation result, and the first operation result is for the second device to call.

[0025] In some possible embodiments, the first device invokes at least one first functional module in the interaction configuration device through a first module interface. The first module interface is configured with at least one first switch, and at least one first switch corresponds to at least one first functional module one by one. Each of the at least one first switches is used to control the enabling or stopping of the corresponding first functional module.

[0026] In some possible embodiments, the second device accesses the first shared memory through a first memory interface.

[0027] In some possible embodiments, the second device invokes the first shared resource through a first resource interface.

[0028] In a second aspect, an embodiment of the present disclosure provides an interaction configuration device, which is applied to a second device. The second device establishes a connection with a first device through a communication link. The device includes a second communication module, a second memory module, and a second resource module;

[0029] The second communication module is configured to configure a second communication management mode of the second device according to at least one of second device information of the second device and first link information of the communication link;

[0030] The second memory module is configured to determine a second shared memory of the second device according to a second preset relationship. The second shared memory is for the first device and the second device to access;

[0031] The second resource module is configured to allocate a second shared resource of the second device. The second shared resource is for the first device to invoke.

[0032] In some possible embodiments, the second device information includes a second device frame format, and the second link information includes a second link frame format;

[0033] The second communication module is configured to configure the second communication management mode of the second device to include a second format conversion mode according to the second device frame format and the second link frame format. The second format conversion mode includes converting the data frame format of the data to be sent into the second link frame format, or converting the data frame format of the data to be received into the second device frame format.

[0034] In some possible embodiments, the second link information includes a second peripheral device type.

[0035] The second communication module is configured to configure the second communication management mode of the second device to include a second interaction mode when the second peripheral device type meets a second preset condition. The second interaction mode includes sending data to the communication link at a second preset frequency, or receiving data from the communication link at a second preset frequency.

[0036] In some possible embodiments, the second communication module is configured to configure the second communication management mode of the second device to include a second monitoring mode, and the second monitoring mode includes determining whether the connection of the communication link is normal according to the data received from the communication link.

[0037] In some possible embodiments, the second shared memory includes at least one second register, and the second preset relationship indicates that there is a one-to-one correspondence between at least one second preset data and at least one second register;

[0038] The second memory module is configured to allocate a corresponding second register for each second preset data in at least one second preset data according to the second preset relationship.

[0039] In some possible embodiments, the second shared resource includes a second storage resource;

[0040] The second resource module is configured to:

[0041] Obtain the second storage data sent by the first device;

[0042] Allocate a second storage space for the second storage data in the second storage resource according to the second data type of the second storage data.

[0043] In some possible embodiments, the second shared resource includes a second computing power resource;

[0044] The second resource module is configured to:

[0045] Obtain the second algorithm identifier and the second input parameter sent by the first device;

[0046] Determine the corresponding second algorithm from the second computing power resource according to the second algorithm identifier;

[0047] Input the second input parameter into the second algorithm for operation to obtain a second operation result, and the second operation result is for the first device to call.

[0048] In some possible embodiments, the second device calls at least one second function module in the interactive configuration device through a second module interface, the second module interface is configured with at least one second switch, at least one second switch corresponds to at least one second function module one by one, and each second switch of at least one second switch is used to control the enabling or stopping of the corresponding second function module.

[0049] In some possible embodiments, the first device accesses the second shared memory through a second memory interface;

[0050] In some possible embodiments, the first device calls the second shared resource through a second resource interface.

[0051] In a third aspect, an embodiment of the present disclosure provides an electronic device, which includes an interaction configuration device as described in any one of the first aspects.

[0052] In a fourth aspect, an embodiment of the present disclosure provides an electronic device, which includes an interaction configuration device as described in the second aspect.

[0053] In a fifth aspect, an embodiment of the present disclosure provides a distributed system, which includes a first device and at least one second device;

[0054] The first device includes an interaction configuration device as described in any one of the first aspects, and each of the at least one second devices includes an interaction configuration device as described in the second aspect;

[0055] Each of the at least one second devices is communicatively connected to the first device via a communication link.

[0056] An interaction configuration device, an electronic device, and a distributed system provided by embodiments of the present disclosure have the following technical effects:

[0057] Data interaction and resource sharing among electronic devices are achieved through the interaction configuration device, significantly reducing the investment in hardware costs. The data protocol construction among devices within the microgrid can be quickly realized through the first communication module, saving the time for protocol formulation and development. At the same time, the first device provides shared resources through the interaction configuration device. When a second device needs resources to support new functions or data, it can call the resources of the first device, improving the stability of the microgrid system operation.

[0058] It should be understood that the above general description and subsequent detailed description are only exemplary and explanatory, and cannot limit the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0059] To more clearly illustrate the technical solutions and advantages in embodiments of the present disclosure or the prior art, the following will briefly introduce the drawings required for description in the embodiments or the prior art. Obviously, the following drawings are only some embodiments of the present disclosure. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0060] Figure 1 is a schematic diagram of the connection relationship of a microgrid system provided by an exemplary embodiment of the present disclosure;

[0061] Figure 2 is a schematic diagram of the first module of an interaction configuration device provided by an exemplary embodiment of the present disclosure;

[0062] Figure 3It is a schematic flowchart of a first format conversion mode provided by an exemplary embodiment of the present disclosure;

[0063] Figure 4 It is a schematic flowchart of a question-and-answer interaction mechanism provided by an exemplary embodiment of the present disclosure;

[0064] Figure 5 It is a schematic module diagram of a first shared memory provided by an exemplary embodiment of the present disclosure;

[0065] Figure 6 It is a schematic module diagram of a first storage resource provided by an exemplary embodiment of the present disclosure;

[0066] Figure 7 It is a schematic module diagram of a first computing power resource provided by an exemplary embodiment of the present disclosure;

[0067] Figure 8 It is a schematic module diagram of a first algorithm interpreter provided by an exemplary embodiment of the present disclosure;

[0068] Figure 9 It is a schematic module diagram of a first module interface provided by an exemplary embodiment of the present disclosure;

[0069] Figure 10 It is a schematic diagram of a second module of an interaction configuration device provided by an exemplary embodiment of the present disclosure;

[0070] Figure 11 It is a schematic diagram of the connection relationship of a distributed system provided by an exemplary embodiment of the present disclosure;

[0071] Figure 12 It is a schematic diagram of data interaction provided by an exemplary embodiment of the present disclosure. Detailed implementation manners

[0072] Next, the technical solutions in the embodiments of the present disclosure will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only a part of the embodiments of the present disclosure, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present disclosure without creative efforts shall fall within the protection scope of the present disclosure.

[0073] It should be noted that the terms "first", "second", etc. in the description, claims and the above-mentioned drawings of the present disclosure are used to distinguish similar objects and do not necessarily describe a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "comprising" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or server comprising a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products or devices.

[0074] Please refer to Figure 1 , Figure 1 FIG. is a schematic diagram of the connection relationship of a microgrid system provided by an embodiment of the present disclosure. The microgrid system is a small power system that can be independent or connected to the main grid to provide power for a specific area or community. The microgrid system is also a distributed system, that is, a system composed of multiple independent but cooperative components. The microgrid system usually includes multiple related electronic devices such as inverter devices and sampling devices.

[0075] In order to ensure the stable operation of each electronic device in the microgrid system and improve economic efficiency, an Energy Management System (EMS) is usually used to communicate with each electronic device and perform power management and regulation on each electronic device in the microgrid system.

[0076] For the existing microgrid system, the following situations exist: First, the functions of each electronic device in the microgrid system are independent of each other. The electronic devices interact through a peripheral communication bus, and the computing power resources and storage resources of each electronic device are only used by itself. The energy management controller usually can only play the role of data monitoring in the microgrid system or undertake the power control of some simple processes. Second, the communication protocols between each electronic device and the energy management controller are often customized. When using new electronic devices, the workload of protocol docking will increase, and these works are often not reusable, increasing redundant work and development cycle. Third, based on the existing hardware conditions, if the functions of the existing microgrid system are to be expanded, the core controllers of some electronic devices may not be able to support large operations. If the hardware of the electronic devices is to be replaced, it may lead to a significant increase in both device cost and time cost.

[0077] On this basis, embodiments of the present disclosure apply an interactive configuration device to a microgrid system to adjust and configure the soft bus framework of the entire microgrid system. A soft bus is a bus communication mechanism simulated or implemented through software, which allows different hardware components, modules, systems, or devices to communicate and exchange data through standardized software interfaces. It does not rely on traditional hardware bus structures but on operating systems or middleware. Generally, in a microgrid system, a soft bus can assist in communication between different devices.

[0078] The interactive configuration device provided by embodiments of the present disclosure can serve as middleware for the soft bus and can be loaded into various devices of the microgrid system in the form of a Software Development Kit (SDK). After the electronic device loads the software development kit, it can be converted into an application program to enable each functional module in the software development kit.

[0079] The SDK generally includes a series of development tools, libraries, API (Application Programming Interface) documents, sample codes, debugging tools, etc., aiming to simplify the software development process. After being transplanted to the corresponding electronic device, functions such as data interaction and resource sharing deployment can be quickly completed.

[0080] Next, a description is given of an interactive configuration device provided by an exemplary embodiment of the present disclosure. The interactive configuration device is applied to a first device, and the first device establishes a connection with a second device through a communication link. For example, the first device can specifically be an energy manager in the microgrid system, and the second device can specifically be other electronic devices in the microgrid system. They can be swapped or otherwise configured according to the actual situation. This embodiment is only taken as an example for ease of explanation and is not limited thereto. In addition, the interactive configuration device can be applied not only to microgrid systems but also to other types of distributed systems.

[0081] In addition, the first device and the second device provided in this embodiment can support the Master-Slave Mode, that is, the first device acts as the host to control the communication process, and the second device acts as the slave to respond to the control instructions of the first device.

[0082] Figure 2 is a module schematic diagram of an interactive configuration device. For details, refer to Figure 2 , and the device includes a first communication module 21, a first memory module 22, and a first resource module 23.

[0083] The first communication module 21 is used to configure the first communication management mode of the first device according to at least one of the first device information of the first device and the first link information of the communication link.

[0084] Specifically, the first device information may specifically include, but is not limited to, the first hardware resource information of the first device, the first protocol information of the first device, etc. The first link information may specifically include, but is not limited to, the first performance requirement information of the communication link, the first protocol information of the communication link, etc. Further, it should be noted that the communication link is usually jointly determined by the first device and the second device according to their communication requirements. Therefore, in some cases, the second device information of the second device may also be carried in the first link information, such as the second hardware resource information of the second device, the second protocol information of the second device, etc., to provide the first device with the relevant information of the second device, facilitating the first device to configure the communication connection with the second device.

[0085] In this embodiment, the communication link of the first device can be managed by configuring the first communication management mode, such as in aspects of protocol packaging, link management, data interaction, interface configuration, etc. To facilitate the understanding of the configuration of the first communication mode, the following is illustrated by several examples:

[0086] In a specific example, the protocol packaging of the first device is managed by configuring the first communication management mode.

[0087] Specifically, the first device information includes the first device frame format, and the first link information includes the first link frame format.

[0088] The first communication module 21 is configured to configure the first communication management mode of the first device to include the first format conversion mode according to the first device frame format and the first link frame format. The first format conversion mode includes converting the data frame format of the data to be sent into the first link frame format, or converting the data frame format of the data to be received into the first device frame format.

[0089] Among them, the first device frame format can be specifically determined according to the data bus protocol of the first device, and the first link frame format can be specifically determined according to the first peripheral type of the communication link connected to the first device. The first peripheral type includes serial communication (RS232, UART), I2C protocol, CAN bus protocol, Modbus protocol, wireless communication (such as Wi-Fi, Zigbee), etc. For example, when the peripheral type is RS232, the first link frame format is the RS232 frame format.

[0090] In addition, the first device includes a protocol packaging layer. The specific operations of the first format conversion mode can be implemented in the protocol packaging layer. The first communication module 21 configures the protocol packaging layer to enable the protocol packaging layer to implement the functions of the first format conversion mode. In the protocol packaging layer, the data to be sent is packed from the frame format required by the first device into the frame format required by the communication link, or the data to be received is unpacked from the frame format required by the communication link into the frame format required by the first device. For example, when the peripheral type of the first device is the CAN bus protocol and the first link frame format is the CAN frame format, but each CAN frame format only has 8 valid data bytes. Therefore, the data to be sent in the first device frame format needs to be disassembled into multiple packets for transmission according to the CAN bus rules; or the data to be received is received and unpacked according to the CAN bus rules to restore the data to be received in the first device frame format.

[0091] See Figure 3 , and the specific process includes: after the data to be sent by the first device is framed, the data to be sent is passed to the protocol packaging layer. The protocol packaging layer packs the data to be sent in the first device frame format into the data to be sent in the first link frame format according to the first link frame format of the corresponding communication link, and then sequentially puts the data to be sent into the send queue. Or, the protocol packaging layer can monitor the situation of the data to be received in the communication link in real time. When the complete data to be received is received, the data to be received in the first link frame format is unpacked to obtain the data to be received in the first device frame format, and then the data to be received is pushed to the data bus of the first device for subsequent parsing.

[0092] In another specific example, the data interaction between the first device and the second device is managed by configuring the first communication management mode.

[0093] This embodiment provides two data interaction mechanisms, including a question-and-answer interaction mechanism and an event-based interaction mechanism. The question-and-answer interaction mechanism focuses on the two-way communication between devices, while the event-based interaction mechanism focuses on the triggering of events.

[0094] The peripheral type of the communication link usually directly determines the selection and design of the interaction mechanism. For example, when the peripheral types are different, their input methods, feedback methods, application scenarios, etc. are all different. Therefore, in this embodiment, the first link information includes the first peripheral type.

[0095] First, the question-and-answer interaction mechanism is described:

[0096] The first communication module 21 is configured to, when the first peripheral type meets the first preset condition, configure the first communication management mode of the first device to include a first interaction mode. The first interaction mode includes sending data to the communication link at a first preset frequency or receiving data from the communication link at the first preset frequency.

[0097] Among them, the first interaction mode is the question-and-answer interaction mechanism. The first preset frequency and the first preset condition can be set according to specific communication requirements. The first preset condition is used to indicate that the first peripheral type can support the first interaction mode.

[0098] For example, when the first peripheral type is RS485, the first communication management mode of the first device is configured to include the first interaction mode. Due to the particularity of the RS485 communication protocol, only the host can initiate communication and the slave responds. In the case where the host does not initiate communication, the slave cannot directly send data to the host.

[0099] In this embodiment, regardless of whether the data sent by the first device contains specific data content or whether the data received by the first device contains specific data content, the first device will continuously receive or send data at the first preset frequency. Therefore, in the first interaction mode, a "null packet frame" setting is also introduced in the first device. The null packet frame is a data frame that does not contain specific data content. For details, see Figure 4 :

[0100] When there is no specific data content to send, the first device will send a null packet frame to the second device through the communication link at the first preset frequency. After receiving the null packet frame, the second device will reply with a null packet frame to the first device through the communication link at the first preset frequency as an acknowledgment. When there is data content to send, after receiving the null packet frame sent back by the second device, the first device will replace the received null packet frame with a data frame containing the data content. Similarly, when the second device needs to send a data frame containing specific data content to the first device, after receiving the null packet frame sent by the first device, the second device will replace the received null packet frame with a data frame containing the specific data content.

[0101] Next, the event-based interaction mechanism will be described:

[0102] The first communication module 21 is configured to, when the first peripheral type meets the second preset condition, configure the first communication management mode of the first device to include a second interaction mode. The second interaction mode includes sending data to the communication link at a first preset frequency or receiving data from the communication link at the first preset frequency.

[0103] Among them, the second interaction mode is the event-based interaction mechanism. The function of the second preset condition is to indicate that the first peripheral type can support the application of the second interaction mode.

[0104] For example, when the first peripheral type is any one of RS232, CAN bus, etc., configuring the first communication management mode of the first device includes the second interaction mode. The event-based interaction mechanism does not have strict timing management for sending and receiving, and data can be pushed arbitrarily.

[0105] In addition, the specific operations of the above data interaction can also be implemented in the protocol packaging layer. The first communication module 21 configures the protocol packaging layer to enable the protocol packaging layer to implement the corresponding data interaction function.

[0106] In another example, the communication link between the first device and the second device is managed by configuring the first communication management mode. The first device can monitor the first connection state of the communication link, and at the same time, the first device can also control the establishment of a connection between the first device and the second device according to the monitoring results.

[0107] Specifically, the first communication module 21 is further configured to configure the first communication management mode of the first device to include the first monitoring mode. The first monitoring mode includes determining whether the connection of the communication link is normal according to the data received from the communication link.

[0108] According to the different peripheral types of the communication link and the types of the second device, the frame types of the data received from the communication link are also different. The frame types include heartbeat frames or interaction frames. A heartbeat frame is a data frame transmitted periodically, usually used to keep the first device and the second device active and ensure that there is no abnormality in the communication connection of the communication link. The heartbeat frame does not transmit actual data content, but is used to check the connection state between devices and ensure that there is no timeout or disconnection. An interaction frame refers to a complete interaction cycle between the first device and the second device during the interaction process. Each interaction frame includes the data input and output and status changes of the first device and the data input and output and status changes of the second device, etc.

[0109] In addition, the first device includes a link management layer, and the specific operations of the first monitoring mode can be implemented in the link management layer. The link management layer will configure a link registry for dynamically managing the relevant information of the communication link. The link management layer of the first device continuously judges the connection state of the communication link with the second device by listening to heartbeat or interaction frames. When the link management layer of the first device does not receive the heartbeat or interaction data from the slave device for a long time, it is determined that the connection state of the communication link is abnormal, and the relevant information of the corresponding communication link in the link registry is reset, and waiting for reconnection to be established.

[0110] Similarly, the second device also includes a link management layer. The link management layer of the second device initiates a link request to the first device and actively triggers a heartbeat, and determines the connection status of the communication link with the first device by listening for the heartbeat response or interaction frame of the first device in real time; when the link management layer of the second device does not receive the slave heartbeat or interaction data for a long time, it determines that the connection status of the communication link is abnormal, resets the relevant information of the corresponding communication link in the link registry, and initiates a connection request again.

[0111] The first memory module 22 is configured to determine the first shared memory of the first device according to a first preset relationship.

[0112] Among them, the first shared memory is accessible to the first device and the second device, and specifically can be used by the second device for operations such as data reading and writing. The first shared memory can be determined by the administrator, or can be determined according to the first hardware resource information of the first device and the data requirements of the second device, and is specifically selected according to the actual situation.

[0113] In some possible embodiments, the first shared memory is described as follows:

[0114] The first memory module 22 is configured to allocate a corresponding first register for each of at least one first preset data according to a first preset relationship.

[0115] Among them, the first shared memory includes at least one first register. At least two of the at least one first registers may include a read-only register and a read-write register. The read-only register block only allows reading, and write operations are rejected; the read-write register block allows both reading and writing operations.

[0116] Although the above-mentioned first shared memory is accessible to the first device and the second device at the same time, in most cases, the specific read and write operations are still executed by the first device. When the second device needs to perform read and write operations on the first preset data in the first shared memory, it can access the first shared memory by calling the corresponding first memory interface and drive the first device to execute specific operations to read or write the relevant first preset data.

[0117] The first preset relationship indicates a one-to-one correspondence between at least one first preset data and at least one first register. The first preset data includes shared data for sharing with the second device, and can be specified by the administrator according to the specific use of the first device. The first preset data is divided into the corresponding first registers according to the first preset relationship.

[0118] For example, in the read-only register of the first device, the register at address 0x0001 corresponds to voltage, and the QR code strings correspond to the addresses from 0x00A0 to 0x00B0. When the second device needs to obtain the QR code string in the first device, it calls the first memory interface and sends a query frame with a starting address of 0x00A0 and reads 16 registers.

[0119] Specifically, referring to Figure 5 , the first shared memory will contain a configured first data table that stores the first preset relationship, declaring the first preset data and its corresponding first register. The interaction configuration device can open the first data table to the second device to establish shared data communication between the first device and the second device. The second device can access the first register by calling the corresponding first memory interface to read or write the first preset data; the first memory interface can include a first data reading interface, a first read-write data interface, etc.

[0120] In addition, in addition to the above first memory interface, the first shared memory also provides a first registration interface for declaring the first preset data that the first device or the second device needs to read or write to the first shared memory. The first device or the second device will obtain the corresponding first preset data according to the declared content and write it into the corresponding first register. The first registration interface can include a first read-only data registration interface, a first read-write data registration interface, etc.

[0121] Although the first shared memory provided in this embodiment is deployed in the first device, it is also open to the second device for access. In the first shared memory, the first device can write the corresponding first preset data, and the second device can read the corresponding first preset data; or the second device can write the corresponding first preset data, and the first device can read the corresponding first preset data. The difference compared with the first communication module 21 is that for some first preset data commonly used by the first device and the second device, direct interaction can be carried out through the first shared memory without a series of operations such as framing, packing, and unpacking through a protocol packaging layer, etc.

[0122] The first resource module 23 is used to allocate the first shared resources of the first device for the second device to call.

[0123] Among them, the second device calls the first shared resources through the first resource interface.

[0124] Although the first shared resources are also deployed in the first device, the difference between the first shared resources and the first shared memory is that, usually, the first shared resources are only for the second device to call to provide storage and computing power support for the second device.

[0125] The first shared resource provided in this embodiment includes, but is not limited to, the first storage resource and the first computing power resource. Taking the first storage resource and the second computing power resource as examples respectively, the first resource module 23 will be described as follows:

[0126] In some possible embodiments, the first shared resource includes the first storage resource.

[0127] The first resource module 23 is configured to obtain the first storage data sent by the second device; and allocate a first storage space for the first storage data in the first storage resource according to the first data type of the first storage data.

[0128] See Figure 6 , in the first storage resource, there are included a first storage resource manager and a first storage protocol manager. Among them, the first storage resource manager is used to manage operations such as reading, writing, and allocation of the first storage data of the second device in the first storage space. The first storage space may specifically be a local FLASH (non-volatile memory). The first storage protocol manager is responsible for managing the communication transfer and parsing of the first storage data.

[0129] A first storage configuration table is cached in the first storage resource manager, which is used to record the relevant parameters of the first storage data stored in the local FLASH, including but not limited to parameters such as storage type, storage start address / storage path name, file size, version, and checksum.

[0130] When the second device establishes communication with the shared storage resource of the first device, the second device will send a first storage request frame to the first device. The first storage management module in the first storage resource manager determines whether there is a record of the relevant first storage request frame in the local FLASH of the first device according to the storage request frame. The first storage request frame can represent the first data type of the first storage data.

[0131] If not, add the relevant parameters of the first storage data to the first storage configuration table and initialize the storage area in the local FLASH, and then write the first storage data sent by the second device into the corresponding storage area.

[0132] If so, determine the type of the current request according to the first storage request frame. The type of the current request includes a first configuration type storage request and a first log type storage request.

[0133] When the type of the current request is the first configuration class storage request, the relevant parameters in the first storage request frame are compared and verified with the relevant parameters in the first storage configuration table. If the verification passes, the relevant parameters in the first storage configuration table are directly sent to the second device; if the verification fails, the relevant parameters in the first storage configuration table are updated according to the relevant parameters sent by the second device, and the corresponding storage area is reset. Finally, the first storage data sent by the second device is written into the reset storage area.

[0134] When the type of the current request is the first log class storage request, it is only necessary to determine whether a corresponding storage area is allocated for the first storage data according to the first storage request frame. If not, the storage area for the first storage data is allocated.

[0135] In the first storage protocol manager, after the second device establishes communication with the shared storage resources of the first device, the first device will send all the configuration information related to the second device in the first storage resources to the second device. All operations of the second device in the first device are executed by the first device. The second device performs operations such as writing and reading data in the first storage space by calling the first resource interface. The first resource interface can specifically be the first configuration reading interface, the first configuration writing interface, the first log reading interface, and so on.

[0136] Regarding the above operations, it should be noted that for each first storage data, there is a corresponding storage area in the first storage space for storing the corresponding first storage data.

[0137] In some possible embodiments, the first shared resource includes the first computing power resource.

[0138] The first resource module 23 is used to obtain the first algorithm identifier and the first input parameter sent by the second device; according to the first algorithm identifier, determine the corresponding first algorithm from the first computing power resources; input the first input parameter into the first algorithm for operation to obtain the first operation result, and the first operation result is for the second device to call.

[0139] See Figure 7 , in the first computing power resources, there are a first algorithm protocol manager, a first algorithm interpreter, and a first algorithm management list. Among them, the first algorithm protocol manager is responsible for data interaction management such as algorithm registration, algorithm startup, and operation result acquisition; the first algorithm interpreter is used to compress and convert the first algorithm string into specific calculation steps to obtain a dynamic algorithm function; the first algorithm management list is used to cache the relevant algorithm information, algorithm process steps of requirements and registrations.

[0140] In the first algorithm protocol manager, the second device first sends a first algorithm registration frame to the first device for algorithm registration. The first algorithm registration frame contains a first algorithm identifier, a first input parameter type, a first input parameter quantity, a first output parameter type, a first output parameter quantity, a first algorithm string, etc. After receiving the first algorithm registration frame, the first device stores it in the first storage space for subsequent parsing by the first algorithm interpreter; finally, it returns a first device registration completion frame to the second device.

[0141] After completing the algorithm registration process, the corresponding first algorithm needs to be added to the first algorithm management list in the first device. The first algorithm management list can use the first algorithm identifier as the index identifier of the first algorithm. When the second device needs to call the corresponding first algorithm, it sends the first algorithm identifier and the first input parameter to the first device by calling the first resource interface, specifically the first algorithm start interface. The first device determines the corresponding first algorithm from the first algorithm management list according to the first algorithm identifier; inputs the first input parameter and the first algorithm into the first algorithm interpreter for calculation to obtain the first calculation result.

[0142] Combined with Figure 7 and Figure 8 , a detailed description of the first algorithm interpreter is as follows: In the first algorithm interpreter, the parsing of the first algorithm includes two cases: the reuse of algorithms stored in the first device and the generation of algorithm functions not stored in the first device.

[0143] For the reuse of existing algorithms, by calling the first resource interface, specifically the first algorithm call interface, the corresponding first algorithm is written into the first storage space.

[0144] For the generation of algorithm functions not stored in the first device, the first language interpreter needs to parse the first algorithm string to form a first algorithm step list. The above-mentioned first algorithm string is a set of value-defined algorithm languages, including algorithm common operations and interpretive language rules such as variable definition, basic four arithmetic operations, loop calculation, Fourier transform, etc. Managers can convert the required algorithm steps into text algorithms of this rule and enter them into the second device according to the specified macro rules. The second device can determine the corresponding first algorithm string according to the first algorithm to be called and send it to the first device.

[0145] The first language parser will decompose the content of the first algorithm string into a first algorithm step list that is executed sequentially. Each step item in the first algorithm step list mainly stores: input parameter address, input parameter type, output parameter address, output parameter type, algorithm meta-function callback address, next step pointer, etc. Since the first algorithm step list is only a sequential description of the transportation process, the first algorithm interpreter also includes a first arithmetic unit for specific calculations.

[0146] The first arithmetic unit includes a first execution mechanism and a first function library. The first execution mechanism maps each step item in the first algorithm step list to a specific function in the first function library. The first arithmetic unit converts and assigns values to the input and output parameters of the function.

[0147] In this embodiment, computing power resources can be provided to a second device with lower computing performance to relieve the computing pressure of the second device. At the same time, a large-scale computing process is decomposed into multiple computing processes and distributed to multiple devices for computing, realizing distributed algorithm deployment and improving the computing efficiency of the first device.

[0148] In some possible embodiments, the first device calls at least one first function module in the interactive configuration device through the first module interface. For example, the first function module may include at least one of a first communication module, a first memory module, and a first resource module.

[0149] The first module interface is configured with at least one first switch. The at least one first switch corresponds to the at least one first function module one by one. Each first switch of the at least one first switch is used to control the enabling or stopping of the corresponding first function module. Since the memory space of the first device is limited in some scenarios, some of its functions can be appropriately trimmed to save resource usage.

[0150] See Figure 9 , the first module interface is used to be compatible with the first device in different scenarios. The first switch specifically includes: a first function macro switch table, a first function compatibility table, a first timer list, and a first bus interface declaration table.

[0151] Among them, the first function macro switch table is used to turn off or on some function blocks; the first function compatibility table is used to rewrite some function functions used in the interactive configuration device. For example, in the single-chip microcomputer platform and the ARMLinux platform, the sending function interface of the serial port may be different. A serial port sending macro will be defined in the first function compatibility table. The sending operation in the interactive configuration device will use this serial port sending macro, and this serial port sending macro needs to be adapted and modified during the transplantation process to meet its sending function. A series of timer functions are provided in the first timer list, such as a 1ms timer, a 10ms timer, etc. The corresponding timer function can be triggered by polling at a precise period as needed to meet the precise timing task scheduling requirements inside the interactive configuration device. The first bus peripheral declaration table is used to specify some peripheral interfaces, parameter configurations, etc. of the access soft bus of the first device.

[0152] In this embodiment, data interaction and resource sharing among various electronic devices are realized through the interactive configuration device, greatly reducing the investment in hardware costs. Through the first communication module, the data protocol construction among devices within the microgrid can be quickly achieved, saving the time for protocol formulation and development. At the same time, the first device provides storage resource sharing and computing power sharing through the interactive configuration device. When the second device cannot support its own data storage, it can borrow the first storage resource of the first device without changing its own hardware, saving hardware and maintenance costs. When the second device needs to complete a computing process with a large amount of computation and its own core controller cannot complete it within the allowable time range, it can call the first computing power resource of the first device for operation, effectively supporting the operation of the second device and improving the stability and flexibility of the system.

[0153] An exemplary embodiment of the present disclosure provides an interactive configuration device. Refer to Figure 10 , which is applied to the second device. The second device is connected to the first device through a communication link. The device includes a second communication module, a second memory module, and a second resource module;

[0154] The second communication module 101 is configured to configure the second communication management mode of the second device according to at least one of the second device information of the second device and the second link information of the communication link.

[0155] The second memory module 102 is configured to determine the second shared memory of the second device according to a second preset relationship. The second shared memory is for the first device and the second device to access.

[0156] The second resource module 103 is configured to allocate the second shared resources of the second device. The second shared resources are for the first device to call.

[0157] In some possible embodiments, the second device information includes a second device frame format, and the second link information includes a second link frame format.

[0158] The second communication module 101 is configured to configure the second communication management mode of the second device according to the second device frame format and the second link frame format, including a second format conversion mode. The second format conversion mode includes converting the data frame format of the data to be sent into the second link frame format, or converting the data frame format of the data to be received into the second device frame format.

[0159] In some possible embodiments, the second link information includes a second peripheral type.

[0160] The second communication module 101 is configured to, when the second peripheral type meets the second preset condition, configure the second communication management mode of the second device to include a second interaction mode, where the second interaction mode includes sending data to the communication link at a second preset frequency or receiving data from the communication link at the second preset frequency.

[0161] In some possible embodiments, the second communication module 101 is further configured to configure the second communication management mode of the second device to include a second monitoring mode, where the second monitoring mode includes determining whether the connection of the communication link is normal based on the data received from the communication link.

[0162] In some possible embodiments, the second shared memory includes at least one second register, and the second preset relationship indicates that there is a one-to-one correspondence between at least one second preset data and at least one second register;

[0163] The second memory module 102 is configured to allocate a corresponding second register for each second preset data in the at least one second preset data according to the second preset relationship.

[0164] In some possible embodiments, the second shared resource includes a second storage resource;

[0165] The second resource module 103 is configured to obtain the second storage data sent by the first device; and allocate a second storage space for the second storage data in the second storage resource according to the second data type of the second storage data.

[0166] In some possible embodiments, the second shared resource includes a second computing power resource;

[0167] The second resource module 103 is configured to obtain the second algorithm identifier and the second input parameter sent by the first device; determine the corresponding second algorithm from the second computing power resource according to the second algorithm identifier; input the second input parameter into the second algorithm for operation to obtain a second operation result, and the second operation result is for the first device to call.

[0168] In some possible embodiments, the second device calls at least one second functional module in the interaction configuration device through a second module interface, where the second module interface is configured with at least one second switch, and the at least one second switch corresponds to the at least one second functional module one by one, and each second switch of the at least one second switch is used to control the enabling or stopping of the corresponding second functional module.

[0169] In some possible embodiments, the first device accesses the second shared memory through a second memory interface;

[0170] In some possible embodiments, the first device calls the second shared resource through a second resource interface.

[0171] The interactive configuration device provided in this embodiment is applied to the second device. Its specific configuration content is similar to that when applied to the first device. Therefore, reference can be made to the description of the interactive configuration device in the previous embodiment, which will not be elaborated here.

[0172] An exemplary embodiment of the present disclosure provides an electronic device, which includes an interactive configuration device as described in any one of the first exemplary embodiments, or an interactive configuration device as described in the second exemplary embodiment.

[0173] An exemplary embodiment of the present disclosure provides a distributed system. Refer to Figure 11 , the distributed system includes a first device 111 and at least one second device 112.

[0174] The first device includes an interactive configuration device as described in any one of the first exemplary embodiments. Each of the at least one second device includes an interactive configuration device as described in the second exemplary embodiment. Each of the at least one second device is communicatively connected to the first device through a communication link.

[0175] In this embodiment, a distributed system with a soft bus as the communication framework is formed by the first device 111 and at least one second device 112. Among them, the first device 111 serves as the host, and the second device 112 serves as the slave. The distributed system provides functions such as data interaction, computing power sharing, and storage sharing, and supports the rapid construction of data protocols and resource sharing among the electronic devices in the system, so as to achieve the maximum utilization of resources in the distributed system.

[0176] In some possible embodiments, there may usually be multiple second devices in the distributed system, and there may be a need for data interaction between the second devices, etc. In this case, the second devices that need to perform data interaction can establish communication connections with each other to complete data interaction, or the first device can be used as an intermediate node between the second devices that need to perform data interaction to transfer data. The second method does not require re - formulating the protocol and is more in line with the requirements of the current distributed system. Based on the above - mentioned embodiments, an example is given below. Refer to Figure 12 :

[0177] The data to be sent by the second device A - the bus protocol frame F. The bus protocol frame F is passed to the protocol packaging layer inside the second device A. The protocol packaging layer packages the bus protocol frame F according to the peripheral type RS232 communication protocol to form a peripheral protocol frame Fac, and then sends the peripheral protocol frame Fac through the RS232 serial port of the second device A.

[0178] The peripheral protocol frame Fac is transmitted to the first device C through the RS232 communication link and monitored by the protocol packaging layer of the first device C. The protocol packaging layer of the first device C unpacks the peripheral protocol frame Fac and restores it to the bus protocol frame F of the first device C. Then, according to the target device identifier in the bus protocol frame F, it is determined that the target device of the bus protocol frame F is the second device B. According to the link registry, the peripheral type of the communication link between the first device C and the second device B is the CAN bus.

[0179] The first device C pushes the bus protocol frame F back to the protocol packaging layer of the first device C. The protocol packaging layer disassembles and packages the bus protocol frame F according to the characteristics of the CAN communication protocol to form peripheral protocol frames Fcb1, Fcb2... (Since the maximum size of a CAN-type peripheral protocol frame is 8 bytes, it needs to be split into multiple frames for transmission). Then, the peripheral protocol frames Fcb1, Fcb2... are sent through the CAN port of the first device C.

[0180] Multiple frames such as the peripheral protocol frames Fcb1, Fcb2... are transmitted to the second device B through the CAN bus and monitored by the protocol packaging layer of the second device B. The protocol packaging layer of the second device B assembles and unpacks the peripheral protocol frames Fcb1, Fcb2... to restore them to the bus protocol frame F, and the transmission is completed.

[0181] In this embodiment, a distributed system with a soft bus as the communication framework is provided. In the distributed system, the first device is used as the host for data interaction. When other second devices in the distributed system have data interaction requirements, the first host can be used as a communication relay node, avoiding the need to rebuild the communication protocol between devices, reducing the investment in software and hardware development costs, and facilitating the management of the distributed system.

[0182] It should be noted that: the above sequence of the embodiments of the present disclosure is only for description and does not represent the superiority or inferiority of the embodiments. And the above specific embodiments of this specification have been described. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be executed in a different order from that in the embodiments and still achieve the desired results. Additionally, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0183] Those of ordinary skill in the art can understand that all or part of the steps to implement the above embodiments can be completed by hardware or by a program instructing relevant hardware.

[0184] The foregoing are only the preferred embodiments of the present disclosure, and are not intended to limit the present disclosure. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present disclosure shall be included within the protection scope of the present disclosure.

Claims

1. An interactive configuration device, characterized in that: Applied to a first device, the first device establishes a connection with a second device via a communication link, the apparatus comprising a first communication module, a first memory module and a first resource module; The first communication module is used to configure a first communication management mode of the first device according to at least one of the first device information of the first device and the first link information of the communication link; The first memory module is used to determine a first shared memory of the first device according to a first preset relationship, where the first shared memory is accessed by the first device and the second device; The first memory module is used to determine a first register of the first device according to the first preset relationship, where the first register is used for the first device and the second device to directly access first preset data; The first resource module is used to allocate a first shared resource of the first device, where the first shared resource is used by the second device; the first shared resource includes a first storage resource; The first resource module is used to: If the first storage request frame is a first configuration type storage request, allocating a first storage space for the first storage data based on a verification result of relevant parameters in the first storage request frame and relevant parameters in the first device; The first storage request frame is used to represent a first data type of the first storage data, and is a request sent by the second device to the first device to request the first device to perform an operation of accessing the first storage data in the first storage space; or; If the first storage request frame is a first log storage request, the first storage space is allocated for the first storage data.

2. The interactive configuration device according to claim 1, characterized in that: The first device information includes a first device frame format, and the first link information includes a first link frame format; The first communication module is used to configure the first communication management mode of the first device according to the first device frame format and the first link frame format, including a first format conversion mode, and the first format conversion mode includes converting the data frame format of the data to be sent into the first link frame format, or converting the data frame format of the data to be received into the first device frame format.

3. The interactive configuration device according to claim 1, characterized in that: The first link information includes a first peripheral type; The first communication module is used to configure the first communication management mode of the first device to include a first interaction mode when the first peripheral type meets a first preset condition. The first interaction mode includes sending data to the communication link at a first preset frequency, or receiving data from the communication link at a first preset frequency.

4. The interactive configuration device according to claim 1, characterized in that: The first communication module is used to configure the first communication management mode of the first device to include a first monitoring mode, and the first monitoring mode includes determining whether the connection of the communication link is normal based on data received from the communication link.

5. The interactive configuration device according to claim 1, characterized in that: The first shared memory includes at least one first register, and the first preset relationship indicates that there is a one-to-one correspondence between at least one first preset data and the at least one first register; The first memory module is used to allocate a corresponding first register to each first preset data in the at least one first preset data according to a first preset relationship.

6. The interactive configuration device according to claim 1, characterized in that: The first shared resource includes a first storage resource; The first resource module is used to: Acquire first stored data sent by the second device; According to a first data type of the first storage data, a first storage space is allocated in the first storage resource for the first storage data.

7. The interactive configuration device according to claim 1, characterized in that: The first shared resource includes a first computing power resource; The first resource module is used to: Obtaining a first algorithm identifier and a first input parameter sent by the second device; Determine, according to the first algorithm identifier, a corresponding first algorithm from the first computing power resources; The first input parameter is input into the first algorithm for operation to obtain a first operation result, and the first operation result is called by the second device.

8. The interactive configuration device according to claim 1, characterized in that: The first device calls at least one first functional module in the interactive configuration device through a first module interface, and the first module interface is configured with at least one first switch, and the at least one first switch corresponds one-to-one to the at least one first functional module, and each first switch of the at least one first switch is used to control the activation or stop of the corresponding first functional module.

9. The interactive configuration device according to any one of claims 1 to 8, characterized in that: The second device accesses the first shared memory through the first memory interface; And / or, the second device calls the first shared resource through a first resource interface.

10. An interactive configuration device, characterized in that: Applied to a second device, the second device establishes a connection with the first device via a communication link, the apparatus comprising a second communication module, a second memory module, and a second resource module; The second communication module is used to configure a second communication management mode of the second device according to at least one of the second device information of the second device and the first link information of the communication link; The second memory module is used to determine a second shared memory of the second device according to a second preset relationship, where the second shared memory is accessed by the first device and the second device; The second memory module is used to determine a second register of the second device according to the second preset relationship, where the second register is used for the first device and the second device to directly access second preset data; The second resource module is used to allocate a second shared resource to the second device, where the second shared resource is used by the first device to call; the second shared resource includes a second storage resource; The second resource module is used to: If the second storage request frame is a second configuration type storage request, allocating a second storage space for the second storage data based on a verification result of relevant parameters in the second storage request frame and relevant parameters in the second device; The second storage request frame is used to represent a second data type of the second storage data, and is a request sent by the first device to the second device to request the second device to perform an operation of accessing the second storage data in the second storage space; or; If the second storage request frame is a second log type storage request, the second storage space is allocated for the second storage data.

11. An electronic device, characterized in that: The electronic device comprises the interactive configuration device according to any one of claims 1-9.

12. An electronic device, characterized in that: The electronic device comprises the interactive configuration device as claimed in claim 10.

13. A distributed system, characterized in that: The distributed system includes a first device and at least one second device; The first device comprises the interaction configuration apparatus according to any one of claims 1 to 9, and each of the at least one second device comprises the interaction configuration apparatus according to claim 10; Each second device of the at least one second device is communicatively connected to the first device via a communication link.

Citation Information

Patent Citations

  • Resource sharing method and device and storage medium

    CN110851271A

  • Data transmission method and device thereof, storage medium, processor and electronic equipment

    CN113645258A