Data writing method, storage system and computer-readable storage medium

The memory controller determines control instructions based on the touch signal of the button module, which solves the limitation of traditional data writing requiring a mouse or keyboard, and realizes data writing operations in non-traditional methods, improving convenience.

CN115202572BActive Publication Date: 2025-08-15HOSIN GLOBAL ELECTRONICS CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210604485.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-31
Publication Date
2025-08-15
Estimated Expiration
2042-05-31

AI Technical Summary

Technical Problem

Traditional data writing mechanisms need to be triggered by the mouse or keyboard, and data writing cannot be achieved through non-mouse or non-keyboard methods.

Method used

The memory controller obtains the touch signal collected by the button module, determines the control instructions based on the number and duration of the touch signal, and sends the instructions to the host system to realize data writing, including data writing, encrypted writing and erasing operations.

Benefits of technology

Data writing can be triggered without a mouse or keyboard, realizing data writing operations in non-traditional ways, improving the flexibility and convenience of data writing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115202572B_ABST
    Figure CN115202572B_ABST
Patent Text Reader

Abstract

The present invention is applicable to the technical field of data storage, and provides a method for data writing, comprising: a memory controller acquiring a touch signal collected by a button module; the memory controller determining, within a preset period, a control instruction corresponding to the touch signal based on the number and duration of the touch signal; the control instruction including a data write instruction; if the control instruction is a data write instruction, the memory controller sends the control instruction to the host system; the memory controller receives the first data returned by the host system based on the data write instruction, and writes the first data into the storage module. The above scheme, based on the button module, acquires the number and duration of the touch signal collected by the button module to determine different control instructions, and executes the control instruction. There is no need to trigger the write instruction through the mouse and keyboard in the host system, which solves the technical problem of being unable to trigger data writing through non-mouse or non-keyboard methods.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of data storage, and in particular relates to a data writing method, a storage system and a computer-readable storage medium. Background Art

[0002] Data backup refers to the process of copying all or part of a data set from an application host's hard drive or array to another storage medium to prevent data loss due to operational errors or system failures. Traditional data backup primarily uses internal or external tape drives for cold backups. With the continuous advancement of technology and the massive increase in data volumes, many enterprises are beginning to adopt network backup. Network backup is generally implemented using specialized data storage management software combined with appropriate hardware and memory modules.

[0003] However, the traditional data writing trigger mechanism often requires manual triggering of the backup command through the mouse or keyboard to implement the backup process. It is impossible to trigger data backup through non-mouse or non-keyboard methods. Summary of the Invention

[0004] In view of this, embodiments of the present invention provide a data writing method, a storage system, and a computer-readable storage medium to solve the technical problem that data writing cannot be triggered by non-mouse or non-keyboard methods.

[0005] A first aspect of an embodiment of the present invention provides a method for writing data. The method is applied to a memory module, wherein the memory module includes a connection interface, a storage module, and a memory controller, the memory controller is connected to a button module, the connection interface is connected to the memory controller and a host system respectively, and the storage module is connected to the memory controller. The method includes:

[0006] The memory controller acquires the touch signal collected by the button module;

[0007] The memory controller determines, within a preset period, a control instruction corresponding to the touch signal according to the number and duration of the touch signal; the control instruction includes a data write instruction; the data write instruction is used to instruct the host system to send first data to the memory controller;

[0008] If the control instruction is the data write instruction, the memory controller sends the control instruction to the host system;

[0009] The memory controller receives the first data returned by the host system according to the data write instruction, and writes the first data into the storage module.

[0010] Furthermore, the touch signal is a high-low level signal.

[0011] Furthermore, the control instruction also includes an erase instruction;

[0012] The memory controller determines, within a preset period, according to the number and duration of the touch signals, a control instruction corresponding to the touch signal, including:

[0013] If within the preset period, the number of high-level signals in the touch signal is one, and the duration of the high-level signal in the touch signal is lower than a threshold, determining that the control instruction corresponding to the touch signal is a data write instruction;

[0014] If, within the preset period, the number of high-level signals in the touch signal is two, and the duration of the high-level signal in each of the touch signals is less than the threshold, then determining that the control instruction corresponding to the touch signal is an encrypted write instruction; the encrypted write instruction is used to encrypt and back up target data stored in the host system;

[0015] If within the preset period, the number of high-level signals in the touch signal is one, and the duration of the high-level signal in each touch signal is not less than the threshold, then it is confirmed that the control instruction corresponding to the touch signal is an erase instruction; the erase instruction is used to format the target data stored in the host system or memory module.

[0016] Furthermore, after the memory controller determines the control instruction corresponding to the touch signal according to the number and duration of the touch signal within a preset period, the method further includes:

[0017] If the control instruction is the erase instruction, the memory controller erases the second data stored in the storage module from the storage module.

[0018] Furthermore, the memory controller receives the first data returned by the host system according to the data write instruction, and writes the first data into the storage module, including:

