Data processing method and electronic device

Through the data processing method based on the memristor array, the image center coordinates are calculated directly in the computing unit, which solves the energy consumption and delay problems caused by data movement in the traditional von Neumann architecture, and achieves efficient image processing.

CN113643175BActive Publication Date: 2024-09-03TSINGHUA UNIVERSITY

Patent Information

Application Number
CN202110938438.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-08-16
Publication Date
2024-09-03
Estimated Expiration
2041-08-16

AI Technical Summary

Technical Problem

The existing image centroid calculation hardware implementation platform is based on the traditional von Neumann architecture, which results in the image information needing to be taken out of the storage unit and then sent to the calculation unit during the calculation process, resulting in unnecessary energy consumption and waste of processing time.

Method used

Using a data processing method based on memristor array, the pixel value of the object to be processed is mapped to the memristor unit in the memristor array, and the memristor array is used to perform multiplication and sum operations to calculate the center coordinates of the image. Reduce the data migration process.

Benefits of technology

Taking advantage of the integration of storage and computing, we can reduce the energy consumption and delay overhead of hardware implementation, improve computing efficiency, and realize intelligent computing tasks with high computing power and high energy efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113643175B
    Figure CN113643175B
Patent Text Reader

Abstract

A data processing method and electronic device based on a memristor array. The data processing method includes obtaining an object to be processed, wherein the object to be processed includes a plurality of pixels arranged in an array; setting a memristor array to map the value of each pixel in the object to be processed to a corresponding memristor unit in the memristor array; and calculating the center coordinates corresponding to the object to be processed by the memristor array, wherein the memristor array is configured to perform multiplication and sum operations. The data processing method based on the memristor array reduces a lot of unnecessary data handling processes and reduces the energy consumption and delay overhead of hardware implementation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present disclosure relate to a data processing method and an electronic device. Background Art

[0002] The integrated storage and computing technology based on memristors is expected to break through the bottleneck of the von Neumann architecture of classical computing systems, bring about explosive growth in hardware computing power and energy efficiency, and further promote the development and implementation of artificial intelligence. It is one of the most promising next-generation hardware chip technologies. Domestic and foreign companies and scientific research institutions have invested a lot of manpower and material resources. After nearly ten years of development, the integrated storage and computing technology based on memristors has gradually entered the prototype demonstration stage of actual chips and systems from the theoretical simulation stage. Summary of the invention

[0003] At least one embodiment of the present disclosure provides a data processing method based on a memristor array, wherein the memristor array includes a plurality of memristor units arranged in an array, and the method includes: obtaining an object to be processed, wherein the object to be processed includes a plurality of pixel points arranged in an array; setting a memristor array to map the value of each pixel point in the object to be processed to a corresponding memristor unit in the memristor array; and calculating the center coordinates corresponding to the object to be processed through the memristor array, wherein the memristor array is configured to perform multiplication and sum operations.

[0004] For example, in the data processing method provided by at least one embodiment of the present disclosure, the center coordinates include a first coordinate and a second coordinate, the object to be processed includes m rows and n columns, m and n are positive integers respectively, and the center coordinates corresponding to the object to be processed are calculated by a memristor array, including: for each pixel point in the multiple pixel points in the object to be processed: multiplying the value of the pixel point by the row number of the row in which the pixel point is located in the object to be processed to obtain a first product corresponding to the pixel point, thereby obtaining m*n first products, summing the m*n first products to obtain a first numerator value, multiplying the value of the pixel point by the column number of the column in which the pixel point is located in the object to be processed to obtain a second product corresponding to the pixel point, thereby obtaining m*n second products, and summing the m*n second products to obtain a second numerator value; adding the value of each pixel point in the object to be processed to obtain a denominator value; dividing the first numerator value by the denominator value to obtain the first coordinate corresponding to the object to be processed, and dividing the second numerator value by the denominator value to obtain the second coordinate corresponding to the object to be processed.

[0005] For example, in the data processing method provided by at least one embodiment of the present disclosure, the value of a pixel point is multiplied by the row number of the row in which the pixel point is located in the object to be processed to obtain a first product corresponding to the pixel point, thereby obtaining m*n first products, and the m*n first products are summed to obtain a first numerator value, including: for the i-th row in m rows, read the values ​​of all pixel points in the i-th row i times to obtain i reading results, add the i reading results to obtain the sum of the pixel values ​​corresponding to the i-th row, where i is a positive integer; add the sums of the m pixel values ​​corresponding to the m rows respectively to obtain the first numerator value.

[0006] For example, in a data processing method provided by at least one embodiment of the present disclosure, a memristor array includes M rows and N columns of memristor units, and the memristor array also includes M word lines, M source lines, and N bit lines, the M word lines and the M source lines correspond to the M rows, respectively, the N bit lines correspond to the N columns, respectively, M and N are positive integers and are greater than or equal to m and n, respectively, each of the plurality of memristor units is turned on upon receiving an on signal applied by a corresponding word line and a read voltage is applied to a corresponding bit line to be read, and a corresponding read current is generated according to the resistance value of the memristor in the memristor unit, wherein the reading i times The invention relates to a method for obtaining a first numerator value by obtaining the values ​​of all pixel points in the i-th row to obtain i reading results, and adding the i reading results to obtain the sum of the pixel values ​​corresponding to the i-th row, including: making the memristor unit corresponding to each pixel point in all pixel points in the i-th row generate i reading currents in m consecutive cycles, and adding the i reading currents generated by all memristor units corresponding to all pixel points in the i-th row to obtain the output current corresponding to the i-th row; and adding the sum of the m pixel values ​​corresponding to the m rows to obtain a first numerator value, including: adding the m output currents corresponding to the m rows to obtain the first numerator value.

[0007] For example, in the data processing method provided by at least one embodiment of the present disclosure, the memristor unit corresponding to each pixel point in all pixels in the i-th row generates i read currents within m consecutive cycles, including: applying a read voltage to the bit lines of the memristor units corresponding to all pixels within m consecutive cycles, and applying a start signal for i cycles to the word lines of the memristor units corresponding to the i-th row within m consecutive cycles.

[0008] For example, in the data processing method provided by at least one embodiment of the present disclosure, the value of a pixel point is multiplied by the column number of the column in which the pixel point is located in the object to be processed to obtain a second product corresponding to the pixel point, thereby obtaining m*n second products, and the m*n second products are summed to obtain a second numerator value, including: for the jth column in n columns, read the values ​​of all pixels in the jth column j times to obtain j reading results, add the j reading results to obtain the sum of the pixel values ​​corresponding to the jth column, where j is a positive integer; add the sums of the n pixel values ​​corresponding to the n columns respectively to obtain the second numerator value.

[0009] For example, in a data processing method provided by at least one embodiment of the present disclosure, a memristor array includes M rows and N columns, and the memristor array also includes M word lines, M source lines, and N bit lines, the M word lines and the M source lines correspond to the M rows, respectively, the N bit lines correspond to the N columns, respectively, M and N are positive integers and are greater than or equal to m and n, respectively, each of the plurality of memristor units is turned on upon receiving an on signal applied by a corresponding word line and a read voltage is applied to the corresponding bit line to be read, and a corresponding read current is generated according to the resistance value of the memristor in the memristor unit, wherein the jth column is read j times. The method comprises: obtaining j reading results of all pixel points in the j-th column, adding the j reading results to obtain the sum of the pixel values ​​corresponding to the j-th column, including: making the memristor unit corresponding to each pixel point in all pixel points in the j-th column generate j reading currents in n consecutive cycles, and summing the j reading currents generated by all memristor units corresponding to all pixel points in the j-th column to obtain the output current corresponding to the j-th column; and adding the sum of n pixel values ​​corresponding to the n columns to obtain a second numerator value, including: adding the n output currents corresponding to the n columns to obtain the second numerator value.

[0010] For example, in the data processing method provided by at least one embodiment of the present disclosure, the memristor unit corresponding to each pixel point in all the pixels in the j-th column generates j read currents within n consecutive cycles, including: applying an open signal to the word line of the memristor unit corresponding to all the pixels within n consecutive cycles, and applying a read voltage for j cycles to the bit line of the memristor unit corresponding to the j-th column within n consecutive cycles.

[0011] For example, in the data processing method provided by at least one embodiment of the present disclosure, the memristor array includes M rows and N columns of memristor units, and the memristor array also includes M word lines, M source lines and N bit lines, the M word lines and the M source lines correspond to the M rows respectively, the N bit lines correspond to the N columns respectively, M and N are positive integers and are greater than or equal to m and n respectively, each of the multiple memristor units is turned on upon receiving the start signal applied by the corresponding word line and a read voltage is applied to the corresponding bit line to be read, and a corresponding read current is generated according to the resistance value of the memristor in the memristor unit, wherein the value of each pixel point in the object to be processed is added to obtain a denominator value, including: obtaining a single read current generated by the memristor unit corresponding to each pixel point in the multiple pixels to obtain multiple read currents; and summing the multiple read currents to obtain the denominator value.

[0012] For example, in the data processing method provided in at least one embodiment of the present disclosure, a read current generated by a memristor unit corresponding to each pixel point among a plurality of pixel points is obtained to obtain a plurality of read currents, including: within one cycle, a read voltage is applied to the bit lines of n columns of memristor units corresponding to n columns of pixel points, and a turn-on signal is applied to the word lines of m rows of memristor units corresponding to m rows of pixel points.

[0013] For example, in the data processing method provided by at least one embodiment of the present disclosure, the value of each pixel point is one of a first value and a second value different from each other, each memristor unit has a first state or a second state, the center coordinates are the centroid coordinates of the object to be processed, and the value of each pixel point in the object to be processed is mapped to the corresponding memristor unit in the memristor array, including: in response to the value of a pixel point in the object to be processed being a first value, the memristor unit corresponding to the pixel point in the memristor array is set to a first state; in response to the value of a pixel point in the object to be processed being a second value, the memristor unit corresponding to the pixel point in the memristor array is set to a second state, and the first state is different from the second state.

[0014] For example, in a data processing method provided by at least one embodiment of the present disclosure, obtaining an object to be processed includes: obtaining an image to be processed, wherein the image to be processed includes at least one connected domain; and taking each connected domain as an object to be processed.

[0015] For example, in the data processing method provided in at least one embodiment of the present disclosure, a memristor array is set to map the value of each pixel point in the object to be processed to the corresponding memristor unit in the memristor array, including: mapping the value of each pixel point in at least one connected domain to the corresponding memristor unit in the memristor array, and making sure that the memristor units corresponding to any two connected domains do not overlap in the row direction and the column direction.

