Data processing method and apparatus, and electronic device

By sending a preset number of first read commands and random numbers to the solid-state drive, and combining them with tag values ​​to construct custom data processing commands, the poor scalability and compatibility issues of existing protocols are resolved, enabling richer command definitions and enhanced user data security.

CN115129255BActive Publication Date: 2025-12-12SHENZHEN CITY TECHWIN SEMICONDUCTOR COMPANY LIMITED
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210771436.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-30
Publication Date
2025-12-12
Estimated Expiration
2042-06-30

AI Technical Summary

Technical Problem

The limited number of reserved fields in existing SATA and NVME protocols results in poor extensibility of custom commands and significant differences in driver detection across different platforms, causing compatibility issues.

Method used

By sending a preset number of first read commands, the solid-state drive enters a specified working mode. Combined with random numbers and tag values, custom data processing commands are constructed, including second read commands or first write commands, to enhance scalability.

Benefits of technology

It enables the definition of more custom commands on different platforms, ensuring user data security and enhancing the scalability and compatibility of data processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115129255B_ABST
    Figure CN115129255B_ABST
Patent Text Reader

Abstract

The application provides a data processing method and device and electronic equipment, the method is applied to the electronic equipment, the electronic equipment is in communication connection with a solid state disk; the method comprises the following steps: sending a preset number of first read commands to the solid state disk, so that the solid state disk enters a specified working mode and returns a random number to the electronic equipment; wherein each read command carries a tag value corresponding to the read command; based on the random number, a data processing command is sent to the solid state disk in the specified working mode, so that the solid state disk processes data corresponding to the data processing command according to the data processing command; wherein the data processing command comprises a second read command or a first write command. In this way, the preset number of first read commands and data processing commands are used to jointly constitute a custom command, the data area of the first read command and the data processing command is relatively large, more custom commands can be defined, and the expansibility is enhanced.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of data processing, and in particular to a data processing method and device and electronic equipment. BACKGROUND

[0002] The solid state disk is a data storage product connected to the host by SATA (Serial Advanced Technology Attachment) or PCIE (Peripheral Component Interconnect Express) and the like, and driven and controlled by the corresponding controller, and initiates services from the application layer.

[0003] The solid state disk connected through the PECI line transmits data in the NVME (Non-Volatile Memory Express) protocol, and the solid state disk connected through the SATA line transmits data in the SATA protocol. The SATA, NVME and the like protocols can define many commands for the application layer to initiate related services, but these commands cannot meet the related service requirements in some special scenarios, such as reading the bad block information of the solid state disk and burning the firmware, which usually requires the disk manufacturer to define some commands.

[0004] In the prior art, there are some reserved fields in the SATA and NVME protocol commands, and some commands are usually defined by using these reserved fields. The reserved fields are generally small, and the extensibility of the defined commands is poor. SUMMARY

[0005] The purpose of the present application is to provide a data processing method and device and electronic equipment to define more custom commands and enhance extensibility.

[0006] The data processing method provided by the present application is applied to an electronic equipment, and the electronic equipment is in communication connection with a solid state disk. The method comprises the following steps: a preset number of first read commands are sent to the solid state disk, so that the solid state disk enters a specified working mode and returns a random number to the electronic equipment. Each first read command carries a tag value corresponding to the first read command. Based on the random number, a data processing command is sent to the solid state disk in the specified working mode, so that the solid state disk processes data corresponding to the data processing command according to the data processing command. The data processing command comprises a second read command or a first write command.

[0007] Further, if the data processing command is the first write command, the first write command carries the random number, the tag value corresponding to the first write command and the data to be written; based on the random number, the data processing command is sent to the solid state disk in the specified working mode, so that the solid state disk processes the data corresponding to the data processing command according to the data processing command. If the data processing command is the first write command, the first write command is sent to the solid state disk in the specified working mode, so that the solid state disk writes the data to be written according to the first write command.

[0008] Further, if the data processing command is the second read command, the second read command carries the random number and the tag value corresponding to the second read command; based on the random number, the data processing command is sent to the solid state disk in the specified working mode, so that the solid state disk processes the data corresponding to the data processing command according to the data processing command. If the data processing command is the second read command, the second read command is sent to the solid state disk in the specified working mode, so that the solid state disk returns the data to be read corresponding to the second read command according to the second read command.

