Interactive configuration device, electronic equipment and distributed system

By introducing interactive configuration devices into the microgrid system, data interaction and resource sharing between devices are realized, which solves the problem of insufficient local resources of the equipment, reduces hardware costs and development time, and improves system stability.

CN119363585AActive Publication Date: 2025-01-24YONG LIAN KE JI (CHANG SHU) YOU XIAN GONG SI
View PDF 8 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

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

Method used

Through interactive configuration devices, data interaction and resource sharing between electronic devices are realized, including communication modules, memory modules and resource modules, configure communication management modes, shared memory and resource allocation, and support the sharing of storage and computing power resources.

Benefits of technology

Significantly reduce the cost of hardware, quickly realize the establishment of data protocols between the devices inside the microcte 'of internal micrometers, save the relevant formulation and development time of the agreement, and improve the stability of the operation of the micro -grid system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119363585A_ABST
    Figure CN119363585A_ABST
Patent Text Reader

Abstract

The invention provides an interactive configuration device, electronic equipment and a distributed system. The interactive configuration device comprises a first communication module, a first memory module and a first resource module, the first communication module is used for configuring a first communication management mode of the first equipment according to at least one of first equipment information of the first equipment and first link information of the communication link; the first memory module is used for determining a first shared memory of the first device according to a first preset relation, and the first shared memory is used for the first device and the second device to access; and the first resource module is used for distributing a first shared resource of the first equipment, and the first shared resource is called by the second equipment. Data protocol construction in the micro-grid system can be quickly realized through the first communication module, the first device provides shared resources for the second device to call, and the stability of the micro-grid system is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] With the improvement of production and living standards, the demand for electricity is also increasing. Some areas have already experienced power outages due to insufficient power supply. Since microgrid systems can integrate multiple energy resources and loads and achieve efficient energy utilization, they have been able to develop rapidly.

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

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

[0005] In a first aspect, an embodiment of the present disclosure provides an interactive configuration device, which is applied to a first device, the first device establishes a connection with a second device through a communication link, and the device includes a first communication module, a first memory module, and a first resource module; A first communication module, 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; A first memory module, used for determining a first shared memory of the first device according to a first preset relationship, the first shared memory being accessible by the first device and the second device; The first resource module is used to allocate a first shared resource to the first device, where the first shared resource is called by the second device.

[0006] 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; 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, the first format conversion mode including 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.

[0007] In some possible embodiments, the first link information includes a first peripheral device 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 the 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.

[0008] In some possible embodiments, 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.

[0009] 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 the 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 at least one first preset data according to a first preset relationship.

[0010] In some possible embodiments, 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 to the first storage data in a first storage resource.

[0011] In some possible embodiments, 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 resource; 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.

[0012] In some possible embodiments, the first device calls at least one first functional module in the interactive configuration device through a first module interface, the first module interface is configured with at least one first switch, at least one first switch corresponds one-to-one to at least one first functional module, and each first switch of at least one first switch is used to control the activation or stop of the corresponding first functional module.

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

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

[0015] In a second aspect, an embodiment of the present disclosure provides an interactive configuration device, which is applied to a second device, the second device establishes a connection with the first device through a communication link, and the device includes a second communication module, a second memory module, and a second resource module; A second communication module, 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; A second memory module, used for determining a second shared memory of the second device according to a second preset relationship, the second shared memory being accessible by the first device and the second device; The second resource module is used to allocate a second shared resource to the second device, where the second shared resource is called by the first device.

[0016] 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; The second communication module is used 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.

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

[0018] The second communication module is used to configure the second communication management mode of the second device to include a second interaction mode when the second peripheral type meets the 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.

[0019] In some possible embodiments, the second communication module is used 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 based on data received from the communication link.

[0020] 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 the at least one second preset data and the at least one second register; The second memory module is used to allocate a corresponding second register to each second preset data in the at least one second preset data according to the second preset relationship.

[0021] In some possible embodiments, the second shared resource includes a second storage resource; The second resource module is used to: Acquire second stored data sent by the first device; According to the second data type of the second storage data, a second storage space is allocated for the second storage data in the second storage resource.