[0016] For example, the data processing method provided by at least one embodiment of the present disclosure also includes: adding the first coordinate to the row number of the row in which the first row of the object to be processed is located in the image to be processed and then subtracting one to obtain a first update value, updating the first coordinate to the first update value, adding the second coordinate to the column number of the column in which the first column of the object to be processed is located in the image to be processed and then subtracting one to obtain a second update value, and updating the second coordinate to the second update value.

[0017] At least one embodiment of the present disclosure provides an electronic device, comprising: a memristor array; a controller, wherein the controller is configured to: obtain an object to be processed, wherein the object to be processed includes a plurality of pixel points arranged in an array; set the memristor array to map the value of each pixel point in the object to be processed to a corresponding memristor unit in the memristor array; calculate the center coordinates corresponding to the object to be processed through the memristor array, wherein the memristor array is configured to perform multiplication and sum operations.

[0018] For example, the electronic device provided in at least one embodiment of the present disclosure further includes: an integrator configured to convert the output current signal of the source line of the memristor array into a corresponding voltage signal and accumulate the voltage signals to obtain an output voltage signal.

[0019] For example, the electronic device provided by at least one embodiment of the present disclosure further includes: an analog-to-digital converter, where the analog-to-digital converter is configured to process the output voltage signal from the integrator. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the drawings of the embodiments will be briefly introduced below. Obviously, the drawings in the following description only relate to some embodiments of the present disclosure, but are not intended to limit the present disclosure.

[0021] Figure 1 A schematic structural diagram of a memristor array is shown;

[0022] Figure 2 A schematic diagram of a memristor unit having a 1T1R structure is shown;

[0023] Figure 3 A schematic diagram of a memristor unit having a 2T2R structure is shown;

[0024] Figure 4 A schematic flow chart of a data processing method based on a memristor array provided by at least one embodiment of the present disclosure is shown;

[0025] Figure 5A A flow chart of a method for calculating the center coordinates corresponding to an object to be processed by using a memristor array provided by at least one embodiment of the present disclosure is shown;

[0026] Figure 5BA schematic diagram of a memristor array provided by at least one embodiment of the present disclosure is shown;

[0027] Fig. 6A A schematic diagram of an image to be processed is shown;

[0028] Figure 6B Shows Fig. 6A The schematic diagram of the mapping state of the image to be processed is shown;

[0029] Figure 6C A schematic diagram showing a mapping state of an image to be processed provided by at least one embodiment of the present disclosure is shown;

[0030] Figure 7 A flow chart of a method for implementing data processing based on a memristor array provided by at least one embodiment of the present disclosure is shown;

[0031] Fig. 8A A schematic diagram of calculating a first coordinate of a centroid based on a memristor array provided by at least one embodiment of the present disclosure is shown;

[0032] Figure 8B A schematic diagram of calculating the second coordinate of the centroid based on a memristor array provided by at least one embodiment of the present disclosure is shown;

[0033] Fig. 9 A schematic block diagram of an electronic device provided by at least one embodiment of the present disclosure is shown. DETAILED DESCRIPTION

[0034] In order to make the purpose, technical solution and advantages of the embodiments of the present disclosure clearer, the technical solution of the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings of the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, not all of the embodiments. Based on the described embodiments of the present disclosure, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present disclosure.

[0035] Unless otherwise defined, the technical terms or scientific terms used in the present disclosure should be understood by people with ordinary skills in the field to which the present disclosure belongs. The "first", "second" and similar words used in the present disclosure do not indicate any order, quantity or importance, but are only used to distinguish different components. Similarly, similar words such as "one", "one" or "the" do not indicate quantity restrictions, but indicate that there is at least one. Similar words such as "include" or "comprise" mean that the elements or objects appearing before the word cover the elements or objects listed after the word and their equivalents, without excluding other elements or objects. Similar words such as "connect" or "connected" are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect. "Up", "down", "left", "right" and the like are only used to indicate relative positional relationships. When the absolute position of the described object changes, the relative positional relationship may also change accordingly.

[0036] The centroid is the geometric center of the cross-sectional figure of an abstract geometric body. For a solid object with uniform density, the center of mass and the centroid coincide.

[0037] The existing hardware implementation platform for image centroid calculation is still based on the traditional von Neumann architecture CPU and GPU. This architecture, in which the computing unit is separated from the storage unit, requires that during the calculation process, the image information must first be taken out of the storage unit and then sent to the computing unit. This data access process causes unnecessary energy consumption and waste of processing time.

[0038] Memristor (e.g., resistive random access memory, phase change memory, conductive bridge memory, etc.) is a non-volatile device whose conductivity state can be adjusted by applying external stimuli. As a two-terminal device, memristor has the characteristics of adjustable resistance and non-volatility, so it is widely used in storage and computing. According to Kirchhoff's current law and Ohm's law, an array composed of memristors can complete multiplication and accumulation calculations in parallel, and storage and calculation occur in each device in the array. Based on this computing architecture, storage and computing can be realized without the need for large amounts of data movement.

[0039] At least one embodiment of the present disclosure provides a data processing method based on a memristor array, wherein the memristor array includes a plurality of memristor units arranged in an array, and the method includes: obtaining an object to be processed, wherein the object to be processed includes a plurality of pixel points arranged in an array; setting a memristor array to map the value of each pixel point in the object to be processed to a corresponding memristor unit in the memristor array; and calculating the center coordinates corresponding to the object to be processed through the memristor array, wherein the memristor array is configured to perform multiplication and sum operations.

[0040] At least one embodiment of the present disclosure also provides an electronic device corresponding to the above-mentioned memristor array-based data processing method.

[0041] The data processing method based on the memristor array provided in the above-mentioned embodiment of the present disclosure can store image information through the memristor array, complete the calculation of the center coordinates of the image, and utilize the storage and computing advantages of the memristor array to reduce unnecessary data transfer processes and reduce the energy consumption and delay overhead of hardware implementation.

[0042] For example, in the present disclosure, the center coordinates corresponding to the object to be processed may include centroid coordinates or centroid coordinates.

[0043] The embodiments of the present disclosure are described in detail below with reference to the accompanying drawings, but the present disclosure is not limited to these specific embodiments.

[0044] Figure 1 A schematic diagram of a memristor array structure is shown. Figure 1 As shown, the memristor array is composed of a plurality of memristor units, which form an array of M rows and N columns, where M and N are both positive integers. Each memristor unit includes a switch element and one or more memristors. Figure 1 In, WL <1> , WL <2> ...WL <m>Respectively represent the word lines of the first row, the second row, ... the Mth row, and the control electrode (eg, the gate of the transistor) of the switch element in the memristor unit circuit of each row is connected to the word line corresponding to the row; BL <1> BL <2> ...BL <n>They represent the bit lines of the first column, the second column, ... the Nth column respectively, and the memristors in the memristor unit circuit of each column are connected to the bit lines corresponding to the column; SL <1> , SL <2> ...SL <m>They represent source lines of the first row, the second row, ... the Mth row respectively, and the sources of the transistors in the memristor unit circuit of each row are connected to the source line corresponding to the row.

[0045] For example, according to Kirchhoff's law, by setting the state of the memristor unit (such as resistance) and applying corresponding word line signals and bit line signals to the word line and bit line, the memristor array can complete multiplication and accumulation calculations in parallel. The multiplication and accumulation calculation process is implemented using physical laws. Unlike the digital circuit implementation of Boolean logic, this calculation process does not require frequent memory access to move weight data, which solves the von Neumann bottleneck of the classical computing system and can achieve high computing power and high energy efficiency intelligent computing tasks.

[0046] Figure 1 The memristor unit in the memristor array can be, for example, a 1T1R structure or a 2T2R structure, wherein the memristor unit of the 1T1R structure includes a switch transistor and a memristor, and the memristor unit of the 2T2R structure includes two switch transistors and two memristors. The present disclosure has no limitation on the type, structure, etc. of the memristor device.

[0047] It should be noted that the transistors used in the embodiments of the present disclosure may be thin film transistors or field effect transistors (such as MOS field effect transistors) or other switching devices with the same characteristics. The source and drain of the transistor used here may be symmetrical in structure, so the source and drain may be indistinguishable in structure. The embodiments of the present disclosure do not limit the type of transistor used.

[0048] Figure 2 FIG. 1 shows a schematic diagram of a memristor unit having a 1T1R structure. Figure 2 As shown, the memristor unit of the 1T1R structure includes a transistor M1 and a memristor R1.

[0049] For example, when the transistor M1 is an N-type transistor, its gate is connected to the word line terminal WL, for example, when a high level is input to the word line terminal WL, the transistor M1 is turned on; the first electrode of the transistor M1 can be a source electrode and is configured to be connected to the source line terminal SL, for example, the transistor M1 can receive a reset voltage through the source line terminal SL; the second electrode of the transistor M1 can be a drain electrode and is configured to be connected to the second electrode (for example, the negative electrode) of the memristor R1, and the first electrode (for example, the positive electrode) of the memristor R1 is connected to the bit line terminal BL, for example, the memristor R1 can receive a set voltage through the bit line terminal BL. For example, when the transistor M1 is a P-type transistor, its gate is connected to the word line terminal WL, for example, when the word line terminal WL is input with a low level, the transistor M1 is turned on; the first electrode of the transistor M1 can be a drain and is configured to be connected to the source line terminal SL, for example, the transistor M1 can receive a reset voltage through the source line terminal SL; the second electrode of the transistor M1 can be a source and is configured to be connected to the second electrode (for example, the negative electrode) of the memristor R1, and the first electrode (for example, the positive electrode) of the memristor R1 is connected to the bit line terminal BL, for example, the memristor R1 can receive a set voltage through the bit line terminal BL. It should be noted that the resistive memory structure can also be implemented as other structures, such as a structure in which the second electrode of the memristor R1 is connected to the source line terminal SL, and the embodiments of the present disclosure are not limited to this.

[0050] The following embodiments are described by taking the transistor M1 as an N-type transistor as an example.

[0051] The function of the word line terminal WL is to apply a corresponding voltage to the gate of the transistor M1, thereby controlling the transistor M1 to be turned on or off. When operating the memristor R1, such as performing a set operation or a reset operation, it is necessary to turn on the transistor M1 first, that is, it is necessary to apply a turn-on voltage to the gate of the transistor M1 through the word line terminal WL. After the transistor M1 is turned on, for example, a voltage can be applied to the memristor R1 at the source line terminal SL and the bit line terminal BL to change the resistance state of the memristor R1. For example, a set voltage can be applied through the bit line terminal BL to make the memristor R1 in a low resistance state; for another example, a reset voltage can be applied through the source line terminal SL to make the memristor R1 in a high resistance state. For example, the resistance value of the high resistance state is more than 100 times the resistance value of the low resistance state, for example, more than 1000 times.

