WO2026001908A1 - 数据处理方法和数据处理设备 - Google Patents

数据处理方法和数据处理设备

Info

Publication number
WO2026001908A1
WO2026001908A1 PCT/CN2025/102864 CN2025102864W WO2026001908A1 WO 2026001908 A1 WO2026001908 A1 WO 2026001908A1 CN 2025102864 W CN2025102864 W CN 2025102864W WO 2026001908 A1 WO2026001908 A1 WO 2026001908A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
core
storage space
processor
memory
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
PCT/CN2025/102864
Other languages
English (en)
French (fr)
Inventor
邱适
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Contemporary Amperex Technology Co Ltd
Contemporary Amperex Future Energy Research Institute Shanghai Ltd
Original Assignee
Contemporary Amperex Technology Co Ltd
Contemporary Amperex Future Energy Research Institute Shanghai Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Contemporary Amperex Technology Co Ltd, Contemporary Amperex Future Energy Research Institute Shanghai Ltd filed Critical Contemporary Amperex Technology Co Ltd
Publication of WO2026001908A1 publication Critical patent/WO2026001908A1/zh
Pending legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F15/00Digital computers in general; Data processing equipment in general
    • G06F15/16Combinations of two or more digital computers each having at least an arithmetic unit, a program unit and a register, e.g. for a simultaneous processing of several programs
    • G06F15/163Interprocessor communication
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F15/00Digital computers in general; Data processing equipment in general
    • G06F15/16Combinations of two or more digital computers each having at least an arithmetic unit, a program unit and a register, e.g. for a simultaneous processing of several programs
    • G06F15/177Initialisation or configuration control