[0009] Further, based on the random number, the data processing command is sent to the solid state disk in the specified working mode, so that the solid state disk processes the data corresponding to the data processing command according to the data processing command. The step of sending the second write command to the solid state disk in the specified working mode, so that the solid state disk determines the data category corresponding to the command parameter according to the command parameter carried by the second write command; wherein the second write command also carries the random number and the tag value corresponding to the second write command; the data processing command is sent to the solid state disk in the specified working mode, so that the solid state disk processes the data corresponding to the data processing command which belongs to the data category to be processed.

[0010] Further, each first read command, data processing command and second write command is constructed according to a preset protocol; wherein the preset protocol includes at least one of the following: SATA protocol and NVME protocol.

[0011] Further, a preset number of first read commands are sent to the solid state disk, so that the solid state disk enters the specified working mode, and the step of returning the random number to the electronic device includes: obtaining the preset number of first read commands; sending each first read command to the solid state disk in turn according to a preset order; receiving the data corresponding to each first read command returned by the solid state disk, and controlling the solid state disk to enter the specified working mode; wherein the data returned by the last first read command is the random number.

[0012] Further, after the step of sequentially sending each first read command to the solid state disk in the preset order, the method further comprises: if there is a first read command that fails to be sent, repeating the step of sequentially sending each first read command to the solid state disk in the preset order until each first read command is successfully sent.

[0013] The application provides a data processing device, which is arranged on an electronic device and is in communication connection with a solid state disk.

[0014] The application provides an electronic device, which comprises a processor and a memory.

[0015] The application provides a computer readable storage medium, which stores computer executable instructions.

[0016] The application provides a data processing method and device and an electronic device. BRIEF DESCRIPTION OF DRAWINGS

[0017] In order to more clearly illustrate the technical solutions in the specific embodiments of the present application or the prior art, the drawings required to be used in the specific embodiments or prior art description will be briefly introduced below. Obviously, the drawings in the following description are some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor on the basis of these drawings.

[0018] Figure 1 A schematic diagram of a read command provided for an embodiment of the present application;

[0019] Figure 2 A flowchart of a data processing method provided for an embodiment of the present application;

[0020] Figure 3 A structural schematic diagram of a data transmission system provided for an embodiment of the present application;

[0021] Figure 4 A flowchart of another data processing method provided for an embodiment of the present application;

[0022] Figure 5 A process schematic diagram of processing special data provided for an embodiment of the present application;

[0023] Figure 6 An execution flowchart of a self-defined command provided for an embodiment of the present application;

[0024] Figure 7 A structural schematic diagram of a data processing apparatus provided for an embodiment of the present application;

[0025] Figure 8 A structural schematic diagram of an electronic device provided for an embodiment of the present application. DETAILED DESCRIPTION

[0026] The technical solutions of the present application will be described below in conjunction with embodiments, obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor belong to the scope of protection of the present application.

[0027] The solid state disk is a data storage product connected to the host by SATA or PCIE, etc., driven and controlled by the corresponding controller, and the business data is initiated from the application layer. The SATA, NVME, etc. protocol defines many commands for the application layer to initiate related businesses, but these commands cannot meet the related business requirements in some special scenarios, and the disk manufacturers usually need to define some commands, which are generally called vender commands.

[0028] In the prior art, some commands are usually defined by using a reserved field in a SATA, NVME protocol command.

[0029] The prior art mainly has the following disadvantages:

[0030] The reserved field is generally small, as shown in a read command diagram, Figure 1 The content 3:0Reserved in the black frame marked part is a reserved field, and the size is only 3 bits, resulting in poor scalability. Figure 1

[0031] In addition, the reserved field may be selected during protocol evolution, at which time the vender command cannot adapt to the protocol specification of the version, and the detection of the command by different platform drivers is different, so the method of using the reserved field may cause poor compatibility.

[0032] In order to facilitate the understanding of the embodiment, first, a data processing method disclosed by the embodiment is introduced in detail, and the method is applied to an electronic device, the electronic device is in communication connection with a solid state disk, as shown in Figure 2 The method comprises the following steps:

[0033] Step S202, a preset number of first read commands are sent to the solid state disk, so that the solid state disk enters a specified working mode and returns a random number to the electronic device; wherein each first read command carries a tag value corresponding to the first read command.