[0052] It should be noted that, in the embodiment of the present disclosure, by applying voltage simultaneously to the word line terminal WL and the bit line terminal BL, the resistance value of the memristor R1 can be made smaller and smaller, that is, the memristor R1 changes from a high resistance state to a low resistance state, and the operation of changing the memristor R1 from a high resistance state to a low resistance state is called a set operation; by applying voltage simultaneously to the word line terminal WL and the source line terminal SL, the resistance value of the memristor R1 can be made larger and larger, that is, the memristor R1 changes from a low resistance state to a high resistance state, and the operation of changing the memristor R1 from a low resistance state to a high resistance state is called a reset operation. For example, the memristor R1 has a threshold voltage, and when the input voltage amplitude is less than the threshold voltage of the memristor R1, the resistance value (or conductance value) of the memristor R1 will not be changed. In this case, the resistance value (or conductance value) of the memristor R1 can be used for calculation by inputting a voltage less than the threshold voltage; the resistance value (or conductance value) of the memristor R1 can be changed by inputting a voltage greater than the threshold voltage.

[0053] Figure 3 FIG. 1 shows a schematic diagram of a memristor unit having a 2T2R structure. Figure 3 As shown, the 2T2R structure memristor unit includes two transistors M1 and M2 and two memristors R1 and R2. The following description is made by taking the transistors M1 and M2 both being N-type transistors as an example.

[0054] The gate of transistor M1 is connected to the word line terminal WL1, for example, transistor M1 is turned on when a high level is input to the word line terminal WL1 of M1, and the gate of transistor M2 is connected to the word line terminal WL2, for example, transistor M2 is turned on when a high level is input to the word line terminal WL2 of M2; the first electrode of transistor M1 can be a source and is configured to be connected to the source line terminal SL, for example, transistor M1 can receive a reset voltage through the source line terminal SL, the first electrode of transistor M2 can be a source and is configured to be connected to the source line terminal SL, for example, transistor M2 can receive a reset voltage through the source line terminal SL, the first electrode of transistor M1 is connected to the first electrode of transistor M2, and they are connected together to the source line terminal SL. The second electrode of the transistor M1 may be a drain and configured to be connected to the second electrode (e.g., negative electrode) of the memristor R1, the first electrode (e.g., positive electrode) of the memristor R1 is connected to the bit line terminal BL1, for example, the memristor R1 may receive a set voltage through the bit line terminal BL1; the second electrode of the transistor M2 may be a drain and configured to be connected to the second electrode (e.g., negative electrode) of the memristor R2, the first electrode (e.g., positive electrode) of the memristor R2 is connected to the bit line terminal BL2, for example, the memristor R2 may receive a set voltage through the bit line terminal BL2.

[0055] It should be noted that the transistors M1 and M2 in the memristor unit of the 2T2R structure may also be P-type transistors, which will not be described in detail here.

[0056] Figure 4 A schematic flow chart of a data processing method based on a memristor array provided by at least one embodiment of the present disclosure is shown.

[0057] For example, Figure 4 As shown, the data processing method based on the memristor array provided by the embodiment of the present disclosure includes steps S401 to S403, and the memristor array includes a plurality of memristor units arranged in an array and is configured to perform multiplication and addition operations (i.e., multiplication and accumulation operations, accumulating the product results of the multiplication to obtain the sum of the accumulated multiplication and addition results). For example, the structural schematic diagram of the memristor array is shown in Figure 1 or the following Figure 5B As shown, each memristor unit can be Figure 2 The 1T1R structure shown or Figure 3 The 2T2R structure shown.

[0058] Step S401: Obtain the object to be processed.

[0059] For example, the object to be processed includes a plurality of pixels arranged in an array.

[0060] Step S402: setting a memristor array, mapping the value of each pixel in the object to be processed to a corresponding memristor unit in the memristor array.

[0061] Step S403: calculating the center coordinates corresponding to the object to be processed by means of the memristor array. Here, the memristor array is configured to perform multiplication and sum operations.

[0062] The data processing method of the above embodiment calculates the center coordinates corresponding to the object to be processed through the memristor array, which reduces a lot of unnecessary data handling processes and reduces the energy consumption and delay overhead of hardware implementation.

[0063] The above steps S401 to S403 are further illustrated below.

[0064] For example, the object to be processed may be a complete image to be processed, for example, the image to be processed is a binary image, and includes a plurality of pixels arranged in an array, and the value of each pixel is one of a first value and a second value different from each other, for example, the first value is 0 and corresponds to white, and the second value is 1 and corresponds to black. The object to be processed may be obtained in a variety of ways, for example, a previously stored binary image, or a currently acquired color or grayscale image is obtained by binarization processing.

[0065] For example, the object to be processed may also be a connected domain in the image to be processed. For example, step S401 may include: obtaining the image to be processed, wherein the image to be processed includes at least one connected domain; and taking each connected domain as the object to be processed.

[0066] Therefore, the object to be processed processed by the present disclosure may be part or all of the image, and the central coordinates corresponding to the part or all of the image may be calculated. In step S402, a memristor array is set to map the value of each pixel point in the object to be processed to a corresponding memristor unit in the memristor array.

[0067] For example, the value of each pixel of a binary image can be stored in a memristor array in the form of conductance, and the storage and computing advantages of the memristor array can be used to efficiently and quickly implement image morphological operations.

[0068] For example, when the object to be processed is a binary image, each memristor unit has a first state and a second state. At this time, the center coordinates are the centroid coordinates of the object to be processed.

[0069] For example, step S402 may include: in response to a pixel value in the object to be processed being a first value, setting the memristor unit corresponding to the pixel in the memristor array to a first state; in response to a pixel value in the object to be processed being a second value, setting the memristor unit corresponding to the pixel in the memristor array to a second state, the first state being different from the second state.

[0070] For example, if the value of a pixel in the object to be processed is a first value (for example, 0), the memristor unit at the position corresponding to the pixel in the memristor array is set to a first state; if the value of a pixel in the object to be processed is a second value (for example, 1), the memristor unit at the position corresponding to the pixel in the memristor array is set to a second state. For example, in one example, the memristor unit is a 1T1R structure, and the value of the pixel can be represented by the high resistance state or low resistance state of the memristor of the memristor unit in the 1T1R structure to represent the value of the pixel as the first value or the second value. For example, by applying a start signal (e.g., 5 volts) to the word line terminal WL, applying a read voltage (e.g., 0.15 volts) to the bit line terminal BL, and applying, for example, a reference voltage (e.g., 0 volts) to the source line terminal SL, a current flowing through the bit line terminal to the source line terminal and through the memristor can be obtained, and the resistance (i.e., the value) stored in the memristor can be obtained by the magnitude of the current. The current obtained when the memristor is in a high-resistance state is much smaller than the current when the memristor is in a low-resistance state, and can even be ignored relative to the current when the memristor is in a low-resistance state (i.e., it can be treated as 0).

[0071] In another example, the memristor unit is a 2T2R structure, and the value of the pixel point can be represented by the resistance difference between the two memristors R1 and R2 in the 2T2R structure. For example, a low resistance difference (for example, 0) represents a first value, and a high resistance difference represents a second value.

[0072] For example, by applying an on signal to the word line terminal WL, applying a read voltage to the bit line terminal BL, and applying a reference voltage (e.g., 0V) to the source line terminal SL, a current can be obtained that flows from the source line terminal to the bit line terminal and through the two memristors respectively. The resistance difference (i.e., numerical value) stored in the memristor can be obtained through the magnitude of the current. When the resistance difference of the memristor is low, the current obtained is much smaller than the current when the resistance difference of the memristor is high, and can even be ignored relative to the current when the resistance difference of the memristor is high (i.e., it can be treated as 0).

[0073] More specifically, if the memristor cell of the memristor array is a 1T1R structure, the first state of the memristor cell corresponds to the memristor in the memristor cell being in a high-resistance state, and the second state of the memristor cell corresponds to the memristor in the memristor cell being in a low-resistance state. For example, if the memristor cell of the memristor array is a 2T2R structure, such as Figure 3 As shown, the second state of the memristor unit corresponds to that the memristor R1 in the memristor unit has a low resistance state and the memristor R2 has a high resistance state, and the first state of the memristor unit corresponds to that the memristor R1 and the memristor R2 in the memristor unit have a high resistance state or a low resistance state at the same time. When the memristor R1 and the memristor R2 in the memristor unit have a low resistance state at the same time, the circuit energy consumption is higher than that when the memristor R1 and the memristor R2 in the memristor unit have a high resistance state at the same time.

[0074] For example, when the object to be processed is a binary image, the center coordinates corresponding to the object to be processed are the centroid coordinates, and the memristor unit stores binary information; for example, when each pixel point in the object to be processed stores density information, the center coordinates corresponding to the object to be processed are the centroid coordinates, and the memristor unit stores multi-bit density information.

[0075] Figure 5A A flow chart of calculating the center coordinates of an object to be processed by a memristor array provided by at least one embodiment of the present disclosure is shown. The center coordinates include a first coordinate and a second coordinate, and the object to be processed includes m rows and n columns, where m and n are positive integers.

[0076] For example, in the present disclosure, the first coordinate represents the horizontal coordinate in the center coordinate corresponding to the object to be processed, and the second coordinate represents the vertical coordinate in the center coordinate corresponding to the object to be processed. The following takes the first coordinate as the horizontal coordinate and the second coordinate as the vertical coordinate as an example to specifically illustrate the execution process of step S403.

[0077] like Figure 5A As shown, the method for calculating the center coordinates corresponding to the object to be processed performs the following steps S501 to S504 on each pixel point among a plurality of pixel points in the object to be processed.

[0078] Step S501: multiply the value of the pixel by the row number of the row where the pixel is located in the object to be processed to obtain a first product corresponding to the pixel, thereby obtaining m*n first products, and summing the m*n first products to obtain a first numerator value.

[0079] Step S502: multiply the value of the pixel by the column number of the column where the pixel is located in the object to be processed to obtain a second product corresponding to the pixel, thereby obtaining m*n second products, and summing the m*n second products to obtain a second numerator value.

[0080] Step S503: sum the value of each pixel in the object to be processed to obtain a denominator value.