Definitions

  • This disclosure relates to, but is not limited to, the field of power equipment technology, and particularly to a data processing method and a data processing device.
  • the present disclosure provides a data processing method and a data processing device.
  • a first processor, a first core, and a second core cooperate with each other to complete data processing, the characteristics of different processors and different cores are fully utilized. This not only realizes multi-level control of data and meets the requirements of complex functions and high real-time performance, but also shortens the development cycle and reduces costs.
  • each piece of hardware accesses the memory in a ring manner to achieve data sharing between different pieces of hardware, which not only improves the efficiency and real-time performance of data sharing, but also reduces the possibility of memory access anomalies.
  • This disclosure provides a data processing method applied in a data processing device, the data processing device including a first processor, a second processor, and a memory, wherein the second processor is of a different type than the first processor, and the second processor includes a first core and a second core.
  • the method includes:
  • the first core retrieves first data from memory, generates a first processing result based on the first data, and stores the first processing result in memory; wherein, the first data is determined by the first processor based on a first data packet sent by an external device;
  • the second core retrieves second data from the memory, generates a second processing result based on the second data, and stores the second processing result in the memory; wherein the second data includes at least one of the following: first data and first processing result;
  • the first processor retrieves third data from memory, generates a second data packet based on the third data, and sends the second data packet to an external device; wherein the third data includes at least one of the following: a first processing result and a second processing result.
  • data processing is completed through the cooperation of the first processor, the first core, and the second core, fully utilizing the characteristics of different processors and cores.
  • This not only achieves multi-level data control, meeting the requirements of complex functions and high real-time performance, but also shortens the development cycle and reduces costs.
  • the first processor, the first core, and the second core access the memory in a ring manner to achieve data sharing among them. This not only improves the efficiency and real-time performance of data sharing but also reduces the possibility of memory access anomalies.
  • the first processor does not need to communicate with the second processor to share data, internal data communication is simplified, reducing communication complexity.
  • the first and second cores in the second processor only need to write the corresponding processing results into the memory without needing to concern themselves with subsequent data transmission and updates. This reduces the development complexity of the second processor while improving data real-time performance.
  • the first core retrieves first data from memory, including: the first core retrieves the first data from memory in response to detecting a first trigger event generated by the first processor; the second core retrieves second data from memory, including: the second core retrieves the second data from memory in response to detecting a second trigger event generated by the first core.
  • the first core obtains the first data shared by the first processor from the memory through a trigger event generated by the first processor, thereby increasing the frequency and accuracy of data sharing between the first core and the first processor and reducing the possibility of memory access anomalies;
  • the second core obtains the second data shared by the first core and the first processor from the memory through a trigger event generated by the first core, thereby increasing the frequency and accuracy of data sharing between the second core and the first core and the first processor and further reducing the possibility of memory access anomalies.
  • the memory includes a receiving storage space and a transmitting storage space.
  • the data processing method further includes: a first core initializing the memory based on a configuration file corresponding to the data processing device to obtain the receiving storage space and the transmitting storage space; wherein the receiving storage space is used to store data to be processed, and the transmitting storage space is used to store data to be transmitted.
  • the data to be processed includes at least one of the following: first data and a first processing result.
  • the data to be transmitted includes at least one of the following: a first processing result and a second processing result.
  • the memory is allocated in real time through the configuration file corresponding to the data processing device to obtain various storage spaces for storing shared data. This not only improves the accuracy of the storage space, but also reduces the possibility of data interference and memory access anomalies by storing different types of data through different storage spaces.
  • the receiving storage space includes a first receiving storage space corresponding to a first core and a second receiving storage space corresponding to a second core
  • the transmitting storage space includes a first transmitting storage space corresponding to a first core and a second transmitting storage space corresponding to a second core
  • the first core retrieves first data from the memory, including: the first core retrieves the first data from the first receiving storage space
  • the first core stores a first processing result in the memory, including: the first core stores the first processing result in the second receiving storage space, and/or, the first core stores the first processing result in the first transmitting storage space
  • the second core retrieves second data from the memory, including: the second core retrieves the first data from the first receiving storage space, and/or, the second core retrieves the first processing result from the second receiving storage space
  • the second core stores the second processing result in the memory, including: the second core stores the second processing result in the second transmitting storage space.
  • the first processor includes at least one communication interface of at least one type
  • the data processing method further includes: the first processor receiving a first data packet sent by an external device through a target communication interface; wherein the target communication interface is one of at least one communication interfaces of at least one type; the first processor parses the first data packet according to the communication protocol corresponding to the target communication interface to obtain initial data, determines the first data based on the initial data, and stores the first data in a memory.
  • the first processor communicates with external devices through various communication interfaces of different types, making full use of the performance of the first processor, improving the compatibility of the data processing device, and broadening the application scenarios of the data processing device; secondly, the first processor parses data packets in real time through the communication protocol corresponding to the target communication interface, improving the accuracy of shared data; finally, the first processor stores the first data in the memory in a timely manner to facilitate data sharing with the first core and the second core.
  • the first processor generates a second data packet based on the third data, including: the first processor generates a second data packet based on the third data and the communication protocol corresponding to the target communication interface; the first processor sends the second data packet to an external device, including: the first processor sends the second data packet to the external device through the target communication interface.
  • the first processor generates data packets in real time through the communication protocol corresponding to the target communication interface, thereby improving the accuracy of the data packets; on the other hand, the first processor sends data packets through the target communication interface, thereby improving the accuracy of data transmission.
  • This disclosure provides a data processing device, including a first processor, a second processor, and a memory.
  • the second processor is of a different type than the first processor, and the second processor includes a first core and a second core, wherein:
  • a first processor is configured to receive a first data packet sent by an external device; determine first data based on the first data packet; and store the first data in a memory.
  • the first core is used to retrieve first data from memory; generate a first processing result based on the first data; and store the first processing result in memory.
  • the second core is used to retrieve second data from memory; generate a second processing result based on the second data; and store the second processing result in memory; wherein the second data includes at least one of the following: first data and a first processing result;
  • the first processor is further configured to retrieve third data from memory; generate a second data packet based on the third data; and send the second data packet to an external device; wherein the third data includes at least one of the following: a first processing result and a second processing result.
  • data processing is completed through the cooperation of the first processor, the first core, and the second core, fully utilizing the characteristics of different processors and cores.
  • This not only achieves multi-level data control, meeting the requirements of complex functions and high real-time performance, but also shortens the development cycle and reduces costs.
  • the first processor, the first core, and the second core access the memory in a ring manner to achieve data sharing among them. This not only improves the efficiency and real-time performance of data sharing but also reduces the possibility of memory access anomalies.
  • the first processor does not need to communicate with the second processor to share data, internal data communication is simplified, reducing communication complexity.
  • the first and second cores in the second processor only need to write the corresponding processing results into the memory without needing to concern themselves with subsequent data transmission and updates. This reduces the development complexity of the second processor while improving data real-time performance.
  • the first processor includes at least one communication interface of at least one type; the first processor is further configured to receive a first data packet sent by an external device through a target communication interface; wherein the target communication interface is one of at least one communication interfaces of at least one type; the first data packet is parsed according to the communication protocol corresponding to the target communication interface to obtain initial data, and the first data is determined based on the initial data.
  • the first processor communicates with external devices through various communication interfaces of different types, making full use of the performance of the first processor, improving the compatibility of the data processing device, and broadening the application scenarios of the data processing device; secondly, the first processor parses data packets in real time through the communication protocol corresponding to the target communication interface, improving the accuracy of shared data; finally, the first processor stores the first data in the memory in a timely manner to facilitate data sharing with the first core and the second core.
  • the first processor is further configured to generate a second data packet based on the third data and the communication protocol corresponding to the target communication interface, and send the second data packet to an external device through the target communication interface.
  • the first processor generates data packets in real time through the communication protocol corresponding to the target communication interface, thereby improving the accuracy of the data packets; on the other hand, the first processor sends data packets through the target communication interface, thereby improving the accuracy of data transmission.
  • the first core is further configured to retrieve first data from memory in response to detecting a first trigger event generated by the first processor; the second core is further configured to retrieve second data from memory in response to detecting a second trigger event generated by the first core.
  • the first core obtains the first data shared by the first processor from the memory through a trigger event generated by the first processor, thereby increasing the frequency and accuracy of data sharing between the first core and the first processor and reducing the possibility of memory access anomalies;
  • the second core obtains the second data shared by the first core and the first processor from the memory through a trigger event generated by the first core, thereby increasing the frequency and accuracy of data sharing between the second core and the first core and the first processor and further reducing the possibility of memory access anomalies.
  • the first processor includes a first processing module, the first core includes a second processing module, and the second core includes a third processing module.
  • the first processing module is used to determine first data based on a first data packet; the second processing module is used to generate a first processing result based on the first data; and the third processing module is used to generate a second processing result based on second data.
  • the first processing time is less than the third processing time, and the third processing time is less than the second processing time.
  • the first processing time is the time it takes for the first processing module to determine the first data
  • the second processing time is the time it takes for the second processing module to generate the first processing result
  • the third processing time is the time it takes for the third processing module to generate the second processing result.
  • data is processed by deploying processing modules with different processing durations in different processors and different cores, which makes full use of the characteristics of different processors and different cores, and improves the real-time performance of data processing while meeting the complex functions of the device.
  • the first core carries an operating system or bare-metal program
  • the second core carries a bare-metal program
  • the data processing device integrates a system-on-a-chip (SoC), in which a first processor, a second processor, and a memory are all located, and the first processor, the second processor, and the memory communicate through the SoC's bus.
  • SoC system-on-a-chip
  • the first processor includes a first interrupt module, which generates a first trigger event so that the first core retrieves first data from memory based on the first trigger event.
  • the first core is triggered to obtain the first data shared by the first processor by a trigger event generated by the first interrupt module integrated in the first processor. This improves the frequency and accuracy of data sharing between the first core and the first processor and reduces the possibility of memory access errors.
  • the first core includes a second interrupt module, which generates a second trigger event so that the second core retrieves second data from memory based on the second trigger event.
  • the second core is triggered to obtain the second data shared by the first core and the first processor by the triggering event generated by the second interrupt module integrated in the first core. This improves the frequency and accuracy of data sharing between the second core, the first core and the first processor, and reduces the possibility of memory access errors.
  • the memory includes a receiving storage space and a transmitting storage space.
  • the receiving storage space is used to store data to be processed, and the transmitting storage space is used to store data to be sent.
  • the data to be processed includes at least one of the following: first data and a first processing result.
  • the data to be sent includes at least one of the following: a first processing result and a second processing result.
  • the receiving storage space and the transmitting storage space are generated by the first core based on the configuration file corresponding to the data processing device.
  • the memory is allocated in real time through the configuration file corresponding to the data processing device to obtain various storage spaces for storing shared data. This not only improves the accuracy of the storage space, but also reduces the possibility of data interference and memory access anomalies by storing different types of data through different storage spaces.
  • the receiving storage space includes a first receiving storage space corresponding to a first core and a second receiving storage space corresponding to a second core
  • the transmitting storage space includes a first transmitting storage space corresponding to a first core and a second transmitting storage space corresponding to a second core
  • the first core is further configured to obtain first data from the first receiving storage space; store a first processing result in the second receiving storage space, and/or store the first processing result in the first transmitting storage space
  • the second core is further configured to obtain first data from the first receiving storage space, and/or obtain a first processing result from the second receiving storage space; and store a second processing result in the second transmitting storage space.
  • Figure 1 is a schematic diagram of the implementation flow of a data processing method provided in an embodiment of this disclosure
  • Figure 2 is a schematic diagram of the composition structure of a data processing device provided in an embodiment of this disclosure
  • Figure 3 is a schematic diagram of the implementation flow of a memory initialization method provided in an embodiment of this disclosure
  • Figure 4 is a schematic diagram of the composition structure of a data processing device provided in an embodiment of this disclosure.
  • Figure 5 is a schematic diagram of the implementation flow of a data processing method provided in an embodiment of this disclosure.
  • Figure 6 is a schematic diagram of the implementation flow of a data processing method provided in an embodiment of this disclosure.
  • first, second, third are used merely to distinguish similar objects and do not represent a specific ordering of objects. It is understood that “first, second, third” may be interchanged in a specific order or sequence where permitted, so that the embodiments of this disclosure described herein can be implemented in an order other than that illustrated or described herein.
  • This disclosure provides a data processing method.
  • data processing is completed through the cooperation of a first processor, a first core, and a second core, fully utilizing the characteristics of different processors and cores. This not only achieves multi-level data control, meeting the requirements of complex functions and high real-time performance, but also shortens the development cycle and reduces costs.
  • the first processor, the first core, and the second core access memory in a ring-shaped manner to achieve data sharing among them. This not only improves the efficiency and real-time performance of data sharing but also reduces the possibility of memory access anomalies.
  • the first processor does not need to communicate with the second processor to share data, internal data communication is simplified, reducing communication complexity.
  • the method provided in this disclosure can be executed by an electronic device, which can be a laptop, tablet, desktop computer, set-top box, mobile device (e.g., mobile phone, portable music player, personal digital assistant, dedicated messaging device, portable gaming device), or a server.
  • an electronic device can be a laptop, tablet, desktop computer, set-top box, mobile device (e.g., mobile phone, portable music player, personal digital assistant, dedicated messaging device, portable gaming device), or a server.
  • a server can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms.
  • cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms.
  • FIG. 1 is a schematic flowchart of a data processing method according to an embodiment of this disclosure, applied in a data processing device.
  • the data processing device includes a first processor, a second processor, and a memory.
  • the type of the second processor is different from that of the first processor.
  • the second processor includes a first core and a second core. As shown in Figure 1, the method includes steps S11 to S13, wherein:
  • Step S11 The first core retrieves first data from the memory, generates a first processing result based on the first data, and stores the first processing result in the memory; wherein, the first data is determined by the first processor based on the first data packet sent by the external device.
  • the data processing device can be any suitable device capable of performing this function.
  • the data processing device is primarily used to process data from external devices.
  • the external device can be any suitable device, such as an energy storage device.
  • An energy storage device can be any suitable device capable of storing energy such as electrical energy or solar energy.
  • a power energy storage device refers to a device that converts electrical energy into other forms for storage, so that it can be released for power supply when needed, such as a battery.
  • the external device is communicatively connected to the data processing device.
  • the first processor can be any suitable processor, such as an FPGA (Field Programmable Gate Array).
  • FPGA Field Programmable Gate Array
  • the second processor can be any suitable processor, such as an ARM (Advanced RISC Machines) processor, a CPU (Central Processing Unit), or a DSP (Digital Signal Processor).
  • the second processor includes at least a first core and a second core. In some implementations, the second processor may also include other cores.
  • the core also known as the kernel, is the most important component of the second processor. Different cores may have the same or different performance characteristics.
  • the memory can be any suitable unit capable of implementing data storage functions, such as RAM (Random Access Memory), OCM (On-Chip Memory), etc.
  • the data processing device can integrate a System on Chip (SoC), in which the first processor, the second processor, and the memory are all located.
  • SoC System on Chip
  • the first data packet includes at least first data, which may refer to the payload data in the first data packet.
  • the first data can be any suitable power data, such as voltage, current, etc.
  • the first data may be different for different power devices.
  • the first data may be parameters related to the energy storage device. Parameters related to the energy storage device may include, but are not limited to, parameters of battery products (e.g., single cells, battery modules, battery packs, etc.), switch parameters, etc.
  • Battery product parameters may include, but are not limited to, current, voltage, power, temperature, state of charge, capacity, etc.
  • Switch parameters may include, but are not limited to, voltage, current, resistance, etc.
  • the first data may include, but is not limited to, at least one of the payload data in the first data packet, the rated data of the data processing device, etc.
  • the first data may include the actual voltage transmitted by the external device and the rated voltage of the data processing device.
  • the data packets can be transmitted in any suitable manner, such as a bus or communication interface.
  • the bus can include, but is not limited to, CAN (Controller Area Network) bus, Ethernet bus, etc.
  • the communication interface can be any suitable interface, such as LVDS (Low-Voltage Differential Signaling) interface, SRIO (Serial RapidIO) interface, Ethernet interface, FT3 interface, GT (Gigabyte Transceiver) interface, etc.
  • the first processor parses the first data packet to obtain the first data, and stores the first data in memory in a timely manner for sharing with the first core, second core, and other hardware.
  • the external device can assemble communication information and first data according to the communication protocol corresponding to the communication interface to obtain a first data packet.
  • a communication protocol refers to the rules and agreements that two entities must follow to complete communication or services.
  • Different communication interfaces can correspond to different communication protocols.
  • the communication information for the same communication protocol can be different.
  • FT3 data packets generated by the FT3 protocol can include, but are not limited to, frame headers, frame lengths, and frame formats.
  • the frame format can define any number of data blocks. In practice, because different manufacturers' FT3 interfaces use different frame formats, different rates, and different encoding information, different manufacturers' FT3 interfaces correspond to different communication information.
  • Encoding information can include, but is not limited to, encoding methods and polarities.
  • Encoding methods can include, but are not limited to, Manchester encoding and differential Manchester encoding.
  • Polarities can include, but are not limited to, 0 and 1, where 1 can represent a transition from low to high, and 0 can represent a transition from high to low.
  • step S11 "the first core retrieves the first data from the memory,” includes step S111, wherein:
  • Step S111 In response to detecting the first trigger event generated by the first processor, the first core retrieves the first data from the memory.
  • the triggering event (including the first triggering event and other triggering events mentioned later) can be any suitable event, such as a timed triggering event, a random triggering event, or a specified triggering event.
  • Timed triggering events are primarily events triggered using a timer.
  • Random triggering events can refer to triggering events generated using random numbers.
  • Specified triggering events can be pre-specified triggering events. For example, a timer is set in the first processor to periodically generate an interrupt (corresponding to the first triggering event). Another example is that the first triggering event is generated after the first processor stores the first data in memory.
  • the first core when the first core detects the first trigger event, it retrieves the first data from the memory.
  • the first core obtains the first data shared by the first processor from the memory through the trigger event generated by the first processor, which improves the frequency and accuracy of data sharing between the first core and the first processor and reduces the possibility of memory access anomalies.
  • the first processing result can be any suitable result. For example, it could be the control result of starting/stopping or protection in power equipment. Or it could be parameters calculated based on the first data.
  • the first core can determine the first processing result through an internal second processing module.
  • the second processing module can be any suitable module capable of implementing this function, such as control software. In practice, this control software can be a program with a runtime of milliseconds or longer, which does not have high requirements for real-time performance or periodicity and has a certain degree of fault tolerance.
  • the first core determines the first processing result, it promptly writes the first processing result into the memory so that it can be shared with hardware such as the second core and the first processor.
  • Step S12 The second core retrieves second data from the memory, generates a second processing result based on the second data, and stores the second processing result in the memory; wherein, the second data includes at least one of the following: first data and first processing result.
  • the second core retrieves the second data by reading the memory.
  • different types of second data correspond to different storage locations.
  • step S12 "the second core retrieves the second data from the memory,” includes step S121, wherein:
  • Step S121 In response to detecting the second trigger event generated by the first core, the second core retrieves the second data from the memory.
  • the second triggering event can be any suitable event.
  • the first core stores the first processing result in memory, it generates a soft interrupt (corresponding to the second triggering event).
  • the second core detects the second triggering event, it retrieves the second data from memory.
  • the second core obtains second data shared by the first core and the first processor from the memory through the trigger event generated by the first core, which improves the frequency and accuracy of data sharing between the second core, the first core and the first processor, and further reduces the possibility of memory access anomalies.
  • the second processing result can be any suitable result, such as the execution result of an algorithm.
  • the second core can determine the second processing result through an internal third processing module.
  • the third processing module can be any suitable module capable of implementing this function, such as algorithm software.
  • the algorithm software can be a program with a runtime in the range of microseconds to hundreds of microseconds, and the algorithm software has high requirements for real-time performance and periodicity.
  • the time taken for the third processing module to generate the second processing result is less than the time taken for the second processing module to generate the first processing result.
  • the second core determines the second processing result, it promptly writes the second processing result into the memory so that it can be shared with the first processor.
  • Step S13 The first processor retrieves third data from the memory, generates a second data packet based on the third data, and sends the second data packet to an external device; wherein the third data includes at least one of the following: a first processing result and a second processing result.
  • the first processor retrieves the third data by reading from memory.
  • different third data correspond to different storage locations.
  • the second data packet can be the third data, or it can be obtained by assembling or packaging the third data.
  • the second data packet can be sent in any suitable manner, such as via a bus or communication interface.
  • the first processor can directly send the third data to an external device, or it can assemble the third data according to the communication protocol corresponding to the target communication interface to obtain the second data packet.
  • the second core after the second core writes the second processing result to memory, it notifies the first processor to retrieve the third data from memory.
  • This notification can be made in any suitable manner, such as broadcasting or writing to a register.
  • the second core can notify the first processor to read the third data promptly by writing to a register of the first processor.
  • data processing is completed through the cooperation of the first processor, the first core, and the second core, fully utilizing the characteristics of different processors and cores.
  • This not only achieves multi-level data control, meeting the requirements of complex functions and high real-time performance, but also shortens the development cycle and reduces costs.
  • the first processor, the first core, and the second core access the memory in a ring manner to achieve data sharing among them. This not only improves the efficiency and real-time performance of data sharing but also reduces the possibility of memory access anomalies.
  • the first processor does not need to communicate with the second processor to share data, internal data communication is simplified, reducing communication complexity.
  • the first and second cores in the second processor only need to write the corresponding processing results into the memory without needing to concern themselves with subsequent data transmission and updates. This reduces the development complexity of the second processor while improving data real-time performance.
  • the memory includes a receiving storage space and a transmitting storage space, and the method further includes step S14, wherein:
  • Step S14 The first core initializes the memory based on the configuration file corresponding to the data processing device to obtain the receiving storage space and the sending storage space.
  • the receiving storage space is used to store data to be processed, which includes at least one of the following: first data and a first processing result.
  • the receiving storage space may include at least one storage block, and each storage block may be of uniform size.
  • the memory may be pre-divided according to a set size to obtain several storage blocks.
  • the receiving storage space may include, but is not limited to, at least one of a first receiving storage space corresponding to a first core and a second receiving storage space corresponding to a second core.
  • the first receiving storage space is used to store data processed by the first core; in implementation, the first processor may store the first data in the first receiving storage space.
  • the second receiving storage space is used to store data processed by the second core; in implementation, the first core may store the first processing result in the second receiving storage space.
  • the sizes of the first receiving storage space and the second receiving storage space may be the same or different.
  • the sending storage space is used to store data to be sent, which includes at least one of the following: a first processing result and a second processing result.
  • the sending storage space may also include at least one storage block, and each storage block may be of uniform size.
  • the sending storage space is different from the receiving storage space.
  • the sending storage space may include, but is not limited to, at least one of a first sending storage space corresponding to a first core and a second sending storage space corresponding to a second core.
  • the first sending storage space is used to store data sent by the first core; in implementation, the first core may store the first processing result in the first sending storage space.
  • the second sending storage space is used to store data sent by the second core; in implementation, the second core may store the second processing result in the second sending storage space.
  • the first sending storage space and the second sending storage space may be the same size or different sizes.
  • This configuration file may include at least the configuration information for storage spaces (including sending and receiving storage spaces).
  • the storage is dynamically configured based on this configuration information to obtain the various storage spaces.
  • the configuration information for each storage space may include, but is not limited to, the storage space's identifier, size, base address, offset address, and belonging object.
  • the belonging object describes the user of that storage space.
  • This configuration file can be any type of file, such as XML (Extensible Markup Language) files, WORD, EXCEL, HTML (Hypertext Markup Language) files, etc.
  • the configuration file can be obtained in any suitable way.
  • the configuration file can be pre-stored in the data processing device.
  • another device can send the configuration file to the data processing device.
  • the receive storage space is allocated using the baddr and size fields in the RRAM_CFG tag of the configuration file.
  • the base address of the receive storage space is 0x10000 and the size is 4096KB.
  • the first receive storage space and the second receive storage space are allocated using the id, user, offset, and size fields in the RAM tag.
  • the first receive storage space is identified as 1, belongs to the first core, has an offset address of 0x1000, and a size of 256KB.
  • the second receive storage space is identified as 2, belongs to the second core, has an offset address of 0x2000, and a size of 1024KB.
  • the transmit storage space is allocated using the baddr and size fields in the TRAM_CFG tag of the configuration file.
  • the base address of the transmit storage space is 0x20000, and the size is 2048KB.
  • the first transmit storage space and the second transmit storage space are allocated using the id, user, offset, and size fields in the RAM tag.
  • the first transmit storage space is identified as 1, belongs to the first core, has an offset address of 0x1000, and a size of 64KB.
  • the second receive storage space is identified as 2, belongs to the second core, has an offset address of 0x1100, and a size of 128KB.
  • the memory is allocated in real time through the configuration file corresponding to the data processing device to obtain various storage spaces for storing shared data. This not only improves the accuracy of the storage space, but also reduces the possibility of data interference and memory access anomalies by storing different types of data through different storage spaces.
  • the receiving storage space includes a first receiving storage space corresponding to the first core and a second receiving storage space corresponding to the second core
  • the transmitting storage space includes a first transmitting storage space corresponding to the first core and a second transmitting storage space corresponding to the second core
  • the step S11 of “the first core obtaining first data from the memory” includes step S151
  • the step S11 of "the first core storing the first processing result into the memory” includes step S152
  • the step S12 of "the second core obtaining second data from the memory” includes step S153
  • the step S12 of "the second core storing the second processing result into the memory” includes step S154
  • Step S151 The first core obtains the first data from the first receiving storage space.
  • the first processor writes the first data into the first receiving storage space through a write operation.
  • Step S152 The first core stores the first processing result in the second receiving storage space, and/or the first core stores the first processing result in the first sending storage space.
  • the first core can write the first processing result to the second receiving storage space and/or the first sending storage space through write operations, according to actual needs.
  • the first processing result needs to be transmitted to the second core, it needs to be written to the second receiving storage space; if the first processing result does not need to be transmitted to the second core, it does not need to be written to the second receiving storage space.
  • the first processing result needs to be transmitted to the first processor, it needs to be written to the first sending storage space; if the first processing result does not need to be transmitted to the first processor, it does not need to be written to the first sending storage space.
  • Step S153 The second core obtains the first data from the first receiving storage space, and/or the second core obtains the first processing result from the second receiving storage space.
  • the second core reads the first data and/or the first processing result through read operations according to actual needs.
  • the second core when the second core needs to further process the first processing result, it can obtain the first processing result through read operations; when the second core needs to process the first data, it can obtain the first data through read operations.
  • Step S154 The second core stores the second processing result into the second transmission storage space.
  • the second core stores the second processing result into the second sending storage space through a write operation.
  • the first data may include the rated voltage value of the data processing device and the actual voltage value sent by the external device.
  • the first processor writes the first data into the first receiving storage space through a write operation.
  • the first core obtains the rated voltage from the first receiving storage space through a read operation
  • the first core calculates the PI parameter (corresponding to the first processing result) based on the rated voltage, and stores the PI parameter to the second receiving storage space through a write operation;
  • the second core obtains the rated voltage and actual voltage from the first receiving storage space and the PI parameter from the second receiving storage space through a read operation.
  • the second core obtains the PI calculation result (corresponding to the aforementioned second processing result) based on the rated voltage, actual voltage, and PI parameters, and stores the PI calculation result in the second transmission storage space through a write operation.
  • the first processor includes at least one communication interface of at least one type, and the method further includes steps S161 to S162, wherein:
  • Step S161 The first processor receives a first data packet sent by an external device through a target communication interface; wherein the target communication interface is a communication interface of at least one type of communication interface.
  • the first processor includes multiple types of communication interfaces, such as FT3 interface, GT interface, LVDS interface, Ethernet interface, etc., and the number of each type of interface can be at least one.
  • the first processor includes gigabit network interface, 100 Mbps network interface, etc.
  • the target communication interface can be any communication interface, such as FT3 interface.
  • the first processor receives a first data packet containing the actual voltage (corresponding to the first data) sent by an external device through the FT3 interface.
  • Step S162 The first processor parses the first data packet according to the communication protocol corresponding to the target communication interface to obtain initial data, determines the first data based on the initial data, and stores the first data in the memory.
  • the first data can be initial data or data obtained after preprocessing the initial data. Preprocessing can include, but is not limited to, splitting, sorting, and assembling.
  • the first processor can integrate a first processing module to preprocess the initial data.
  • the first processing module can be any suitable module capable of implementing this function, such as data processing software.
  • the data processing software can be a program with a runtime in the nanosecond or hundred-nanosecond range, and the data processing software has high real-time requirements.
  • the time taken for the first processing module to determine the first data is less than the time taken for the third processing module to determine the second processing result.
  • the first data packet before parsing the first data packet, it can be verified according to a preset verification rule. If the verification passes, the first data packet can then be parsed.
  • a preset verification rule may use different verification rules. These verification rules may include, but are not limited to, whether the content of the communication information in the first data packet is legal and correct.
  • the first processor writes the first data into the memory through a write operation.
  • the first processor communicates with external devices through various communication interfaces of different types, making full use of the performance of the first processor, improving the compatibility of the data processing device, and broadening the application scenarios of the data processing device; secondly, the first processor parses data packets in real time through the communication protocol corresponding to the target communication interface, improving the accuracy of shared data; finally, the first processor stores the first data in the memory in a timely manner to facilitate data sharing with the first core and the second core.
  • step S13 "the first processor generates a second data packet based on the third data and sends the second data packet to an external device," includes step S131, wherein:
  • Step S131 The first processor generates a second data packet based on the communication protocol corresponding to the third data and the target communication interface, and sends the second data packet to the external device through the target communication interface.
  • the target communication interface can be any communication interface, such as an FT3 interface, a GT interface, etc. Different communication interfaces may correspond to different communication protocols.
  • the first processor assembles the third data into packets according to the communication protocol corresponding to the target communication interface to obtain the second data packet, and then sends the second data packet to the external device.
  • the first processor generates data packets in real time through the communication protocol corresponding to the target communication interface, thereby improving the accuracy of the data packets; on the other hand, the first processor sends data packets through the target communication interface, thereby improving the accuracy of data transmission.
  • FIG. 2 is a schematic diagram of the composition structure of a data processing device provided in this disclosure.
  • the data processing device 20 includes a first processor 21, a second processor 22, and a memory 23.
  • the type of the second processor is different from that of the first processor.
  • the second processor 22 includes a first core 221 and a second core 222, wherein:
  • the first processor 21 is configured to receive a first data packet sent by an external device; determine first data based on the first data packet; and store the first data in a memory.
  • the first core 221 is used to retrieve first data from memory; generate a first processing result based on the first data; and store the first processing result in memory.
  • the second core 222 is used to retrieve second data from memory; generate a second processing result based on the second data; and store the second processing result in memory; wherein the second data includes at least one of the following: first data and a first processing result;
  • the first processor 21 is further configured to retrieve third data from memory; generate a second data packet based on the third data; and send the second data packet to an external device; wherein the third data includes at least one of the following: a first processing result and a second processing result.
  • the data processing device can be any suitable device.
  • the data processing device has many and complex functions, and also has high requirements for control accuracy and real-time performance.
  • the first processor can be any suitable processor, such as an FPGA.
  • the first data packet can be any suitable data packet.
  • the first data packet includes at least first data, which may refer to the payload data in the first data packet.
  • the external device can assemble the first data into packets according to the communication protocol corresponding to the target communication interface to obtain the first data packet.
  • the target communication interface refers to the interface through which the external device communicates with the data processing device.
  • the target communication interface may include, but is not limited to, an FT3 interface, a GT interface, etc.
  • the process by which the first processor determines the first data can be found in the specific implementation of the aforementioned step S162.
  • the first processor includes a first interrupt module, which generates a first trigger event so that the first core retrieves first data from memory based on the first trigger event.
  • the first interrupt module can be any suitable module capable of implementing this function.
  • the first trigger event can be any suitable event, such as a timed trigger event, a random trigger event, or a specified trigger event.
  • the first interrupt module can use a timer to generate the first trigger event periodically.
  • the first interrupt module can generate the first trigger event after detecting that the first processor has written the first data to memory. In practice, the first data is retrieved from memory only after the first core detects the first trigger event.
  • the first core is triggered to obtain the first data shared by the first processor by a trigger event generated by the first interrupt module integrated in the first processor. This improves the frequency and accuracy of data sharing between the first core and the first processor and reduces the possibility of memory access errors.
  • the second processor can be any suitable processor, such as an ARM processor, CPU, DSP, etc.
  • the second processor must include at least a first core and a second core.
  • the first and second cores can be configured to run in AMP (Asymmetric Multi-Processing), SMP (Symmetric Multi-Processing), or BMP (Bond Multi-Processing) architectures.
  • AMP Asymmetric Multi-Processing
  • SMP Symmetric Multi-Processing
  • BMP Bill Multi-Processing
  • the first and second cores are configured as a master core and a slave core, with each core running different tasks relatively independently.
  • Each core can carry and run a different operating system or bare-metal program, and the cores start sequentially without interfering with each other.
  • the first core carries an operating system or bare-metal program
  • the second core carries a bare-metal program
  • the operating system can be any suitable operating system, such as Microsoft Windows, macOS, Linux, Google ChromeOS, iOS, Android, etc.
  • some power equipment uses a visual development approach.
  • the runtime environment of visual development is relatively complex and usually requires the participation of an operating system. Therefore, the operating system can be installed in the first core.
  • Bare-metal programming typically refers to programs with specific functions developed without an operating system, and these programs do not depend on an operating system to run.
  • the second core primarily implements various algorithms in power control, and can operate without an operating system to ensure the accuracy and real-time performance of the algorithms.
  • the first processing result can be any suitable result. For example, it could be the control result of starting, stopping, or protecting electrical equipment. Or it could be a parameter calculated based on the first data.
  • the first core determines the first processing result through internal control software. In practice, the process by which the first core determines the first processing result can be found in the specific implementation of step S11 described above.
  • the first core includes a second interrupt module, which generates a second trigger event so that the second core retrieves second data from memory based on the second trigger event.
  • the second interrupt module can be any suitable module capable of implementing this function.
  • the second trigger event can be any suitable event, such as a timed trigger event, a random trigger event, or a specified trigger event.
  • the second interrupt module can use a timer to periodically generate the second trigger event.
  • the second interrupt module can generate the second trigger event after detecting that the first core has written the second data to memory. In practice, the second core retrieves the second data from memory after detecting the second trigger event.
  • the second core is triggered to obtain the second data shared by the first core and the first processor by the triggering event generated by the second interrupt module integrated in the first core. This improves the frequency and accuracy of data sharing between the second core, the first core and the first processor, and reduces the possibility of memory access errors.
  • the second processing result can be any suitable result.
  • the execution result of an algorithm the second core determines the second processing result through internal algorithm software.
  • the process by which the second core determines the second processing result can be found in the specific implementation of step S12 described above.
  • the memory can be any suitable unit that can perform data storage functions, such as RAM, OCM, etc.
  • the memory includes a receiving storage space and a transmitting storage space.
  • the receiving storage space is used to store data to be processed, and the transmitting storage space is used to store data to be sent.
  • the data to be processed includes at least one of the following: first data and a first processing result.
  • the data to be sent includes at least one of the following: a first processing result and a second processing result.
  • the receiving storage space and the transmitting storage space are generated by the first core based on the configuration file corresponding to the data processing device.
  • the receiving storage space may include at least one storage block, and each storage block may be of the same size.
  • the sending storage space may also include at least one storage block, and each storage block may be of the same size.
  • the configuration file can be any type of file, such as XML, Word, Excel, HTML, etc.
  • the configuration file may include at least configuration information for the storage space (including sending storage space and receiving storage space).
  • the memory is dynamically configured based on this configuration information to obtain the various storage spaces.
  • the process of generating the receiving storage space and sending storage space can be found in the specific implementation of step S14 above.
  • FIG. 3 is a schematic flowchart of a memory initialization method provided in an embodiment of this disclosure. As shown in Figure 3, the method includes steps S301 to S305, wherein:
  • Step S301 The first core determines whether the configuration file exists. If it exists, proceed to step S302; otherwise, proceed to step S304.
  • Step S302 The first core determines whether the configuration file has been successfully parsed. If yes, proceed to step S303; otherwise, proceed to step S304.
  • Step S303 The first core initializes the memory according to the configuration information in the configuration file to obtain each storage space, and then proceeds to step S305;
  • the first core can synchronize the various storage spaces to the first processor and the second core.
  • Step S304 The first core reported initialization failure
  • the memory is allocated in real time through the configuration file corresponding to the data processing device to obtain various storage spaces for storing shared data. This not only improves the accuracy of the storage space, but also reduces the possibility of data interference and memory access anomalies by storing different types of data through different storage spaces.
  • the first processor includes a first processing module, the first core includes a second processing module, and the second core includes a third processing module.
  • the first processing module is used to determine first data based on a first data packet; the second processing module is used to generate a first processing result based on the first data; and the third processing module is used to generate a second processing result based on second data.
  • the first processing module can be any suitable module capable of implementing this function.
  • This first processing module is mainly used for preprocessing data, such as splitting, sorting, and assembling.
  • the first processing module can be a program with a runtime in the nanosecond or hundred-nanosecond range, and this first processing module has high real-time requirements.
  • the second processing module can be any suitable module capable of implementing this function. This second processing module is primarily used to generate the control results of the device. In some implementations, the second processing module can be a program with a runtime of milliseconds or longer. This second processing module has low requirements for real-time performance and periodicity, and possesses a certain degree of fault tolerance.
  • the third processing module can be any suitable module capable of implementing this function. This third processing module is primarily used to generate the execution results of the algorithm. In some implementations, the third processing module can be a program with a runtime in the range of microseconds to hundreds of microseconds, and this third processing module has high requirements for real-time performance and periodicity.
  • the data processing time of each processing module is different to meet the real-time, accuracy, and complexity requirements of the device.
  • the first processing time is less than the third processing time and the third processing time is less than the second processing time.
  • the first processing time is the time it takes for the first processing module to determine the first data
  • the second processing time is the time it takes for the second processing module to generate the first processing result
  • the third processing time is the time it takes for the third processing module to generate the second processing result.
  • data is processed by deploying processing modules with different processing durations in different processors and different cores, which makes full use of the characteristics of different processors and different cores, and improves the real-time performance of data processing while meeting the complex functions of the device.
  • the data processing device integrates a system-on-a-chip (SoC), in which a first processor, a second processor, and a memory are all located, and the first processor, the second processor, and the memory communicate through the SoC's bus.
  • SoC system-on-a-chip
  • the SoC may include, but is not limited to, a first processor, a second processor, a bus, and memory.
  • the first processor, the second processor, and the memory can be mounted on the bus and communicate with each other through the bus.
  • FIG. 4 is a schematic diagram of the composition structure of a data processing device provided in an embodiment of this disclosure.
  • the data processing device integrates a System-on-a-Chip (SoC), which includes a first processor 21, a second processor, a memory 23, and a bus 24.
  • SoC System-on-a-Chip
  • the second processor includes a first core 221 and a second core 222, wherein:
  • the memory 23 includes a receiving storage space 231 and a transmitting storage space 232.
  • the receiving storage space 231 includes a first receiving storage space corresponding to the first core and a second receiving storage space corresponding to the second core.
  • the transmitting storage space 232 includes a first transmitting storage space corresponding to the first core and a second transmitting storage space corresponding to the second core.
  • the first processor 21 includes multiple communication interfaces 211 and data processing software 212 (corresponding to the aforementioned first processing module). It receives a first data packet sent by an external device through a target communication interface among the multiple communication interfaces 211, and preprocesses the initial data in the first data packet through the data processing software 212 to obtain the first data and stores the first data in the first receiving storage space.
  • the second core 222 includes algorithm software 2221 (corresponding to the aforementioned third processing module), which is used to determine the second processing result based on the second data and store the second processing result in the second transmission storage space.
  • algorithm software 2221 corresponding to the aforementioned third processing module
  • the first processor 21 is also configured to obtain a first processing result from a first transmission storage space and/or a second processing result from a second transmission storage space according to actual needs, and generate a second data packet, and send the second data packet to an external device through a target communication interface among the plurality of communication interfaces 211.
  • Step S501 The FPGA (corresponding to the aforementioned first processor) determines the first data according to the first data packet sent by the external device and stores the first data in the first receiving storage space;
  • Step S502 The FPGA generates a timed interrupt (corresponding to the aforementioned first trigger event) according to the set processing cycle to notify CPU0 (corresponding to the aforementioned first core) to process it.
  • Step S503 After CPU0 responds to the timer interrupt, it retrieves the first data from the first receiving storage space and determines the first processing result based on the first data.
  • Step S504 CPU0 stores the first processing result in the second receiving storage space and/or the first sending storage space according to actual needs, and generates a soft interrupt (corresponding to the aforementioned second triggering event) to notify CPU1 (corresponding to the aforementioned second core) to process it.
  • step S505 after responding to the soft interrupt, CPU1 retrieves first data from the first receiving storage space and/or the first processing result from the second receiving storage space according to actual needs, and determines the second processing result based on the first data and/or the first processing result.
  • Step S506 CPU1 stores the second processing result in the second transmission storage space and notifies the FPGA to process it through a write register operation;
  • Step S507 After receiving the notification, the FPGA generates a second data packet based on the first processing result and/or the second processing result, and sends the second data packet to the external device.
  • FIG. 6 is a schematic flowchart of a data processing method provided in this embodiment of the present disclosure. As shown in Figure 6, the method includes steps S601 to S615, wherein:
  • Step S601 The FPGA receives the first data packet sent by the external device through the FT3 interface (corresponding to the aforementioned target communication interface), parses the first data packet, and obtains the actual voltage (corresponding to the aforementioned initial data);
  • Step S603 The FPGA stores the rated voltage and the actual voltage (corresponding to the aforementioned first data) into the first receiving storage space;
  • Step S604 The FPGA determines whether the processing cycle has ended. If yes, proceed to step S605; otherwise, proceed to step S604.
  • Step S605 The FPGA generates a timer interrupt
  • Step S606 CPU0 responds to the timer interrupt
  • Step S608 CPU0 stores the PI parameters to the second receiving storage space and/or the first transmitting storage space according to actual needs.
  • Step S609 CPU0 generates a software interrupt
  • Step S610 CPU1 responds to a software interrupt
  • Step S611 CPU1 obtains the rated voltage and actual voltage from the first receiving storage space and the PI parameter from the second receiving storage space according to actual needs.
  • Step S613 CPU1 stores the PI control result to the second transmission storage space and notifies the FPGA to process it through a write register operation;
  • Step S614 After receiving the notification, the FPGA retrieves the PI control result from the second transmission storage space and assembles the PI control result into a second data packet.
  • Step S615 The FPGA sends the second data packet to the external device.
  • data processing is completed through the cooperation of the first processor, the first core, and the second core, fully utilizing the characteristics of different processors and cores.
  • This not only achieves multi-level data control, meeting the requirements of complex functions and high real-time performance, but also shortens the development cycle and reduces costs.
  • the first processor, the first core, and the second core access the memory in a ring manner to achieve data sharing among them. This not only improves the efficiency and real-time performance of data sharing but also reduces the possibility of memory access anomalies.
  • the first processor does not need to communicate with the second processor to share data, internal data communication is simplified, reducing communication complexity.
  • the first and second cores in the second processor only need to write the corresponding processing results into the memory without needing to concern themselves with subsequent data transmission and updates. This reduces the development complexity of the second processor while improving data real-time performance.
  • the first processor includes at least one communication interface of at least one type; the first processor is further configured to receive a first data packet sent by an external device through a target communication interface; wherein the target communication interface is one of at least one communication interfaces of at least one type; the first data packet is parsed according to the communication protocol corresponding to the target communication interface to obtain initial data, and the first data is determined based on the initial data.
  • the first processor is further configured to generate a second data packet based on the third data and the communication protocol corresponding to the target communication interface, and send the second data packet to an external device through the target communication interface.
  • the first core is further configured to retrieve first data from memory in response to detecting a first trigger event generated by the first processor; the second core is further configured to retrieve second data from memory in response to detecting a second trigger event generated by the first core.
  • the receiving storage space includes a first receiving storage space corresponding to a first core and a second receiving storage space corresponding to a second core
  • the transmitting storage space includes a first transmitting storage space corresponding to a first core and a second transmitting storage space corresponding to a second core
  • the first core is further configured to obtain first data from the first receiving storage space; store a first processing result in the second receiving storage space, and/or store the first processing result in the first transmitting storage space
  • the second core is further configured to obtain first data from the first receiving storage space, and/or obtain a first processing result from the second receiving storage space; and store a second processing result in the second transmitting storage space.
  • the disclosed devices and methods can be implemented in other ways.
  • the device embodiments described above are merely illustrative.
  • the division of units is only a logical functional division, and in actual implementation, there may be other division methods, such as: multiple units or components may be combined, or integrated into another system, or some features may be ignored or not executed.
  • the coupling, direct coupling, or communication connection between the various components shown or discussed may be through some interfaces, and the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.
  • the units described above as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; they may be located in one place or distributed across multiple network units; some or all of the units may be selected to achieve the purpose of this embodiment according to actual needs. Furthermore, in the embodiments of this disclosure, all functional units may be integrated into one processing unit, or each unit may be a separate unit, or two or more units may be integrated into one unit; the integrated unit may be implemented in hardware or in a combination of hardware and software functional units.
  • the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it performs the steps of the above method embodiments.
  • the aforementioned storage medium includes various media that can store program code, such as mobile storage devices, read-only memory (ROM), magnetic disks, or optical disks.
  • the integrated units described above are implemented as software functional modules and sold or used as independent products, they can also be stored in a computer-readable storage medium.
  • This computer software product is stored in a storage medium and includes several instructions to cause an electronic device (which may be a personal computer, server, or network device, etc.) to execute all or part of the methods of the various embodiments of this disclosure.
  • the aforementioned storage medium includes various media capable of storing program code, such as mobile storage devices, ROM, magnetic disks, or optical disks.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Multi Processors (AREA)