[0019] The memory controller receives the first data returned by the host system according to the data write instruction;

[0020] The memory controller compresses the first data to obtain compressed first data;

[0021] The memory controller traverses the historical data in the storage module;

[0022] If the historical data is different from the compressed first data, the memory controller writes the compressed first data into the storage module.

[0023] Furthermore, if the historical data is different from the compressed first data, the memory controller writes the first data into the storage module, including:

[0024] The memory controller obtains a dictionary list corresponding to the historical data; the dictionary list is used to store historical identification information of the historical data; the historical identification information includes high-frequency data or summary data corresponding to the historical data;

[0025] The memory controller extracts current identification information of the first data;

[0026] If the current identification information is different from the historical identification information, the memory controller determines that the historical data is different from the compressed first data, and writes the compressed first data into the storage module.

[0027] Furthermore, the memory module also includes a lamp group.

[0028] Furthermore, the memory controller receives the first data returned by the host system according to the data write instruction, and writes the first data into the storage module, including:

[0029] The memory controller receives the first data returned by the host system according to the data write instruction;

[0030] The memory controller writes the first data into the storage module and controls the light group to flash red;

[0031] If the first data is written completely, the memory controller controls the light group to change from a flashing red light to a permanently lit red light.

[0032] A second aspect of an embodiment of the present invention provides a storage system, comprising a memory module and a host system; wherein the memory module comprises a connection interface, a memory module, and a memory controller, the memory controller is connected to a button module, the connection interface is connected to the memory controller and the host system respectively, and the storage module is connected to the memory controller;

[0033] The memory controller is used to obtain the touch signal collected by the button module;

[0034] The memory controller is configured to determine, within a preset period, a control instruction corresponding to the touch signal according to the number and duration of the touch signal; the control instruction includes a data write instruction; the data write instruction is configured to instruct the host system to send first data to the memory controller;

[0035] If the control instruction is the data write instruction, the memory controller sends the control instruction to the host system;

[0036] The host system is configured to send the first data corresponding to the data write instruction to the memory controller according to the data write instruction;

[0037] The memory controller is configured to receive the first data returned by the host system according to the data write instruction, and write the first data into the storage module;

[0038] If the control instruction is the erase instruction, the memory controller erases the second data stored in the storage module from the storage module.

[0039] A third aspect of an embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method described in the first aspect are implemented.

[0040] Compared with the prior art, the embodiments of the present invention have the following advantages: In the present invention, the memory controller obtains the touch signal collected by the button module; within a preset period, the memory controller determines the control instruction corresponding to the touch signal based on the number and duration of the touch signal; the control instruction includes a data write instruction; the data write instruction is used to instruct the host system to send first data to the memory controller; if the control instruction is the data write instruction, the memory controller sends the control instruction to the host system; the memory controller receives the first data returned by the host system according to the data write instruction, and writes the first data to the storage module. The above solution, based on the button module, obtains the number and duration of the touch signal collected by the button module to determine different control instructions, and executes the control instructions. There is no need for a mouse or keyboard in the host system to trigger the write instruction, which solves the technical problem of being unable to trigger data writing by non-mouse or non-keyboard methods. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments or related technical descriptions. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0042] Figure 1 is a schematic diagram of a storage system provided by the present invention;

[0043] Figure 2 This is a schematic diagram of various PIN pins of a memory controller provided by the present invention;

[0044] Figure 3 is a schematic diagram of a memory controller provided by the present invention;

[0045] Figure 4 is a schematic diagram of a memory module provided by the present invention;

[0046] Figure 5 A schematic flow chart of a data writing method provided by the present invention is shown;

[0047] Figure 6 A specific schematic flow chart of step 502 in a method for writing data provided by the present invention is shown;

[0048] Figure 7 A specific schematic flow chart of step 504 in a method for writing data provided by the present invention is shown;

[0049] Figure 8 A specific schematic flow chart of step 5044 in a method for writing data provided by the present invention is shown;

[0050] Figure 9 A schematic flow chart of another data writing method provided by the present invention is shown. DETAILED DESCRIPTION

[0051] In the following description, specific details such as particular system structures and techniques are provided for purposes of illustration, not limitation, to facilitate a thorough understanding of the embodiments of the present invention. However, it will be apparent to those skilled in the art that the present invention may be practiced in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present invention with unnecessary detail.

[0052] Embodiments of the present invention provide a data writing method, a storage system, and a computer-readable storage medium to solve the technical problem that data writing cannot be triggered by non-mouse or non-keyboard methods.

[0053] First, the present invention provides a storage system, which includes a memory module and a host system; wherein the memory module includes a connection interface, a storage module, and a memory controller, the memory controller is connected to a button module, the connection interface is connected to the memory controller and the host system respectively, and the storage module is connected to the memory controller;

[0054] The memory controller is used to obtain the touch signal collected by the button module;

[0055] The memory controller is configured to determine, within a preset period, a control instruction corresponding to the touch signal according to the number and duration of the touch signal; the control instruction includes a data write instruction; the data write instruction is configured to instruct the host system to send first data to the memory controller;