[0081] Step S504: Divide the first numerator value and the denominator value to obtain the first coordinate corresponding to the object to be processed, and divide the second numerator value and the denominator value to obtain the second coordinate corresponding to the object to be processed.

[0082] For example, before executing step S501, the row number of each row and the column number of each column of the object to be processed may be obtained first.

[0083] For example, the object to be processed includes a plurality of pixel points arranged in an array of m rows and n columns, the first row in the object to be processed is numbered 1, the second row in the object to be processed is numbered 2, ..., and the last row in the object to be processed is numbered m; for example, the first column in the object to be processed is numbered 1, the second column in the object to be processed is numbered 2, ..., and the last column in the object to be processed is numbered n. For example, the calculation formula for the centroid coordinates corresponding to the object to be processed is as follows:

[0084]

[0085]

[0086] Here, x represents the abscissa of the centroid, y represents the ordinate of the centroid, Row_0 represents the row number of the first row in the object to be processed, Col_0 represents the column number of the first column in the object to be processed, Row_end represents the row number of the last row of the object to be processed, Col_end represents the column number of the last column of the object to be processed, Row represents the row number of the row where each pixel point is located in the object to be processed, Col represents the column number of the column where each pixel point is located in the object to be processed, N(Row) represents the number of pixels with a value of 1 in the Row of the object to be processed, and N(Col) represents the number of pixels with a value of 1 in the Col column of the object to be processed.

[0087] When calculating the first coordinate, the value of each pixel (for example, 0 or 1 when the object to be processed is a binary image) is multiplied by the row number of the row in which the pixel is located in the image to be processed to obtain a first product, and the first products corresponding to all the pixels in the object to be processed are added together, and the sum is used as the first numerator value, that is, the horizontal coordinate numerator value in formula (1).

[0088] For example, the object to be processed is a binary image, including m rows and n columns. There are m*n pixels in the object to be processed, and the value of each pixel is 0 or 1. As mentioned above, the m rows of the object to be processed are numbered 1, ..., m in sequence, where m is a positive integer. For example, for the first row of the object to be processed, the row number is 1, and the first product corresponding to each pixel in the first row is the value of the pixel multiplied by 1. Since there are m*n pixels in the object to be processed, performing the above operation on each pixel will eventually result in m*n products, and adding the m*n products will result in the first numerator value.

[0089] For example, if the value of a pixel is 0, the first product corresponding to the pixel is 0. Therefore, the sum of the first products corresponding to the pixels in each row of the object to be processed is equal to the row number of the row multiplied by the number of pixels with a value of 1, which corresponds to the calculation formula of the numerator value of the horizontal axis in formula (1).

[0090] Similarly, when calculating the second coordinate, the value of each pixel is multiplied by the column number of the column in which the pixel is located in the object to be processed to obtain the second product, and the second products corresponding to all the pixels in the object to be processed are added together, and the sum is used as the second numerator value, that is, the numerator value of the vertical coordinate in formula (2).

[0091] As mentioned above, the n columns of the object to be processed are numbered 1, ..., n in sequence, where n is a positive integer. For example, for the first column of the object to be processed, the column number is 1, and the second product corresponding to each pixel in the first column is the value of the pixel multiplied by 1. Since there are m*n pixels in the object to be processed, performing the above operation on each pixel will eventually result in m*n products, and adding the m*n products will result in the second numerator value.

[0092] For example, if the value of a pixel is 0, the second product corresponding to the pixel is 0. Therefore, the sum of the second products corresponding to the pixels in each column of the object to be processed is equal to the column number of the column multiplied by the number of pixels with a value of 1, which corresponds to the calculation formula of the ordinate numerator value in formula (2).

[0093] For example, the value of each pixel in the object to be processed is added to obtain a denominator value, that is, the denominator value in formula (1) and formula (2).

[0094] Afterwards, the numerator and denominator of the horizontal coordinate are divided according to formula (1) to obtain the first coordinate, that is, the horizontal coordinate in the center coordinate corresponding to the object to be processed, and the numerator and denominator of the vertical coordinate are divided according to formula (2) to obtain the second coordinate, that is, the vertical coordinate in the center coordinate corresponding to the object to be processed.

[0095] In some embodiments of the present disclosure, step S501 may include: for the i-th row among m rows, reading the values ​​of all pixel points in the i-th row i times to obtain i reading results, adding the i reading results to obtain the sum of the pixel values ​​corresponding to the i-th row, where i is a positive integer; adding the sums of the m pixel values ​​corresponding to the m rows respectively to obtain a first numerator value.

[0096] In some embodiments of the present disclosure, the memristor array includes M rows and N columns of memristor units, that is, each row has N memristor units and each column has M memristor units. The memristor array also includes M word lines, M source lines, and N bit lines, the M word lines and the M source lines correspond to the M rows, respectively, the N bit lines correspond to the N columns, respectively, and M and N are positive integers and are greater than or equal to m and n, respectively.

[0097] Figure 5B A schematic diagram of a memristor array provided by at least one embodiment of the present disclosure is shown.

[0098] like Figure 5B As shown, the memristor array includes a plurality of memristor units arranged in an array, for example, including 50 rows and 50 columns of memristor units. The plurality of memristor units may be Figure 2 The 1T1R structure shown or Figure 3 Of course, it should be noted that the memristor array may also include more rows and more columns of memristor units as required, and the present disclosure does not limit this.

[0099] The value of each pixel is mapped to a memristor unit. For example, the memristor array used here can store binary information. For example, when the memristor in the memristor unit is in a high-resistance state, it indicates that the value of the corresponding pixel is 0. When the memristor in the memristor unit is in a low-resistance state, it indicates that the value of the corresponding pixel is 1. Thus, the center coordinates of the object to be processed can be calculated using the memristor array.

[0100] For example, the object to be processed is a binary image, and includes a plurality of pixels arranged in an array, and the value of each pixel is one of a first value and a second value that are different from each other, for example, the first value is 0 and corresponds to white, and the second value is 1 and corresponds to black, and the value of each pixel in the object to be processed is mapped to a corresponding memristor unit in the memristor array. Figure 5B As shown, the 0 or 1 value marked on each memristor unit represents the value of the pixel point stored therein.

[0101] For example, the memristor array further includes 50 word lines, 50 source lines, and 50 bit lines. The 50 word lines and the 50 source lines correspond to 50 rows, respectively, and the 50 bit lines correspond to 50 columns, respectively.

[0102] For example, 50 source lines are electrically connected to an integrator through a switch element, and the integrator converts the current signal output by the source line of the memristor unit into a corresponding voltage signal and accumulates it to obtain an output voltage signal. For example, an integrator is electrically connected to 50 source lines of a memristor unit, and the integrator is used to convert the current signal output by the source line of the memristor unit into a corresponding voltage signal and accumulate it to obtain an output voltage signal, for example, an analog-to-digital converter is electrically connected to the integrator, and the analog-to-digital converter is used to quantize the output voltage signal from the integrator.

[0103] For example, each of the plurality of memristor units is turned on upon receiving an enable signal applied by a corresponding word line and a read voltage is applied to a corresponding bit line for reading, and a corresponding read current is generated according to the resistance value of the memristor in the memristor unit.

[0104] For example, when each of the multiple memristor units is turned on by receiving an enable signal applied by a corresponding word line and a read voltage is applied to a corresponding bit line for reading, if the memristor unit is in a first state, a first read current is generated on the corresponding source line; if the memristor unit is in a second state, a second read current is generated on the corresponding source line.

[0105] For example, the memristor in the memristor unit can also store multi-bit width data. In this case, the memristor also includes more states in addition to the first state and the second state, and each state corresponds to a different resistance value of the memristor. Therefore, when the memristor unit is read, it generates different read currents according to the different resistance values ​​of the memristor.

[0106] For example, reading the values ​​of all pixels in the i-th row i times to obtain i reading results, and adding the i reading results to obtain the sum of the pixel values ​​corresponding to the i-th row may include: causing the memristor unit corresponding to each pixel in all the pixels in the i-th row to generate i reading currents in m consecutive cycles, and adding the i reading currents generated by all memristor units corresponding to all the pixels in the i-th row to obtain the output current corresponding to the i-th row; and adding the sum of the m pixel values ​​corresponding to the m rows to obtain a first numerator value, which may include: adding the m output currents corresponding to the m rows to obtain the first numerator value.

[0107] For example, causing the memristor unit corresponding to each pixel in all pixels in the i-th row to generate i read currents within m consecutive cycles may include: applying a read voltage to the bit lines of the memristor units corresponding to all pixels within m consecutive cycles, and applying a start signal for i cycles to the word lines of the memristor units corresponding to the i-th row within m consecutive cycles.

[0108] For example, according to Kirchhoff's law, the source line current of the memristor unit is the product of the input voltage and the conductance matrix. As described above, the values ​​of each pixel point of the object to be processed are stored in the memristor array in the form of conductance, and the row number of each pixel point in the object to be processed is converted into a different number of high-level pulses and input to the corresponding WL end. For example, in m consecutive cycles, the word line end of the memristor unit corresponding to all the pixels in the first row of the object to be processed inputs a one-cycle start signal, the word line end of the memristor unit corresponding to all the pixels in the second row of the object to be processed inputs two cycles of start signals, and the word line end of the memristor unit corresponding to all the pixels in the i-th row of the object to be processed inputs i cycles of start signals, and so on.

[0109] For example, in the first cycle, an enable signal is applied to the word lines corresponding to the memristor units corresponding to all the pixels in the object to be processed; in the second cycle, an enable signal is applied to the word lines of the memristor units corresponding to all the pixels in the (m-1) rows of the object to be processed except the first row, and the enable signal is not applied to the word lines of the memristor units corresponding to all the pixels in the first row; in the third cycle, an enable signal is applied to the word lines of the memristor units corresponding to all the pixels in the (m-2) rows of the object to be processed except the first row and the second row, and the enable signal is not applied to the word lines of the memristor units corresponding to all the pixels in the first row and the second row, and so on.

[0110] For example, in m consecutive cycles, the bit line ends of the memristor units corresponding to all pixels corresponding to the object to be processed are input with a high level (for example, the amplitude of the high level is about 0.15V), thereby reading the values ​​of all pixels in the i-th row i times.

[0111] For example, within m consecutive cycles, the sum of the currents obtained by all source lines of the memristor units corresponding to all rows of the object to be processed is the sum of the values ​​of all pixels multiplied by the row numbers of the rows in which they are located, and the word line ends of the memristor units corresponding to all pixels corresponding to the i-th row in the object to be processed input an i-cycle turn-on signal, so that the first numerator value corresponding to the object to be processed can be obtained based on the sum of the currents of all source lines.