[0034] The electronic device in the application can be understood as an application program, and the solid state disk can be understood as a computer storage device mainly using flash memory as a permanent memory, which can be simply referred to as SSD, and is composed of a control unit and a storage unit. The main functions of the solid state disk in the computer are two, the first function is the storage function, the operating system and all software and user data are stored in the hard disk, the second function is the extraction function of all data, there is storage and there is taking, and the function is summarized as the read and write function of data.

[0035] In the specific implementation process, referring to the structure diagram of a data transmission system, Figure 3 The solid state disk can be connected to the host through a SATA line or a PCIE line, and the application program is driven and controlled by the SATA controller or the PCIE controller on the host to initiate related services.

[0036] ​Generally, the data stored in the solid state disk storage unit can include two kinds, one is user data, and the other is special data provided by the solid state disk manufacturer. The SATA protocol or the NVME protocol can define many commands, including read commands and write commands. The read command is used to read the data stored in the solid state disk storage unit, and the write command is used to write data to the solid state disk. In some special scenarios, the commands defined by the SATA protocol or the NVME protocol cannot meet the related business requirements. For example, the read command defined by the SATA protocol cannot read the bad block information (special data) of the solid state disk to the application program, because the commands defined by the SATA protocol or the NVME protocol can only be used to process user data.

[0037] In actual application, in order to be able to process the special data in the solid state disk, the application program can construct a preset number of first read commands according to the preset protocol (SATA protocol or NVME protocol). Each read command can carry a tag value corresponding to the read command. Each tag value is generally a special value previously negotiated by the electronic device and the solid state disk end. Although each tag value is generally a special value that is not common, there is still a situation that one of the tag values is the same as the tag value carried by the command for processing user data. Therefore, sending all the preset number of first read commands to the solid state disk can play a reminding role, reminding the solid state disk that the current received read-write command may be a link in the entire process of processing special data, and it cannot be completely determined. Therefore, after receiving the preset number of first read commands, the solid state disk returns a generated random number to the application program to further determine whether the current received read-write command is a link in the entire process of processing special data (corresponding to entering a specified working mode).

[0038] Step S204, based on the random number, a data processing command is sent to the solid state disk in the specified working mode, so that the solid state disk processes the data corresponding to the data processing command according to the data processing command. The data processing command includes a second read command or a first write command.

[0039] The application program receives the random number sent by the solid state disk, and sends a data processing command to the solid state disk in the specified working mode (judging whether the current received read-write command is a link in the entire process of processing special data) to make the solid state disk finally determine that the current received read-write command is a link in the entire process of processing special data, and process the data corresponding to the data processing command.

[0040] The application provides a data processing method, which is applied to an electronic device in communication connection with a solid state disk; the method comprises the following steps: sending a preset number of first read commands to the solid state disk, so that the solid state disk enters a specified working mode and returns a random number to the electronic device; wherein each read command carries a tag value corresponding to the read command; based on the random number, a data processing command is sent to the solid state disk in the specified working mode, so that the solid state disk processes data corresponding to the data processing command according to the data processing command; wherein the data processing command comprises a second read command or a first write command. In this way, the preset number of first read commands and the data processing command are used to jointly form a custom command, the data area of the first read command and the data processing command is relatively large, more custom commands can be defined, and the expansibility is enhanced.

[0041] The application also provides another data processing method, which is implemented on the basis of the method in the above embodiment; as shown in the figure, the method comprises the following steps: Figure 4

[0042] In step S402, a preset number of first read commands are acquired.

[0043] In step S404, each first read command is sent to the solid state disk in a preset order.

[0044] In step S406, if there is a first read command that fails to be sent, the step of sending each first read command to the solid state disk in a preset order is repeated until each first read command is successfully sent.

[0045] In the specific implementation process, the application program can construct a preset number of first read commands, a second write command and a data processing command (a first write command or a second read command) according to a preset protocol (SATA protocol or NVME protocol), and each read command and write command can carry a corresponding tag value. The preset number of first read commands, the second write command and the data processing command can form a read-write command sequence in a preset order. Assuming that there are three first read commands, the order of the read commands and the write command in the read-write command sequence is: the first read command, the second read command, the third read command, the second write command and the data processing command; the three first read commands are sent to the solid state disk in the order of the first read command, the second read command and the third read command. If any of the three first read commands fails to be sent, the step of sending the three first read commands to the solid state disk in the order of the first read command, the second read command and the third read command is repeated until the first read command, the second read command and the third read command are successfully sent.