[0022] In some possible embodiments, the second shared resource includes a second computing power resource; The second resource module is used to: Obtaining a second algorithm identifier and a second input parameter sent by the first device; Determine, according to the second algorithm identifier, a corresponding second algorithm from the second computing power resources; The second input parameter is input into the second algorithm for operation to obtain a second operation result, and the second operation result is called by the first device.

[0023] In some possible embodiments, the second device calls at least one second functional 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 one-to-one to at least one second functional module, and each second switch of at least one second switch is used to control the activation or stop of the corresponding second functional module.

[0024] In some possible embodiments, the first device accesses the second shared memory through the second memory interface; In some possible embodiments, the first device calls the second shared resource through the second resource interface.

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

[0026] In a fourth aspect, an embodiment of the present disclosure provides an electronic device, the electronic device comprising the interactive configuration device as in the second aspect.

[0027] In a fifth aspect, an embodiment of the present disclosure provides a distributed system, the distributed system including a first device and at least one second device; The first device comprises the interactive configuration apparatus as described in any one of the first aspects, and each second device in at least one second device comprises the interactive configuration apparatus as described in the second aspect; Each second device of the at least one second device is communicatively connected to the first device via a communication link.

[0028] The interactive configuration device, electronic device and distributed system provided by the embodiments of the present disclosure have the following technical effects: The interactive configuration device enables data interaction and resource sharing among electronic devices, greatly reducing hardware cost investment. The first communication module can quickly implement the construction of data protocols between devices within the microgrid, saving protocol-related formulation and development time. At the same time, the first device provides shared resources through the interactive configuration device. When the second device needs resources to support new functions or data, it can call the resources of the first device to improve the stability of the microgrid system operation.

[0029] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] In order to more clearly illustrate the technical solutions and advantages of the embodiments of the present disclosure or the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0031] Figure 1 is a schematic diagram of a connection relationship of a microgrid system provided by an exemplary embodiment of the present disclosure; Figure 2 is a schematic diagram of a first module of an interactive configuration device provided by an exemplary embodiment of the present disclosure; Figure 3 is a flowchart of a first format conversion mode provided by an exemplary embodiment of the present disclosure; Figure 4 is a flowchart of a question-and-answer interaction mechanism provided by an exemplary embodiment of the present disclosure; Figure 5 is a schematic diagram of a module of a first shared memory provided by an exemplary embodiment of the present disclosure; Figure 6 is a module schematic diagram of a first storage resource provided by an exemplary embodiment of the present disclosure; Figure 7 is a module schematic diagram of a first computing power resource provided by an exemplary embodiment of the present disclosure; Figure 8 is a module schematic diagram of a first algorithm interpreter provided by an exemplary embodiment of the present disclosure; Fig. 9 is a module schematic diagram of a first module interface provided by an exemplary embodiment of the present disclosure; Fig.10 is a schematic diagram of a second module of an interactive configuration device provided by an exemplary embodiment of the present disclosure; Fig.11is a schematic diagram of a connection relationship of a distributed system provided by an exemplary embodiment of the present disclosure; Fig.12 It is a data interaction schematic diagram provided by an exemplary embodiment of the present disclosure. DETAILED DESCRIPTION

[0032] The following will be combined with the drawings in the embodiments of the present disclosure to clearly and completely describe the technical solutions in the embodiments of the present disclosure. Obviously, the described embodiments are only part of the embodiments of the present disclosure, rather than all the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present disclosure.

[0033] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, 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 "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product, or server that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products, or devices.

[0034] See also Figure 1 , Figure 1 : 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 power grid to provide power to a specific area or community. The microgrid system is also a distributed system, that is, a system composed of multiple independent but collaborative components. The microgrid system usually includes multiple related electronic devices such as inverter equipment and sampling equipment.

[0035] In order to ensure the stable operation of each electronic device in the microgrid system and improve the economic benefits, an energy management controller (EMS) is usually used to communicate with each electronic device and perform power management and regulation on each electronic device in the microgrid system.