[0056] If the control instruction is the data write instruction, the memory controller sends the control instruction to the host system;

[0057] The host system is configured to send the first data corresponding to the data write instruction to the memory controller according to the data write instruction;

[0058] The memory controller is configured to receive the first data returned by the host system according to the data write instruction, and write the first data into the storage module;

[0059] If the control instruction is the erase instruction, the memory controller erases the second data stored in the storage module from the storage module.

[0060] To better understand the storage system provided by the present invention, see Figure 1 , Figure 1 This is a schematic diagram of a storage system provided by the present invention. Figure 1The storage system 10 includes a host system 11 and a memory module 12. The host system 11 can be any type of computer system. For example, the host system 11 can be various electronic systems such as a laptop computer, a desktop computer, a smart phone, a tablet computer, an industrial computer, a game console, or a digital camera. The memory module 12 is used to store data from the host system 11. For example, the memory module 12 may include a solid-state drive, a USB flash drive, a memory card, or other types of non-volatile storage devices. The host system 11 can be electrically connected to the memory module 12 via a Serial Advanced Technology Attachment (SATA) interface, a high-speed peripheral component interconnect Express (PCI Express), a Universal Serial Bus (USB), or other types of connection interfaces. Therefore, the host system 11 can store data in the memory module 12 and / or read data from the memory module 12.

[0061] The memory module 12 may include a connection interface 121, a storage module 122, a memory controller 123, and a light assembly 124. The connection interface 121 is used to connect the memory module 12 to the host system 11. For example, the connection interface 121 may support a connection interface standard such as SATA, PCI Express, or USB. The memory module 12 can communicate with the host system 11 via the connection interface 121.

[0062] The storage module 122 is used to store data. The storage module 122 may include a rewritable non-volatile memory module. The storage module 122 includes a memory cell array. The memory cells in the storage module 122 store data in the form of voltage. For example, the storage module 122 may include a single-level cell (SLC) NAND flash memory module, a multi-level cell (MLC) NAND flash memory module, a triple-level cell (TLC) NAND flash memory module, a quad-level cell (QLC) NAND flash memory module, or other memory modules with similar characteristics.

[0063] The memory controller 123 is connected to the connection interface 121 and the memory module 122. The memory controller 123 can be used to control the memory module 12. For example, the memory controller 123 can control the connection interface 121 and the memory module 122 to perform data access and data management. For example, the memory controller 123 may include a central processing unit (CPU), or other programmable general-purpose or special-purpose microprocessor, a digital signal processor (DSP), a programmable controller, an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or other similar devices, or a combination of these devices.

[0064] In one embodiment, the memory controller 123 is also referred to as a flash memory controller. In one embodiment, the storage module 122 is also referred to as a flash memory module. The storage module 122 can receive a command sequence from the memory controller 123 and access the storage unit according to the command sequence.

[0065] Light group 124 is used to indicate the execution status of the control instruction. Light group 124 can emit lights of different colors. Different control instructions correspond to different lights, and each light can be used to indicate the execution status of the control instruction. For example: when executing a data write instruction, the light group flashes red, and when the data write instruction is completed, the light group changes from flashing red to constant red, to indicate the execution status of the data write instruction. When executing an encryption write instruction, the light group flashes yellow, and when the encryption write instruction is completed, the light group changes from flashing yellow to constant yellow, to indicate the execution status of the encryption write instruction. When executing an erase instruction, the light group flashes blue, and when the erase instruction is completed, the light group changes from flashing blue to constant blue, to indicate the execution status of the erase instruction.

[0066] The memory module 12 further includes a button module connected to the memory controller 123 . Figure 2 Schematic diagram of each PIN pin of a memory controller provided by the present invention. Figure 2 As shown, the button module is connected to the memory controller 123 through "XGPIO1" and inputs high and low level signals (touch signals) to the memory controller 123. The memory controller 123 determines the corresponding control instructions based on the high and low level signals to perform data writing or erasing and other processing.

[0067] Figure 3 This is a schematic diagram of a memory controller provided by the present invention. Figure 3The memory controller 123 includes a memory control circuit 1233 , a host interface 1231 and a memory interface 1232 .

[0068] The memory control circuit 1233 is used to control the overall operation of the memory controller 123. Specifically, the memory control circuit 1233 has multiple control instructions, and when the memory module 12 operates, these control instructions are executed to perform operations such as writing, reading, and erasing data. The following description of the operation of the memory control circuit 1233 is equivalent to describing the operation of the memory controller 123.

[0069] In this embodiment, the control instructions of the memory control circuit 1233 are implemented in firmware. For example, the memory control circuit 1233 includes a microprocessor unit (not shown) and a read-only memory (ROM) (not shown), and the control instructions are burned into the ROM. When the memory module 12 is operating, these control instructions are executed by the microprocessor unit to perform operations such as writing, reading, and erasing data.