[0046] ​Step S408, receiving the data corresponding to each first read command returned by the solid state disk, and controlling the solid state disk to enter the specified working mode; wherein the data returned by the last sent first read command is a random number.

[0047] In actual implementation, after successfully receiving the first read command, the solid state disk returns the data corresponding to the first read command to the application program; after successfully receiving the second read command, the solid state disk returns the data corresponding to the second read command to the application program; after successfully receiving the third read command, the solid state disk enters the specified working mode and returns a random number to the application program.

[0048] Step S410, sending a second write command to the solid state disk in the specified working mode, so that the solid state disk determines the data category to be processed corresponding to the command parameter according to the command parameter carried by the second write command; wherein the second write command also carries a random number and a tag value corresponding to the second write command.

[0049] After receiving the random number, the application program sends a second write command to the solid state disk, returns the tag value corresponding to the second write command and the random number to the solid state disk. Only when processing special data, the random number will be returned to the solid state disk again. When processing user data, the random number will not be returned. Therefore, after receiving the random number and the tag value corresponding to the second write command, the solid state disk determines that the current read-write command is a link in the entire special data processing process, so that only special data is processed and user data is not processed, thereby ensuring the safety of user data.

[0050] In the specific implementation process, the second write command also carries a command parameter, and different command parameters correspond to different special data types (equivalent to data categories to be processed), such as 0x2 indicating processing of log information and 0x1 indicating processing of ring block information. Therefore, the solid state disk can determine which special data to process according to the command parameter.

[0051] Step S412, sending a data processing command to the solid state disk in the specified working mode, so that the solid state disk processes the data corresponding to the data processing command which belongs to the data category to be processed.

[0052] In the specific implementation process, the specific business initiated by the application program determines whether the data processing command is a first write command or a second read command. For example, when the initiated business is to read bad block information, the data processing command is a second read command; when the initiated business is to burn firmware, the data processing command is a first write command.

[0053] If the data processing command is the first write command, the first write command carries a random number, the tag value corresponding to the first write command, and the data to be written. After the electronic device (application) sends the first write command to the solid-state drive in the specified working mode, it writes the data to be written carried by the first write command into the special data type corresponding to the command parameter.

[0054] If the data processing command is a second read command, the second read command carries a random number and the tag value corresponding to the second read command. After the electronic device sends the second read command to the solid-state drive in the specified working mode, the solid-state drive returns the data to be read corresponding to the second read command in the special data type of the command parameters to the electronic device.

[0055] To better understand the above embodiments, this application provides a method such as... Figure 5 The diagram illustrates a process for processing special data. As can be seen from the diagram, the entire process can be divided into three main parts: the first part is the handshake stage (which reminds the SSD that the read / write command it is currently receiving may be a step in the process of processing special data); the second part is the vendor mode stage (which further determines whether the read / write command the SSD is currently receiving is a step in the process of processing special data); and the third part is the special data processing stage (which determines that the read / write command the SSD is currently receiving is a step in the process of processing special data).

[0056] The "handshake" phase involves the first n read commands (a preset number of first read commands) being sent to the SSD in a predetermined order, and the corresponding data being returned. Each read command carries a unique tag, which can be a pre-negotiated value between the application and the disk (such as a special logical block address 0x12345). This tag indicates that it is one of a custom command (a sequence of read and write commands) designed to process special data on the SSD and requires special handling. Specifically, read command 1 with tag-1 is sent to the SSD first, and the corresponding data is returned. Then, read command 2 with tag-2 is sent to the SSD, and the corresponding data is returned. Each read command operates in this manner until read command n with tag-n (the last first read command) is successfully sent to the SSD. Only then is the entire "handshake" phase successfully completed. The handshake phase described above only serves as a reminder to the SSD that the currently received read / write command may be part of the entire process of processing special data, but it does not completely confirm this.