[0036] For the existing microgrid system, there are the following situations: First, the functions of each electronic device in the microgrid system are independent of each other, and the electronic devices interact through the peripheral communication bus. The computing power resources and storage resources of each electronic device are only used by itself. The energy management controller can usually 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. These tasks are often not reused, increasing redundant work and development cycle. Third, based on the existing hardware conditions, if the existing microgrid system is to be expanded in function, the core controllers of some electronic devices may not be able to support large operations. If the hardware of the electronic equipment is to be replaced, it may lead to a significant increase in device costs and time costs.

[0037] On this basis, the embodiment of the present disclosure uses an interactive configuration device and applies it 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 by software, which allows different hardware components, modules, systems or devices to communicate and exchange data through a standardized software interface. It does not rely on the traditional hardware bus structure, but relies on an operating system or middleware. Usually in a microgrid system, a soft bus can help communication between different devices.

[0038] The interactive configuration device provided in the embodiment of the present disclosure can be used as the middleware of the soft bus and can be loaded into various devices of the microgrid system in the form of a software development kit (SDK). After loading the software development kit, the electronic device can convert it into an application to enable the various functional modules in the software development kit.

[0039] SDK usually 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 porting it to the corresponding electronic device, it can quickly complete functions such as data interaction and resource sharing deployment.

[0040] The following is a description of an interactive configuration device provided by an exemplary embodiment of the present disclosure, where the interactive configuration device is applied to a first device, and the first device establishes a connection with a second device via a communication link. For example, the first device may specifically be an energy manager in a microgrid system, and the second device may specifically be other electronic devices in the microgrid system, which may be replaced or otherwise configured according to actual conditions. This embodiment is only used as an example for ease of explanation, but is not limited thereto. In addition, in addition to being applied to microgrid systems, the interactive configuration device may also be applied to other types of distributed systems.

[0041] In addition, the first device and the second device provided in this embodiment may support a master-slave mode, that is, the first device acts as a master to control the communication process, and the second device acts as a slave to respond to control instructions of the first device.

[0042] Figure 2 is a schematic diagram of a module of an interactive configuration device, see Figure 2 The device includes a first communication module 21, a first memory module 22 and a first resource module 23.

[0043] The first communication module 21 is used 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.

[0044] Specifically, the first device information may include but is not limited to the first hardware resource information of the first device, the first protocol information of the first device, etc., and the first link information may include but is not limited to the first performance requirement information of the communication link, the first protocol information of the communication link, etc. It should be further explained 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 first link information may also carry the second device information of the second device, 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 relevant information of the second device, so as to facilitate the configuration of the communication connection between the first device and the second device.

[0045] In this embodiment, the first communication management mode can be configured to manage the communication link of the first device, such as protocol packaging, link management, data interaction, interface configuration, etc. In order to facilitate the understanding of the configuration of the first communication mode, several examples are used below to illustrate: In a specific example, the management of the protocol packaging of the first device is achieved by configuring the first communication management mode.

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

[0047] The first communication module 21 is used to configure the first communication management mode of the first device including 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.

[0048] 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.

[0049] In addition, the first device includes a protocol packaging layer, and the specific operation of the first format conversion mode can be implemented in the protocol packaging layer. The first communication module 21 configures the protocol packaging layer so that the protocol packaging layer implements the function of the first format conversion mode. In the protocol packaging layer, the data to be sent is packaged 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, the first link frame format is the CAN frame format, but a frame of the CAN frame format has only 8 valid data bytes. Therefore, it is necessary to disassemble the data to be sent in the frame format of the first device into multiple packets according to the CAN bus rules for transmission; or to receive and unpack the data to be received according to the CAN bus rules, and restore it to the data to be received in the frame format of the first device.

[0050] See also Figure 3 , the specific process includes: after the data to be sent of the first device is framed, the data to be sent is passed to the protocol packaging layer, and the protocol packaging layer packages 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 sending queue. Alternatively, the protocol packaging layer can monitor the status of the data to be received in the communication link in real time, and 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 analysis.

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