Abstract

本公开提供了一种数据处理方法和数据处理设备,该方法应用于数据处理设备中,数据处理设备包括第一处理器、第二处理器和存储器,第二处理器包括第一核心和第二核心,该方法包括:第一核心从存储器中获取第一数据,基于第一数据,生成第一处理结果,将第一处理结果存储至存储器中;其中,第一数据是第一处理器基于外部设备发送的第一数据包确定的;第二核心从存储器中获取第二数据,基于第二数据,生成第二处理结果,将第二处理结果存储至存储器中;第一处理器从存储器中获取第三数据,基于第三数据,生成第二数据包,将第二数据包发送至外部设备中。

Description

数据处理方法和数据处理设备
相关申请的交叉引用
本公开基于申请号为202410836154.8、申请日为2024年06月25日、发明名称为“数据处理方法和数据处理设备”的中国专利申请提出,并要求该中国专利申请的优先权,该中国专利申请的全部内容在此引入本公开作为参考。
技术领域
本公开涉及但不限于电力设备技术领域,尤其涉及一种数据处理方法和数据处理设备。
背景技术
相关技术中,大部分电力设备(例如,储能设备、阀控设备、控制保护设备等)为了满足复杂功能、高实时性等要求,一般是通过提高处理器的性能、搭载实时操作系统等来实现,存在开发周期长、成本高、实时性差等问题。
发明内容
有鉴于此,本公开实施例提供一种数据处理方法和数据处理设备,通过第一处理器、第一核心和第二核心之间相互配合共同完成数据的处理,充分利用了不同处理器、不同核心的特性,不仅实现了数据的多级控制,能够满足复杂功能和高实时性的要求,而且还在缩短了开发周期的同时还降低了成本,同时,各个硬件通过环形的方式来访问存储器,以实现不同硬件之间的数据共享,不仅提高了数据共享的效率和实时性,而且还降低了存储器出现访问异常的可能性。
本公开实施例的技术方案是这样实现的:
本公开实施例提供一种数据处理方法,应用于数据处理设备中,数据处理设备包括第一处理器、第二处理器和存储器,第二处理器的类型不同于第一处理器的类型,第二处理器包括第一核心和第二核心,该方法包括:
第一核心从存储器中获取第一数据,基于第一数据,生成第一处理结果,将第一处理结果存储至存储器中;其中,第一数据是第一处理器基于外部设备发送的第一数据包确定的;
第二核心从存储器中获取第二数据,基于第二数据,生成第二处理结果,将第二处理结果存储至存储器中;其中,第二数据包括以下至少之一:第一数据、第一处理结果;
第一处理器从存储器中获取第三数据,基于第三数据,生成第二数据包,将第二数据包发送至外部设备中;其中,第三数据包括以下至少之一:第一处理结果、第二处理结果。
在本公开实施例中,首先,通过第一处理器、第一核心和第二核心之间相互配合共同完成数据的处理,充分利用了不同处理器、不同核心的特性,不仅实现了数据的多级控制,能够满足复杂功能和高实时性的要求,而且还在缩短了开发周期的同时还降低了成本;其次,第一处理器、第一核心和第二核心之间通过环形的方式来访问存储器,以实现第一处理器、第一核心和第二核心之间的数据共享,不仅提高了数据共享的效率和实时性,而且还降低了存储器出现访问异常的可能性,同时,由于第一处理器并不需要与第二处理器之间进行通信来共享数据,简化了设备内部的数据通信,降低了通信的复杂度;最后,第二处理器中的第一核心和第二核心只需要将对应的处理结果写入存储器中,而并不需要关注后续数据的传输、更新等,在降低了第二处理器的开发复杂度的同时还提高了数据的实时性。
在一些实施方式中,第一核心从存储器中获取第一数据,包括:第一核心响应于检测到第一处理器生成的第一触发事件,从存储器中获取第一数据;第二核心从存储器中获取第二数据,包括:第二核心响应于检测到第一核心生成的第二触发事件,从存储器中获取第二数据。
在本公开实施方式中,一方面,第一核心通过第一处理器生成的触发事件,从存储器中获取第一处理器共享的第一数据,提高了第一核心和第一处理器之间数据共享的频次和准确度,降低了存储器出现访问异常的可能性;另一方面,第二核心通过第一核心生成的触发事件,从存储器中获取第一核心、第一处理器共享的第二数据,提高了第二核心、第一核心与第一处理器之间数据共享的频次和准确度,进一步降低了存储器出现访问异常的可能性。
在一些实施方式中,存储器包括接收存储空间和发送存储空间,该数据处理方法还包括:第一核心基于数据处理设备对应的配置文件,对存储器进行初始化,得到接收存储空间和发送存储空间;其中,接收存储空间用于存放待处理数据,发送存储空间用于存储待发送数据,待处理数据包括以下至少之一:第一数据、第一处理结果,待发送数据包括以下至少之一:第一处理结果、第二处理结果。
在本公开实施方式中,通过数据处理设备对应的配置文件实时分配存储器,以得到用于存储共享数据的各个存储空间,不仅提高了存储空间的准确度,而且通过不同的存储空间来存储不同类型的数据,在降低了出现数据干扰的可能性的同时还降低了存储器出现访问异常的可能性。
在一些实施方式中,接收存储空间包括第一核心对应的第一接收存储空间和第二核心对应的第二接收存储空间,发送存储空间包括第一核心对应的第一发送存储空间和第二核心对应的第二发送存储空间;第一核心从存储器中获取第一数据,包括:第一核心从第一接收存储空间中获取第一数据;第一核心将第一处理结果存储至存储器中,包括:第一核心将第一处理结果存储至第二接收存储空间中,和/或,第一核心将第一处理结果存储至第一发送存储空间中;第二核心从存储器中获取第二数据,包括:第二核心从第一接收存储空间中获取第一数据,和/或,第二核心从第二接收存储空间中获取第一处理结果;第二核心将第二处理结果存储至存储器中,包括:第二核心将第二处理结果存储至第二发送存储空间中。
在本公开实施方式中,一方面,通过给第一核心和第二核心分别分配对应的接收存储空间来存储对应的待处理数据,降低了不同待处理数据之间出现串扰的可能性,从而提高了待处理数据的准确度;另一方面,通过给第一核心和第二核心分别分配对应的发送存储空间来存储对应的待发送数据,降低了不同待发送数据之间出现串扰的可能性,从而提高了待发送数据的准确度。
在一些实施方式中,第一处理器包括至少一种类型的至少一个通信接口,该数据处理方法还包括:第一处理器接收外部设备通过目标通信接口发送的第一数据包;其中,目标通信接口为至少一种类型的至少一个通信接口中的一个通信接口;第一处理器按照目标通信接口对应的通信协议,对第一数据包进行解析,得到初始数据,基于初始数据,确定第一数据,将第一数据存储至存储器中。
在本公开实施方式中,首先,通过第一处理器的不同类型的各个通信接口与外部设备之间通信,充分利用了第一处理器的性能,提高了数据处理设备的兼容性,拓宽了数据处理设备的使用场景;其次,第一处理器通过目标通信接口对应的通信协议来实时解析数据包,提高了共享数据的准确度;最后,第一处理器将第一数据及时存储至该存储器中,以便于实现与第一核心、第二核心之间共享数据。
在一些实施方式中,第一处理器基于第三数据,生成第二数据包,包括:第一处理器基于第三数据和目标通信接口对应的通信协议,生成第二数据包;第一处理器将第二数据包发送至外部设备中,包括:第一处理器通过目标通信接口,将第二数据包发送至外部设备中。
在本公开实施方式中,一方面,第一处理器通过目标通信接口对应的通信协议来实时生成数据包,提高了数据包的准确度;另一方面,第一处理器通过目标通信接口来发送数据包,提高了数据发送的精准度。
本公开实施例提供一种数据处理设备,包括第一处理器、第二处理器和存储器,第二处理器的类型不同于第一处理器的类型,第二处理器包括第一核心和第二核心,其中:
第一处理器,用于接收外部设备发送的第一数据包;基于第一数据包,确定第一数据;将第一数据存储至存储器中;
第一核心,用于从存储器中获取第一数据;基于第一数据,生成第一处理结果;将第一处理结果存储至存储器中;
第二核心,用于从存储器中获取第二数据;基于第二数据,生成第二处理结果;将第二处理结果存储至存储器中;其中,第二数据包括以下至少之一:第一数据、第一处理结果;
第一处理器,还用于从存储器中获取第三数据;基于第三数据,生成第二数据包;将第二数据包发送至外部设备中;其中,第三数据包括以下至少之一:第一处理结果、第二处理结果。
在本公开实施例中,首先,通过第一处理器、第一核心和第二核心之间相互配合共同完成数据的处理,充分利用了不同处理器、不同核心的特性,不仅实现了数据的多级控制,能够满足复杂功能和高实时性的要求,而且还在缩短了开发周期的同时还降低了成本;其次,第一处理器、第一核心和第二核心之间通过环形的方式来访问存储器,以实现第一处理器、第一核心和第二核心之间的数据共享,不仅提高了数据共享的效率和实时性,而且还降低了存储器出现访问异常的可能性,同时,由于第一处理器并不需要与第二处理器之间进行通信来共享数据,简化了设备内部的数据通信,降低了通信的复杂度;最后,第二处理器中的第一核心和第二核心只需要将对应的处理结果写入存储器中,而并不需要关注后续数据的传输、更新等,在降低了第二处理器的开发复杂度的同时还提高了数据的实时性。
在一些实施方式中,第一处理器包括至少一种类型的至少一个通信接口;第一处理器,还用于接收外部设备通过目标通信接口发送的第一数据包;其中,目标通信接口为至少一种类型的至少一个通信接口中的一个通信接口;按照目标通信接口对应的通信协议,对第一数据包进行解析,得到初始数据,基于初始数据,确定第一数据。
在本公开实施方式中,首先,通过第一处理器的不同类型的各个通信接口与外部设备之间通信,充分利用了第一处理器的性能,提高了数据处理设备的兼容性,拓宽了数据处理设备的使用场景;其次,第一处理器通过目标通信接口对应的通信协议来实时解析数据包,提高了共享数据的准确度;最后,第一处理器将第一数据及时存储至该存储器中,以便于实现与第一核心、第二核心之间共享数据。
在一些实施方式中,第一处理器,还用于基于第三数据和目标通信接口对应的通信协议,生成第二数据包,通过目标通信接口,将第二数据包发送至外部设备中。
在本公开实施方式中,一方面,第一处理器通过目标通信接口对应的通信协议来实时生成数据包,提高了数据包的准确度;另一方面,第一处理器通过目标通信接口来发送数据包,提高了数据发送的精准度。
在一些实施方式中,第一核心,还用于响应于检测到第一处理器生成的第一触发事件,从存储器中获取第一数据;第二核心,还用于响应于检测到第一核心生成的第二触发事件,从存储器中获取第二数据。
在本公开实施方式中,一方面,第一核心通过第一处理器生成的触发事件,从存储器中获取第一处理器共享的第一数据,提高了第一核心和第一处理器之间数据共享的频次和准确度,降低了存储器出现访问异常的可能性;另一方面,第二核心通过第一核心生成的触发事件,从存储器中获取第一核心、第一处理器共享的第二数据,提高了第二核心、第一核心与第一处理器之间数据共享的频次和准确度,进一步降低了存储器出现访问异常的可能性。
在一些实施方式中,第一处理器中包括第一处理模块,第一核心中包括第二处理模块,第二核心中包括第三处理模块,第一处理模块,用于基于第一数据包,确定第一数据;第二处理模块,用于基于第一数据,生成第一处理结果;第三处理模块,用于基于第二数据,生成第二处理结果;其中,第一处理时长小于第三处理时长且第三处理时长小于第二处理时长,第一处理时长为第一处理模块确定第一数据的时长,第二处理时长为第二处理模块生成第一处理结果的时长,第三处理时长为第三处理模块生成第二处理结果的时长。
在本公开实施方式中,通过在不同处理器、不同核心中部署不同处理时长的处理模块来对数据进行处理,充分利用了不同处理器、不同核心的特性,在满足设备的复杂功能的同时还提高了数据处理的实时性。
在一些实施方式中,第一核心中搭载操作系统或裸机程序,第二核心中搭载裸机程序。
在本公开实施方式中,通过在不同核心上搭载操作系统或裸机程序,充分利用了双核的特性,以在不同核心上部署不同实时性要求的软件实现对数据的精准处理,从而在提高整体的控制性能的同时满足速度、精度等要求。
在一些实施方式中,数据处理设备中集成片上系统,第一处理器、第二处理器和存储器均位于片上系统中,第一处理器、第二处理器和存储器通过片上系统的总线进行通信。
在本公开实施方式中,通过在数据处理设备中集成SoC,充分发挥SoC中不同处理器、不同核心的特性,不仅满足了高实时性、高精度、高复杂度等要求,而且在降低了开发成本的同时还提高了开发效率,从而提高了电力设备的安全和稳定。
在一些实施方式中,第一处理器中包括第一中断模块,第一中断模块用于生成第一触发事件,以使得第一核心基于第一触发事件,从存储器中获取第一数据。
在本公开实施方式中,通过第一处理器中集成的第一中断模块生成的触发事件来触发第一核心获取第一处理器共享的第一数据,提高了第一核心和第一处理器之间数据共享的频次和准确度,降低了存储器出现访问异常的可能性。
在一些实施方式中,第一核心中包括第二中断模块,第二中断模块用于生成第二触发事件,以使得第二核心基于第二触发事件,从存储器中获取第二数据。
在本公开实施方式中,通过第一核心中集成的第二中断模块生成的触发事件来触发第二核心获取第一核心、第一处理器共享的第二数据,提高了第二核心、第一核心与第一处理器之间数据共享的频次和准确度,降低了存储器出现访问异常的可能性。
在一些实施方式中,存储器包括接收存储空间和发送存储空间,接收存储空间用于存放待处理数据,发送存储空间用于存储待发送数据,待处理数据包括以下至少之一:第一数据、第一处理结果,待发送数据包括以下至少之一:第一处理结果、第二处理结果,接收存储空间和发送存储空间是第一核心基于数据处理设备对应的配置文件生成的。
在本公开实施方式中,通过数据处理设备对应的配置文件实时分配存储器,以得到用于存储共享数据的各个存储空间,不仅提高了存储空间的准确度,而且通过不同的存储空间来存储不同类型的数据,在降低了出现数据干扰的可能性的同时还降低了存储器出现访问异常的可能性。
在一些实施方式中,接收存储空间包括第一核心对应的第一接收存储空间和第二核心对应的第二接收存储空间,发送存储空间包括第一核心对应的第一发送存储空间和第二核心对应的第二发送存储空间;第一核心,还用于从第一接收存储空间中获取第一数据;将第一处理结果存储至第二接收存储空间中,和/或,将第一处理结果存储至第一发送存储空间中;第二核心,还用于从第一接收存储空间中获取第一数据,和/或,从第二接收存储空间中获取第一处理结果;将第二处理结果存储至第二发送存储空间中。
在本公开实施方式中,一方面,通过给第一核心和第二核心分别分配对应的接收存储空间来存储对应的待处理数据,降低了不同待处理数据之间出现串扰的可能性,从而提高了待处理数据的准确度;另一方面,通过给第一核心和第二核心分别分配对应的发送存储空间来存储对应的待发送数据,降低了不同待发送数据之间出现串扰的可能性,从而提高了待发送数据的准确度。
应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性的,而非限制本公开。
附图说明
此处的附图被并入说明书中并构成本说明书的一部分,这些附图示出了符合本公开的实施例,并与说明书一起用于说明本公开的技术方案。
图1为本公开实施例提供的一种数据处理方法的实现流程示意图一;
图2为本公开实施例提供的一种数据处理设备的组成结构示意图一;
图3为本公开实施例提供的一种存储器的初始化方法的实现流程示意图;
图4为本公开实施例提供的一种数据处理设备的组成结构示意图二;
图5为本公开实施例提供的一种数据处理方法的实现流程示意图二;
图6为本公开实施例提供的一种数据处理方法的实现流程示意图三。
具体实施方式
为了使本公开的目的、技术方案和优点更加清楚,下面将结合附图对本公开作进一步地详细描述,所描述的实施例不应视为对本公开的限制,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其它实施例,都属于本公开保护的范围。
在以下的描述中,涉及到“一些实施例”,其描述了所有可能实施例的子集,但是可以理解,“一些实施例”可以是所有可能实施例的相同子集或不同子集,并且可以在不冲突的情况下相互结合。
在以下的描述中,所涉及的术语“第一\第二\第三”仅仅是区别类似的对象,不代表针对对象的特定排序,可以理解地,“第一\第二\第三”在允许的情况下可以互换特定的顺序或先后次序,以使这里描述的本公开实施例能够以除了在这里图示或描述的以外的顺序实施。
除非另有定义,本文所使用的所有的技术和科学术语与属于本公开的技术领域的技术人员通常理解的含义相同。本文中所使用的术语只是为了描述本公开实施例的目的,不是旨在限制本公开。
相关技术中,大部分电力设备(例如,储能设备、阀控设备、控制保护设备等)为了满足复杂功能、高实时性等要求,一般是通过提高处理器的性能、搭载实时操作系统等来实现,存在以下几个问题:
(1)若使用实时性较好的操作系统虽然可以确保任务是实时的,但是这类操作系统一般无法实现很复杂的功能,而且需要移植的话会增加开发工作量,拉长了开发周期,同时也会影响实时操作系统的实时性。
(2)若使用非实时性的操作系统同时提高处理器的运算性能,虽然可以在一定程度上可以提高实时性,但是不仅无法满足一些微秒级、纳秒级等任务的要求,而且还增加了成本。
本公开实施例提供一种数据处理方法,首先,通过第一处理器、第一核心和第二核心之间相互配合共同完成数据的处理,充分利用了不同处理器、不同核心的特性,不仅实现了数据的多级控制,能够满足复杂功能和高实时性的要求,而且还在缩短了开发周期的同时还降低了成本;其次,第一处理器、第一核心和第二核心之间通过环形的方式来访问存储器,以实现第一处理器、第一核心和第二核心之间的数据共享,不仅提高了数据共享的效率和实时性,而且还降低了存储器出现访问异常的可能性,同时,由于第一处理器并不需要与第二处理器之间进行通信来共享数据,简化了设备内部的数据通信,降低了通信的复杂度;最后,第二处理器中的第一核心和第二核心只需要将对应的处理结果写入存储器中,而并不需要关注后续数据的传输、更新等,在降低了第二处理器的开发复杂度的同时还提高了数据的实时性。本公开实施例提供的方法可以由电子设备执行,电子设备可以为笔记本电脑,平板电脑,台式计算机,机顶盒,移动设备(例如,移动电话,便携式音乐播放器,个人数字助理,专用消息设备,便携式游戏设备)等各种类型的终端,也可以实施为服务器。服务器可以是独立的物理服务器,也可以是多个物理服务器构成的服务器集群或者分布式系统,还可以是提供云服务、云数据库、云计算、云函数、云存储、网络服务、云通信、中间件服务、域名服务、安全服务、内容分发网络(Content Delivery Network,CDN)、以及大数据和人工智能平台等基础云计算服务的云服务器。
下面,将结合本公开实施例中的附图,对本公开实施例中的技术方案进行清楚、完整地描述。
图1为本公开实施例提供的一种数据处理方法的实现流程示意图一,应用于数据处理设备中,该数据处理设备包括第一处理器、第二处理器和存储器,第二处理器的类型不同于第一处理器的类型,第二处理器包括第一核心和第二核心,如图1所示,该方法包括步骤S11至步骤S13,其中:
步骤S11、第一核心从存储器中获取第一数据,基于第一数据,生成第一处理结果,将第一处理结果存储至存储器中;其中,第一数据是第一处理器基于外部设备发送的第一数据包确定的。
这里,数据处理设备可以是任意合适的能够实现该功能的设备。在一些实施方式中,该数据处理设备主要用于处理外部设备的数据。
外部设备可以是任意合适的设备,例如,储能设备等。储能设备可以是任意合适的能够实现电能、光能等能量存储的设备。例如,电力储能设备,该电力储能设备是指将电能转化为其他形式储存起来,以便在需要时再将其释放出来供电使用的设备,比如,电池。在实施时,外部设备与数据处理设备通信连接。
第一处理器可以是任意合适的处理器,例如,FPGA(Field Programmable Gate Array,现场可编程逻辑门阵列)等。
第二处理器可以是任意合适的处理器,例如,ARM(Advanced RISC Machines)处理器、CPU(Central Processing Unit,中央处理器)、DSP(Digital Signal Processing,数字信号处理器)等。第二处理器中至少包括第一核心和第二核心。在一些实施方式中,第二处理器还可以包括其它核心。核心(Core)又称之内核,是第二处理器最重要的组成部分。不同的核心的性能可以相同,也可以不同。
存储器可以是任意合适的能够实现数据存储功能的单元,例如,RAM(Random Access Memory,随机存取存储器)、OCM(On-Chip Memory,片上存储器)等。在一些实施方式中,该数据处理设备中可以集成片上系统(System on Chip,SoC),第一处理器、第二处理器和存储器均位于该SoC中。
第一数据包中至少包括第一数据,第一数据可以是指第一数据包中的净荷数据。第一数据可以是任意合适的电力数据,例如,电压、电流等。在一些实施方式中,不同的电力设备对应的第一数据可以是不同的。例如,在外部设备为储能设备的情况下,该第一数据可以是储能设备相关的参数。储能设备相关的参数可以包括但不限于电池产品(例如,单电池、电池模组、电池包等)的参数、开关的参数等。电池产品的参数可以包括但不限于电流、电压、功率、温度、荷电状态、容量等。开关的参数可以包括但不限于电压、电流、电阻等。
在一些实施方式中,第一数据可以包括但不限于第一数据包中的净荷数据、数据处理设备的额定数据等中的至少之一。例如,该第一数据包括外部设备发送的实际电压和数据处理设备的额定电压。
数据包(包括第一数据包及后文其它的数据包)的传递方式可以是任意合适的方式,例如,总线、通信接口等。总线可以包括但不限于CAN(Controller Area Network,控制器局域网)总线、以太网总线等。通信接口可以是任意合适的接口,例如,LVDS(Low-Voltage Differential Signaling,低电压差分信号)接口、SRIO(Serial RapidIO,串行互连协议)接口、以太网接口、FT3接口、GT(Gigabyte Transceiver,G比特收发器)接口等。在实施时,第一处理器对第一数据包进行解析,以得到第一数据,并将第一数据及时存储至存储器中,以便于共享给第一核心、第二核心等硬件。
在一些实施方式中,外部设备可以按照通信接口对应的通信协议,将通信信息和第一数据进行组装,以得到第一数据包。通信协议是指双方实体完成通信或服务所必须遵循的规则和约定。不同的通信接口可以对应不同的通信协议。在一些实施方式中,对于同一通信协议的通信信息可以不同。例如,对于FT3协议生成的FT3数据包可以包括但不限于帧头、帧长、帧格式等,帧格式可以定义任意数量的数据块。在实施时,由于不同厂商的FT3接口使用不同的帧格式、不同的速率、不同的编码信息等,因此,不同厂商的FT3接口对应不同的通信信息。编码信息可以包括但不限于编码方式、极性等。其中,编码方式可以包括但不限于曼彻斯特编码、差分曼彻斯特编码等。极性可以包括但不限于0、1等,1可以表示从低到高跳变,0可以表示从高到低跳变。
在一些实施方式中,该步骤S11中的“第一核心从存储器中获取第一数据”,包括步骤S111,其中:
步骤S111、第一核心响应于检测到第一处理器生成的第一触发事件,从存储器中获取第一数据。
这里,触发事件(包括第一触发事件和后文提及的其它触发事件)可以是任意合适的事件,例如,定时触发事件、随机触发事件、指定触发事件等。定时触发事件主要是利用定时器触发的事件。随机触发事件可以是指利用随机数生成的触发事件。指定触发事件可以是预先指定的触发事件。例如,在第一处理器中设定定时器,通过该定时器定时产生中断(对应于该第一触发事件)。又例如,在第一处理器将第一数据存储至存储器后,生成该第一触发事件。
在实施时,当第一核心检测到该第一触发事件后,再从存储器中获取第一数据。
在本公开实施方式中,第一核心通过第一处理器生成的触发事件,从存储器中获取第一处理器共享的第一数据,提高了第一核心和第一处理器之间数据共享的频次和准确度,降低了存储器出现访问异常的可能性。
第一处理结果可以是任意合适的结果。例如,电力设备中的启停、保护等控制结果。又例如,根据第一数据计算得到的参数。在一些实施方式中,第一核心可以通过内部的第二处理模块来确定第一处理结果。第二处理模块可以是任意合适的能够实现该功能的模块,例如,控制软件。在实施时,该控制软件可以是运行周期在毫秒级及以上的程序,该控制软件对于实时性、周期性的要求不高,并且具有一定的容错性。
在实施时,当第一核心确定第一处理结果后,将第一处理结果及时写入至存储器中,以便于共享给第二核心、第一处理器等硬件。
步骤S12、第二核心从存储器中获取第二数据,基于第二数据,生成第二处理结果,将第二处理结果存储至存储器中;其中,第二数据包括以下至少之一:第一数据、第一处理结果。
这里,第二核心通过读存储器以获取该第二数据。在一些实施方式中,不同的第二数据对应不同的存储位置。
在一些实施方式中,该步骤S12的“第二核心从存储器中获取第二数据”,包括步骤S121,其中:
步骤S121、第二核心响应于检测到第一核心生成的第二触发事件,从存储器中获取第二数据。
这里,第二触发事件可以是任意合适的事件。例如,在第一核心将第一处理结果存储至存储器后,生成软中断(对应于第二触发事件)。在实施时,当第二核心检测到该第二触发事件后,再从存储器中获取第二数据。
在本公开实施方式中,第二核心通过第一核心生成的触发事件,从存储器中获取第一核心、第一处理器共享的第二数据,提高了第二核心、第一核心与第一处理器之间数据共享的频次和准确度,进一步降低了存储器出现访问异常的可能性。
第二处理结果可以是任意合适的结果。例如,算法的执行结果。在一些实施方式中,第二核心可以通过内部的第三处理模块来确定第二处理结果。第三处理模块可以是任意合适的能够实现该功能的模块,例如,算法软件。在实施时,该算法软件可以是运行周期在微秒级至百微秒级的程序,该算法软件对于实时性、周期性的要求高。在一些实施方式中,第三处理模块生成第二处理结果的时长小于第二处理模块生成第一处理结果的时长。
在实施时,当第二核心确定第二处理结果后,将第二处理结果及时写入至存储器中,以便于共享给第一处理器。
步骤S13、第一处理器从存储器中获取第三数据,基于第三数据,生成第二数据包,将第二数据包发送至外部设备中;其中,第三数据包括以下至少之一:第一处理结果、第二处理结果。
这里,第一处理器通过读存储器以获取该第三数据。在一些实施方式中,不同的第三数据对应不同的存储位置。
第二数据包可以是第三数据,也可以是对第三数据进行组装或打包后得到的。第二数据包的发送方式可以是任意合适的方式,例如,总线、通信接口等。在一些实施方式中,第一处理器可以直接将第三数据发送至外部设备中,也可以按照目标通信接口对应的通信协议,对第三数据进行组装,以得到第二数据包。
在一些实施方式中,当第二核心将第二处理结果写入至存储器后,通知第一处理器从存储器中获取该第三数据。该通知的方式可以是任意合适的方式,例如,广播、写寄存器等。比如,第二核心通过写第一处理器的某一寄存器,以通知第一处理器及时读取该第三数据。
在本公开实施例中,首先,通过第一处理器、第一核心和第二核心之间相互配合共同完成数据的处理,充分利用了不同处理器、不同核心的特性,不仅实现了数据的多级控制,能够满足复杂功能和高实时性的要求,而且还在缩短了开发周期的同时还降低了成本;其次,第一处理器、第一核心和第二核心之间通过环形的方式来访问存储器,以实现第一处理器、第一核心和第二核心之间的数据共享,不仅提高了数据共享的效率和实时性,而且还降低了存储器出现访问异常的可能性,同时,由于第一处理器并不需要与第二处理器之间进行通信来共享数据,简化了设备内部的数据通信,降低了通信的复杂度;最后,第二处理器中的第一核心和第二核心只需要将对应的处理结果写入存储器中,而并不需要关注后续数据的传输、更新等,在降低了第二处理器的开发复杂度的同时还提高了数据的实时性。
在一些实施方式中,存储器包括接收存储空间和发送存储空间,该方法还包括步骤S14,其中:
步骤S14、第一核心基于数据处理设备对应的配置文件,对存储器进行初始化,得到接收存储空间和发送存储空间。
这里,接收存储空间用于存放待处理数据,待处理数据包括以下至少之一:第一数据、第一处理结果。接收存储空间可以包括至少一个存储块,每个存储块的大小可以是一致的。在一些实施方式中,可以预先按照设定大小对存储器进行划分,得到若干个存储块。在一些实施方式中,接收存储空间可以包括但不限于第一核心对应的第一接收存储空间、第二核心对应的第二接收存储空间等中的至少之一。第一接收存储空间用于存放第一核心处理的数据,在实施时,第一处理器可以将第一数据存储至第一接收存储空间。第二接收存储空间用于存储第二核心处理的数据,在实施时,第一核心可以将第一处理结果存储至第二接收存储空间。在一些实施方式中,第一接收存储空间和第二接收存储空间的大小可以相同,也可以不同。
发送存储空间用于存储待发送数据,待发送数据包括以下至少之一:第一处理结果、第二处理结果。发送存储空间也可以包括至少一个存储块,每个存储块的大小可以是一致的。在实施时,发送存储空间与接收存储空间不同。在一些实施方式中,发送存储空间可以包括但不限于第一核心对应的第一发送存储空间、第二核心对应的第二发送存储空间等中的至少之一。第一发送存储空间用于存放第一核心发送的数据,在实施时,第一核心可以将第一处理结果存储至第一发送存储空间。第二发送存储空间用于存储第二核心发送的数据,在实施时,第二核心可以将第二处理结果存储至第二发送存储空间。在一些实施方式中,第一发送存储空间和第二发送存储空间的大小可以相同,也可以不同。
该配置文件中可以至少包括存储空间(包括发送存储空间和接收存储空间)的配置信息,根据该配置信息来动态配置存储器,以得到各个存储空间。存储空间的配置信息可以包括但不限于存储空间的标识、大小、基地址、偏移地址、所属对象等。所属对象用于描述该存储空间的使用者。该配置文件可以是任意形式的文件,例如,XML(Extensible Markup Language,可扩展标记语言)文件、WORD、EXCEL、HTML(Hyper Text Markup Language,超文本标记语言)文件等。
配置文件的获取方式可以是任意合适的方式。例如,数据处理设备中预先存储该配置文件。又例如,其它设备将该配置文件发送至数据处理设备中。
以下面所示的配置文件为例:
通过该配置文件的标签RRAM_CFG中的baddr字段和size字段来分配接收存储空间,该接收存储空间的基地址为0x10000,大小为4096KB;通过该标签RAM中的id、user、offset、size字段来分配第一接收存储空间和第二接收存储空间,该第一接收存储空间的标识为1、所属对象为第一核心、偏移地址为0x1000、大小为256KB,该第二接收存储空间的标识为2、所属对象为第二核心、偏移地址为0x2000、大小为1024KB。
通过该配置文件的标签TRAM_CFG中的baddr字段和size字段来分配发送存储空间,该发送存储空间的基地址为0x20000,大小为2048KB;通过该标签RAM中的id、user、offset、size字段来分配第一发送存储空间和第二发送存储空间,该第一发送存储空间的标识为1、所属对象为第一核心、偏移地址为0x1000、大小为64KB,该第二接收存储空间的标识为2、所属对象为第二核心、偏移地址为0x1100、大小为128KB。
在本公开实施方式中,通过数据处理设备对应的配置文件实时分配存储器,以得到用于存储共享数据的各个存储空间,不仅提高了存储空间的准确度,而且通过不同的存储空间来存储不同类型的数据,在降低了出现数据干扰的可能性的同时还降低了存储器出现访问异常的可能性。
在一些实施方式中,接收存储空间包括第一核心对应的第一接收存储空间和第二核心对应的第二接收存储空间,发送存储空间包括第一核心对应的第一发送存储空间和第二核心对应的第二发送存储空间;该步骤S11中的“第一核心从存储器中获取第一数据”包括步骤S151,该步骤S11中的“第一核心将第一处理结果存储至存储器中”包括步骤S152,该步骤S12中的“第二核心从存储器中获取第二数据”包括步骤S153,该步骤S12中的“第二核心将第二处理结果存储至存储器中”包括步骤S154,其中:
步骤S151、第一核心从第一接收存储空间中获取第一数据。
这里,第一处理器通过写操作,将第一数据写入第一接收存储空间。
步骤S152、第一核心将第一处理结果存储至第二接收存储空间中,和/或,第一核心将第一处理结果存储至第一发送存储空间中。
这里,第一核心可以根据实际需求,通过写操作,将第一处理结果写入第二接收存储空间和/或第一发送存储空间。在实施时,若第一处理结果需要传递至第二核心,此时,需要将第一处理结果写入第二接收存储空间;若第一处理结果不需要传递至第二核心,此时,不需要将第一处理结果写入第二接收存储空间;若第一处理结果需要传递至第一处理器,此时,需要将第一处理结果写入第一发送存储空间;若第一处理结果不需要传递至第一处理器,此时,不需要将第一处理结果写入第一发送存储空间。
步骤S153、第二核心从第一接收存储空间中获取第一数据,和/或,第二核心从第二接收存储空间中获取第一处理结果。
这里,第二核心根据实际需求,通过读操作读取第一数据和/或第一处理结果。在实施时,当第二核心需要对第一处理结果进行进一步处理时,此时,可以通过读操作获取该第一处理结果;当第二核心需要对第一数据进行处理时,此时,可以通过读操作获取该第一数据。
步骤S154、第二核心将第二处理结果存储至第二发送存储空间中。
这里,第二核心通过写操作,将第二处理结果存储至第二发送存储空间中。
例如,对于阀控设备的PI(Proportional Integral,比例和积分)控制算法,第一数据可以包括数据处理设备的额定电压值和外部设备发送的实际电压值,在实施时,第一处理器通过写操作,将第一数据写入第一接收存储空间中;
第一核心通过读操作,从第一接收存储空间中获取额定电压;
第一核心根据该额定电压计算PI参数(对应于第一处理结果),通过写操作,将PI参数存储至第二接收存储空间;
第二核心通过读操作,从第一接收存储空间中获取额定电压和实际电压,及从第二接收存储空间中获取PI参数;
第二核心根据额定电压、实际电压和PI参数,得到PI计算结果(对应于前述第二处理结果),通过写操作,将PI计算结果存储至第二发送存储空间。
在本公开实施方式中,一方面,通过给第一核心和第二核心分别分配对应的接收存储空间来存储对应的待处理数据,降低了不同待处理数据之间出现串扰的可能性,从而提高了待处理数据的准确度;另一方面,通过给第一核心和第二核心分别分配对应的发送存储空间来存储对应的待发送数据,降低了不同待发送数据之间出现串扰的可能性,从而提高了待发送数据的准确度。
在一些实施方式中,第一处理器包括至少一种类型的至少一个通信接口,该方法还包括步骤S161至步骤S162,其中:
步骤S161、第一处理器接收外部设备通过目标通信接口发送的第一数据包;其中,目标通信接口为至少一种类型的至少一个通信接口中的一个通信接口。
这里,第一处理器包括多个类型的通信接口,例如,FT3接口、GT接口、LVDS接口、以太网接口等,每一种接口的数量可以为至少一个。例如,第一处理器包括千兆网接口、百兆网接口等。目标通信接口可以是任意的通信接口,例如,FT3接口,在实施时,第一处理器接收外部设备通过FT3接口发送的包含实际电压(对应于第一数据)的第一数据包。
步骤S162、第一处理器按照目标通信接口对应的通信协议,对第一数据包进行解析,得到初始数据,基于初始数据,确定第一数据,将第一数据存储至存储器中。
这里,第一数据可以是初始数据,也可以是对初始数据进行预处理后得到的数据。预处理可以包括但不限于拆分、排序、组装等。在一些实施方式中,该第一处理器中可以集成第一处理模块,通过该第一处理模块对初始数据进行预处理。第一处理模块可以是任意合适的能够实现该功能的模块,例如,数据处理软件。在实施时,该数据处理软件可以是运行周期在纳秒级及百纳秒级的程序,该数据处理软件对于实时性的要求高。在一些实施方式中,该第一处理模块确定第一数据的时长小于第三处理模块确定第二处理结果的时长。
在一些实施方式中,在对第一数据包进行解析之前,可以按照预设的校验规则,先对第一数据包进行校验,在校验通过的情况下,再对第一数据包进行解析。在实施时,不同的通信协议对应的校验规则可以不同。该校验规则可以包括但不限于第一数据包的通信信息的内容是否合法、是否正确等。
在实施时,第一处理器通过写操作,将第一数据写入存储器中。
在本公开实施方式中,首先,通过第一处理器的不同类型的各个通信接口与外部设备之间通信,充分利用了第一处理器的性能,提高了数据处理设备的兼容性,拓宽了数据处理设备的使用场景;其次,第一处理器通过目标通信接口对应的通信协议来实时解析数据包,提高了共享数据的准确度;最后,第一处理器将第一数据及时存储至该存储器中,以便于实现与第一核心、第二核心之间共享数据。
在一些实施方式中,该步骤S13中的“第一处理器基于第三数据,生成第二数据包,将第二数据包发送至外部设备中”,包括步骤S131,其中:
步骤S131、第一处理器基于第三数据和目标通信接口对应的通信协议,生成第二数据包,通过目标通信接口,将第二数据包发送至外部设备中。
这里,目标通信接口可以是任意的通信接口,例如,FT3接口、GT接口等。不同的通信接口对应的通信协议可能不同。在实施时,第一处理器按照该目标通信接口对应的通信协议,对第三数据进行组包,以得到该第二数据包,并将第二数据包发送至外部设备。
在本公开实施方式中,一方面,第一处理器通过目标通信接口对应的通信协议来实时生成数据包,提高了数据包的准确度;另一方面,第一处理器通过目标通信接口来发送数据包,提高了数据发送的精准度。
基于上述实施例,本公开实施例还提供一种数据处理设备,图2为本公开实施例提供的一种数据处理设备的组成结构示意图一,如图2所示,该数据处理设备20第一处理器21、第二处理器22和存储器23,第二处理器的类型不同于第一处理器的类型,第二处理器22包括第一核心221和第二核心222,其中:
第一处理器21,用于接收外部设备发送的第一数据包;基于第一数据包,确定第一数据;将第一数据存储至存储器中;
第一核心221,用于从存储器中获取第一数据;基于第一数据,生成第一处理结果;将第一处理结果存储至存储器中;
第二核心222,用于从存储器中获取第二数据;基于第二数据,生成第二处理结果;将第二处理结果存储至存储器中;其中,第二数据包括以下至少之一:第一数据、第一处理结果;
第一处理器21,还用于从存储器中获取第三数据;基于第三数据,生成第二数据包;将第二数据包发送至外部设备中;其中,第三数据包括以下至少之一:第一处理结果、第二处理结果。
这里,该数据处理设备可以是任意合适的设备。在实施时,该数据处理设备的功能较多且复杂,对于控制精度、实时性等要求也较高。
第一处理器可以是任意合适的处理器,例如,FPGA。第一数据包可以是任意合适的数据包。在一些实施方式中,该第一数据包中至少包括第一数据,第一数据可以是指第一数据包中的净荷数据。在实施时,外部设备可以按照目标通信接口对应的通信协议,对第一数据进行组包,以得到第一数据包。目标通信接口是指外部设备与数据处理设备进行通信的接口。该目标通信接口可以包括但不限于FT3接口、GT接口等。第一处理器确定第一数据的过程可以参见前述步骤S162的具体实施方式。
在一些实施方式中,第一处理器中包括第一中断模块,第一中断模块用于生成第一触发事件,以使得第一核心基于第一触发事件,从存储器中获取第一数据。
这里,第一中断模块可以是任意合适的能够实现该功能的模块。第一触发事件可以是任意合适的事件,例如,定时触发事件、随机触发事件、指定触发事件等。在一些实施方式中,第一中断模块可以利用定时器定时生成该第一触发事件。在一些实施方式中,第一中断模块可以在检测到第一处理器将第一数据写入存储器后,生成该第一触发事件。在实施时,当第一核心检测到该第一触发事件后,再从存储器中获取第一数据。
在本公开实施方式中,通过第一处理器中集成的第一中断模块生成的触发事件来触发第一核心获取第一处理器共享的第一数据,提高了第一核心和第一处理器之间数据共享的频次和准确度,降低了存储器出现访问异常的可能性。
第二处理器可以是任意合适的处理器,例如,ARM处理器、CPU、DSP等。第二处理器中至少包括第一核心和第二核心。第一核心和第二核心可以被配置为以AMP(Asymmetric Multi-Processing,非对称多处理)架构、SMP(Symmetric Multi-Processing,对称多处理)架构、BMP(Bond Multi-Processing,绑定多处理)架构等运行。在AMP架构中,第一核心和第二核心被配置为包括主核和从核,各个内核相对独立地运行不同的任务,每个核心可以分别搭载、运行不同的操作系统或裸机程序,各个内核有序启动且互不干扰。
在一些实施方式中,第一核心中搭载操作系统或裸机程序,第二核心中搭载裸机程序。
这里,操作系统可以是任意合适的操作系统,例如,Microsoft Windows、macOS、Linux、Google chromeOS、iOS、Android等。在一些实施方式中,部分电力设备通过使用可视化开发方式,可视化开发的运行环境比较复杂,通常需要操作系统的参与,因此,可以在第一核心中搭载操作系统。
裸机程序通常是指在没有操作系统的基础上开发具有特定功能的程序,该程序不依赖操作系统运行。在实施时,考虑到实时性要求,第二核心主要实现电力控制中的各种算法,可以不搭载操作系统,以保证算法执行的精准性和实时性。
在本公开实施方式中,通过在不同核心上搭载操作系统或裸机程序,充分利用了双核的特性,以在不同核心上部署不同实时性要求的软件实现对数据的精准处理,从而在提高整体的控制性能的同时满足速度、精度等要求。
第一处理结果可以是任意合适的结果。例如,电力设备中的启停、保护等控制结果。又例如,根据第一数据计算得到的参数。在一些实施方式中,第一核心通过内部的控制软件来确定第一处理结果。在实施时,第一核心确定第一处理结果的过程可以参见前述步骤S11的具体实施方式。
在一些实施方式中,第一核心中包括第二中断模块,第二中断模块用于生成第二触发事件,以使得第二核心基于第二触发事件,从存储器中获取第二数据。
这里,第二中断模块可以是任意合适的能够实现该功能的模块。第二触发事件可以是任意合适的事件,例如,定时触发事件、随机触发事件、指定触发事件等。在一些实施方式中,第二中断模块可以利用定时器定时生成该第二触发事件。在一些实施方式中,第二中断模块可以在检测到第一核心将第二数据写入存储器后,生成该第二触发事件。在实施时,当第二核心检测到该第二触发事件后,再从存储器中获取第二数据。
在本公开实施方式中,通过第一核心中集成的第二中断模块生成的触发事件来触发第二核心获取第一核心、第一处理器共享的第二数据,提高了第二核心、第一核心与第一处理器之间数据共享的频次和准确度,降低了存储器出现访问异常的可能性。
第二处理结果可以是任意合适的结果。例如,算法的执行结果。在一些实施方式中,第二核心通过内部的算法软件来确定第二处理结果。在实施时,第二核心确定第二处理结果的过程可以参见前述步骤S12的具体实施方式。
存储器可以是任意合适的能够实现数据存储功能的单元,例如,RAM、OCM等。
在一些实施方式中,存储器包括接收存储空间和发送存储空间,接收存储空间用于存放待处理数据,发送存储空间用于存储待发送数据,待处理数据包括以下至少之一:第一数据、第一处理结果,待发送数据包括以下至少之一:第一处理结果、第二处理结果,接收存储空间和发送存储空间是第一核心基于数据处理设备对应的配置文件生成的。
这里,接收存储空间可以包括至少一个存储块,每个存储块的大小可以是一致的。发送存储空间也可以包括至少一个存储块,每个存储块的大小可以是一致的。
该配置文件可以是任意形式的文件,例如,XML文件、WORD、EXCEL、HTML文件等。该配置文件中可以至少包括存储空间(包括发送存储空间和接收存储空间)的配置信息,根据该配置信息来动态配置存储器,以得到各个存储空间。在实施时,该接收存储空间和发送存储空间的生成过程可以参见前述步骤S14的具体实施方式。
图3为本公开实施例提供的一种存储器的初始化方法的实现流程示意图,如图3所示,该方法包括步骤S301至步骤S305,其中:
步骤S301、第一核心判断配置文件是否存在,若存在,进入步骤S302,反之,则进入步骤S304;
步骤S302、第一核心判断配置文件是否解析成功,若是,则进入步骤S303,反之,则进入步骤S304;
步骤S303、第一核心根据配置文件中的配置信息初始化存储器,以得到各个存储空间,进入步骤S305;
这里,在初始化存储器结束后,第一核心可以将各个存储空间同步至第一处理器和第二核心。
步骤S304、第一核心上报初始化失败;
步骤S305、结束。
在本公开实施方式中,通过数据处理设备对应的配置文件实时分配存储器,以得到用于存储共享数据的各个存储空间,不仅提高了存储空间的准确度,而且通过不同的存储空间来存储不同类型的数据,在降低了出现数据干扰的可能性的同时还降低了存储器出现访问异常的可能性。
在一些实施方式中,第一处理器中包括第一处理模块,第一核心中包括第二处理模块,第二核心中包括第三处理模块,第一处理模块,用于基于第一数据包,确定第一数据;第二处理模块,用于基于第一数据,生成第一处理结果;第三处理模块,用于基于第二数据,生成第二处理结果。
这里,第一处理模块可以是任意合适的能够实现该功能的模块,该第一处理模块主要用于对数据进行拆分、排序、组装等预处理。在一些实施方式中,第一处理模块可以是运行周期在纳秒级及百纳秒级的程序,该第一处理模块对于实时性的要求高。
第二处理模块可以是任意合适的能够实现该功能的模块,该第二处理模块主要用于生成设备的控制结果。在一些实施方式中,第二处理模块可以是运行周期在毫秒级及以上的程序,该第二处理模块对于实时性、周期性的要求不高,并且具有一定的容错性。
第三处理模块可以是任意合适的能够实现该功能的模块,该第三处理模块主要用于生成算法的执行结果。在一些实施方式中,第三处理模块可以是运行周期在微秒级至百微秒级的程序,该第三处理模块对于实时性、周期性的要求高。
在实施时,各个处理模块的数据处理时长均不同,以满足设备的实时性、精度和复杂度要求。在一些实施方式中,第一处理时长小于第三处理时长且第三处理时长小于第二处理时长,第一处理时长为第一处理模块确定第一数据的时长,第二处理时长为第二处理模块生成第一处理结果的时长,第三处理时长为第三处理模块生成第二处理结果的时长。
在本公开实施方式中,通过在不同处理器、不同核心中部署不同处理时长的处理模块来对数据进行处理,充分利用了不同处理器、不同核心的特性,在满足设备的复杂功能的同时还提高了数据处理的实时性。
在一些实施方式中,数据处理设备中集成片上系统,第一处理器、第二处理器和存储器均位于片上系统中,第一处理器、第二处理器和存储器通过片上系统的总线进行通信。
这里,SoC中可以包括但不限于第一处理器、第二处理器、总线、存储器等。在实施时,第一处理器、第二处理器和存储器可以挂载在总线上,通过总线进行通信。
在本公开实施方式中,通过在数据处理设备中集成SoC,充分发挥SoC中不同处理器、不同核心的特性,不仅满足了高实时性、高精度、高复杂度等要求,而且在降低了开发成本的同时还提高了开发效率,从而提高了电力设备的安全和稳定。
图4为本公开实施例提供的一种数据处理设备的组成结构示意图二,如图4所示,该数据处理设备集成SoC,SoC中包括第一处理器21、第二处理器、存储器23和总线24,第二处理器包括第一核心221和第二核心222,其中:
存储器23包括接收存储空间231和发送存储空间232,接收存储空间231包括第一核心对应的第一接收存储空间和第二核心对应的第二接收存储空间,发送存储空间232包括第一核心对应的第一发送存储空间和第二核心对应的第二发送存储空间;
第一处理器21中包括多个通信接口211和数据处理软件212(对应于前述第一处理模块),通过该多个通信接口211中的目标通信接口接收外部设备发送的第一数据包,通过该数据处理软件212对第一数据包中的初始数据进行预处理,以得到第一数据,并将第一数据存储至第一接收存储空间中;
第一核心221中搭载操作系统2211、可视化软件2212和控制软件2213(对应于前述第二处理模块),可视化软件2212用于实现数据处理设备的可视化操作,控制软件2213用于基于第一数据确定第一处理结果,按照实际需求,将第一处理结果存储至第二接收存储空间和/或第一发送存储空间;
第二核心222中包括算法软件2221(对应于前述第三处理模块),该算法软件2221用于基于第二数据确定第二处理结果,将第二处理结果存储至第二发送存储空间;
第一处理器21还用于根据实际需求,从第一发送存储空间中获取第一处理结果和/或从第二发送存储空间中获取第二处理结果,并生成第二数据包,通过该多个通信接口211中的目标通信接口将第二数据包发送至外部设备。
图5为本公开实施例提供的一种数据处理方法的实现流程示意图二,如图5所示,该方法包括步骤S501至步骤S507,其中:
步骤S501、FPGA(对应于前述第一处理器)根据外部设备发送的第一数据包,确定第一数据,将第一数据存储至第一接收存储空间中;
步骤S502、FPGA根据设置的处理周期,产生定时中断(对应于前述第一触发事件),以通知CPU0(对应于前述第一核心)进行处理;
步骤S503、CPU0响应定时中断后,从第一接收存储空间中获取第一数据,根据第一数据,确定第一处理结果;
步骤S504、CPU0根据实际需求,将第一处理结果存储至第二接收存储空间和/或第一发送存储空间,并产生软中断(对应于前述第二触发事件),以通知CPU1(对应于前述第二核心)进行处理;
步骤S505、CPU1在响应软中断后,根据实际需求,从第一接收存储空间中获取第一数据和/或第二接收存储空间中获取第一处理结果,并根据第一数据和/或第一处理结果,确定第二处理结果;
步骤S506、CPU1将第二处理结果存储至第二发送存储空间,并通过写寄存器操作通知FPGA进行处理;
步骤S507、FPGA在接收到通知后,根据第一处理结果和/或第二处理结果,生成第二数据包,将第二数据包发送至外部设备中。
图6为本公开实施例提供的一种数据处理方法的实现流程示意图三,如图6所示,该方法包括步骤S601至步骤S615,其中:
步骤S601、FPGA通过FT3接口(对应于前述目标通信接口)接收外部设备发送的第一数据包,对该第一数据包进行解析,得到实际电压(对应于前述初始数据);
步骤S602、FPGA通过以太网接口获取数据处理设备的额定电压;
步骤S603、FPGA将额定电压和实际电压(对应于前述第一数据)存储至第一接收存储空间中;
步骤S604、FPGA判断是否到处理周期,若是,则进入步骤S605,反之,则进入步骤S604;
步骤S605、FPGA产生定时中断;
步骤S606、CPU0响应定时中断;
步骤S607、CPU0从第一接收存储空间中获取额定电压,根据额定电压计算PI控制算法的PI参数(对应于前述第一处理结果);
步骤S608、CPU0根据实际需求,将PI参数存储至第二接收存储空间和/或第一发送存储空间;
步骤S609、CPU0产生软中断;
步骤S610、CPU1响应软中断;
步骤S611、CPU1根据实际需求,从第一接收存储空间中获取额定电压和实际电压,并从第二接收存储空间中获取PI参数;
步骤S612、CPU1根据额定电压、实际电压和PI参数,确定PI控制结果(对应于前述第二处理结果);
步骤S613、CPU1将PI控制结果存储至第二发送存储空间,并通过写寄存器操作通知FPGA进行处理;
步骤S614、FPGA在接收到通知后,从第二发送存储空间中获取PI控制结果,并对PI控制结果进行组包生成第二数据包;
步骤S615、FPGA将第二数据包发送至外部设备中。
在本公开实施例中,首先,通过第一处理器、第一核心和第二核心之间相互配合共同完成数据的处理,充分利用了不同处理器、不同核心的特性,不仅实现了数据的多级控制,能够满足复杂功能和高实时性的要求,而且还在缩短了开发周期的同时还降低了成本;其次,第一处理器、第一核心和第二核心之间通过环形的方式来访问存储器,以实现第一处理器、第一核心和第二核心之间的数据共享,不仅提高了数据共享的效率和实时性,而且还降低了存储器出现访问异常的可能性,同时,由于第一处理器并不需要与第二处理器之间进行通信来共享数据,简化了设备内部的数据通信,降低了通信的复杂度;最后,第二处理器中的第一核心和第二核心只需要将对应的处理结果写入存储器中,而并不需要关注后续数据的传输、更新等,在降低了第二处理器的开发复杂度的同时还提高了数据的实时性。
在一些实施方式中,第一处理器包括至少一种类型的至少一个通信接口;第一处理器,还用于接收外部设备通过目标通信接口发送的第一数据包;其中,目标通信接口为至少一种类型的至少一个通信接口中的一个通信接口;按照目标通信接口对应的通信协议,对第一数据包进行解析,得到初始数据,基于初始数据,确定第一数据。
在一些实施方式中,第一处理器,还用于基于第三数据和目标通信接口对应的通信协议,生成第二数据包,通过目标通信接口,将第二数据包发送至外部设备中。
在一些实施方式中,第一核心,还用于响应于检测到第一处理器生成的第一触发事件,从存储器中获取第一数据;第二核心,还用于响应于检测到第一核心生成的第二触发事件,从存储器中获取第二数据。
在一些实施方式中,接收存储空间包括第一核心对应的第一接收存储空间和第二核心对应的第二接收存储空间,发送存储空间包括第一核心对应的第一发送存储空间和第二核心对应的第二发送存储空间;第一核心,还用于从第一接收存储空间中获取第一数据;将第一处理结果存储至第二接收存储空间中,和/或,将第一处理结果存储至第一发送存储空间中;第二核心,还用于从第一接收存储空间中获取第一数据,和/或,从第二接收存储空间中获取第一处理结果;将第二处理结果存储至第二发送存储空间中。
以上设备实施例的描述,与上述方法实施例的描述是类似的,具有同方法实施例相似的有益效果。对于本公开设备实施例中未披露的技术细节,请参照本公开方法实施例的描述而理解。
需要说明的是,本公开实施例中,如果以软件功能模块的形式实现上述方法,并作为独立的产品销售或使用时,也可以存储在一个计算机可读取存储介质中。基于这样的理解,本公开实施例的技术方案本质上或者说对相关技术做出贡献的部分可以以软件产品的形式体现出来,该软件产品存储在一个存储介质中,包括若干指令用以使得一台电子设备(可以是个人计算机、服务器、或者网络设备等)执行本公开各个实施例方法的全部或部分。而前述的存储介质包括:U盘、移动硬盘、只读存储器(Read Only Memory,ROM)、磁碟或者光盘等各种可以存储程序代码的介质。这样,本公开实施例不限制于任何特定的硬件和软件结合。
应理解,说明书通篇中提到的“一个实施例”或“一实施例”意味着与实施例有关的特定特征、结构或特性包括在本公开的至少一个实施例中。因此,在整个说明书各处出现的“在一个实施例中”或“在一实施例中”未必一定指相同的实施例。此外,这些特定的特征、结构或特性可以任意适合的方式结合在一个或多个实施例中。应理解,在本公开的各种实施例中,上述各过程的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本公开实施例的实施过程构成任何限定。上述本公开实施例序号仅仅为了描述,不代表实施例的优劣。需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者装置不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者装置所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者装置中还存在另外的相同要素。
在本公开所提供的几个实施例中,应该理解到,所揭露的设备和方法,可以通过其它的方式实现。以上所描述的设备实施例仅仅是示意性的,例如,单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,如:多个单元或组件可以结合,或可以集成到另一个系统,或一些特征可以忽略,或不执行。另外,所显示或讨论的各组成部分相互之间的耦合、或直接耦合、或通信连接可以是通过一些接口,设备或单元的间接耦合或通信连接,可以是电性的、机械的或其它形式的。
上述作为分离部件说明的单元可以是、或也可以不是物理上分开的,作为单元显示的部件可以是、或也可以不是物理单元;既可以位于一个地方,也可以分布到多个网络单元上;可以根据实际的需要选择其中的部分或全部单元来实现本实施例方案的目的。另外,在本公开实施例中的各功能单元可以全部集成在一个处理单元中,也可以是各单元分别单独作为一个单元,也可以两个或两个以上单元集成在一个单元中;上述集成的单元既可以采用硬件的形式实现,也可以采用硬件加软件功能单元的形式实现。
本领域普通技术人员可以理解:实现上述方法实施例的全部或部分步骤可以通过程序指令相关的硬件来完成,前述的程序可以存储于计算机可读取存储介质中,该程序在执行时,执行包括上述方法实施例的步骤;而前述的存储介质包括:移动存储设备、只读存储器(Read Only Memory,ROM)、磁碟或者光盘等各种可以存储程序代码的介质。
或者,本公开上述集成的单元如果以软件功能模块的形式实现并作为独立的产品销售或使用时,也可以存储在一个计算机可读取存储介质中。基于这样的理解,本公开的技术方案本质上或者说对相关技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台电子设备(可以是个人计算机、服务器、或者网络设备等)执行本公开各个实施例方法的全部或部分。而前述的存储介质包括:移动存储设备、ROM、磁碟或者光盘等各种可以存储程序代码的介质。
以上,仅为本公开的实施方式,但本公开的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本公开揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本公开的保护范围之内。