[0057] In order to further determine whether the current received read-write command is a link in the whole process of processing special data, the solid state disk enters a vender mode (enters a specified working mode), generates a random pattern (special pattern) and sends the random pattern to the application program. After that, the read command or the write command sent by the application program is provided with a corresponding special tag and the random pattern returned by the solid state disk. The solid state disk can always correctly recognize the remaining read-write command of the vender command (self-defined command), thereby only processing the special data and ensuring the safety of user data. Specifically, the application program receives the random pattern, and returns a write command (second write command) with a tag-n+1, a pattern and an arg (command parameter) to the solid state disk. The random pattern is a random number generated and returned by the solid state disk. When the application program returns the pattern to the solid state disk, the disk can more clearly determine that the current received read-write command is a link in the whole process of processing special data.

[0058] After the determination, the application program then sends a read command with a tag-n+2, a pattern or a write command with a tag-n+2, a pattern and data to be written (data) to the solid state disk (second read command or first write command), for processing the special data in the solid state disk. If the read command (second read command) is sent, the solid state disk also needs to return the special data corresponding to the command parameters in the second read command and the second write command to the application program.

[0059] From Figure 5 It can be seen that the self-defined command is composed of multiple read-write commands in a fixed order. In order to better understand the above embodiment, the application further provides a self-defined command as shown in Figure 6The execution flowchart of a self-defined command (vender command) is shown; when the vender command starts, n read commands with a special tag are sent to handshake with the solid state disk to ensure that the solid state disk correctly enters the vender command mode, the commands in the handshake stage are all read commands and cannot damage user data. If there is any read command in the handshake stage that is not successfully sent to the solid state disk (read command sending fails), the vender command restarts until all the read commands in the handshake stage are successfully sent, when the last read command n is successfully sent, the handshake succeeds, the solid state disk enters the vender mode, and a random pattern is returned, and a write command with a special tag, pattern and arg is continuously sent to the solid state disk, if the sending fails, the vender command restarts, if the sending succeeds, a write command with a special tag, pattern and data (to be written data) is continuously sent to the solid state disk, or a read command with a special tag, pattern and data (to be read data) is continuously sent to the solid state disk, if the sending fails, the vender command restarts, if it is a write command, the whole process is directly ended after the write command is successfully sent, if it is a read-write command, the solid state disk returns the data (to be read data) corresponding to the read command first after the read command is successfully sent, and then the whole process is ended.

[0060] The application provides a data processing method and device and electronic equipment, the method is applied to the electronic equipment, and the electronic equipment is in communication connection with a solid state disk; in the method, a combination of a first read command, a second write command, a first write command or a second read command is a command defined by a SATA or NVME protocol, so that a preset number of combinations of the first read command, the second write command, the first write command or the second read command are used to form a self-defined command (equivalent to a combination of read-write commands used to form a self-defined command), and there is no compatibility problem in any platform. In the application, the first read command, the second write command, the first write command or the second read command all use a special tag, and the second write command, the first write command or the second read command also returns a random pattern, so that the safety of user data can be effectively ensured. Compared with a reserved field in a read-write command, a data area of the read-write command is much larger, so that more self-defined commands can be defined if the combination of the read-write commands is used to form the self-defined command, and the expansibility is enhanced.

[0061] The application further provides a data processing device, which is arranged on an electronic equipment and is in communication connection with a solid state disk. Figure 7As shown, the device comprises: a first sending module 70, configured to send a preset number of first read commands to the solid state disk, so that the solid state disk enters a specified working mode, and returns a random number to the electronic device; wherein each first read command carries a tag value corresponding to the first read command; a second sending module 71, configured to send a data processing command to the solid state disk based on the random number, so that the solid state disk processes data corresponding to the data processing command according to the data processing command; wherein the data processing command comprises a second read command or a first write command.

[0062] The application provides a data processing device, which is arranged on an electronic device and is in communication connection with a solid state disk; a preset number of first read commands are sent to the solid state disk, so that the solid state disk enters a specified working mode and returns a random number to the electronic device; wherein each read command carries a tag value corresponding to the read command; a data processing command is sent to the solid state disk in the specified working mode based on the random number, so that the solid state disk processes data corresponding to the data processing command according to the data processing command; wherein the data processing command comprises a second read command or a first write command. In the device, the preset number of first read commands and the data processing command jointly constitute a custom command, the data area of the first read command and the data processing command is relatively large, more custom commands can be defined, and the expansibility is enhanced.