[0112] It should be noted that the present disclosure does not limit the order of generating the read current and the order of applying the start signal, as long as the memristor units corresponding to all pixels in the i-th row generate i read currents within m consecutive cycles.

[0113] In some embodiments of the present disclosure, step S502 may include: for the jth column in n columns, reading the values ​​of all pixel points in the jth column j times to obtain j reading results, adding the j reading results to obtain the sum of the pixel values ​​corresponding to the jth column, where j is a positive integer; adding the sums of the n pixel values ​​corresponding to the n columns respectively to obtain a second numerator value.

[0114] For example, reading the values ​​of all pixels in the jth column j times to obtain j reading results, and adding the j reading results to obtain the sum of the pixel values ​​corresponding to the jth column may include: causing the memristor unit corresponding to each pixel in all the pixels in the jth column to generate j read currents in n consecutive cycles, and adding the j read currents generated by all memristor units corresponding to all the pixels in the jth column to obtain the output current corresponding to the jth column; and adding the sum of the n pixel values ​​corresponding to the n columns to obtain a second numerator value may include: adding the n output currents corresponding to the n columns to obtain the second numerator value.

[0115] For example, making the memristor unit corresponding to each pixel in all the pixels in the j-th column generate j read currents within n consecutive cycles may include: applying an open signal to the word line of the memristor unit corresponding to all the pixels within n consecutive cycles, and applying a read voltage for j cycles to the bit line of the memristor unit corresponding to the j-th column within n consecutive cycles.

[0116] For example, the column number of each pixel point in the column to be processed is converted into a different number of high-level pulses and input to the corresponding BL terminal. For example, in n consecutive cycles, the bit line of the memristor unit corresponding to all the pixel points in the first column of the object to be processed inputs a read voltage of one cycle, the bit line of the memristor unit corresponding to all the pixel points in the second column of the object to be processed inputs a read voltage of two cycles, the bit line of the memristor unit corresponding to all the pixel points in the jth column of the object to be processed inputs a read voltage of j cycles, and so on.

[0117] For example, in the first cycle, a read voltage is applied to the bit lines corresponding to the memristor units corresponding to all the pixels in the object to be processed; in the second cycle, a read voltage is applied to the bit lines corresponding to the memristor units corresponding to all the pixels in the (n-1) columns of the object to be processed except the first column, and no read voltage is applied to the bit lines of the memristor units corresponding to all the pixels in the first column; in the third cycle, a read voltage is applied to the bit lines of the memristor units corresponding to all the pixels in the (n-2) columns of the object to be processed except the first column and the second column, and no read voltage is applied to the bit lines of the memristor units corresponding to all the pixels in the first column and the second column, and so on.

[0118] For example, within n consecutive cycles, the word line ends of the memristor units corresponding to all the pixel points corresponding to the object to be processed are input with a turn-on signal (for example, the amplitude of the turn-on signal is about 5V), and the bit line ends of the memristor units corresponding to all the pixel points corresponding to the j-th column in the object to be processed are input with a read voltage of j cycles, thereby realizing the reading of the values ​​of all the pixel points in the j-th column j times.

[0119] For example, in n consecutive cycles, the sum of the currents obtained by all source lines in the array area corresponding to the object to be processed is the sum of the values ​​of all pixel points multiplied by the column number of the column, so that the second numerator value corresponding to the object to be processed can be obtained based on the sum of the currents of all source lines.

[0120] It should be noted that the present disclosure does not limit the order of generating the read current and the order of applying the read voltage, as long as it is ensured that the memristor units corresponding to all pixels in the jth column generate j read currents within n consecutive cycles.

[0121] After obtaining the first numerator value and the second numerator value corresponding to the object to be processed, according to formula (1) and formula (2), it is also necessary to obtain the denominator value, that is, the sum of all pixel points.

[0122] In some embodiments of the present disclosure, step S503 may include: obtaining a read current generated by a memristor unit corresponding to each pixel point in a plurality of pixels to obtain a plurality of read currents; and adding the plurality of read currents to obtain a denominator value.

[0123] In some embodiments of the present disclosure, obtaining a read current generated by a memristor unit corresponding to each pixel point among a plurality of pixel points to obtain a plurality of read currents may include: within one cycle, applying a read voltage to the bit lines of n columns of memristor units corresponding to n columns of pixel points, and applying a turn-on signal to the word lines of m rows of memristor units corresponding to m rows of pixel points.

[0124] For example, a one-cycle turn-on signal is input to all word line ends of the corresponding array area in the memristor array mapped to the object to be processed, and a one-cycle read voltage (for example, the amplitude of the read voltage is about 0.15V) is applied to all bit line ends of the array area. The total current accumulated by all source lines in the array area is the sum of the pixels, that is, the denominator value.

[0125] Of course, obtaining the read current generated by the memristor unit corresponding to each pixel point among multiple pixels is not limited to being generated within one cycle, that is, the control method of the bit line and the word line is not limited to the method described above. The read current generated by the memristor unit corresponding to all the pixels can also be obtained within multiple cycles, as long as the memristor unit corresponding to each pixel point only generates one read current within multiple cycles.

[0126] For example, after obtaining the first numerator value, the second numerator value, and the denominator value, the first coordinate and the second coordinate corresponding to the object to be processed may be obtained according to step S504.

[0127] It should be noted that the order of obtaining the first numerator value, the second numerator value and the denominator value can be set arbitrarily as needed. For example, the denominator value can be obtained first according to the above method, and then the second numerator value can be obtained, and finally the first numerator value can be obtained. The present disclosure does not limit the calculation order of the denominator value, the first numerator value and the second numerator value.

[0128] At least one embodiment of the present disclosure provides a data processing method that maps pixel values ​​of an object to be processed into a memristor array, controls the drive signals applied to the word lines and source lines of the memristor array, and calculates the center coordinates of the object to be processed in parallel and quickly, thereby avoiding energy consumption and delay caused by additional data access.

[0129] Furthermore, the present disclosure can also calculate the centroid of the object to be processed by writing multi-bit-wide density information in a memristor and using the data processing method provided in any embodiment of the present disclosure.

[0130] For example, in some embodiments, the object to be processed is a connected domain in the image to be processed. In this case, Row_0 in formula (1) represents the row number of the first row in the connected domain in the image to be processed, and Col_0 in formula (2) represents the column number of the first column in the connected domain in the image to be processed.

[0131] When calculating the first coordinate corresponding to the connected domain, it is necessary to input a plurality of cycles of the start signal to the word line of the memristor unit corresponding to the first row of the connected domain, and the number of cycles is determined by the row number of the first row of the connected domain in the image to be processed. Similarly, when calculating the second coordinate corresponding to the connected domain, it is also necessary to input a plurality of cycles of the read voltage to the bit line of the memristor unit corresponding to the first column of the connected domain, which will extend the calculation cycle and waste energy.

[0132] In order to reduce the number of pulses input to the word line or bit line of the memristor array, formulas (1) and (2) are modified to the following formulas (3) and (4):

[0133]

[0134]

[0135] The parameter definitions in the above formulas are the same as those in formula (1) and formula (2), and will not be repeated here.

[0136] As shown in Formula 3 and Formula 4, when calculating the center coordinates corresponding to the connected domain, it is also necessary to obtain the row number of the row where the first row of the connected domain is located in the image to be processed, and the column number of the column where the first column of the connected domain is located in the image to be processed.

[0137] For example, the data processing method provided by at least one embodiment of the present disclosure may also include: adding the first coordinate to the row number of the row in which the first row of the object to be processed is located in the image to be processed and then subtracting one to obtain a first update value, updating the first coordinate to the first update value, adding the second coordinate to the column number of the column in which the first column of the object to be processed is located in the image to be processed and then subtracting one to obtain a second update value, and updating the second coordinate to the second update value.

[0138] For example, when the first row of the object to be processed is located in the first row of the image to be processed, the first coordinate is the same as the first coordinate update value; when the first row of the object to be processed is not located in the first row of the image to be processed, the first coordinate is different from the first coordinate update value; when the first column of the object to be processed is located in the first column of the image to be processed, the second coordinate is the same as the second coordinate update value; when the first column of the object to be processed is not located in the first column of the image to be processed, the second coordinate is different from the second coordinate update value.

[0139] According to the calculation method of the center coordinate as described above, the number of pulses input to the word line end or the bit line end of the memristor array is greatly reduced, the calculation cycle is reduced, and the energy consumption is reduced.

[0140] The connected domain division of the object to be processed may have the problem of connected domain overlap. Fig. 6A Schematic diagram of an image to be processed is shown. Figure 6B Shows Fig. 6A Schematic diagram of the mapping state of the image to be processed.

[0141] like Fig. 6A As shown, the image to be processed is a binary image, that is, the value of each pixel includes one of a first value and a second value. Fig. 6A The white boxes in the figure represent the pixel points with the first value, and the black boxes represent the pixel points with the second value. In addition, the image to be processed includes four connected domains, namely connected domain No. 1 labeled 1, connected domain No. 2 labeled 2, connected domain No. 3 labeled 3, and connected domain No. 4 labeled 4.

[0142] The schematic diagram of mapping the image to be processed shown in 6A to the memristor array is as follows Figure 6B Reference Figure 6B , each circular dot represents a memristor unit, the hollow dashed dot indicates that the state of the memristor unit is the first state, that is, the value of the corresponding pixel point is the first value, and the black solid dot indicates that the state of the memristor unit is the second state, that is, the value of the corresponding pixel point is the second value.

[0143] If the image to be processed is tiled directly, such as Figure 6B As shown in FIG. 1 , the rows and columns of connected domain No. 1 (the row where the first row of the connected domain is located in the image to be processed is numbered 1, and the column where the first column of the connected domain is located in the image to be processed is numbered 1) and connected domain No. 2 (the row where the first row of the connected domain is located in the image to be processed is numbered 3, and the column where the first column of the connected domain is located in the image to be processed is numbered 1) overlap, that is, the four pixels defined by the dotted box belong to both connected domain No. 1 and connected domain No. 2. At this time, if the calculation of the center coordinates is performed directly, the following problems will occur: If the corresponding pulse signals are input to the word lines and bit lines of the memristor units corresponding to all the pixels in connected domain No. 1 at the same time, then the two pixel points in connected domain No. 2 that do not belong to connected domain No. 1 will also be activated, and they will affect the calculation of the second coordinate value of connected domain No. 1; correspondingly, if the corresponding pulse signals are input to the word lines and bit lines of the memristor units corresponding to all the pixels in connected domain No. 2 at the same time, then some pixel points in the third row and fourth row of connected domain No. 1 that do not belong to connected domain No. 2 will also be activated, and they will also affect the calculation of the first coordinate value of connected domain No. 2.