[0070] In another embodiment, the control instructions of the memory control circuit 1233 can also be stored in the form of program code in a specific area of the memory module 122 (for example, a system area in the memory module dedicated to storing system data). In addition, the memory control circuit 1233 includes a microprocessor unit (not shown), a read-only memory (not shown), and a random access memory (RAM) (not shown). In particular, the read-only memory includes a boot code. When the memory controller 123 is enabled, the microprocessor unit first executes the boot code to load the control instructions stored in the memory module 122 into the RAM of the memory control circuit 1233. The microprocessor unit then executes these control instructions to perform operations such as writing, reading, and erasing data.

[0071] Furthermore, in another embodiment, the control instructions of the memory control circuit 1233 can also be implemented in hardware. For example, the memory control circuit 1233 includes a microcontroller, a memory cell management circuit, a memory write circuit, a memory read circuit, a memory erase circuit, and a data processing circuit. The memory cell management circuit, the memory write circuit, the memory read circuit, the memory erase circuit, and the data processing circuit are electrically connected to the microcontroller. The memory cell management circuit is used to manage the memory cells or groups of memory cells in the memory module 122. The memory write circuit is used to issue a write instruction sequence to the memory module 122 to write data to the memory module 122. The memory read circuit is used to issue a read instruction sequence to the memory module 122 to read data from the memory module 122. The memory erase circuit is used to issue an erase instruction sequence to the memory module 122 to erase data from the memory module 122. The data processing circuit is used to process data to be written to the memory module 122 and data to be read from the memory module 122. The write command sequence, read command sequence, and erase command sequence may each include one or more program codes or instruction codes and are used to instruct the storage module 122 to perform corresponding write, read, and erase operations. In one embodiment, the memory control circuit 1233 may also issue other types of command sequences to the storage module 122 to instruct it to perform corresponding operations.

[0072] The host interface 1231 is electrically connected to the memory control circuit 1233 and is used to receive and identify instructions and data transmitted by the host system 11. In other words, the instructions and data transmitted by the host system 11 are transmitted to the memory control circuit 1233 through the host interface 1231. In this embodiment, the host interface 1231 is compatible with the SATA standard. However, it should be understood that the present invention is not limited to this, and the host interface 1231 may also be compatible with the PATA standard, IEEE 1394 standard, PCI Express standard, USB standard, SD standard, UHS-I standard, UHS-II standard, MS standard, MMC standard, eMMC standard, UFS standard, CF standard, IDE standard, or other suitable data transmission standards.

[0073] The memory interface 1232 is electrically connected to the memory control circuit 1233 and is used to access the memory module 122. In other words, data to be written to the memory module 122 will be converted into a format acceptable to the memory module 122 via the memory interface 1232. Specifically, if the memory control circuit 1233 wants to access the memory module 122, the memory interface 1232 will transmit a corresponding command sequence. For example, these command sequences may include a write command sequence indicating the writing of data, a read command sequence indicating the reading of data, an erase command sequence indicating the erasing of data, and corresponding command sequences for instructing various memory operations (e.g., changing the read voltage level or performing garbage collection operations, etc.). These command sequences are, for example, generated by the memory control circuit 1233 and transmitted to the memory module 122 via the memory interface 1232. These command sequences may include one or more signals, or data on a bus. These signals or data may include command codes or program codes. For example, a read command sequence may include information such as a read identification code and a memory address.

[0074] In this embodiment, the memory controller 123 can perform single-frame encoding on data stored in the same physical programming unit, or multi-frame encoding on data stored in multiple physical programming units. Depending on the encoding algorithm used, the memory controller 123 can encode the data to be protected to generate corresponding error correction codes and / or error checking codes.

[0075] In one embodiment, the memory controller 123 further includes a buffer memory 1235, an error checking and correction circuit 1234, and a power management circuit 1236. The buffer memory 1235 is electrically connected to the memory control circuit 1233 and is used to temporarily store data and commands from the host system 11 or data from the memory module 122. The power management circuit 1236 is electrically connected to the memory control circuit 1233 and is used to control the power supply of the memory module 12. The error checking and correction circuit 1234 is electrically connected to the memory control circuit 1233 and is used to perform error checking and correction operations to ensure data accuracy. Specifically, when the memory control circuit 1233 receives a write command from the host system 11, the error checking and correction circuit 1234 generates an error correction code (ECC) and / or an error detecting code (EDC) corresponding to the data of the write command, and the memory control circuit 1233 writes the data corresponding to the write command and the corresponding error correction code and / or error checking code into the memory module 122. Afterwards, when the memory control circuit 1233 reads data from the storage module 122, it will simultaneously read the error correction code and / or error check code corresponding to the data, and the error checking and correction circuit 1234 will perform error checking and correction operations on the read data based on the error correction code and / or error check code.