[0063] Further, if the data processing command is a first write command, the first write command carries the random number, the tag value corresponding to the first write command and to-be-written data; the second sending module is further configured to: if the data processing command is a first write command, a first write command is sent to the solid state disk in the specified working mode, so that the solid state disk writes the to-be-written data according to the first write command.

[0064] Further, if the data processing command is a second read command, the second read command carries the random number and the tag value corresponding to the second read command; the second sending module is further configured to: if the data processing command is a second read command, a second read command is sent to the solid state disk in the specified working mode, so that the solid state disk returns to-be-read data corresponding to the second read command according to the second read command.

[0065] Further, the second sending module is further configured to: a second write command is sent to the solid state disk in the specified working mode, so that the solid state disk determines a to-be-processed data category corresponding to a command parameter carried in the second write command according to the command parameter; wherein the second write command further carries a random number and a tag value corresponding to the second write command; the data processing command is sent to the solid state disk in the specified working mode, so that the solid state disk processes data corresponding to the data processing command, which belongs to the to-be-processed data category.

[0066] Further, each first read command, data processing command and second write command is constructed according to a preset protocol; wherein the preset protocol comprises at least one of the following: a SATA protocol and an NVME protocol.

[0067] Further, the first sending module is further configured to: acquire a preset number of first read commands; send each first read command to the solid state disk in a preset order; receive data corresponding to each first read command returned by the solid state disk; and control the solid state disk to enter a specified working mode; wherein the data returned by the last first read command is a random number.

[0068] Further, the first sending module is further configured to: if there is a first read command that fails to be sent, repeatedly execute the step of sending each first read command to the solid state disk in a preset order until each first read command is successfully sent.

[0069] The data processing apparatus provided in the embodiments of the present application has the same implementation principle and technical effects as the data processing method described above, and the data processing apparatus embodiment part can refer to the corresponding content in the data processing method embodiment described above.

[0070] The embodiments of the present application further provide an electronic device, referring to Figure 8 The electronic device includes a processor 130 and a memory 131, and the memory 131 stores machine executable instructions that can be executed by the processor 130, and the processor 130 executes the machine executable instructions to implement the data processing method described above.

[0071] Further, Figure 8 The electronic device shown in the figure further includes a bus 132 and a communication interface 133, and the processor 130, the communication interface 133 and the memory 131 are connected through the bus 132.

[0072] The memory 131 can include a high-speed random access memory (RAM, Random Access Memory), and can also include a non-volatile memory, such as at least one disk memory. The communication connection between the system network element and at least one other network element is realized through at least one communication interface 133 (which can be wired or wireless), and the Internet, a wide area network, a local area network, a metropolitan area network, etc. can be used. The bus 132 can be an ISA bus, a PCI bus or an EISA bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 8 Only one bidirectional arrow is used in the figure, but it does not mean that there is only one bus or one type of bus.

[0073] The processor 130 can be an integrated circuit chip having a processing capability of signals. In the implementation process, each step of the above method can be completed by the integrated logic circuit of hardware or the instruction in the form of software in the processor 130. The processor 130 described above can be a general processor, including a central processing unit (CPU), a network processor (NP), etc.; can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component. Each method, step and logic block disclosed in the embodiment of the present application can be implemented or executed. The general processor can be a microprocessor or the processor can also be any conventional processor. The steps of the method disclosed in combination with the embodiment of the present application can be directly embodied as a hardware decoding processor for execution, or can be executed by a combination of hardware and software modules in the decoding processor. The software module can be located in a random access memory, a flash memory, a read only memory, a programmable read only memory or an electrically erasable programmable memory, a register or other mature storage medium in the art. The storage medium is located in the memory 131, and the processor 130 reads the information in the memory 131 and combines the hardware to complete the steps of the method of the above embodiment.

[0074] The embodiment of the present application further provides a computer readable storage medium, which stores computer executable instructions. When the computer executable instructions are called and executed by a processor, the computer executable instructions cause the processor to implement the above data processing method. For details, refer to the method embodiment, which will not be repeated here.

[0075] The data processing method, device and electronic equipment provided by the embodiment of the present application include a computer readable storage medium storing program codes, and the instructions included in the program codes can be used to execute the method described in the above method embodiment. For details, refer to the method embodiment, which will not be repeated here.