[0144] Therefore, the embodiments of the present disclosure need to ensure that the array areas occupied by all connected domains do not overlap in both the row and column directions during the process of mapping the pixel points in the image to the memristor array.

[0145] For example, step S402 may include: mapping the value of each pixel point in at least one connected domain to a corresponding memristor unit in the memristor array, and making sure that the memristor units corresponding to any two connected domains do not overlap in the row direction and the column direction.

[0146] For example, Figure 6C A schematic diagram of mapping an image to be processed provided by at least one embodiment of the present disclosure is shown.

[0147] To avoid overlap, you can Fig. 6A The connected domain No. 2 in is shifted down by two pixels and mapped into the memristor array.

[0148] It should be noted that, although the connected domain No. 2 is translated downward by 2 pixels during the mapping process in step S402, when calculating the first coordinate and the second coordinate corresponding to the connected domain No. 2, the row number of the row where the first row of the connected domain No. 2 is located in the image to be processed, and the column number of the column where the first column of the connected domain No. 2 is located in the image to be processed is still used to calculate the center coordinate corresponding to the connected domain No. 2. For example, for the connected domain No. 2, reference Fig. 6A , its first row is located in the third row of the image to be processed, then the row number of its first row in the image to be processed is 3, its first column is located in the first column of the image to be processed, then the column number of its first column in the image to be processed is 1, when calculating the first coordinate update value and the second coordinate update value corresponding to connected domain No. 2, the calculation is based on Row_0 being 3 and Col_0 being 1.

[0149] For example, in some embodiments, the row number Row_0 of the row in which the first row of each connected domain is located in the image to be processed and the column number Col_0 of the column in which the first column is located in the image to be processed can be obtained in advance. After the first coordinate and the second coordinate are calculated by the memristor array, the first coordinate is added to Row_0 and then subtracted by 1 to obtain the first coordinate update value, and the first coordinate is updated to the first coordinate update value, that is, the horizontal coordinate in the center coordinate corresponding to the object to be processed is the first coordinate update value. Similarly, the second coordinate is added to Col_0 and then subtracted by 1 to obtain the second coordinate update value, and the second coordinate is updated to the second coordinate update value, that is, the vertical coordinate in the center coordinate corresponding to the object to be processed is the second coordinate update value.

[0150] For example, in some other embodiments, the row number of the first row of a connected domain in the image after translation and the column number of the first column in the image after translation can be obtained, the row number is subtracted from the change in the row number due to translation, and the calculation result is used as the row number Row_0 of the row where the first row of the connected domain is in the image to be processed, and the column number is subtracted from the change in the column number due to translation, and the calculation result is used as the column number Col_0 of the column where the first column of the connected domain is in the image to be processed, and subsequent calculations are performed. For example, for connected domain No. 2, refer to Figure 6B , its first row is located in the fifth row of the translated image, then the row number of its first row in the translated image is 5, and the column number of its first column in the translated image is 1. Since connected domain No. 2 is translated downward by 2 rows during mapping, the row number Row_0 of the row where the first row of connected domain No. 2 is located in the image to be processed is 5-2=3, and the column number Col_0 of the column where the first column of connected domain No. 2 is located in the image to be processed is still 1.

[0151] The data processing method provided by at least one embodiment of the present disclosure uses the first row or the first column in the object to be processed as the starting number, and after obtaining the first coordinate and the second coordinate, updates the first coordinate and the second coordinate according to the position of the object to be processed in the image to be processed, thereby reducing the number of pulse inputs, reducing the calculation cycle, and reducing energy consumption.

[0152] Figure 7 A flow chart of a data processing method based on a memristor array provided by at least one embodiment of the present disclosure is shown.

[0153] like Figure 7 As shown, first, an image to be processed is obtained, and the image to be processed includes N connected domains, which are numbered 1, ...N, and each connected domain is an object to be processed.

[0154] Then, if Figure 7 As shown, for the i-th connected domain, the first numerator value a of the i-th connected domain is calculated. The specific process of calculating the first numerator value is as described in step S501, which will not be repeated here.

[0155] Then, if Figure 7 As shown, the denominator value b of the first coordinate or the second coordinate of the i-th connected component is calculated. The specific process of calculating the denominator value is as described in step S503 and will not be repeated here.

[0156] Then, if Figure 7 As shown, the second numerator value c of the i-th connected domain is calculated. The specific process of calculating the second numerator value is as described in step S502 and will not be repeated here.

[0157] Then, if Figure 7 As shown, the first numerator value a is divided by the denominator value b to obtain the first coordinate of the i-th connected domain, and the second numerator value c is divided by the denominator value b to obtain the second coordinate of the i-th connected domain. The specific process of calculating the first coordinate and the second coordinate is as described in step S504 and will not be repeated here.

[0158] Then, if Figure 7 As shown, the first coordinate of the ith connected domain is added to the row number of the first row of the ith connected domain in the image to be processed minus one to obtain a first update value corresponding to the ith connected domain, the first coordinate corresponding to the ith connected domain is updated to the first update value, the second coordinate of the ith connected domain is added to the column number of the first column of the ith connected domain in the image to be processed minus one to obtain a second update value corresponding to the ith connected domain, and the second coordinate corresponding to the ith connected domain is updated to the second update value.

[0159] For example, Fig. 6A The image to be processed shown includes 4 connected domains. In this embodiment, the row number of the first row of each of the 4 connected domains in the object to be processed and the column number of the first column in the object to be processed are both 1.

[0160] For example, for connected domain No. 4, when it is used as an object to be processed for centroid calculation, the row number of the first row of connected domain No. 4 in the object to be processed and the column number of the first column in the object to be processed are both 1. However, the row number of its first row in the image to be processed is 6, and the column number of its first column in the image to be processed is 4. Therefore, according to formula (3) and formula (4), after calculating the first coordinate and the second coordinate corresponding to connected domain No. 4, add 5 (the row number of the first row of connected domain No. 4 in the image to be processed minus 1) to the first coordinate corresponding to connected domain No. 4 to obtain the first update value corresponding to connected domain No. 4, update the first coordinate corresponding to connected domain No. 4 to the first update value, add 3 (the column number of the first column of connected domain No. 4 in the image to be processed minus 1) to the second coordinate corresponding to connected domain No. 4 to obtain the second update value corresponding to connected domain No. 4, and update the second coordinate corresponding to connected domain No. 4 to the second update value.

[0161] Next, the above steps are repeated to calculate the centroid coordinates of other connected domains in the image to be processed, until the calculation of the centroid coordinates of all connected domains in the image to be processed is completed.

[0162] Below through Fig. 8A and Figure 8B right Figure 7 The method for calculating the center coordinates of the image to be processed is further illustrated. Fig. 6A The schematic diagram of mapping the image to be processed to the memristor array is shown in Figure 6C As shown, Fig. 8A and Figure 8B exist Figure 6C The description is based on the mapping state of the memristor array shown in FIG. 1 . The description of the image to be processed can be referred to above and will not be repeated here.

[0163] Fig. 8A A schematic diagram of calculating a first coordinate based on a memristor array provided by at least one embodiment of the present disclosure is shown.