[0076] Figure 4 This is a schematic diagram of a memory module provided by the present invention. Figures 1 to 4 The storage module 122 includes a plurality of physical units 301(1) to 301(A). Each physical unit includes a plurality of storage cells and is used to store data in a non-volatile manner. For example, a physical unit may include one or more physical blocks. Each physical block may include a plurality of physical programming units. A physical programming unit may include one or more physical pages. Multiple storage cells in a physical programming unit can be programmed simultaneously to store data. In addition, all storage cells in a physical block can be erased simultaneously.

[0077] In one embodiment, the physical units 301 ( 1 ) to 301 (A) in the storage module 122 are divided into a data area 31 . The physical units 301 ( 1 ) to 301 (A) in the data area 31 store data from the host system 11 .

[0078] In one embodiment, if Figure 4As shown, the memory control circuit 1233 can configure multiple logical units 302(1)-302(B) to map the physical units in the data area 31. For example, a logical unit can be composed of one or more logical addresses. The mapping relationship between logical units and physical units can be recorded in a logical-to-physical mapping table. When receiving an access instruction from the host system 11, the memory control circuit 1233 can access data to the physical units in the data area 31 according to the corresponding logical-to-physical mapping table.

[0079] This embodiment takes the above hardware environment as an example to describe the execution process of the memory module in detail. Figure 5 , Figure 5 FIG. 1 shows a schematic flow chart of a method for writing data provided by the present invention. Figure 5 As shown, the method may include the following steps:

[0080] Step 501: The memory controller obtains the touch signal collected by the button module.

[0081] A pushbutton module is a switch that uses a button to push a transmission mechanism, connecting or disconnecting the moving contact and the stationary contact, thereby switching the circuit. Pushbutton modules come in a variety of configurations, including standard snap-on, mushroom-head, self-locking, self-reset, rotary, with indicator lights, with illuminated symbols, and key-type. They are available in single, double, and i-button configurations, as well as in various combinations. They typically utilize a water-logging structure, consisting of a button cap, return spring, stationary contact, moving contact, and housing.

[0082] The button module includes a fixed button and a rotating button. The fixed button generates high and low level signals when the user presses the fixed button according to a certain pressing force; the rotating button generates high and low level signals when the user rotates the rotating button to a certain angle.

[0083] The button module can also be a virtual touch button in the display interface on the touch screen. The virtual touch button includes a movable button, a fixed button, a hidden button, etc. When the user presses the position of the virtual touch button according to a certain pressing force, corresponding high and low level signals are generated.

[0084] like Figure 2 As shown, the button module is connected to the memory controller 123 via "XGPIO1" and inputs high and low level signals (touch signals) to the memory controller 123. The memory controller 123 receives the touch signals collected by the button module. Specifically, the touch signals are high and low level signals. When the button module is pressed, a high level is generated, and when the button module is not pressed, a low level is generated.

[0085] In step 502, the memory controller determines the control instruction corresponding to the touch signal according to the number and duration of the touch signal within a preset period; the control instruction includes a data write instruction; the data write instruction is used to instruct the host system to send the first data to the memory module.

[0086] The user can trigger different control instructions by performing different pressing operations on the button module, such as: short pressing the button module once, short pressing the button module twice, long pressing the button module, or short pressing followed by long pressing the button module. Different pressing operations can trigger different control instructions, including but not limited to data write instructions, encryption write instructions, or erase instructions, etc., or a combination of multiple instructions. Among them, the data write instruction is used to instruct the host system to send first data to the memory controller, and then the memory controller writes the first data into the storage module.

[0087] The memory controller needs to determine the control instruction corresponding to the touch signal according to the number and duration of the touch signal.

[0088] The specific process of determining the touch signal is as follows: Figure 6 , Figure 6 FIG. 5 shows a specific schematic flow chart of step 502 in a method for writing data provided by the present invention. Figure 6 As shown, step 502 includes steps 5021 to 5023:

[0089] Step 5021: If within the preset period, the number of high-level signals in the touch signal is one, and the duration of the high-level signal in the touch signal is lower than the threshold, confirm that the control instruction corresponding to the touch signal is a data write instruction.

[0090] When the user briefly presses the button module, a touch signal with a single, short-duration high-level signal is generated. Therefore, the memory module can determine the control instruction corresponding to the touch signal based on the number and duration of the high-level signals in the touch signal.

[0091] Based on the above rules, the memory module can determine the control instruction corresponding to the touch signal. The specific process is as follows: within a preset period, there is only one touch signal, and the duration of the high-level signal in the touch signal is lower than the threshold, indicating that the touch signal was triggered by a short press by the user. The control instruction corresponding to the touch signal can be determined to be a data write instruction.

[0092] Step 5022: If within the preset period, the number of high-level signals in the touch signal is two, and the duration of the high-level signal in each touch signal is lower than the threshold, then confirm that the control instruction corresponding to the touch signal is an encrypted write instruction; the encrypted write instruction is used to encrypt and back up the target data stored in the host system.

[0093] When the user briefly presses the button module twice, a touch signal having two short-duration high-level signals is obtained.