Claims (17)

  1. 一种数据处理方法,应用于数据处理设备中,所述数据处理设备包括第一处理器、第二处理器和存储器,所述第二处理器的类型不同于所述第一处理器的类型,所述第二处理器包括第一核心和第二核心,所述方法包括:
    所述第一核心从所述存储器中获取第一数据,基于所述第一数据,生成第一处理结果,将所述第一处理结果存储至所述存储器中;其中,所述第一数据是所述第一处理器基于外部设备发送的第一数据包确定的;
    所述第二核心从所述存储器中获取第二数据,基于所述第二数据,生成第二处理结果,将所述第二处理结果存储至所述存储器中;其中,所述第二数据包括以下至少之一:所述第一数据、所述第一处理结果;
    所述第一处理器从所述存储器中获取第三数据,基于所述第三数据,生成第二数据包,将所述第二数据包发送至所述外部设备中;其中,所述第三数据包括以下至少之一:所述第一处理结果、所述第二处理结果。
  2. 根据权利要求1所述的数据处理方法,其中,
    所述第一核心从所述存储器中获取第一数据,包括:所述第一核心响应于检测到所述第一处理器生成的第一触发事件,从所述存储器中获取所述第一数据;
    所述第二核心从所述存储器中获取第二数据,包括:所述第二核心响应于检测到所述第一核心生成的第二触发事件,从所述存储器中获取所述第二数据。
  3. 根据权利要求1或2所述的数据处理方法,其中,所述存储器包括接收存储空间和发送存储空间,所述方法还包括:
    所述第一核心基于所述数据处理设备对应的配置文件,对所述存储器进行初始化,得到所述接收存储空间和所述发送存储空间;其中,所述接收存储空间用于存放待处理数据,所述发送存储空间用于存储待发送数据,所述待处理数据包括以下至少之一:所述第一数据、所述第一处理结果,所述待发送数据包括以下至少之一:所述第一处理结果、所述第二处理结果。
  4. 根据权利要求3所述的数据处理方法,其中,所述接收存储空间包括所述第一核心对应的第一接收存储空间和所述第二核心对应的第二接收存储空间,所述发送存储空间包括所述第一核心对应的第一发送存储空间和所述第二核心对应的第二发送存储空间;
    所述第一核心从所述存储器中获取第一数据,包括:所述第一核心从所述第一接收存储空间中获取所述第一数据;
    所述第一核心将所述第一处理结果存储至所述存储器中,包括:所述第一核心将所述第一处理结果存储至所述第二接收存储空间中,和/或,所述第一核心将所述第一处理结果存储至所述第一发送存储空间中;
    所述第二核心从所述存储器中获取第二数据,包括:所述第二核心从所述第一接收存储空间中获取所述第一数据,和/或,所述第二核心从所述第二接收存储空间中获取所述第一处理结果;
    所述第二核心将所述第二处理结果存储至所述存储器中,包括:所述第二核心将所述第二处理结果存储至所述第二发送存储空间中。
  5. 根据权利要求1至4中任一项所述的数据处理方法,其中,所述第一处理器包括至少一种类型的至少一个通信接口,所述方法还包括:
    所述第一处理器接收所述外部设备通过目标通信接口发送的所述第一数据包;其中,所述目标通信接口为所述至少一种类型的至少一个通信接口中的一个通信接口;
    所述第一处理器按照所述目标通信接口对应的通信协议,对所述第一数据包进行解析,得到初始数据,基于所述初始数据,确定所述第一数据,将所述第一数据存储至所述存储器中。
  6. 根据权利要求5所述的数据处理方法,其中,
    所述第一处理器基于第三数据,生成第二数据包,将所述第二数据包发送至所述外部设备中,包括:所述第一处理器基于所述第三数据和所述目标通信接口对应的通信协议,生成所述第二数据包,通过所述目标通信接口,将所述第二数据包发送至所述外部设备中。
  7. 一种数据处理设备,包括第一处理器、第二处理器和存储器,所述第二处理器的类型不同于所述第一处理器的类型,所述第二处理器包括第一核心和第二核心,其中:
    所述第一处理器,用于接收外部设备发送的第一数据包;基于所述第一数据包,确定第一数据;将所述第一数据存储至所述存储器中;
    所述第一核心,用于从所述存储器中获取所述第一数据;基于所述第一数据,生成第一处理结果;将所述第一处理结果存储至所述存储器中;
    所述第二核心,用于从所述存储器中获取第二数据;基于所述第二数据,生成第二处理结果;将所述第二处理结果存储至所述存储器中;其中,所述第二数据包括以下至少之一:所述第一数据、所述第一处理结果;
    所述第一处理器,还用于从所述存储器中获取第三数据;基于第三数据,生成第二数据包;将所述第二数据包发送至所述外部设备中;其中,所述第三数据包括以下至少之一:所述第一处理结果、所述第二处理结果。
  8. 根据权利要求7所述的数据处理设备,其中,所述第一处理器包括至少一种类型的至少一个通信接口;
    所述第一处理器,还用于接收所述外部设备通过目标通信接口发送的所述第一数据包;其中,所述目标通信接口为所述至少一种类型的至少一个通信接口中的一个通信接口;按照所述目标通信接口对应的通信协议,对所述第一数据包进行解析,得到初始数据,基于所述初始数据,确定所述第一数据。
  9. 根据权利要求8所述的数据处理设备,其中,
    所述第一处理器,还用于基于所述第三数据和所述目标通信接口对应的通信协议,生成所述第二数据包,通过所述目标通信接口,将所述第二数据包发送至所述外部设备中。
  10. 根据权利要求7至9中任一项所述的数据处理设备,其中,
    所述第一核心,还用于响应于检测到所述第一处理器生成的第一触发事件,从所述存储器中获取所述第一数据;
    所述第二核心,还用于响应于检测到所述第一核心生成的第二触发事件,从所述存储器中获取所述第二数据。
  11. 根据权利要求7至10中任一项所述的数据处理设备,其中,所述第一处理器中包括第一处理模块,所述第一核心中包括第二处理模块,所述第二核心中包括第三处理模块,其中:
    所述第一处理模块,用于基于所述第一数据包,确定所述第一数据;
    所述第二处理模块,用于基于所述第一数据,生成第一处理结果;
    所述第三处理模块,用于基于所述第二数据,生成第二处理结果;
    其中,第一处理时长小于第三处理时长且第三处理时长小于第二处理时长,所述第一处理时长为所述第一处理模块确定所述第一数据的时长,所述第二处理时长为所述第二处理模块生成所述第一处理结果的时长,所述第三处理时长为所述第三处理模块生成所述第二处理结果的时长。
  12. 根据权利要求7至11中任一项所述的数据处理设备,其中,所述第一核心中搭载操作系统或裸机程序,所述第二核心中搭载裸机程序。
  13. 根据权利要求7至12中任一项所述的数据处理设备,其中,所述数据处理设备中集成片上系统,所述第一处理器、所述第二处理器和所述存储器均位于所述片上系统中,所述第一处理器、所述第二处理器和所述存储器通过所述片上系统的总线进行通信。
  14. 根据权利要求7至13中任一项所述的数据处理设备,其中,所述第一处理器中包括第一中断模块;
    所述第一中断模块,用于生成第一触发事件,以使得第一核心基于所述第一触发事件,从所述存储器中获取所述第一数据。
  15. 根据权利要求7至14中任一项所述的数据处理设备,其中,所述第一核心中包括第二中断模块;
    所述第二中断模块用于生成第二触发事件,以使得所述第二核心基于所述第二触发事件,从所述存储器中获取所述第二数据。
  16. 根据权利要求7至15中任一项所述的数据处理设备,其中,所述存储器包括接收存储空间和发送存储空间,所述接收存储空间用于存放待处理数据,所述发送存储空间用于存储待发送数据,所述待处理数据包括以下至少之一:所述第一数据、所述第一处理结果,所述待发送数据包括以下至少之一:所述第一处理结果、所述第二处理结果,所述接收存储空间和所述发送存储空间是所述第一核心基于所述数据处理设备对应的配置文件生成的。
  17. 根据权利要求16所述的数据处理设备,其中,所述接收存储空间包括所述第一核心对应的第一接收存储空间和所述第二核心对应的第二接收存储空间,所述发送存储空间包括所述第一核心对应的第一发送存储空间和所述第二核心对应的第二发送存储空间;
    所述第一核心,还用于从所述第一接收存储空间中获取所述第一数据;将所述第一处理结果存储至所述第二接收存储空间中,和/或,将所述第一处理结果存储至所述第一发送存储空间中;
    所述第二核心,还用于从所述第一接收存储空间中获取所述第一数据,和/或,从所述第二接收存储空间中获取所述第一处理结果;将所述第二处理结果存储至所述第二发送存储空间中。