[0052] 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 two-way communication between devices, while the event-based interaction mechanism focuses on event triggering.

[0053] The type of peripheral device of the communication link can usually directly determine the selection and design of the interaction mechanism. For example, different peripheral device types have different input methods, feedback methods, application scenarios, etc. Therefore, in this embodiment, the first link information includes the first peripheral device type.

[0054] First, let’s explain the question-and-answer interaction mechanism: The first communication module 21 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 the 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.

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

[0056] For example, when the first peripheral type is RS485, the first communication management mode of the first device is configured to include a first interactive mode. Due to the particularity of the RS485 communication protocol, only the host can initiate communication and the slave can respond. If the host does not initiate communication, the slave cannot directly send data to the host.

[0057] 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 continue to receive or send data at the first preset frequency. Therefore, in the first interaction mode, the first device also introduces the setting of "empty packet frame", which is a data frame without specific data content. For details, see Figure 4 : When there is no specific data content to be sent, the first device will send an empty packet frame to the second device through the communication link at a first preset frequency; after the second device receives the empty packet frame, it will reply an empty packet frame to the first device through the communication link at the first preset frequency as a response. When there is data content to be sent, after receiving the empty packet frame sent back by the second device, the first device will replace the received empty packet frame with the 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 empty packet frame sent by the first device, the second device will replace the received empty packet frame with the data frame containing the specific data content.

[0058] Next, the event-based interaction mechanism is explained: The first communication module 21 is used to configure the first communication management mode of the first device to include a second interaction mode when the first peripheral type meets the second preset condition. The second 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.

[0059] The second interaction mode is an event-based interaction mechanism, and the second preset condition is used to characterize that the first peripheral type can support applications of the second interaction mode.

[0060] For example, when the first peripheral type is any one of RS232, CAN bus, etc., the first communication management mode of the first device is configured to include the second interaction mode. The event-based interaction mechanism has no strict timing management for sending and receiving, and data can be pushed arbitrarily.

[0061] 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 so that the protocol packaging layer can implement the corresponding data interaction function.

[0062] 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 the first device can also control the establishment of a connection between the first device and the second device according to the monitoring result.

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

[0064] Depending on the type of peripheral device in the communication link and the type of the second device, the frame type of the data received from the communication link is also different, and the frame type includes a heartbeat frame or an interaction frame. A heartbeat frame is a periodically transmitted data frame, which is usually used to maintain the active state between the first device and the second device and ensure that there is no abnormality in the communication connection of the communication link. The heartbeat frame does not transmit the actual data content, but is used to check the connection status between the 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 between the first device and the second device. Each interaction frame contains the data input, output and status changes of the first device and the data input, output and status changes of the second device, etc.

[0065] In addition, the first device includes a link management layer, and the specific operation of the first monitoring mode can be implemented in the link management layer. The link management layer will be configured with a link registration table for dynamically managing the relevant information of the communication link. The link management layer of the first device determines the connection status of the communication link with the second device in real time by monitoring the heartbeat or interaction frame. When the link management layer of the first 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, and resets it through the corresponding communication link related information in the link registration table, and waits for reconnection.

[0066] 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 between the second device and the first device by monitoring 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, and resets the corresponding communication link related information in the link registration table, and re-initiates a connection request.

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

[0068] The first shared memory is accessed by the first device and the second device, and can be used by the second device to read and write data. The first shared memory can be determined by a management personnel, 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 selected according to actual conditions.

[0069] In some possible embodiments, the first shared memory is described as follows: The first memory module 22 is used to allocate a corresponding first register to each first preset data in the at least one first preset data according to the first preset relationship.

[0070] The first shared memory includes at least one first register. At least two of the at least one first register may include a read-only register and a read-write register. The read-only register block only allows reading, and writing operations will be rejected; the read-write register block allows reading and writing operations.

[0071] Although the above-mentioned first shared memory is accessed by the first device and the second device at the same time, in most cases, the specific read and write operations are still performed 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 perform specific operations to read or write the relevant first preset data.