[0094] Based on the above rules, the memory module can determine the control instruction corresponding to the touch signal. The specific process is as follows: within a preset period, there are two touch signals, and the duration of the high-level signal in the touch signal is lower than the threshold, indicating that the touch signal was triggered by the user through two short presses. The control instruction corresponding to the touch signal can be determined to be an encrypted write instruction.

[0095] Step 5023: If within the preset period, the number of high-level signals in the touch signal is one, and the duration of the high-level signal in each touch signal is not less than the threshold, then confirm that the control instruction corresponding to the touch signal is an erase instruction; the erase instruction is used to format the target data stored in the host system or memory module.

[0096] When the user long presses the button module, a touch signal having a high-level signal that lasts once and for a long time is obtained.

[0097] The memory module can determine the control instruction corresponding to the touch signal based on the above rules. The specific process is as follows: within a preset period, there is only one touch signal, and the duration of the high-level signal in the touch signal is not less than the threshold, indicating that the touch signal was triggered by a long press operation by the user. The control instruction corresponding to the touch signal can be determined to be an erase instruction.

[0098] Step 503: If the control instruction is the data write instruction, the memory controller sends the control instruction to the host system.

[0099] Because the data write command is used to write first data from a specified storage location in the host system to the storage module, the memory controller needs to send the data write command to the host system. Upon receiving the data write command, the host system sends the first data to the memory controller, which then writes the first data into the storage module.

[0100] The location where data stored on a PC or mobile phone (i.e., host system 11) is stored can be pre-configured, for example, to a folder called "USER file in the C: / / directory." Once the memory module and host system are connected and powered on, communication between them is established, enabling data access between them. For example, when the host system receives a data write instruction, it sends the first data in the folder "USER file in the C: / / directory" to the memory controller, thereby writing the data to the memory module.

[0101] Step 504 : The memory controller receives the first data returned by the host system according to the data write instruction, and writes the first data into the storage module.

[0102] When the memory controller receives the first data returned by the host system, it directly writes the first data into the storage module. Preferably, in order to save storage resources, the present invention also provides the following write logic:

[0103] See Figure 7 , Figure 7 FIG. 5 shows a specific schematic flow chart of step 504 in a method for writing data provided by the present invention. Figure 7 As shown, step 504 includes steps 5041 to 5044:

[0104] Step 5041: The memory controller receives the first data returned by the host system according to the data write instruction.

[0105] In step 5042 , the memory controller compresses the first data to obtain compressed first data.

[0106] In order to further save storage space, the present embodiment compresses the first data to obtain compressed first data. Specifically, the present embodiment performs data compression processing on the first data by Huffman coding, and the specific process is as follows: the first data is counted to count the frequency of occurrence of each character in the first data, and multiple character strings of preset length are output. After obtaining the weight value of each character string based on the character frequency information segment of each character string, the multiple character strings are weighted. Based on the multiple character strings after weight sorting, a Huffman tree including multiple character strings is constructed. According to the Huffman tree, each character in the first data is Huffman coded to obtain a coding comparison table, which records each character and the Huffman code corresponding to each character. According to the coding comparison table, the first data is compressed to obtain the first data, and the first data and the coding comparison table are output.

[0107] Step 5043: The memory controller traverses the historical data in the storage module.

[0108] Step 5044: If the historical data is different from the compressed first data, the memory controller writes the compressed first data into the storage module.

[0109] In actual application scenarios, the same data may be written repeatedly due to user errors or repeated operations. To prevent this, this embodiment compares the compressed first data with the historical data. Only when the historical data differs from the compressed first data is the compressed first data written to the storage module. If the historical data and the compressed first data are the same, the compressed first data is deleted or discarded.

[0110] Specifically, step 5044 further includes the following process:

[0111] See Figure 8 , Figure 8 FIG. 5 shows a specific schematic flow chart of step 5044 in a method for writing data provided by the present invention. Figure 8 As shown, step 5044 includes steps A1 to A3:

[0112] In step A1, the memory controller obtains a dictionary list corresponding to historical data; the dictionary list is used to store historical identification information of the historical data; the historical identification information includes but is not limited to high-frequency data or summary data corresponding to the historical data.

[0113] To improve the efficiency of comparing historical data with the compressed first data, this embodiment uses a dictionary list to implement the comparison operation. The dictionary list is a list or database pre-stored in the storage module and is used to store historical identification information of historical data (historical data refers to data already stored in the storage module). Historical identification information refers to all feature data that can be used to characterize historical data, including but not limited to high-frequency data or summary data. The most frequently occurring data can be extracted from the historical data as high-frequency data, and summary data can also be extracted from the historical data based on natural language processing.

[0114] Step A2: The memory controller extracts current identification information of the first data.

[0115] The current identification information includes but is not limited to data such as high-frequency data or summary data.

[0116] Step A3: If the current identification information is different from the historical identification information, the memory controller determines that the historical data is different from the compressed first data, and writes the compressed first data into the storage module.