PCT/CN2025/102864 2024-06-25 2025-06-23 数据处理方法和数据处理设备 Pending WO2026001908A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202410836154.8A CN121210375A (zh) 2024-06-25 2024-06-25 数据处理方法和数据处理设备
CN202410836154.8 2024-06-25

Publications (1)

Publication Number Publication Date
WO2026001908A1 true WO2026001908A1 (zh) 2026-01-02

Family

ID=98119992

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2025/102864 Pending WO2026001908A1 (zh) 2024-06-25 2025-06-23 数据处理方法和数据处理设备

Country Status (2)

Country Link
CN (1) CN121210375A (zh)
WO (1) WO2026001908A1 (zh)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007122320A (ja) * 2005-10-27 2007-05-17 Seiko Epson Corp マルチプロセッサシステム
CN115830430A (zh) * 2022-12-21 2023-03-21 天津大学 基于嵌入式平台的主从架构多核并行目标识别系统及方法
CN117370262A (zh) * 2023-08-31 2024-01-09 华为技术有限公司 通信方法、装置、芯片系统和电子设备
CN117472448A (zh) * 2023-12-28 2024-01-30 山东省计算中心(国家超级计算济南中心) 一种申威众核处理器从核簇加速并行方法、设备及介质
CN117590783A (zh) * 2023-11-23 2024-02-23 国网智能电网研究院有限公司 一种基于共享存储介质的多核心控制切换系统及方法

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007122320A (ja) * 2005-10-27 2007-05-17 Seiko Epson Corp マルチプロセッサシステム
CN115830430A (zh) * 2022-12-21 2023-03-21 天津大学 基于嵌入式平台的主从架构多核并行目标识别系统及方法
CN117370262A (zh) * 2023-08-31 2024-01-09 华为技术有限公司 通信方法、装置、芯片系统和电子设备
CN117590783A (zh) * 2023-11-23 2024-02-23 国网智能电网研究院有限公司 一种基于共享存储介质的多核心控制切换系统及方法
CN117472448A (zh) * 2023-12-28 2024-01-30 山东省计算中心(国家超级计算济南中心) 一种申威众核处理器从核簇加速并行方法、设备及介质