[0072] The first preset relationship indicates that at least one first preset data has a one-to-one correspondence with at least one first register. The first preset data includes shared data for sharing with the second device, which can be specified by the administrator according to the specific purpose of the first device. The first preset data is divided into the corresponding first register according to the first preset relationship.

[0073] For example, in the read-only register of the first device, the register address 0x0001 corresponds to voltage, and the addresses 0x00A0 to 0x00B0 correspond to a QR code string. 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 the number of registers read is 16 registers.

[0074] Specifically, participate Figure 5 , the first shared memory will include a configuration first data table, the first data table stores the first preset relationship, declares the first preset data and its corresponding first register. The interactive 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 accesses the first register by calling the corresponding first memory interface to read or write the first preset data; the first memory interface may include a first data reading interface, a first read-write data interface, etc.

[0075] In addition to the first memory interface described above, 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, and the first device or the second device will obtain the corresponding first preset data and write it into the corresponding first register according to the declared content. The first registration interface may include a first read-only data registration interface, a first read-write data registration interface, etc.

[0076] 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 by the second device. 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. Compared with the first communication module 21, the difference is that for some first preset data commonly used by the first device and the second device, they can interact directly through the first shared memory without the need for a series of operations such as framing, packaging, and unpacking through the protocol packaging layer.

[0077] The first resource module 23 is used to allocate a first shared resource to the first device, where the first shared resource is used by the second device.

[0078] The second device calls the first shared resource through the first resource interface.

[0079] Although the first shared resource is also deployed in the first device, the difference between the first shared resource and the first shared memory is that, usually, the first shared resource is only called by the second device to provide storage and computing power support for the second device.

[0080] The first shared resource provided in this embodiment includes but is not limited to a first storage resource and a first computing resource. The first resource module 23 is described below using the first storage resource and the second computing resource as examples: In some possible embodiments, the first shared resource includes a first storage resource.

[0081] The first resource module 23 is configured to obtain 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 a first data type of the first storage data.

[0082] See also Figure 6 The first storage resource includes a first storage resource manager and a first storage protocol manager. The first storage resource manager is used to manage the reading, writing, and allocation of the first storage data of the second device in the first storage space. The first storage space can be a local FLASH (non-volatile memory). The first storage protocol manager is responsible for managing the communication, transmission, and analysis of the first storage data.

[0083] The first storage resource manager caches a first storage configuration table for recording relevant parameters of the first storage data stored in the local FLASH, including but not limited to storage type, storage start address / storage path name, file size, version, verification and other parameters.

[0084] After the second device establishes a shared storage resource communication with the first device, the second device sends a first storage request frame to the first device, and the first storage management module in the first storage resource manager determines that there is no record of storing the related 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.

[0085] If not, then add the relevant parameters of the first storage data in 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.

[0086] If yes, the type of the current request is determined according to the first storage request frame, and the type of the current request includes a first configuration type storage request and a first log type storage request.

[0087] When the type of the current request is a first configuration type 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, and finally the first storage data sent by the second device is written into the reset storage area.

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

[0089] In the first storage protocol manager, after the second device establishes a shared storage resource communication with the first device, the first device will send all configuration information related to the second device in the first storage resource to the second device. The operations of the second device in the first device are all executed by the first device, and the second device writes and reads data in the first storage space by calling the first resource interface. The first resource interface can specifically be a first configuration read interface, a first configuration write interface, a first log read interface, and the like.

[0090] 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.

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

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

[0093] See also Figure 7 , in the first computing power resource, includes the first algorithm protocol manager, the first algorithm interpreter and the first algorithm management list. Among them, the first algorithm protocol manager is responsible for data interaction management such as algorithm registration, algorithm startup, and calculation 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 and algorithm process steps required and registered.

[0094] 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 includes the first algorithm identifier, the first input parameter type, the first input parameter quantity, the first output parameter type, the first output parameter quantity and the first algorithm character 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, the first device replies with a first device registration completion frame to the second device.