[0164] For example, Fig. 8A The memristor array shown in the figure includes eight rows and eight columns of memristor units, and the first row (as shown in FIG. Fig. 8A The first row is marked as "the first row" to the eighth row, and the first column is marked as "the first row" from left to right. Fig. 8A Of course, it should be noted that Fig. 8A This is only a schematic diagram, and the memristor array may also include more rows and more columns to process more or larger objects to be processed.

[0165] Fig. 8A A horizontal arrow in the figure indicates that a turn-on signal of one cycle is applied to a corresponding word line (not shown) in the memristor array, and a vertical arrow indicates that a read voltage of one cycle is applied to a corresponding bit line (not shown) in the memristor array.

[0166] The dashed box BS1 represents the input signal change of the bit line end of all memristor units corresponding to the connected domain No. 1, the dashed box BS2 represents the input signal change of the bit line end of all memristor units corresponding to the connected domain No. 2, the dashed box BS3 represents the input signal change of the bit line end of all memristor units corresponding to the connected domain No. 3, and the dashed box BS4 represents the input signal change of the bit line end of all memristor units corresponding to the connected domain No. 4. Similarly, the dashed box WS1 represents the input signal change of the word line end of all memristor units corresponding to the connected domain No. 1, the dashed box WS2 represents the input signal change of the word line end of all memristor units corresponding to the connected domain No. 2, the dashed box WS3 represents the input signal change of the word line end of all memristor units corresponding to the connected domain No. 3, and the dashed box WS4 represents the input signal change of the word line end of all memristor units corresponding to the connected domain No. 4.

[0167] Below Fig. 6A Taking connected domain No. 1 and connected domain No. 2 in the example, the process of the data processing method provided by at least one embodiment of the present disclosure is specifically described.

[0168] For connected domain No. 1, Fig. 8A As shown in the dashed box BS1 in FIG. 1 , a continuous read voltage is input to the bit lines of the memristor units corresponding to all pixels in the connected domain No. 1 in four consecutive cycles. Fig. 8A As shown in the dotted box WS1 in the figure, in the four consecutive cycles, in the first cycle, a one-cycle turn-on signal is applied to the word lines corresponding to the memristor units in the first to fourth rows in the memristor array, in the second cycle, a one-cycle turn-on signal is applied to the word lines corresponding to the memristor units in the second, third and fourth rows in the memristor array, in the third cycle, a one-cycle turn-on signal is applied to the word lines corresponding to the memristor units in the third and fourth rows in the memristor array, and in the fourth cycle, a one-cycle turn-on signal is applied to the word lines corresponding to the memristor units in the fourth row in the memristor array. Thus, within four consecutive cycles, all memristor units corresponding to all pixels in the first row of connected domain No. 1 generate one read current, all memristor units corresponding to all pixels in the second row of connected domain No. 1 generate two read currents, all memristor units corresponding to all pixels in the third row of connected domain No. 1 generate three read currents, and all memristor units corresponding to all pixels in the fourth row of connected domain No. 1 generate four read currents, thereby adding the read currents generated by the source lines from the first row to the fourth row in the memristor array to obtain the first numerator value of connected domain No. 1.

[0169] Similarly, when calculating the denominator value corresponding to connected domain No. 1 ( Fig. 8A (not shown), for example, a continuous turn-on signal is applied to the word lines corresponding to the memristor units corresponding to all the pixels in the first row to the fourth row in the memristor array, so that the memristor units corresponding to all the pixels in the first row to the fourth row in the memristor array are turned on at the same time, and a read voltage of one cycle is applied to the bit lines corresponding to the memristor units corresponding to all the pixels in the first column to the eighth column in the memristor array, so that the read currents generated by the source lines in the first row to the fourth row in the memristor array are added to obtain the denominator value of the connected domain No. 1.

[0170] For connected domain No. 1, its first row in the image to be processed is numbered 1, so its first coordinate is the first numerator value divided by the denominator value plus 1 minus 1, that is, it is still the ratio of the first numerator value to the denominator value.

[0171] For connected domain No. 2, if Fig. 8A As shown in the dotted box BS2 in FIG. 1 , a continuous read voltage is input to the bit lines of the memristor units corresponding to all pixels in the connected domain No. 2 in three consecutive cycles. Fig. 8A As shown in the dotted box WS2 in the figure, within the three consecutive cycles, within the first cycle, a one-cycle turn-on signal is applied to the word lines corresponding to the memristor units in the fifth to seventh rows of the memristor array, within the second cycle, a one-cycle turn-on signal is applied to the word lines corresponding to the memristor units in the sixth and seventh rows of the memristor array, and within the third cycle, a one-cycle turn-on signal is applied to the word lines corresponding to the memristor units in the seventh row of the memristor array. As a result, within the three consecutive cycles, all memristor units corresponding to all pixels in the first row of connected domain No. 2 generate one read current, all memristor units corresponding to all pixels in the second row of connected domain No. 2 generate two read currents, and all memristor units corresponding to all pixels in the third row of connected domain No. 2 generate three read currents, thereby adding the read currents generated by the source lines in the fifth to seventh rows of the memristor array to obtain the first numerator value of connected domain No. 2.

[0172] Similarly, when calculating the denominator value corresponding to the connected domain No. 2 ( Fig. 8A (not shown), for example, a one-cycle turn-on signal is applied to the word line corresponding to the memristor unit corresponding to all the pixels in the fifth to seventh rows in the memristor array, so that the memristor units corresponding to all the pixels in the fifth to seventh rows in the memristor array are turned on, and a one-cycle read voltage is applied to the bit line corresponding to the memristor unit corresponding to all the pixels in the first to second columns in the memristor array, thereby adding the read currents generated by the source lines in the fifth to seventh rows in the memristor array to obtain the denominator value corresponding to the connected domain No. 2.

[0173] For connected domain No. 2, its first row is numbered 3 in the image to be processed, so its first coordinate is the first numerator value divided by the denominator value plus 3 minus 1.

[0174] Figure 8B A schematic diagram of an example of second coordinate calculation based on the centroid of a memristor array provided by at least one embodiment of the present disclosure is shown.

[0175] For example, Figure 8B Memristor array and mapping method in Fig. 8A The same, repeated parts will not be repeated. Figure 8B A horizontal arrow in the figure indicates that a turn-on signal of one cycle is applied to a corresponding word line (not shown) in the memristor array, and a vertical arrow indicates that a read voltage of one cycle is applied to a corresponding bit line (not shown) in the memristor array.

[0176] Similarly, the dotted boxes BS'1 to BS'4 respectively represent the input signal changes at the bit line ends of all memristor units corresponding to connected domains No. 1 to No. 4, and the dotted boxes WL'1 to WS'4 respectively represent the input signal changes at the word line ends of all memristor units corresponding to connected domains No. 1 to No. 4.

[0177] For connected domain No. 1, Figure 8B As shown in the dashed box WS'1 in FIG, in the continuous 8 cycles, the word lines of the memristor units corresponding to all the pixels in the connected domain No. 1 are continuously turned on. Figure 8B As shown in the dotted box BS'1 in , in the 8 consecutive cycles, in the 1st cycle, a read voltage of 1 cycle is applied to the bit lines corresponding to the memristor units in the first to eighth columns of the memristor array, in the 2nd cycle, a read voltage of 1 cycle is applied to the bit lines corresponding to the memristor units in the other seven columns except the first column of the memristor array, in the 3rd cycle, a read voltage of 1 cycle is applied to the bit lines corresponding to the memristor units in the other six columns except the first and second columns of the memristor array, and so on. Thus, in the 8 consecutive cycles, all memristor units corresponding to all pixels in the first column of the connected domain No. 1 generate a read current once, all memristor units corresponding to all pixels in the second column of the connected domain No. 1 generate a read current twice, ..., all memristor units corresponding to all pixels in the eighth column of the connected domain No. 1 generate 8 read currents, and the read currents generated by the source lines in the first to fourth rows of the memristor array are added to obtain the second numerator value of the connected domain No. 1.

[0178] For example, the calculation method of the denominator value corresponding to the No. 1 connected domain is as described above and will not be repeated here. For example, for the No. 1 connected domain, the column number of its first column in the image to be processed is 1, so its second coordinate is the second numerator value divided by the denominator value plus 1 minus 1, that is, it is still the ratio of the second numerator value to the denominator value.

[0179] For connected domain No. 2, if Figure 8B As shown in the dashed box WS'2 in FIG, in two consecutive cycles, a continuous on signal is input to the word lines of the memristor units corresponding to all pixels in the connected domain No. 2. Figure 8B As shown in the dotted box BS'2 in the figure, in the two consecutive cycles, in the first cycle, a read voltage of one cycle is applied to the bit lines corresponding to the memristor units in the first column and the second column in the memristor array, and in the second cycle, a read voltage of one cycle is applied to the bit lines corresponding to the memristor units in the second column in the memristor array. As a result, in the two consecutive cycles, all memristor units corresponding to all pixels in the first column of connected domain No. 2 generate one read current, and all memristor units corresponding to all pixels in the second column of connected domain No. 2 generate two read currents, so that the read currents generated by the source lines from the fifth to the seventh rows in the memristor array are added to obtain the second numerator value of connected domain No. 2.

[0180] For example, the calculation method of the denominator value corresponding to the connected domain No. 2 is as described above, and will not be repeated here. For example, for the connected domain No. 2, the column number of its first column in the image to be processed is 1, so its second coordinate is the second numerator value divided by the denominator value plus 1 minus 1, that is, it is still the ratio of the second numerator value to the denominator value.

[0181] The calculation method of the first numerator value, the second numerator value and the corresponding denominator value of the connected domain No. 3 and the connected domain No. 4 can refer to the connected domain No. 1 and the connected domain No. 2, and will not be repeated here.

[0182] Fig. 9 A schematic block diagram of an electronic device 900 provided by at least one embodiment of the present disclosure is shown.

[0183] like Fig. 9 As shown, the electronic device 900 includes a memristor array 901 and a controller 902. The memristor array 901 is configured to perform multiplication and sum operations, and the controller 902 is configured to execute steps S401 to S403. For example, the memristor array 901 and the controller 902 can communicate with each other via a system bus.

[0184] For example, the memristor array 901 may be configured as follows: Figure 1 or Figure 5B As shown, the memristor array 901 includes a plurality of memristor units arranged in an array, and includes M rows and N columns, that is, each row has N memristor units, each column has M memristor units, and the structure of each memristor unit can be Figure 2 The 1T1R structure shown or Figure 3 The memristor array further includes M word lines, M source lines and N bit lines, the M word lines and the M source lines correspond to M rows respectively, the N bit lines correspond to N columns respectively, and M and N are positive integers.

[0185] For example, the controller 902 may include a processor and a memory, wherein the memory is used to store computer-readable instructions non-transiently, and the memory may also store initial data required for processing and data generated by the processing (including intermediate data or final data). For example, the controller executes the program stored in the memory to implement the method of calculating the center coordinates of an image, and the implementation method is the same as the implementation method mentioned in the aforementioned embodiment of the method for calculating the center coordinates of an image, which will not be repeated here.

[0186] The processor may be, for example, a central processing unit, a graphics processing unit, etc., and may be, for example, a CISC, RISC architecture, etc., and may perform various appropriate actions and processes according to the program stored in the memory. Specific examples of the memory may include, but are not limited to: a disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. The embodiments of the present disclosure do not limit the specific types, structures, etc. of the processor and the memory.

[0187] For example, the electronic device 900 further includes: a conversion module 904, for example, the conversion module 904 includes an accumulation unit, and the accumulation unit is configured to convert the output current signal of the source line of the memristor array 901 into a corresponding voltage signal and accumulate it to obtain an output voltage signal.

[0188] For example, the accumulation unit may be an integrator, which is configured to convert the output current signal of the source line of the memristor array 901 into a corresponding voltage signal and accumulate the voltage signal to obtain an output voltage signal.

[0189] For example, the electronic device 900 further includes an analog-to-digital converter, and the analog-to-digital converter is configured to perform quantization processing on the output voltage signal from the accumulation unit.

[0190] For example, Fig. 9 As shown, the electronic device 900 may further include a source line driving circuit 905, a word line driving circuit 906, and a bit line driving circuit 907. For example, the word line driving circuit 906 is configured to apply control signals to the M word lines of the memristor array, respectively. For example, the bit line driving circuit 907 is configured to apply input signals to the N bit lines of the memristor array. For example, the source line driving circuit 905 is configured to control the output signals of the M source lines of the memristor array, for example, the source line driving circuit 905 includes a control switch, and the control switch receives the control signal of the word line of the corresponding row to turn on or off.

[0191] In addition, the electronic device 900 may also include an input interface and an output interface (not shown), and the memristor array 901, the controller 902, the input interface and the output interface may also communicate with each other through the system bus. For example, the input interface is configured to receive instructions from an external computer device, from a user, etc. to control the operation of the memristor array and the controller, etc. For example, an external device that communicates with the memristor array 901 and the controller 902 through the input interface and the output interface may be included in an environment that provides any type of user interface with which a user can interact. Examples of user interface types include graphical user interfaces, natural user interfaces, etc. For example, a graphical user interface may accept input from a user using input devices such as a keyboard, a mouse, a remote controller, etc., and provide output on an output device such as a display. In addition, a natural user interface may enable a user to interact with a parallel acceleration device in a manner that is not subject to constraints imposed by input devices such as a keyboard, a mouse, a remote controller, etc. In contrast, a natural user interface may rely on speech recognition, touch and stylus recognition, gesture recognition on and near the screen, air gestures, head and eye tracking, speech and voice, vision, touch, gestures, and machine intelligence, etc.

[0192] For example, the operation process of the electronic device 900 may refer to the relevant description in the above-mentioned method embodiment for calculating the center coordinates of an image based on a memristor array, and the repeated parts will not be repeated here.

[0193] There are a few points to note about this disclosure:

[0194] (1) The drawings of the embodiments of the present disclosure only relate to the structures related to the embodiments of the present disclosure, and other structures may refer to the general design.

[0195] (2) For the sake of clarity, the thickness and size of layers or structures are exaggerated in the drawings used to describe embodiments of the present invention. It is understood that when an element such as a layer, film, region, or substrate is referred to as being "on" or "under" another element, the element may be "directly" "on" or "under" the other element, or there may be intervening elements.

[0196] (3) In the absence of conflict, the embodiments of the present disclosure and the features therein may be combined with each other to obtain new embodiments.

[0197] The above description is only a specific implementation of the present disclosure, but the protection scope of the present disclosure is not limited thereto, and the protection scope of the present disclosure shall be based on the protection scope of the claims.< / m> < / n> < / m>

Claims

1. A data processing method based on a memristor array, wherein: The memristor array includes a plurality of memristor units arranged in an array, and the method includes: Acquire an object to be processed, wherein the object to be processed includes a plurality of pixel points arranged in an array; Setting the memristor array to map the value of each pixel in the object to be processed to a corresponding memristor unit in the memristor array; The center coordinates corresponding to the object to be processed are calculated by using the memristor array, wherein the memristor array is configured to perform multiplication and sum operations.

2. The data processing method according to claim 1, wherein: The center coordinates include a first coordinate and a second coordinate. The object to be processed includes m rows and n columns, where m and n are positive integers respectively. Calculating the center coordinates corresponding to the object to be processed by the memristor array includes: For each pixel point in the plurality of pixels in the object to be processed: The value of the pixel point is multiplied by the row number of the row where the pixel point is located in the object to be processed to obtain a first product corresponding to the pixel point, thereby obtaining m*n first products, and the m*n first products are summed to obtain a first numerator value, Multiplying the value of the pixel by the column number of the column where the pixel is located in the object to be processed to obtain a second product corresponding to the pixel, thereby obtaining m*n second products, and summing the m*n second products to obtain a second numerator value; Adding the value of each pixel in the object to be processed to obtain a denominator value; The first numerator value is divided by the denominator value to obtain a first coordinate corresponding to the object to be processed, and the second numerator value is divided by the denominator value to obtain a second coordinate corresponding to the object to be processed.

3. The data processing method according to claim 2, wherein: The method includes: multiplying the value of the pixel by the row number of the row where the pixel is located in the object to be processed to obtain a first product corresponding to the pixel, thereby obtaining m*n first products, and summing the m*n first products to obtain a first numerator value, including: For the i-th row among the m rows, Read the values ​​of all pixels in the i-th row i times to obtain i reading results, Adding the i reading results together obtains the sum of the pixel values ​​corresponding to the i-th row, where i is a positive integer; The sum of the m pixel values ​​corresponding to the m rows is added together to obtain the first numerator value.

4. The data processing method according to claim 3, wherein: The memristor array includes M rows and N columns of memristor units, and the memristor array also includes M word lines, M source lines, and N bit lines, the M word lines and the M source lines correspond to the M rows respectively, the N bit lines correspond to the N columns respectively, M and N are positive integers and are greater than or equal to m and n respectively, Each of the plurality of memristor units is turned on upon receiving an on signal applied by a corresponding word line and a read voltage is applied to a corresponding bit line for reading, and a corresponding read current is generated according to the resistance value of the memristor in the memristor unit. The method of reading the values ​​of all pixels in the i-th row i times to obtain i reading results, and adding the i reading results to obtain the sum of the pixel values ​​corresponding to the i-th row includes: In m consecutive cycles, the memristor unit corresponding to each pixel point in all the pixels in the i-th row generates i read currents, Adding i read currents generated by all memristor units corresponding to all pixel points in the i-th row to obtain an output current corresponding to the i-th row; and Adding the sum of the m pixel values ​​corresponding to the m rows to obtain the first numerator value includes: The m output currents corresponding to the m rows are added together to obtain the first numerator value.

5. The data processing method according to claim 4, wherein: The method causes the memristor unit corresponding to each pixel point in all the pixels in the i-th row to generate i read currents in m consecutive cycles, including: In the m consecutive cycles, the read voltage is applied to the bit lines of the memristor units corresponding to all the pixels, In the m consecutive cycles, an on signal of i cycles is applied to the word lines of the memristor units corresponding to the i-th row.

6. The data processing method according to claim 2, wherein: The method includes: multiplying the value of the pixel by the column number of the column where the pixel is located in the object to be processed to obtain a second product corresponding to the pixel, thereby obtaining m*n second products, and summing the m*n second products to obtain a second numerator value, including: For the jth column among the n columns, Read the values ​​of all pixels in the j-th column j times to obtain j reading results, The j reading results are added together to obtain the sum of the pixel values ​​corresponding to the j-th column, where: j is a positive integer; The sum of the n pixel values ​​corresponding to the n columns is added together to obtain the second numerator value.

7. The data processing method according to claim 6, wherein: The memristor array includes M rows and N columns, and the memristor array also includes M word lines, M source lines and N bit lines, the M word lines and the M source lines correspond to the M rows respectively, the N bit lines correspond to the N columns respectively, M and N are positive integers and are greater than or equal to m and n respectively, Each of the plurality of memristor units is turned on upon receiving an on signal applied by a corresponding word line and a read voltage is applied to a corresponding bit line to be read, and a corresponding read current is generated according to the resistance value of the memristor in the memristor unit, The method of reading the values ​​of all pixels in the j-th column j times to obtain j reading results and adding the j reading results to obtain the sum of the pixel values ​​corresponding to the j-th column includes: In n consecutive cycles, the memristor unit corresponding to each pixel point in all the pixels in the j-th column generates j times of read current, Adding j times of read currents generated by all memristor units corresponding to all pixels in the j-th column to obtain an output current corresponding to the j-th column; and Adding the sum of the n pixel values ​​corresponding to the n columns to obtain the second numerator value includes: The n output currents corresponding to the n columns are added together to obtain the second numerator value.

8. The data processing method according to claim 7, wherein: The method causes the memristor unit corresponding to each pixel point in all the pixels in the j-th column to generate j read currents in n consecutive cycles, including: In the continuous n cycles, the start signal is applied to the word lines of the memristor units corresponding to all the pixels, In the n consecutive cycles, a read voltage of j cycles is applied to the bit lines of the memristor cells corresponding to the j-th column.

9. The data processing method according to any one of claims 2 to 8, wherein: The memristor array includes M rows and N columns of memristor units, and the memristor array also includes M word lines, M source lines, and N bit lines, the M word lines and the M source lines correspond to the M rows respectively, the N bit lines correspond to the N columns respectively, M and N are positive integers and are greater than or equal to m and n respectively, Each of the plurality of memristor units is turned on upon receiving an on signal applied by a corresponding word line and a read voltage is applied to a corresponding bit line for reading, and a corresponding read current is generated according to the resistance value of the memristor in the memristor unit. The value of each pixel in the object to be processed is added to obtain a denominator value, including: Obtaining a read current generated by a memristor unit corresponding to each pixel point in the plurality of pixel points, so as to obtain a plurality of read currents; The plurality of read currents are summed to obtain the denominator value.

10. The data processing method according to claim 9, wherein: Obtaining a read current generated by a memristor unit corresponding to each pixel point in the plurality of pixel points to obtain a plurality of read currents, including: In one cycle, the read voltage is applied to the bit lines of the n columns of memristor units corresponding to the n columns of pixels, Applying an on signal to the word lines of the m rows of memristor units corresponding to the m rows of pixels.

11. The data processing method according to claim 1, wherein: The value of each pixel is one of a first value and a second value that are different from each other, and each memristor unit has a first state or a second state. The center coordinates are the centroid coordinates of the object to be processed. Mapping the value of each pixel in the object to be processed to a corresponding memristor unit in the memristor array includes: In response to a value of a pixel point in the object to be processed being the first value, setting a memristor unit corresponding to the pixel point in the memristor array to a first state; In response to a pixel value of the object to be processed being the second value, setting a memristor unit corresponding to the pixel in the memristor array to a second state, The first state is different from the second state.

12. The data processing method according to claim 2, wherein: Get the object to be processed, including: Acquire an image to be processed, wherein the image to be processed includes at least one connected domain; Each connected domain is taken as the object to be processed.

13. The data processing method according to claim 12, wherein: Setting the memristor array to map the value of each pixel in the object to be processed to a corresponding memristor unit in the memristor array includes: The value of each pixel point in the at least one connected domain is mapped to a corresponding memristor unit in the memristor array, and the memristor units corresponding to any two connected domains do not overlap in the row direction and the column direction.

14. The data processing method according to claim 12 or 13, further comprising: Add the first coordinate to the row number of the row where the first row of the object to be processed in the image to be processed is located and then subtract one to obtain a first update value, and update the first coordinate to the first update value. The second coordinate is added to the column number of the column where the first column of the object to be processed in the image to be processed is located and then subtracted by one to obtain a second update value, and the second coordinate is updated to the second update value.

15. An electronic device comprising: Memristor arrays; A controller, wherein the controller is configured as: Acquire an object to be processed, wherein the object to be processed includes a plurality of pixel points arranged in an array; Setting the memristor array to map the value of each pixel in the object to be processed to a corresponding memristor unit in the memristor array; The center coordinates corresponding to the object to be processed are calculated by using the memristor array, wherein the memristor array is configured to perform multiplication and sum operations. 16 . The electronic device according to claim 15 , further comprising an integrator, wherein the integrator is configured to convert the output current signal of the source line of the memristor array into a corresponding voltage signal and accumulate the voltage signals to obtain an output voltage signal.

17. The electronic device according to claim 15, further comprising an analog-to-digital converter, The analog-to-digital converter is configured to process the output voltage signal from the integrator.

Citation Information

Patent Citations

  • Memristor-based neural network parallel acceleration method, processor and device

    CN110807519A

  • Spherical data classification device based on memristor array and operation method thereof

    CN112819036A

  • Phase-coding for coordinate transformation

    US20150235124A1

Cited By

  • Memory array and in-memory computing circuit

    US20250191654A1