Also Published As

Publication number Publication date
CN121210375A (zh) 2025-12-26

Similar Documents

Publication Publication Date Title
EP3667496B1 (en) Distributed computing system, data transmission method and device in distributed computing system
US12367171B1 (en) Storage adapter device for communicating with network storage
KR102111229B1 (ko) 에뮬레이션된 엔드포인트 구성
US20140068134A1 (en) Data transmission apparatus, system, and method
KR101861312B1 (ko) 다중슬롯 링크 계층 플릿에서의 제어 메시징
CN111124277B (zh) 一种深度学习数据集缓存方法、系统、终端及存储介质
EP4195598B1 (en) In-vehicle signal transmission method and system
US10846163B1 (en) Hybrid hardware and software reporting management
CN117032812B (zh) 服务器的管理方法、设备、装置、存储介质和电子设备
US11095626B2 (en) Secure in-line received network packet processing
CN109768970A (zh) 一种基于可配置的通用协议生成方法
CN104303174A (zh) 通过处理器间互连来隧道传输平台管理消息
CN115543755B (zh) 一种性能监管方法、装置、系统、设备和介质
KR102210289B1 (ko) 하드웨어 관리 통신 프로토콜
CN106610789B (zh) 一种数据处理方法、装置及系统
WO2017032112A1 (zh) 一种与无中央处理器单板通讯的方法及通讯设备
US10936048B2 (en) System, apparatus and method for bulk register accesses in a processor
US20260119433A1 (en) Server system, job execution method and apparatus, device, and medium
US10558453B1 (en) System and method to achieve shared drive firmware version consistency via ESRT update
CN113867890A (zh) 一种日志采集方法、装置、介质
US10581997B2 (en) Techniques for storing or accessing a key-value item
CN119003097B (zh) 软件实现重要产品数据功能的方法、计算机设备及介质
CN113079152A (zh) 一种数据传输方法、装置及介质
Shim et al. Design and implementation of initial OpenSHMEM on PCIe NTB based cloud computing
CN110798366B (zh) 任务逻辑的处理方法、装置及设备

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 25825974

Country of ref document: EP

Kind code of ref document: A1