Data processing method, switching station terminal equipment and readable storage medium
By using two core chips in the terminal equipment of the opening and closing station for data exchange, and using the double buffer mechanism of the buffer area, the problems of complex structure and unstable communication in the existing technology are solved, and high reliability and high real-time performance are achieved. Data processing.
Patent Information
- Application Number
- CN202410669791.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-28
- Publication Date
- 2024-10-15
AI Technical Summary
The structure of the existing switching station terminal equipment is complex, the communication reliability and real-time performance between multiple chips are insufficient, and there is the problem of unstable data exchange.
Use a chip with at least two cores to exchange data through a shared cache module, set the main cache area and backup cache area, store and read data according to the status information of the cache block, avoid the cores from reading and writing the same cache block at the same time, and ensure Reliability and real-time performance of data communications.
It simplifies the architecture of switching station terminal equipment, improves the reliability and real-time nature of data communication, avoids the risk of system crash, and realizes the efficient completion of real-time operating status data collection and communication functions.
Smart Images

Figure CN118779252A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of switchgear terminal equipment, and in particular to a data processing method, a switchgear terminal equipment and a readable storage medium. Background Art
[0002] The terminal equipment of the switchgear (DTU) is generally installed in conventional switchgear, ring network cabinets, small substations, box-type substations, etc., and is used to complete the collection and calculation of the position signal, voltage, current, active power, reactive power, power factor, electric energy and other data of the switchgear, realize the opening and closing operation of the switchgear, and perform fault identification, isolation and restoration of power supply to the non-fault section of the switchgear. At present, the DTU structure includes 2 chips, one chip is responsible for the real-time operation status data collection of the switchgear, and the other chip is responsible for communication, operation status data reception and data analysis functions. This DTU structure requires the installation of multiple chips, which makes the DTU architecture too complicated, and multiple chips need to exchange data through external communication, which has problems of communication reliability deviation and real-time deviation. Summary of the invention
[0003] In view of this, the embodiments of the present application provide a data processing method, a switch terminal device and a readable storage medium to at least solve the above-mentioned technical problems existing in the prior art.
[0004] According to a first aspect of the present application, an embodiment of the present application provides a data processing method, which is applied to a switch terminal device, wherein the switch terminal device includes a chip having at least two cores, wherein the at least two cores include a first core and a second core, wherein the first core and the second core exchange data through a common cache module, wherein the cache module includes a primary cache area and a backup cache area, wherein the primary cache area includes a plurality of primary cache blocks, and the backup cache area includes a plurality of backup cache blocks corresponding to the plurality of primary cache blocks one by one;
[0005] Methods include:
[0006] The first kernel obtains the operation status data of the target device connected to the switch terminal device;
[0007] Determine a target primary cache block in the primary cache area for storing the running status data;
[0008] Determine the state information of the target primary cache block, the state information including writable state information or non-writable state information;
[0009] Based on the status information of the target primary cache block, the running status data is written to the target primary cache block or a backup cache block corresponding to the target primary cache block, and the location information of the running status data is recorded.
[0010] Optionally, based on the status information of the target primary cache block, the running status data is written to the target primary cache block, or a backup cache block corresponding to the target primary cache block, and the location information of the running status data is recorded, including:
[0011] If the state information of the target primary cache block is state information that can be written, write the running state data into the target primary cache block, and record the running state data and store it in the target primary cache block;
[0012] If the state information of the target primary cache block is state information that cannot be written, the running state data is written to the backup cache block corresponding to the target primary cache block, and the running state data is recorded and stored in the backup cache block corresponding to the target primary cache block.
[0013] Optionally, determining a target primary cache block in the primary cache area for storing the running status data includes:
[0014] Determine the first primary cache block corresponding to the last data write;
[0015] According to the arrangement order of the primary cache blocks, the next primary cache block of the first primary cache block is determined as the target primary cache block for storing the running status data.
[0016] Optionally, after the first kernel obtains the operating status data of the target device connected to the switch terminal device, the data processing method further includes:
[0017] Based on the operating status data, determine the opening and closing information of the target equipment;
[0018] Based on the on / off information of the target device, the target device is controlled to be in an on state or a disconnected state.
[0019] According to a second aspect of the present application, an embodiment of the present application provides a data processing method, which is applied to a switch terminal device, wherein the switch terminal device includes a chip having at least two cores, wherein the at least two cores include a first core and a second core, wherein the first core and the second core exchange data through a common cache module, wherein the cache module includes a primary cache area and a backup cache area, wherein the primary cache area includes a plurality of primary cache blocks, and the backup cache area includes a plurality of backup cache blocks corresponding one to one to the plurality of primary cache blocks;
[0020] Methods include:
[0021] The second core determines, in response to a trigger signal for reading the running status data, a target primary cache block in the primary cache area for storing the running status data;
[0022] Setting the state information of the target main cache block to a state information that cannot be written;
[0023] Determine location information of the running status data, the location information including that the running status data is stored in a target primary cache block, or that the running status data is stored in a backup cache block corresponding to the target primary cache block;
[0024] Based on the location information of the running status data, the running status data is read from the target primary cache block or the backup cache block corresponding to the target primary cache block.
[0025] Optionally, based on the location information of the running status data, reading the running status data from the target primary cache block or the backup cache block corresponding to the target primary cache block includes:
[0026] If the location information of the running status data indicates that the running status data is stored in the target primary cache block, reading the running status data from the target primary cache block;
[0027] If the location information of the running status data indicates that the running status data is stored in the backup cache block corresponding to the target primary cache block, the running status data is read from the backup cache block corresponding to the target primary cache block.
[0028] Optionally, after reading the running status data, the data processing method further includes:
[0029] The state information of the target main cache block is set to be writable state information.
[0030] Optionally, after reading the running status data, the data processing method further includes:
[0031] Determine the current and voltage of the target device based on the operating status data;
[0032] Displays the current and voltage of the target device.
[0033] According to a third aspect of the present application, an embodiment of the present application provides a switchgear terminal device, including:
[0034] A chip having at least two cores, wherein the at least two cores include a first core and a second core, wherein the first core and the second core exchange data via a common cache module, wherein the cache module includes a primary cache area and a backup cache area, wherein the primary cache area includes a plurality of primary cache blocks, and the backup cache area includes a plurality of backup cache blocks corresponding to the plurality of primary cache blocks in a one-to-one manner;
[0035] The first kernel is used to obtain the operation status data of the target device connected to the switch terminal device; determine the target main cache block in the main cache area for storing the operation status data; determine the state information of the target main cache block, the state information includes the state information that can be written or the state information that cannot be written; based on the state information of the target main cache block, write the operation status data to the target main cache block, or the backup cache block corresponding to the target main cache block, and record the location information of the operation status data;
[0036] The second core is used to determine a target main cache block for storing the running status data in the main cache area in response to a trigger signal for reading the running status data; set the status information of the target main cache block to state information that cannot be written; determine the location information of the running status data, the location information includes that the running status data is stored in the target main cache block, or the running status data is stored in a backup cache block corresponding to the target main cache block; based on the location information of the running status data, read the running status data from the target main cache block, or the backup cache block corresponding to the target main cache block.
[0037] According to the fourth aspect of the present application, an embodiment of the present application provides a computer-readable storage medium, which stores computer instructions, and the computer instructions are used to enable a computer to execute a data processing method such as the first aspect or any embodiment of the first aspect, or a data processing method such as the second aspect or any embodiment of the second aspect.
[0038] The data processing method, switchgear terminal device and readable storage medium provided in the embodiments of the present application are achieved by setting a chip with at least two cores in the switchgear terminal device, wherein the at least two cores include a first core and a second core, and the first core and the second core exchange data through a common cache module, so that only one chip can be used to realize functions such as real-time operation status data collection of the switch device, as well as communication, operation status data reception and data analysis functions, thereby simplifying the architecture of the switchgear terminal device; and the first core and the second core are located in the same chip, and the first core and the second core use inter-core communication to exchange data, so that the data communication has high reliability and high real-time performance; and, by setting a dual cache mechanism to store data, when the first core stores data, it will first determine whether the main cache block of the main cache area is in a writable state, and only when it is in a writable state will the data be written to the main cache block, otherwise it will be written to the backup cache block, thereby avoiding the problem of the first core and the second core reading and writing the same cache block at the same time, causing the system to crash.
[0039] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] Figure 1 This is a schematic diagram of the structure of the chip in the embodiment of the present application;
[0041] Figure 2 Schematic diagram of the data processing method in the embodiment of the present application;
[0042] Figure 3 This is a schematic diagram of the structure of the cache module in the embodiment of the present application;
[0043] Figure 4 A flowchart of another data processing method in an embodiment of the present application;
[0044] Figure 5 A flowchart of another data processing method in an embodiment of the present application;
[0045] Figure 6 This is a schematic diagram of the hardware structure of a switch terminal device in an embodiment of the present application. DETAILED DESCRIPTION
[0046] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present application.
[0047] The embodiment of the present application provides a data processing method, which is applied to a switch terminal device, wherein the switch terminal device includes a chip having at least two cores, and the chip structure is as follows: Figure 1 As shown, at least two cores include a first core 11 and a second core 12. The first core 11 and the second core 12 exchange data through a common cache module 13. The cache module 13 includes a main cache area and a backup cache area. The main cache area includes multiple main cache blocks 131, and the backup cache area includes multiple backup cache blocks 132 corresponding to the multiple main cache blocks 131 one by one.
[0048] Data processing methods such as Figure 2 As shown, including:
[0049] S201, the first kernel obtains the operation status data of the target device connected to the switch terminal device.
[0050] In this embodiment, if Figure 1 As shown, the chip can be a chip based on an asymmetric multi-processor structure (AMP) architecture. The first kernel can be a real-time kernel, and the second kernel can be a management kernel. The first kernel 11 is responsible for the real-time operation status data collection of the target device connected to the switch terminal device, and the operation status data includes but is not limited to current, voltage, electric energy, and DC quantity. The DC quantity includes but is not limited to position signals, and the target device includes but is not limited to switch devices. Specifically, the first kernel 11 can collect the real-time voltage and current of the target device through the serial peripheral interface (SPI), and the first kernel 11 can communicate with the metering chip through the SPI interface to obtain the electric energy measurement of the target device. The first kernel 11 can perform real-time telesignaling and remote control of the target device through the general purpose I / O ports (GPIO). The first kernel 11 can collect the DC quantity of the target device through the analog-to-digital converter interface (ADC).
[0051] The second core 12 is responsible for communication, operation status data reception and data analysis functions. The first core 11 and the second core 12 perform data synchronization through inter-core communication. Specifically, the second core 12 can be connected to the encryption module of the switch terminal device through the SPI interface, and the data is encrypted through the encryption module. The second core 12 can be connected to the Bluetooth module, communication serial port, and positioning module of the switch terminal device through the Universal Asynchronous Receiver / Transmitter (UART), and communicate with external devices through the Bluetooth module, positioning module, and communication serial port. The second core 12 can be connected to the Ethernet of the switch terminal device through the media access controller (GMAC), and communicate with external devices through Ethernet. The second core 12 can perform communication expansion through the USB interface.
[0052] In this embodiment, in order to solve the problem that the first core 11 and the second core 12 may interact with the same cache block, a double cache area is set in the cache module 13, namely a primary cache area and a backup cache area.
[0053] In some embodiments, the first kernel may collect the operating status data of the target device at a fixed period of 20 us, and then transfer the operating status data to the ring buffer inside the first kernel.
[0054] S202, determining a target primary cache block in the primary cache area for storing running status data.
[0055] In some embodiments, in order to meet the characteristics of large amount of DTU data, a main data buffer area with a size of 32M and a backup buffer area with a size of 32M can be set.
[0056] In some embodiments, the first core may store the running status data with a data size of 0.8M into the cache module 13 at a fixed period of 1s. If the sizes of the primary cache area and the backup cache area are 32M, the cache module 13 may store data for up to 40s.
[0057] In this embodiment, the running status data is preferentially written into the primary cache area. Therefore, before the first kernel writes the running status data into the cache module 13, it may first determine a target primary cache block in the primary cache area for storing the running status data.
[0058] In some embodiments, before the first kernel writes the running status data into the cache module 13, it can also first determine the target backup main cache block for storing the running status data in the backup cache area, and determine the target main cache block for storing the running status data based on the correspondence between the backup main cache block and the main cache block.
[0059] S203, determining the state information of the target primary cache block, where the state information includes writable state information or non-writable state information.
[0060] In this embodiment, the status information of the primary cache block is updated in real time, wherein the status information of the primary cache block includes status information that can be written and status information that cannot be written. If the status information of the primary cache block is status information that can be written, it means that the second kernel is not performing a data read operation on the primary cache block at this time. If the status information of the primary cache block is status information that cannot be written, it means that the second kernel is performing a data read operation on the primary cache block at this time.
[0061] In some embodiments, the status information of the primary cache block may be represented by a data status flag. Figure 3As shown, the main cache area and the backup cache area each include 40 cache blocks, for example, cache block 1 (channel1 index1, channel2 index1 ... channel16 index500) ... cache block 40 (channel1 index19501, channel2index19501 ... channel16 index20000), each main cache block is set with a data status flag can_write_flagx (x is 1, 2, 3 ... 40, representing the number of the main cache block) and a data location flag data_location_flagx (x is 1, 2, 3 ... 40, representing the number of the main cache block). Among them, when can_write_flagx is 1, it means that the main cache block / main cache area can be written; when can_write_flagx is 0, it means that the main cache block / main cache area cannot be written; the data location flag represents the location information of the running status data. When data_location_flagx is 0, it means that the running status data is stored in the main cache area / main cache block, and when data_location_flagx is 1, it means that the running status data is stored in the backup cache area / backup cache block. Therefore, the status information of the target main cache block can be determined by reading the value of the data status flag.
[0062] S204, based on the status information of the target primary cache block, write the running status data to the target primary cache block, or a backup cache block corresponding to the target primary cache block, and record the location information of the running status data.
[0063] In this embodiment, once it is determined whether the target primary cache block can be written, the operating status data can be written to the target primary cache block or the backup cache block corresponding to the target primary cache block, and the location information of the operating status data write can be recorded accordingly.
[0064] The data processing method provided in the embodiment of the present application is achieved by setting a chip with at least two cores in the switchgear terminal device, the at least two cores include a first core and a second core, the first core and the second core exchange data through a common cache module, so that only one chip can be used to realize functions such as real-time operation status data collection of the switchgear, as well as communication, operation status data reception and data analysis functions, thereby simplifying the architecture of the switchgear terminal device; and the first core and the second core are located in the same chip, the first core and the second core use inter-core communication to exchange data, so that the data communication has high reliability and high real-time performance; and, by setting a dual cache mechanism to store data, when the first core stores data, it will first determine whether the main cache block of the main cache area is in a writable state, and only when it is in a writable state will the data be written to the main cache block, otherwise it will be written to the backup cache block, thereby avoiding the problem of the first core and the second core reading and writing the same cache block at the same time, causing the system to crash.
[0065] In an optional embodiment, step S204, based on the status information of the target primary cache block, writes the running status data to the target primary cache block, or a backup cache block corresponding to the target primary cache block, and records the location information of the running status data, including:
[0066] If the status information of the target primary cache block is writable status information, the running status data is written to the target primary cache block, and the running status data is recorded and stored in the target primary cache block; if the status information of the target primary cache block is unwritable status information, the running status data is written to the backup cache block corresponding to the target primary cache block, and the running status data is recorded and stored in the backup cache block corresponding to the target primary cache block.
[0067] For example, Figure 3As shown, if the first core, represented by R5, determines that the target main cache block for storing the running status data in the main cache area is the main cache block numbered 1, then R5 reads the value of can_write_flag1. Since the value of can_write_flag1 is 1, R5 reads can_write_flag1 as 1, indicating that the main cache block numbered 1 can be written, that is, the main cache area can be written, then the running status data is written to the main cache block numbered 1, that is, the main cache area, and data_location_flag1 is set to 0, indicating that the running status data is stored in the main cache area. If R5 determines that the target main cache block for storing the running status data in the main cache area is the main cache block numbered 2, R5 reads the value of can_write_flag2. Since the value of can_write_flag2 is 0, R5 reads can_write_flag2 as 0, indicating that the main cache block numbered 2 cannot be written, that is, the main cache area cannot be written. The running status data is then written to the backup cache block corresponding to the main cache block numbered 2, that is, the backup cache area, and data_location_flag2 is set to 1, indicating that the running status data is stored in the backup cache area.
[0068] In this embodiment, when it is determined that the target main cache block can be written, the operating status data is written to the target main cache block, otherwise it is written to the backup cache block corresponding to the target main cache block, thereby avoiding the first core and the second core from reading and writing the same cache block at the same time, and when the first core and the second core read and write, there is no need to wait, and the reading and writing speed of the first core and the second core will not be reduced.
[0069] In an optional embodiment, step S202, determining a target primary cache block in the primary cache area for storing the running status data, includes:
[0070] Determine the first primary cache block corresponding to the last data write; and determine the next primary cache block of the first primary cache block as the target primary cache block for storing the running status data according to the arrangement order of the primary cache blocks.
[0071] In this embodiment, the first core stores data in the order of the primary cache blocks. Therefore, each time data is written, the corresponding primary cache block can be recorded. When it is necessary to determine the target primary cache block for storing the running status data in the current primary cache area, the first primary cache block corresponding to the last data write can be determined, and then the next primary cache area is used as the target primary cache block. In this way, when the first core stores data, the data is stored in the order of the primary cache blocks, which is convenient for fast data storage and also convenient for the second core to read data.
[0072] In an optional embodiment, in step 201, after the first kernel obtains the operation status data of the target device connected to the switch terminal device, the data processing method further includes:
[0073] Based on the running status data, the on / off information of the target device is determined; based on the on / off information of the target device, the target device is controlled to be in an on state or a disconnected state.
[0074] In specific implementation, the first core can collect the operation status data of the target device at a fixed period of 20us through a timer, and then extract 80 points of data from the operation status data, determine whether the target device needs to be disconnected based on the relay protection algorithm, and obtain the opening and closing information. When it is determined that the target device needs to be disconnected, the circuit breaker in the target device is controlled in a disconnected state through real-time telemetry and telesignaling control; when it is determined that the target device does not need to be disconnected, no action is taken, and the target device is controlled to be in an open state.
[0075] In this embodiment, the on or off state of the target device may be controlled by the first kernel based on the running state data of the target device.
[0076] The embodiment of the present application also provides a data processing method, which is applied to a switch terminal device, wherein the switch terminal device includes a chip having at least two cores, and the chip structure is as follows: Figure 1 As shown, at least two cores include a first core 11 and a second core 12. The first core 11 and the second core 12 exchange data through a common cache module 13. The cache module 13 includes a main cache area and a backup cache area. The main cache area includes multiple main cache blocks 131, and the backup cache area includes multiple backup cache blocks 132 corresponding to the multiple main cache blocks 131 one by one.
[0077] Data processing methods such as Figure 4 As shown, including:
[0078] S401, the second core determines a target primary cache block for storing the operating status data in the primary cache area in response to a trigger signal for reading the operating status data.
[0079] In this embodiment, the trigger signal for reading the running status data may be sent from the first core to the second core through inter-core communication, or a timer may be set in the second core to generate a trigger signal for reading the running status data based on a timing signal of the timer.
[0080] In this embodiment, the second core reads the running status data from the cache module in the order in which the first core stores the running status data.
[0081] In some embodiments, the second core may read the running status data with a data size of 0.8M from the cache module 13 at a fixed period of 1s.
[0082] S402, setting the state information of the target primary cache block to a state information that cannot be written.
[0083] In this embodiment, in order to avoid the situation where the first kernel also needs to write the operating status data to the target primary cache block when reading data from the target primary cache block, after determining the target primary cache block for storing the operating status data in the primary cache area, the status information of the target primary cache block is set to non-writable status information, so that the first kernel cannot perform a write operation on the target primary cache block.
[0084] In some embodiments, the data status flag of the target primary cache block can be set to 1, for example, the data status flag can_write_flagx (x is the number of the target primary cache block) is set to 0, indicating that the primary cache block cannot be written and the second core is reading the target primary cache block.
[0085] S403, determining location information of the running status data, where the location information includes that the running status data is stored in a target primary cache block, or that the running status data is stored in a backup cache block corresponding to the target primary cache block.
[0086] In this embodiment, since the cache mode is a double cache mechanism, it is necessary to determine the location information of the running status data.
[0087] In some embodiments, the location information of the running status data can be determined by reading the value of the data location flag, for example, reading the value of the data location flag data_location_flagx (x is the number of the target main cache block). If data_location_flagx is 0, it means that the running status data is stored in the target main cache block. If data_location_flagx is 1, it means that the running status data is stored in the backup cache block corresponding to the target main cache block.
[0088] S404, based on the location information of the running status data, read the running status data from the target primary cache block or the backup cache block corresponding to the target primary cache block.
[0089] In this embodiment, once the location information of the running status data is determined, the running status data can be read based on the location information of the running status data.
[0090] In some embodiments, step S404, based on the location information of the running status data, reading the running status data from the target primary cache block or the backup cache block corresponding to the target primary cache block, includes:
[0091] If the location information of the running status data is that the running status data is stored in the target primary cache block, the running status data is read from the target primary cache block; if the location information of the running status data is that the running status data is stored in the backup cache block corresponding to the target primary cache block, the running status data is read from the backup cache block corresponding to the target primary cache block.
[0092] In this way, the operating status data can be accurately read.
[0093] The data processing method provided in the embodiment of the present application is achieved by setting a chip with at least two cores in the switchgear terminal device, the at least two cores include a first core and a second core, the first core and the second core exchange data through a common cache module, so that only one chip can be used to realize functions such as real-time operation status data collection of the switchgear, as well as communication, operation status data reception and data analysis functions, thereby simplifying the architecture of the switchgear terminal device; and the first core and the second core are located in the same chip, the first core and the second core use inter-core communication to exchange data, so that the data communication has high reliability and high real-time performance; and, by setting a dual cache mechanism to store data, when the second core reads data, it will first set the main cache block of the main cache area to a non-writable state, so that the first core cannot write data to the main cache block at this time, thereby avoiding the problem that the first core and the second core read and write the same cache block at the same time, causing a system crash.
[0094] In some embodiments, after reading the running status data, the data processing method further includes:
[0095] The state information of the target main cache block is set to be writable state information.
[0096] In this way, after the second kernel reads data from the target primary cache block, the first kernel can store the running status data of the target device into the target primary cache block again.
[0097] In an optional embodiment, after reading the running status data, the data processing method further includes:
[0098] Based on the operating status data, the current and voltage of the target device are determined; and the current and voltage of the target device are displayed.
[0099] In specific implementation, the read operating status data can be accurately calculated to obtain the current current and voltage of the target device and display them on the DTU device interface.
[0100] In this embodiment, the current and voltage of the target device can be displayed in real time, thereby improving the user experience.
[0101] In order to further illustrate the data processing method of the embodiment of the present application, the following is explained by taking the first core as R5 and the second core as A55 as an example.
[0102] The design of the switchgear terminal equipment based on the AMP architecture chip includes the use of dual-core assistance, and the R5 core performs the relay protection algorithm in real time to realize the remote control and remote signaling of the circuit breaker of the target device. The real-time core R5 and the management core A55 use memory sharing and data synchronization to realize the inter-core sharing and communication of sampled data. In order to meet the characteristics of the large amount of DTU data, a main data cache area of 32M is set to ensure that up to 40s of data can be stored. In order to solve the problem of simultaneous interaction between R5 and A55, a backup cache area of the same size of 32M is configured. After the management core obtains the sampled data, it displays and manages the data, and displays it on the DTU interface. The software process is as follows Figure 5 Shown include:
[0103] Step 1: The real-time core and the management core complete their respective startups.
[0104] Step 2: The real-time core completes the initialization of peripherals such as the serial port and timer AD.
[0105] Step 3: The real-time core uses a timer to periodically collect real-time voltage and current telemetry signals at a fixed rate of 20us, obtains raw data, and transfers the raw data to a ring buffer (BUFF area) inside the real-time core.
[0106] Step 4: Extract 80 points of data per cycle from the original data for relay protection algorithm to achieve real-time telemetry and telesignaling control of the circuit breaker.
[0107] Step 5: The real-time core writes the raw data of 500 points and 0.8M in a fixed cycle of 1s to the data sharing area. Before writing to the sharing area, it will first query whether can_write_flagx (where can_write_flag is the data status flag of the main cache area, and x is the target main cache block number of the sharing area) is 1. If it is 1, it means that the main cache area can be written, and the raw data of each sampling is written to the main cache area. After writing the data to the main cache area, the relevant data location flag data_location_flagx (where can_write_flag is the data location flag, and x is the target main cache block number of the sharing area) is set to 0, indicating that the current raw data is stored in the main cache area. If can_write_flagx is 0, it means that the main cache area cannot be written, and the raw data of each sampling is written to the backup cache area. After writing the data to the backup cache area, the relevant data location flag data_location_flagx is set to 1, indicating that the current raw data is stored in the backup cache area.
[0108] Step 6: The management core completes the reading of the data in the shared area with a period of 1s. First, set can_write_flagx (x is the target main cache block number of the shared area) to 0, indicating that the current management core is reading the target main cache block data. Then query the data location flag data_location_flagx. If it is 0, go to the main cache area to read 500 points of data. If it is 1, go to the backup cache area to read 500 points of data and store them in the ring buffer inside the management core. After the reading is completed, set can_write_flagx to 1, indicating that the cache block management core has completed the reading and R5 can be written. Then, in the user state, through the debugging node (sys node), the data in the ring buffer is taken out, and the taken data is accurately calculated to obtain the current voltage and current data, and displayed on the DTU interface.
[0109] Compared with existing implementation solutions, the solution for switchgear terminal equipment based on AMP architecture chip can be met with a single chip; AMP architecture chip uses a built-in real-time core to process real-time data acquisition and real-time calculation, fault local action and line loss measurement and other functions; AMP architecture chip uses a built-in management core to be responsible for communication, status monitoring data reception and data analysis functions; the dual buffer area mechanism adopted in the embodiment of the present application solves the problem of simultaneous interaction of dual cores of DTU under large data volume.
[0110] According to an embodiment of the present application, the present application also provides a switch terminal device and a readable storage medium.
[0111] The terminal device of the switch has at least two core chips, such as Figure 1As shown, at least two cores include a first core and a second core, the first core and the second core exchange data through a common cache module, the cache module includes a main cache area and a backup cache area, the main cache area includes multiple main cache blocks, and the backup cache area includes multiple backup cache blocks corresponding to the multiple main cache blocks one by one.
[0112] The first kernel is used to obtain the operating status data of the target device connected to the switch terminal device; determine the target main cache block in the main cache area for storing the operating status data; determine the status information of the target main cache block, the status information includes writable status information or non-writable status information; based on the status information of the target main cache block, write the operating status data to the target main cache block, or a backup cache block corresponding to the target main cache block, and record the location information of the operating status data.
[0113] The second core is used to determine a target main cache block in the main cache area for storing the operating status data in response to a trigger signal for reading the operating status data; set the status information of the target main cache block to a state information that cannot be written; determine the location information of the operating status data, the location information including that the operating status data is stored in the target main cache block, or that the operating status data is stored in a backup cache block corresponding to the target main cache block; based on the location information of the operating status data, read the operating status data from the target main cache block or the backup cache block corresponding to the target main cache block.
[0114] Figure 6 A schematic block diagram of an example switch terminal device 800 that can be used to implement an embodiment of the present application is shown. The switch terminal device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workbenches, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The switch terminal device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples, and are not intended to limit the implementation of the present application described herein and / or required.
[0115] like Figure 6As shown, the switch terminal device 800 includes a chip 801, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 802 or a computer program loaded from a storage unit 808 to a random access memory (RAM) 803. In the RAM 803, various programs and data required for the operation of the switch terminal device 800 can also be stored. The chip 801, the ROM 802, and the RAM 803 are connected to each other via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.
[0116] Multiple components in the switchgear terminal device 800 are connected to the I / O interface 805, including: an input unit 806, such as a keyboard, a mouse, etc.; an output unit 807, such as various types of displays, speakers, etc.; a storage unit 808, such as a disk, an optical disk, etc.; and a communication unit 809, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 809 allows the switchgear terminal device 800 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0117] Chip 801 can be various general and / or special processing components with processing and computing capabilities. Chip 801 performs the various methods and processes described above, such as data processing methods. For example, in some embodiments, the data processing method can be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 808. In some embodiments, part or all of the computer program can be loaded and / or installed on the switch terminal device 800 via ROM 802 and / or communication unit 809. When the computer program is loaded into RAM 803 and executed by chip 801, one or more steps of the data processing method described above can be performed. Alternatively, in other embodiments, chip 801 can be configured to perform the data processing method by any other appropriate means (for example, by means of firmware).
[0118] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0119] The program code for implementing the method of the present application can be written in any combination of one or more programming languages. These program codes can be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, implements the functions / operations specified in the flow chart and / or block diagram. The program code can be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0120] In the context of the present application, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0121] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0122] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.
[0123] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship with each other. The server may be a cloud server, a server of a distributed system, or a server combined with a blockchain.
[0124] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this application can be executed in parallel, sequentially or in different orders, as long as the expected results of the technical solution disclosed in this application can be achieved, and this document is not limited here.
[0125] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include at least one of the features. In the description of this application, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.
[0126] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A data processing method, It is characterized in that Applied to a switchgear terminal device, the switchgear terminal device comprises a chip having at least two cores, the at least two cores comprising a first core and a second core, the first core and the second core exchange data via a common cache module, the cache module comprising a primary cache area and a backup cache area, the primary cache area comprising a plurality of primary cache blocks, the backup cache area comprising a plurality of backup cache blocks corresponding to the plurality of primary cache blocks one by one; The method comprises: The first kernel obtains the operation status data of the target device connected to the switch terminal device; Determine a target primary cache block in the primary cache area for storing the running status data; Determine state information of the target primary cache block, wherein the state information includes state information that can be written or state information that cannot be written; Based on the status information of the target primary cache block, the running status data is written to the target primary cache block or a backup cache block corresponding to the target primary cache block, and the location information of the running status data is recorded.
2. The data processing method according to claim 1, It is characterized in that Based on the status information of the target primary cache block, writing the running status data to the target primary cache block or a backup cache block corresponding to the target primary cache block, and recording the location information of the running status data, including: If the state information of the target primary cache block is state information that can be written, writing the running state data into the target primary cache block, and recording the running state data and storing it in the target primary cache block; If the state information of the target primary cache block is state information that cannot be written, the running state data is written to the backup cache block corresponding to the target primary cache block, and the running state data is recorded and stored in the backup cache block corresponding to the target primary cache block.
3. The data processing method according to claim 1, It is characterized in that Determining a target primary cache block in the primary cache area for storing the running status data includes: Determine the first primary cache block corresponding to the last data write; According to the arrangement order of the primary cache blocks, the next primary cache block of the first primary cache block is determined as the target primary cache block for storing the running status data.
4. The data processing method according to claim 1, It is characterized in that After the first kernel acquires the operation status data of the target device connected to the switch terminal device, the method further includes: Based on the operating status data, determining the opening and closing information of the target device; Based on the on / off information of the target device, the target device is controlled to be in an on state or an off state.
5. A data processing method, It is characterized in that Applied to a switchgear terminal device, the switchgear terminal device comprises a chip having at least two cores, the at least two cores comprising a first core and a second core, the first core and the second core exchange data via a common cache module, the cache module comprising a primary cache area and a backup cache area, the primary cache area comprising a plurality of primary cache blocks, the backup cache area comprising a plurality of backup cache blocks corresponding to the plurality of primary cache blocks one by one; The method comprises: The second kernel determines, in response to a trigger signal for reading the running status data, a target primary cache block in the primary cache area for storing the running status data; Setting the state information of the target primary cache block to state information that cannot be written; Determine location information of the running status data, the location information including that the running status data is stored in the target primary cache block, or that the running status data is stored in a backup cache block corresponding to the target primary cache block; Based on the location information of the running status data, the running status data is read from the target primary cache block or a backup cache block corresponding to the target primary cache block.
6. The data processing method according to claim 5, It is characterized in that Reading the running status data from the target primary cache block or a backup cache block corresponding to the target primary cache block based on the location information of the running status data includes: If the location information of the running status data indicates that the running status data is stored in the target primary cache block, read the running status data from the target primary cache block; If the location information of the running status data indicates that the running status data is stored in the backup cache block corresponding to the target primary cache block, the running status data is read from the backup cache block corresponding to the target primary cache block.
7. The data processing method according to claim 5, It is characterized in that After reading the running status data, the method further includes: The state information of the target primary cache block is set to state information that can be written.
8. The data processing method according to claim 5, It is characterized in that After reading the running status data, the method further includes: Determining a current and a voltage of the target device based on the operating status data; Displays the current and voltage of the target device.
9. A switchgear terminal device, It is characterized in that include: A chip having at least two cores, wherein the at least two cores include a first core and a second core, wherein the first core and the second core exchange data via a common cache module, wherein the cache module includes a primary cache area and a backup cache area, wherein the primary cache area includes a plurality of primary cache blocks, and the backup cache area includes a plurality of backup cache blocks corresponding to the plurality of primary cache blocks in a one-to-one manner; The first kernel is used to obtain the operation status data of the target device connected to the switch terminal device; Determine a target primary cache block in the primary cache area for storing the running status data; Determine state information of the target primary cache block, wherein the state information includes state information that can be written or state information that cannot be written; Based on the status information of the target primary cache block, write the running status data into the target primary cache block, or a backup cache block corresponding to the target primary cache block, and record the location information of the running status data; The second core is used to determine a target main cache block in the main cache area for storing the running status data in response to a trigger signal for reading the running status data; and set the status information of the target main cache block to a state information that cannot be written; Determine location information of the running status data, the location information including that the running status data is stored in the target primary cache block, or that the running status data is stored in a backup cache block corresponding to the target primary cache block; Based on the location information of the running status data, the running status data is read from the target primary cache block or a backup cache block corresponding to the target primary cache block.
10. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the data processing method according to any one of claims 1 to 8.