[0095] After completing the algorithm registration process, the first device needs to add the corresponding first algorithm to the first algorithm management list, and 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 calls the first resource interface, which can be the first algorithm startup interface, to send the first algorithm identifier and the first input parameter to the first device. The first device determines the corresponding first algorithm from the first algorithm management list based on the first algorithm identifier; inputs the first input parameter and the first algorithm into the first algorithm interpreter for operation to obtain the first operation result.

[0096] Combination Figure 7 and Figure 8 , the first algorithm interpreter is described in detail: in the first algorithm interpreter, the parsing of the first algorithm includes the following two situations: reuse of the algorithm stored in the first device and generation of the algorithm function not stored in the first device.

[0097] For the reuse of an existing algorithm, the first resource interface, which may be specifically a first algorithm calling interface, is called to write the corresponding first algorithm into the first storage space.

[0098] For the generation of algorithm functions that are not stored in the first device, the first language interpreter is required 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 variable definitions, basic four arithmetic operations, loop calculations, Fourier transforms and other common algorithm operations and interpretive language rules. The administrator can convert the required algorithm steps into a text algorithm of this rule, and enter it 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.

[0099] The first language parser will decompose the content of the first algorithm string into a first algorithm step list to be 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 operator to perform specific operations.

[0100] The first operator 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 operator converts and assigns input and output parameters of the function.

[0101] In this embodiment, computing resources can be provided to the 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.

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

[0103] The first module interface is configured with at least one first switch, and the at least one first switch corresponds to the at least one first functional module one by one, and each first switch of the at least one first switch is used to control the activation or deactivation of the corresponding first functional module. Since the memory space of the first device is limited in some scenarios, some functions can be appropriately cut to save resource usage.

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

[0105] Among them, the first function macro switch table is used to close or open some function blocks; the first function function compatibility table is used to rewrite some function functions used in the interactive configuration device. For example, under the single-chip microcomputer platform and the ARMLinux platform, the serial port sending function interface may be different. A serial port sending macro will be defined in the first function function compatibility table. The sending operation in the interactive configuration device will use this serial port sending macro. During the transplantation process, this serial port sending macro needs to be adapted and modified to meet its sending function. A series of timer functions are provided in the first timer list, such as 1ms timer, 10ms timer, etc., and the corresponding timer function can be specified as needed to trigger precise periodic polling to meet the needs of precise timing task scheduling inside the interactive configuration device. The first bus peripheral declaration table is used to specify some peripheral interfaces, parameter configuration and other information of the first device's access soft bus.

[0106] In this embodiment, data interaction and resource sharing of various electronic devices are realized through the interactive configuration device, which greatly reduces the hardware cost investment. The data protocol construction between the various devices inside the microgrid can be quickly realized through the first communication module, saving the time for protocol-related 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 large amount of computing process, 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 calculation, effectively providing support for the calculation of the second device and improving the stability and flexibility of the system.

[0107] An exemplary embodiment of the present disclosure provides an interactive configuration device. Fig.10 , applied to a second device, the second device establishes a connection with the first device through a communication link, the device includes a second communication module, a second memory module and a second resource module; The second communication module 101 is used 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 second link information of the communication link.

[0108] The second memory module 102 is used to determine a second shared memory of the second device according to the second preset relationship, and the second shared memory is accessed by the first device and the second device.

[0109] The second resource module 103 is used to allocate a second shared resource to the second device, where the second shared resource is called by the first device.

[0110] 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.

[0111] The second communication module 101 is used to configure the second communication management mode of the second device including 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.

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

[0113] The second communication module 101 is used to configure the second communication management mode of the second device to include a second interaction mode when the second peripheral type meets the 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.

[0114] In some possible embodiments, the second communication module 101 is further used 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 based on data received from the communication link.

[0115] 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 the at least one second preset data and the at least one second register; The second memory module 102 is used to allocate a corresponding second register to each second preset data in the at least one second preset data according to the second preset relationship.

[0116] In some possible embodiments, the second shared resource includes a second storage resource; The second resource module 103 is configured to obtain 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 a second data type of the second storage data.