[0117] If the current identification information is the same as the historical identification information, the compressed first data is deleted.

[0118] Optionally, in order to better indicate the execution status of the control instruction to the user, this embodiment additionally provides a light group in the memory module. Different control instructions correspond to different lights, and each light can be used to indicate the execution status of the control instruction. For example: when executing a data write instruction, the light group flashes red, and when the data write instruction is completed, the light group changes from flashing red to constantly bright red, to indicate the execution status of the data write instruction. When executing an encryption write instruction, the light group flashes yellow, and when the encryption write instruction is completed, the light group changes from flashing yellow to constantly bright yellow, to indicate the execution status of the encryption write instruction. When executing an erase instruction, the light group flashes blue, and when the erase instruction is completed, the light group changes from flashing blue to constantly bright blue, to indicate the execution status of the erase instruction.

[0119] It is worth noting that in the prior art, processes such as writing or erasing data require the user to operate the host system, which then sends control instructions to the memory module to execute the corresponding writing or erasing process. In contrast, this embodiment only requires pressing a button on the memory module to send control instructions to the host system or erase local data, without requiring any operation in the host system. Therefore, this embodiment differs significantly from the prior art in terms of the generator or sender of control instructions.

[0120] In an embodiment, the memory controller acquires the touch signal collected by the button module; the memory controller determines the control instruction corresponding to the touch signal according to the number and duration of the touch signal within a preset period; the control instruction includes a data write instruction; the data write instruction is used to instruct the host system to send the first data to the memory controller; if the control instruction is the data write instruction, the memory controller sends the control instruction to the host system; the memory controller receives the first data returned by the host system according to the data write instruction, and writes the first data to the storage module. The above solution, based on the button module, acquires the number and duration of the touch signal collected by the button module to determine different control instructions, and executes the control instructions. There is no need to operate the mouse and keyboard in the host system to trigger the write instruction, which solves the technical problem of not being able to trigger data writing by non-mouse or non-keyboard methods.

[0121] Optionally, after step 502, the method further includes the following step 505. Figure 9 , Figure 9 A schematic flow chart of another data writing method provided by the present invention is shown.

[0122] Step 501: The memory controller obtains the touch signal collected by the button module.

[0123] In step 502, the memory controller determines the control instruction corresponding to the touch signal according to the number and duration of the touch signal within a preset period; the control instruction includes a data write instruction; the data write instruction is used to instruct the host system to send the first data to the memory controller.

[0124] Step 503: If the control instruction is the data write instruction, the memory controller sends the control instruction to the host system.

[0125] Step 504 : The memory controller receives the first data returned by the host system according to the data write instruction, and writes the first data into the storage module.

[0126] Step 505: If the control instruction is the erase instruction, the memory controller erases the second data stored in the storage module from the storage module.

[0127] In this embodiment, when the control instruction is an erase instruction, the second data stored in the storage module is erased from the storage module, and the data erasure process can be implemented without the need for inputs of a mouse or a keyboard.

[0128] An embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the above-mentioned various method embodiments can be implemented.

[0129] An embodiment of the present invention provides a computer program product. When the computer program product is run on a mobile terminal, the mobile terminal can implement the steps in the above-mentioned method embodiments when executing the computer program product.

[0130] If the integrated unit is implemented as a software functional unit and sold or used as a standalone product, it can be stored in a computer-readable storage medium. Based on this understanding, the present invention implements all or part of the process steps in the above-mentioned method embodiments by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When executed by a processor, the computer program can implement the steps of each of the above-mentioned method embodiments. The computer program includes computer program code, which can be in source code form, object code form, executable file, or some intermediate form. The computer-readable medium can include at least: any entity or device capable of carrying the computer program code to the camera / memory module, a recording medium, computer memory, read-only memory (ROM), random access memory (RAM), an electrical carrier signal, a telecommunications signal, and a software distribution medium. Examples include a USB flash drive, a removable hard drive, a magnetic disk, or an optical disk. In some jurisdictions, based on legislation and patent practice, computer-readable media cannot be electrical carrier signals or telecommunications signals.

[0131] In the above embodiments, the description of each embodiment has its own focus. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant description of other embodiments.

[0132] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present invention.

[0133] In the embodiments provided by the present invention, it should be understood that the disclosed devices / network equipment and methods can be implemented in other ways. For example, the device / network equipment embodiments described above are merely illustrative. For example, the division of the modules or units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0134] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, and may be located in one place or distributed across multiple network units.

[0135] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, integers, steps, operations, elements and / or components, but does not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or groups thereof.

[0136] It will also be understood that the term "and / or" used in the present description and appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.

[0137] As used in the present specification and the appended claims, the term "if" may be interpreted as "when" or "upon" or "in response to determining" or "in response to monitoring," depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is monitored" may be interpreted as meaning "upon determination" or "in response to determining" or "upon monitoring [described condition or event]" or "in response to monitoring [described condition or event]," depending on the context.

[0138] In addition, in the description of the present specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.