[0076] If the functions are realized in the form of software function units and sold or used as independent products, they can be stored in a computer readable storage medium. Based on this understanding, the technical solutions of the present application or the parts of the present application that essentially contribute to the prior art or the parts of the technical solutions can be embodied in the form of software products. The computer software product is stored in a storage medium and includes a plurality of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in the various embodiments of the present application. The aforementioned storage medium includes a U disk, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk or an optical disk, and various media that can store program codes.

[0077] Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: it can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacement for part or all of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present application.

Claims

1. A data processing method, characterized by, The method is applied to an electronic device in communication connection with a solid state disk; the method comprises: sending a preset number of first read commands to the solid state disk to make the solid state disk enter a specified working mode and return a random number to the electronic device; wherein each first read command carries a tag value corresponding to the first read command; based on the random number, sending a data processing command to the solid state disk in the specified working mode to make the solid state disk process data corresponding to the data processing command according to the data processing command; wherein the data processing command comprises a second read command or a first write command; if the data processing command is the first write command, the first write command carries the random number, the tag value corresponding to the first write command and to-be-written data; the step of based on the random number, sending a data processing command to the solid state disk in the specified working mode to make the solid state disk process data corresponding to the data processing command according to the data processing command comprises: if the data processing command is the first write command, sending the first write command to the solid state disk in the specified working mode to make the solid state disk write the to-be-written data according to the first write command; if the data processing command is the second read command, the second read command carries the random number and the tag value corresponding to the second read command; the step of based on the random number, sending a data processing command to the solid state disk in the specified working mode to make the solid state disk process data corresponding to the data processing command according to the data processing command comprises: if the data processing command is the second read command, sending the second read command to the solid state disk in the specified working mode to make the solid state disk return to-be-read data corresponding to the second read command according to the second read command.

2. The method of claim 1, wherein, the step of based on the random number, sending a data processing command to the solid state disk in the specified working mode to make the solid state disk process data corresponding to the data processing command according to the data processing command comprises: sending a second write command to the solid state disk in the specified working mode to make the solid state disk determine a to-be-processed data category corresponding to a command parameter carried by the second write command according to the command parameter; wherein the second write command also carries the random number and a tag value corresponding to the second write command; sending the data processing command to the solid state disk in the specified working mode to make the solid state disk process data corresponding to the data processing command which belongs to the to-be-processed data category.

3. The method of claim 2, wherein each of the first read commands, the data processing command, and the second write command is constructed according to a preset protocol; and the preset protocol comprises at least one of a SATA protocol and an NVME protocol. ​ 4. The method of claim 1, wherein, The step of sending a preset number of first read commands to the solid state disk to make the solid state disk enter a specified working mode and returning a random number to the electronic device comprises: obtaining the preset number of first read commands; sending each of the first read commands to the solid state disk in a preset order; receiving data corresponding to each of the first read commands returned by the solid state disk and controlling the solid state disk to enter the specified working mode; wherein the data returned by the last first read command sent is the random number.

5. The method of claim 4, wherein, After the step of sending each of the first read commands to the solid state disk in a preset order, the method further comprises: if there is a first read command that fails to be sent, repeating the step of sending each of the first read commands to the solid state disk in a preset order until each of the first read commands is successfully sent.

6. A data processing apparatus, characterized by The device for implementing the method of claim 1 is arranged on an electronic device, and the electronic device is in communication connection with a solid state disk; the device comprises: a first sending module for sending a preset number of first read commands to the solid state disk to make the solid state disk enter a specified working mode and return a random number to the electronic device; wherein each of the first read commands carries a tag value corresponding to the first read command; a second sending module for sending a data processing command to the solid state disk to make the solid state disk process data corresponding to the data processing command according to the data processing command; wherein the data processing command comprises a second read command or a first write command.

7. An electronic device, comprising: The device comprises a processor and a memory, and the memory stores machine executable instructions that can be executed by the processor; the processor executes the machine executable instructions to implement the data processing method of any one of claims 1-5.

8. A computer-readable storage medium, characterized in that, The computer readable storage medium stores computer executable instructions; when the computer executable instructions are called and executed by a processor, the computer executable instructions cause the processor to implement the data processing method of any one of claims 1-5.

Citation Information

Patent Citations

  • Execution method and device of terminal trusted assembly and computer equipment

    CN111177709A

  • Data conversion apparatus, chip, method and device, and image system

    WO2018049648A1