[0117] In some possible embodiments, the second shared resource includes a second computing power resource; The second resource module 103 is used 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 resources according to the second algorithm identifier; input the second input parameter into the second algorithm for calculation to obtain a second calculation result, and the second calculation result is called by the first device.

[0118] In some possible embodiments, the second device calls at least one second functional 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 one-to-one to at least one second functional module, and each second switch of at least one second switch is used to control the activation or stop of the corresponding second functional module.

[0119] In some possible embodiments, the first device accesses the second shared memory through the second memory interface; In some possible embodiments, the first device calls the second shared resource through the second resource interface.

[0120] The interactive configuration device provided in this embodiment is applied to the second device, and its specific configuration content is similar to that when applied to the first device. Therefore, reference may be made to the description of the interactive configuration device in the previous embodiment, which will not be repeated here.

[0121] An exemplary embodiment of the present disclosure provides an electronic device, wherein the electronic device includes the interaction configuration device as in any one of the first exemplary embodiment or the interaction configuration device as in the second exemplary embodiment.

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

[0123] The first device comprises the interactive configuration device as in any one of the first exemplary embodiment, and each of the at least one second device comprises the interactive configuration device as in the second exemplary embodiment. Each of the at least one second device is communicatively connected to the first device via a communication link.

[0124] In this embodiment, a distributed system with a soft bus as a communication framework is formed by the first device 111 and at least one second device 112. The first device 111 serves as a host and the second device 112 serves as a 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 of various electronic devices in the system, thereby achieving maximum utilization of resources in the distributed system.

[0125] In some possible embodiments, there may be multiple second devices in a distributed system, and there may be a need for data interaction between the second devices. In this case, the second devices that need to interact with each other can establish a communication connection to complete the data interaction, or the first device can serve as an intermediate node between the second devices that need to interact with each other to transfer the data. The second method does not require the re-establishment of the protocol and is more in line with the needs of the current distributed system. Based on the above embodiments, an example is given, see Fig.12 : The data to be sent by the second device A - 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.

[0126] 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 will unpack the peripheral protocol frame Fac and restore 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 registration table, it is determined that the peripheral type of the communication link between the first device C and the second device B is the CAN bus.

[0127] 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 a CAN type peripheral protocol frame is at most 8 bytes, it needs to be split into multiple frames for transmission), and then the peripheral protocol frames Fcb1, Fcb2... are sent through the CAN port of the first device C.

[0128] The peripheral protocol frames Fcb1, Fcb2, etc. are transmitted to the second device B via the CAN bus and detected by the protocol packaging layer of the second device B. The protocol packaging layer of the second device B will frame and unpack the peripheral protocol frames Fcb1, Fcb2, etc., and restore them to the bus protocol frame F, and the transmission is completed.

[0129] In this embodiment, a distributed system with a soft bus as a communication framework is provided, in which a first device is used as a 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 transit node to avoid rebuilding the communication protocol between the devices, reduce the investment in software and hardware development costs, and facilitate the management of the distributed system.

[0130] It should be noted that the above-mentioned sequence of the embodiments of the present disclosure is for description only and does not represent the advantages and disadvantages of the embodiments. The above-mentioned specific embodiments of this specification are described. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0131] Those skilled in the art will appreciate that all or part of the steps to implement the above embodiments may be accomplished by hardware, or by instructing related hardware through a program.

[0132] The above description is only a preferred embodiment of the present disclosure and is not intended to limit the present disclosure. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present disclosure should be included in 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 resource module is used to allocate a first shared resource to the first device, where the first shared resource is called by the second device.

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 resource module is used to allocate a second shared resource to the second device, where the second shared resource is called by the first device.

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

  • System and method for inductively pairing devices to share data or resources

    CN102646081A

  • Sharing memory and I / O services between nodes

    CN105793830A

  • Resource management method and device

    CN109582592A

  • Shared resource allocation method and device and equipment

    CN110096355A

  • Resource sharing method and device and storage medium

    CN110851271A