[0139] References to "one embodiment" or "some embodiments" in the present specification mean that a particular feature, structure, or characteristic described in conjunction with that embodiment is included in one or more embodiments of the present invention. Thus, phrases such as "in one embodiment," "in some embodiments," "in other embodiments," and "in yet other embodiments" appearing in various places in this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "including," "comprising," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.

[0140] The embodiments described above are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present invention, and should all be included in the scope of protection of the present invention.

Claims

1. A method for writing data, wherein the method is applied to a memory module, The memory module includes a connection interface, a storage module, and a memory controller, the memory controller is connected to the button module, the connection interface is connected to the memory controller and the host system respectively, and the storage module is connected to the memory controller. The method of writing data includes: The memory controller acquires the touch signal collected by the button module; The memory controller determines, within a preset period, a control instruction corresponding to the touch signal according to the number and duration of the touch signal; the control instruction includes a data write instruction; the data write instruction is used to instruct the host system to send first data to the memory controller; If the control instruction is the data write instruction, the memory controller sends the control instruction to the host system; The memory controller receives the first data returned by the host system according to the data write instruction, and writes the first data into the storage module.

2. The method for writing data as claimed in claim 1, wherein: The touch signal is a high-low level signal.

3. The method for writing data as claimed in claim 2, wherein: The control instructions also include erase instructions; The memory controller determines, within a preset period, according to the number and duration of the touch signals, a control instruction corresponding to the touch signal, including: If within the preset period, the number of high-level signals in the touch signal is one, and the duration of the high-level signal in the touch signal is lower than a threshold, determining that the control instruction corresponding to the touch signal is a data write instruction; If, within the preset period, the number of high-level signals in the touch signal is two, and the duration of the high-level signal in each of the touch signals is less than the threshold, then determining that the control instruction corresponding to the touch signal is an encrypted write instruction; the encrypted write instruction is used to encrypt and back up target data stored in the host system; If within the preset period, the number of high-level signals in the touch signal is one, and the duration of the high-level signal in each touch signal is not less than the threshold, then it is confirmed that the control instruction corresponding to the touch signal is an erase instruction; the erase instruction is used to format the target data stored in the host system or memory module.

4. The method for writing data as claimed in claim 3, wherein: After the memory controller determines the control instruction corresponding to the touch signal according to the number and duration of the touch signal within a preset period, the method further includes: If the control instruction is the erase instruction, the memory controller erases the second data stored in the storage module from the storage module.

5. The method for writing data as claimed in claim 1, wherein: The memory controller receives the first data returned by the host system according to the data write instruction, and writes the first data into the storage module, including: The memory controller receives the first data returned by the host system according to the data write instruction; The memory controller compresses the first data to obtain compressed first data; The memory controller traverses the historical data in the storage module; If the historical data is different from the compressed first data, the memory controller writes the compressed first data into the storage module.

6. The method for writing data as claimed in claim 5, wherein: If the historical data is different from the compressed first data, the memory controller writes the first data into the storage module, comprising: The memory controller obtains a dictionary list corresponding to the historical data; the dictionary list is used to store historical identification information of the historical data; the historical identification information includes high-frequency data or summary data corresponding to the historical data; The memory controller extracts current identification information of the first data; If the current identification information is different from the historical identification information, the memory controller determines that the historical data is different from the compressed first data, and writes the compressed first data into the storage module.

7. The method for writing data as claimed in claim 1, wherein: The memory module also includes a light bank.

8. The method for writing data as claimed in claim 7, wherein: The memory controller receives the first data returned by the host system according to the data write instruction, and writes the first data into the storage module, including: The memory controller receives the first data returned by the host system according to the data write instruction; The memory controller writes the first data into the storage module and controls the light group to flash red; If the first data is written completely, the memory controller controls the light group to change from a flashing red light to a permanently lit red light.

9. A storage system comprising a memory module and a host system; wherein: The memory module includes a connection interface, a storage module and a memory controller, the memory controller is connected to the button module, the connection interface is connected to the memory controller and the host system respectively, and the storage module is connected to the memory controller; The memory controller is used to obtain the touch signal collected by the button module; The memory controller is configured to determine, within a preset period, a control instruction corresponding to the touch signal according to the number and duration of the touch signal; the control instruction includes a data write instruction; the data write instruction is configured to instruct the host system to send first data to the memory controller; If the control instruction is the data write instruction, the memory controller sends the control instruction to the host system; The host system is configured to send the first data corresponding to the data write instruction to the memory controller according to the data write instruction; The memory controller is configured to receive the first data returned by the host system according to the data write instruction, and write the first data into the storage module; If the control instruction is an erase instruction, the memory controller erases the second data stored in the storage module from the storage module.

10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by the memory controller, the steps of the method according to any one of claims 1 to 8 are implemented.

Citation Information

Patent Citations

  • Controlled storage apparatus and access operation software

    CN101493866A

  • Memory storage device, memory controller and access method of storage device

    CN102789430A