Instruction execution method and apparatus, electronic device, medium, product and chip

CN123030232APending Publication Date: 2026-11-03BEIJING X RING TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611215538.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-11
Publication Date
2026-11-03

AI Technical Summary

Technical Problem

In existing technologies, UFS controllers require multiple memory access operations, which leads to bandwidth consumption and system burden, affecting instruction execution speed.

Method used

The software module sends dynamically changing information to the control module, which then determines the target instruction based on pre-stored fixed information and executes the operation in the storage module, reducing memory access and hardware memory access and simplifying the instruction execution process.

Benefits of technology

It reduces memory access bandwidth consumption, lowers system load, speeds up instruction execution, and improves the processing power of multi-core CPUs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123030232A_ABST
    Figure CN123030232A_ABST
Patent Text Reader

Abstract

The present disclosure relates to an instruction execution method, device, electronic equipment, medium, product and chip. The method comprises: a software module sending first information to a control module, the first information being used to represent information in a target instruction to be executed by the control module which changes dynamically; the control module receiving the first information sent by the software module, and determining the target instruction based on the first information and second information pre-stored in the control module, the second information being used to represent information in the target instruction which is fixed and unchangeable; the control module sending the target instruction to a storage module; and the storage module executing a target operation corresponding to the target instruction on a preset storage medium based on the target instruction. The present disclosure can save memory access operations, reduce bandwidth consumption and transmission resource consumption of memory access, thereby reducing the system burden. In addition, the instruction execution process can be simplified, the instruction execution delay can be reduced, and the instruction execution process can be accelerated.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of instruction execution technology, and in particular to an instruction execution method, apparatus, electronic device, medium, product, and chip. Background Technology

[0002] With the continuous upgrading of the performance of mobile terminals and high-speed storage devices, Universal Flash Storage (UFS) can be equipped with a Multi Circular Queue (MCQ) mechanism to achieve multi-core concurrent instruction execution. Summary of the Invention

[0003] To overcome the problems existing in related technologies, this disclosure provides an instruction execution method, apparatus, electronic device, medium, product, and chip.

[0004] According to a first aspect of the present disclosure, an instruction execution method is provided, comprising: The software module sends first information to the control module, the first information being used to characterize the dynamically changing information in the target instruction to be executed by the control module; The control module receives the first information sent by the software module, and determines the target instruction based on the first information and the second information pre-stored in the control module, wherein the second information is used to characterize the fixed information in the target instruction; The control module sends the target instruction to the storage module; The storage module executes the target operation corresponding to the target instruction on the preset storage medium based on the target instruction.

[0005] In this embodiment, during the process of the control module determining the target instruction, the control module does not need to access memory, and the software module does not need to send fixed information to the control module each time, but only needs to send dynamically changing information. This eliminates memory access operations, reduces bandwidth and transmission resource consumption, and thus alleviates the system burden. Furthermore, the control module can encapsulate the target instruction based on the first and second information, thereby simplifying the instruction execution process, reducing instruction execution latency, and accelerating the instruction execution process.

[0006] In some embodiments, determining the target instruction based on the first information and the second information pre-stored in the control module includes: The control module encapsulates the first information and the second information into the target instruction based on the format information and / or protocol information of the target instruction.

[0007] In this embodiment of the disclosure, the control module encapsulates the first information and the second information based on format information and / or protocol information to obtain the target instruction. This enables hardware to complete the instruction encapsulation, eliminating the need for the software module to assemble the instruction and then access the hardware memory to obtain the instruction. This further reduces the latency in the instruction acquisition process and allows the control module to quickly obtain the instruction.

[0008] In some embodiments, after the storage module executes the target operation corresponding to the target instruction on the preset storage medium based on the target instruction, the method further includes: The control module acquires feedback information from the target instruction and stores the feedback information in a preset storage location within a preset storage space; the feedback information includes the completion status of the target instruction and / or the response information of the target instruction, and the preset storage space is located within the control module.

[0009] In this embodiment of the disclosure, the feedback information after the instruction is executed can be stored in a preset storage space in the control module, eliminating the need for the control module to write the feedback information into memory. This reduces the number of times the control module accesses memory and saves bandwidth consumption.

[0010] In some embodiments, the software module is configured with the storage address of the preset storage location, and the method further includes: The software module reads the feedback information from the preset storage space based on the storage address of the preset storage location.

[0011] In this embodiment of the disclosure, the software module can directly access the preset storage space inside the control module to read feedback information, thereby omitting the software's memory read operations and continuously reducing memory bandwidth usage.

[0012] In some embodiments, the method further includes: In response to storing the feedback information in a preset storage location within the preset storage space, the control module sends a stop command to the software module; the stop command is used to stop the processing operation of the software module. The software module reads the feedback information from the preset storage space based on the storage address of the preset storage location, including: In response to receiving the stop command from the control module, the software module stops the current processing operation and reads the feedback information from the preset storage space based on the storage address of the preset storage location.

[0013] In this embodiment, after the hardware module has stored the feedback information, it actively sends a stop command to notify the software module. The software module does not need to poll the memory, which can reduce the power consumption and computing power waste caused by invalid polling of the software module.

[0014] In some embodiments, the first information includes at least one of the instruction execution start position of the target instruction, the instruction execution direction of the target instruction, and the amount of data during the execution of the target instruction.

[0015] In this embodiment of the disclosure, the first information includes high-frequency dynamic parameters such as the instruction execution start position, the instruction execution direction of the target instruction, and the amount of data when the target instruction is executed, which can specifically simplify the transmission content of the software module.

[0016] In some embodiments, the second information includes at least one of the following: the service type of the target instruction, the instruction set type of the target instruction, the interface identifier of the interface corresponding to the target instruction, the storage area identifier of the preset storage medium, and the instruction control identifier of the target instruction.

[0017] In this embodiment of the disclosure, the parameters included in the second information are fixed over a long period of time, which can support configuration once and reuse multiple times, thereby improving the execution speed of instructions.

[0018] According to a second aspect of the present disclosure, an instruction execution apparatus is provided, comprising: The software module is configured to send first information to the control module, the first information being used to characterize dynamically changing information in the target instruction to be executed by the control module; The control module is configured to receive the first information sent by the software module, and determine the target instruction based on the first information and the second information pre-stored in the control module, wherein the second information is used to characterize the fixed information in the target instruction; The control module is also configured to send the target instruction to the storage module; The storage module is configured to perform the target operation corresponding to the target instruction on the preset storage medium based on the target instruction.

[0019] In some embodiments, the control module is configured to: Based on the format information and / or protocol information of the target instruction, the first information and the second information are encapsulated into the target instruction.

[0020] In some embodiments, the control module is further configured to: The system acquires feedback information of the target instruction and stores the feedback information in a preset storage location within a preset storage space. The feedback information includes the completion status of the target instruction and / or the response information of the target instruction. The preset storage space is located in the control module.

[0021] In some embodiments, the software module is configured with the storage address of the preset storage location, and the software module is further configured to: The feedback information is read from the preset storage space based on the storage address of the preset storage location.

[0022] According to a third aspect of the present disclosure, an electronic device is provided, comprising: processor; Memory used to store processor-executable instructions; The processor is configured to execute the instruction execution method as described in the first aspect of this disclosure.

[0023] According to a fourth aspect of the present disclosure, a non-transitory computer-readable storage medium is provided, which, when instructions in the storage medium are executed by a processor of an electronic device, enables the electronic device to perform the instruction execution method as described in the first aspect of the present disclosure.

[0024] According to a fifth aspect of the present disclosure, a computer program product is provided, including a computer program that, when executed by a processor, implements the instruction execution method as described in the first aspect of the present disclosure.

[0025] According to a sixth aspect of the present disclosure, a chip is provided, the chip being configured to implement the instruction execution method as described in the first aspect of the present disclosure.

[0026] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description

[0027] The accompanying drawings, which are incorporated in and form a part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure.

[0028] Figure 1 This is a flowchart illustrating an instruction execution method according to an exemplary embodiment.

[0029] Figure 2 This is a schematic diagram illustrating an instruction execution method according to an exemplary embodiment.

[0030] Figure 3 This is a schematic diagram illustrating an instruction execution method according to an exemplary embodiment.

[0031] Figure 4 This is a block diagram illustrating an instruction execution device according to an exemplary embodiment.

[0032] Figure 5This is a block diagram of an electronic device according to an exemplary embodiment. Detailed Implementation

[0033] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this disclosure as detailed in the appended claims.

[0034] This disclosure can be applied to scenarios involving the interaction between software modules and storage modules. The software module may include a central processing unit (CPU), and the storage module may include a UFS storage chip. The UFS storage chip supports the MCQ mechanism, allowing the CPU to interact with the UFS storage chip simultaneously through multiple parallel queues, thereby significantly improving the read / write performance and concurrent data processing capabilities of the flash memory chip.

[0035] The instruction execution method provided in this disclosure is executed by an electronic device, which may specifically be a mobile phone, tablet computer, laptop, smart robot, smart wearable device, or other smart device. In addition, the electronic device is equipped with various hardware resources and energy storage devices that provide electrical energy for the operation of these hardware resources.

[0036] Figure 1 This is a flowchart illustrating an instruction execution method according to an exemplary embodiment, executed by an electronic device. See also... Figure 1 The method includes the following steps: In step S101, the software module sends first information to the control module. The first information is used to characterize the dynamically changing information in the target instruction to be executed by the control module.

[0037] The first piece of information can be dynamic information from the instruction information of the target instruction.

[0038] In some embodiments, a software module may refer to a driver running on a CPU. The software module can be used for communication between the CPU and a control module. The control module may include a UFS control module, which may be a hardware circuit module in an electronic device. The control module can be used for communication between the software module and a storage module. The storage module can receive instructions sent by the control module and process / operate on a preset storage medium based on the instructions. The storage module may include a UFS storage chip, and the preset storage medium may include UFS storage particles. The preset storage medium may be UFS storage space, and the preset storage medium is located in the storage module.

[0039] In some embodiments, the first information includes at least one of the instruction execution start position of the target instruction, the instruction execution direction of the target instruction, and the amount of data during the execution of the target instruction. In one example, when the target instruction is a read / write instruction, the first information may include the read / write start position, the read / write direction, and the amount of data to be read / written, i.e., reading / writing a certain length of data starting from a certain location on the preset storage medium towards a certain read / write location. In one example, when the target instruction is a storage space reclamation instruction, the first information may include the reclamation start position, the reclamation direction, and the size of the data block to be reclaimed, i.e., reclaiming a data block of a certain size starting from a certain location on the preset storage medium towards a certain reclamation direction.

[0040] Of course, it is understood that the parameters included in the first information above are merely exemplary parameters, and the parameters included in the first information can be set and selected based on the actual situation.

[0041] In some embodiments, target instructions can refer to different types of instructions. In one example, target instructions may include data read / write instructions, storage space management instructions, configuration management instructions, and maintenance management instructions, etc. Of course, it is understood that the content of target instructions can be added and selected based on actual needs.

[0042] The following is a brief explanation of each type of instruction.

[0043] In one example, data read / write instructions can be used to read data from a preset storage medium or write data to a preset storage medium. For example, data read / write instructions can include read / write instructions and batch fill instructions.

[0044] In one example, storage space management instructions can be used to manage preset storage media. For instance, storage space management instructions can include storage space reclamation instructions and storage space allocation instructions. Storage space reclamation instructions can reclaim invalid data blocks from flash memory.

[0045] In one example, configuration management commands can be used to configure a preset storage medium and / or query and modify the configuration parameters of the preset storage medium. For example, configuration management commands can include partition configuration commands and partition query commands. Partition configuration commands can configure different storage areas of the preset storage medium, and partition query commands can query the available partitions in the preset storage medium.

[0046] In one example, maintenance management commands can be used to control the startup / stop of a preset storage medium, format the preset storage medium, and detect the preset storage medium. For example, maintenance management commands may include wake-up commands, power-off commands, detection commands, formatting commands, etc.

[0047] In some embodiments, when sending the first information to the control module, the software module may simultaneously send other information. In one example, when the target instruction is a write instruction, the software module may simultaneously send the storage address of the data to be written to a preset storage medium to the control module. In one example, before sending the first information to the control module, the software module may assign a task tag to the target instruction; the task tag can be used to represent different instructions.

[0048] In step S102, the control module receives the first information sent by the software module, and determines the target instruction based on the first information and the second information pre-stored in the control module. The second information is used to characterize the fixed information in the target instruction.

[0049] The second piece of information can be static information from the instruction information of the target instruction.

[0050] In some embodiments, the second information may include at least one of the following: the transaction type of the target instruction, the command set type (CST) of the target instruction, the interface identifier (IID) of the interface corresponding to the target instruction, the storage area identifier / logical unit number (LUN) of the preset storage medium, and the instruction control identifier (Flags) of the target instruction.

[0051] The parameters included in the second information are briefly explained below.

[0052] The business type corresponding to the target instruction can indicate the business that the target instruction corresponds to. For example, the business type can be a read / write business. It should be noted that the field value of the business type corresponding to the target instruction can be different under different business conditions. For example, the code of the business type corresponding to the target instruction under a read / write business is 0x01.

[0053] The instruction set type corresponding to the target instruction indicates the type of operation instructions included in the target instruction. During the interaction between the software module, control module, and preset storage medium (i.e., the interaction between the CPU and the UFS flash memory chip), the instruction set type corresponding to the target instruction is the Small Computer System Interface (SCSI) instruction set and will not switch to other instruction sets. Therefore, in the target instruction, the value of the instruction set type field can be fixed to the encoding corresponding to the SCSI instruction set.

[0054] The interface identifier of the interface used by the target instruction can refer to the interface identifier of the interface used when the control module and the preset storage medium interact. Furthermore, if the control module and the preset storage medium remain unchanged, the interface used for communication between them remains the same.

[0055] The preset storage medium can be divided into multiple storage areas, such as a system partition and a user data partition. The storage area identifier of the preset storage medium can be used to characterize the storage area in the preset storage medium corresponding to the target operation of the target instruction to be executed. The storage area identifier can refer to the partition identifier of a partition; for example, LUN0 refers to the system partition, while LUN1 refers to the user data partition. In some embodiments, the storage area identifier of the preset storage medium remains unchanged when the partition is not switched.

[0056] The instruction control identifier for a target instruction can be used to control the transmission rules of the target instruction. The instruction control identifier includes multiple bits, each indicating the attributes and transmission rules of the target instruction. Thus, after receiving the target instruction, the UFS flash memory chip will perform corresponding processing based on the instruction control identifier. For example, the instruction control identifier may include a Response Expected bit, and if this bit is set to 1, the storage medium will return feedback information. Another example is an R / W bit, which is used to distinguish whether the target instruction is a read instruction or a write instruction.

[0057] Of course, it is understood that the parameters included in the second information above are merely exemplary parameters, and the parameters included in the second information can be set and selected based on the actual situation.

[0058] In some embodiments, the second information can be pre-stored in the control module, and the control module can encapsulate the first information and the second information into a target instruction. In some embodiments, the control module can encapsulate the first information and the second information into a target instruction based on the format information and / or protocol information of the target instruction.

[0059] The format information can include the structure and arrangement rules of the target instructions. For example, the format information can represent the format of the UFS Protocol Information Unit (UPIU). UPIU is the smallest communication data unit specified by the UFS transmission protocol. The protocol information can be used to characterize the transmission protocol supported by the storage module, such as the UFS transmission protocol.

[0060] In some embodiments, the position and order of each parameter in the first and second information within the target instruction can be determined based on format information, thereby placing each parameter in its corresponding position within the instruction and preventing incorrect parameter placement from causing the storage module to fail to correctly identify the target instruction. Furthermore, encapsulating the first and second information into a target instruction based on protocol information can determine that the target instruction is an instruction under a transmission protocol supported by the storage module. Thus, by encapsulating the first and second information using format information and / or protocol information to obtain the target instruction, the target instruction can be obtained more easily, and it can be ensured that the storage module can correctly identify and execute the target instruction.

[0061] In one example, the target instruction can be a UPIU format instruction. The structure of a UPIU can include a header, business fields, and data fields. The header can include second information, and the business fields can include first information.

[0062] It should be noted that the first and second information of different types of target instructions can be the same or different. For example, under the MCQ mechanism, the control module can determine the first and second information corresponding to each target instruction separately, and determine each target instruction based on the first and second information corresponding to each target instruction, thereby avoiding the determination of incorrect target instructions. Furthermore, under the MCQ mechanism, the control module can determine each target instruction serially; that is, the control module can read one set of first information, determine one target instruction based on that first information and its corresponding second information, and then read another set of first information and determine another target instruction based on that first information and its corresponding second information.

[0063] Step S103: The control module sends the target instruction to the storage module.

[0064] The storage module may include UFS storage chips.

[0065] It should be noted that the control module cannot interact directly with the preset storage medium. Therefore, the control module needs to interact with the storage module, and the storage module interacts with the preset storage medium to achieve the interaction between the control module and the preset storage medium.

[0066] In some embodiments, the control module may include a First-In-First-Out (FIFO) instruction buffer. The control module can store target instructions in the instruction FIFO buffer, and the storage module can read target instructions from the instruction FIFO buffer, thereby enabling the control module to send target instructions to the storage module. It should be noted that the instruction output between the control module and the storage module follows the FIFO rule, that is, in the case of multiple target instructions, the control module can send each target instruction to the storage module serially.

[0067] In step S104, the storage module performs the target operation corresponding to the target instruction on the preset storage medium based on the target instruction.

[0068] In some embodiments, after receiving a target instruction, the storage module can parse the target instruction to determine the target operation corresponding to the target instruction. In some embodiments, the storage module can parse the target instruction to obtain information such as first information and second information included in the target instruction, and then perform corresponding operations on a preset storage medium based on the first information and second information.

[0069] In some embodiments, the target operation corresponding to the target instruction can be determined based on the target instruction. For example, if the target instruction is a read / write instruction, the target operation can be a read / write operation; if the target instruction is a recycling instruction, the target operation can be a recycling operation.

[0070] In some embodiments, executing the target operation corresponding to the target instruction on the preset storage medium may include operating on the flash memory array of the preset storage medium. It should be noted that the instruction start position is a logical address, and the storage module cannot directly operate on the flash memory array of the preset storage medium based on the instruction start position. Therefore, the storage module can convert the instruction start position into a physical address represented by the physical page / physical block address of the flash memory array, and operate on the flash memory array based on the physical address represented by the physical page / physical block address.

[0071] In some embodiments, taking a read / write instruction as an example, the process of step S104 is described as follows: The storage module parses the header of the target instruction and obtains the following: the code for the service type corresponding to the target instruction is 0x01, indicating that the target instruction is a read / write service data packet; the R bit in the R / W bit of the instruction control identifier is set to 1, indicating that the target instruction is a read instruction; the storage area identifier of the preset storage medium for this operation is LUN1, indicating that the read object of this read operation is the user data partition; the interface identifier is 'a'; and the instruction set type is SCSI. From this, the storage module extracts the SCSI Command Descriptor Block (CDB) from the target instruction. Then, the storage module can parse the following from the CDB: the read start position, the read direction, and the length of the data to be read. The storage module can then convert the read start position into its physical address and, based on the physical address and the above information, read data from the flash array.

[0072] In some embodiments, when there are multiple target instructions, the storage module can process multiple target instructions in parallel. That is, the storage module can simultaneously execute the target operation corresponding to each target instruction on the preset storage medium based on each target instruction. For example, if the storage module receives two target instructions, one is a read instruction and the other is a write instruction, then the storage module can simultaneously perform read and write operations on the preset storage medium.

[0073] In some embodiments, after the storage module executes the target operation corresponding to the target instruction on a preset storage medium based on the target instruction, the storage module can determine the feedback information of the target instruction and send the feedback information of the target instruction to the control module. The feedback information includes the completion status of the target instruction and / or the response information of the target instruction. Optionally, the feedback information of the target instruction can be sent in the form of a UPIU data packet.

[0074] In some embodiments, the completion status of a target instruction can characterize the execution result of the target instruction being executed successfully or failing. The completion status of a target instruction may include task tags, execution results, etc. The response information of a target instruction may include exception information after execution failure, such as remaining transmission bytes, error diagnosis information, and the status of the storage module.

[0075] In some embodiments, the control module can acquire feedback information from the target instruction and store the feedback information in a preset storage location within a preset storage space; wherein, the preset storage space is located within the control module. That is, the control module can store the feedback information in its own storage space, rather than storing it in memory. Thus, the feedback information after instruction execution can be stored in the preset storage space within the control module, eliminating the need for the control module to write the feedback information to memory, reducing the number of memory accesses by the control module, and saving bandwidth consumption.

[0076] In some embodiments, the software module can send a request instruction to the control module, which can be used to request the reading of feedback information. That is, the software module can read feedback information from the control module. In this way, the software module can directly access the preset storage space inside the control module to read feedback information, thereby eliminating the need for software to read memory and continuously reducing memory bandwidth usage.

[0077] In some embodiments, feedback information can be stored in a preset storage location. Accordingly, the software module can pre-configure the storage address of the preset storage location. When the software module needs to read feedback information, the request instruction can include the storage address of the preset storage location. In this way, the software module can read feedback information from the preset storage space based on the storage address of the preset storage location.

[0078] Of course, it's understandable that feedback information can be stored in a non-fixed, preset storage location. Correspondingly, in response to a received request command, the control module can send the storage address of the feedback information in the preset storage space to the software module. After receiving the storage address of the feedback information, the software module can read the feedback information from the preset storage space based on that storage address.

[0079] In some embodiments, in response to storing feedback information to a preset storage location in a preset storage space, the control module sends a stop command to the software module. The stop command stops the processing operation of the software module. Upon receiving the stop command from the control module, the software module stops its current processing operation and reads the feedback information from the preset storage space based on the storage address of the preset storage location. That is, the control module can send a stop command to the software module, and upon receiving the stop command, the software module can stop its current processing operation and read the feedback information.

[0080] With the continuous performance upgrades of mobile terminals and high-speed storage devices, UFS can be equipped with the MCQ mechanism to achieve multi-core concurrent instruction execution. In related technologies, the UFS controller needs to perform multiple memory accesses to read instructions from memory and interact with the UFS storage chip based on these instructions to perform corresponding operations on the preset storage medium. Furthermore, the UFS controller writes the instruction execution status to memory, and the software module needs to read this status from memory. The instruction execution process in these technologies requires multiple memory accesses, increasing bandwidth consumption and system load, severely impacting instruction execution speed.

[0081] The method provided in this disclosure eliminates the need for the control module to access memory during the determination of the target instruction. Furthermore, the software module does not need to send fixed information to the control module each time; instead, it only needs to send dynamically changing information. This eliminates memory access operations, reducing bandwidth and transmission resource consumption, thereby alleviating system burden. Additionally, the control module can encapsulate the target instruction based on the first and second information, simplifying the instruction execution process, reducing latency, and accelerating execution.

[0082] refer to Figure 2 The diagram shown illustrates an instruction execution method. Figure 2 This includes the CPU's software modules, UFS controller, memory, UFS storage chips, and UFS storage particles. The software modules belong to the software layer, while the UFS controller, memory, UFS storage chips, and UFS storage particles all belong to the hardware layer. Furthermore, Figure 2 The instruction execution method shown is applied to the interaction process between the CPU and the UFS storage chip under the MCQ mechanism. The transmission channel between the software module and the UFS storage chip is bound to a Submission Queue (SQ) and a Completion Queue (CQ). It should be noted that under the MCQ mechanism, a single channel can be upgraded to multi-channel parallel transmission, with each channel bound to a Submission Queue (SQ) and a Completion Queue (CQ).

[0083] In related technologies, the software module can assign task tags to instructions, assemble the instruction UPIU and UFS Transfer Request Descriptor (UTRD), and fill in the Physical Region Descriptor Table (PRDT). Here, the instruction UPIU can refer to the instruction to be issued, and the PRDT refers to the physical address in memory of the data to be operated on. For example, for a write instruction, the PRRD refers to the physical address in memory of the data to be written to flash memory; for a read instruction, the PRDT refers to the physical address in memory of the data read from flash memory. Of course, it's understandable that if no data operation is involved, the PRDT can be omitted. The UTRD can refer to the data block containing the first address in memory of the instruction UPIU, and can also include the task tag, PRDT address, etc. The software module can write the instruction and UTRD into memory, write the second address of the UTRD in memory into the SQ (System Queued Query), and increment the pointer of the SQ.

[0084] Next, the UFS controller detects the SQ instruction incremented by one, can read the second address in SQ, and decrement the SQ instruction. The UFS controller can access memory based on the second address, read the UTRD from memory, and after reading the UTRD, access memory based on the second address in the UTRD, read the instruction UPIU from memory, thus obtaining the instruction, and store the instruction in the instruction FIFO cache.

[0085] Afterwards, the UFS controller can communicate with the UFS storage chip based on instructions. The UFS storage chip can perform corresponding operations on the UFS flash memory chip based on instructions, determine CQ entries and response data packets, and send CQ entries and response data packets to the UFS controller. CQ entries can be used to carry the completion status of instructions.

[0086] Afterwards, the UFS controller can write CQ entries to the CQ in memory, write response packets to memory, and simultaneously increment the CQ pointer. The software detects the change in the CQ, can read CQ entries from the CQ, and read the response UPIU from memory, while decrementing the CQ pointer. Based on the read CQ entries and response UPIU, the software module can obtain the instruction execution status and result, and release the task tag.

[0087] From the above, it can be concluded that during the execution of instructions in related technologies, the hardware must perform at least three memory access operations (reading UTRD, reading UPIU, and reading the response UPIU). These memory access operations affect data transfer bandwidth, severely impacting data transmission. Furthermore, the software module's assembly of UTRD and UFS controller access to memory to obtain instructions places a burden on the CPU, affecting CPU performance. In multi-core CPU systems, insufficient performance of any single core may lead to instruction execution failure.

[0088] refer to Figure 3 The diagram shown illustrates an instruction execution method. Figure 3The system comprises a CPU software module, a UFS controller, UFS storage chips, and UFS storage particles. The software module belongs to the software layer, while the UFS controller, memory, UFS storage chips, and UFS storage particles all belong to the hardware layer. During the interaction between the software module and the UFS storage chip, the software module can assign task tags to target instructions and send dynamic information and task tags from the target instructions to the UFS controller. The UFS controller receives the dynamic information from the target instructions sent by the software module and, based on the dynamic information and the static information from the target instructions pre-stored in the UFS controller, determines the target instruction. Subsequently, the UFS controller can communicate with the UFS storage chip based on the instruction. The UFS storage chip can execute the target operation corresponding to the target instruction on the UFS storage particles based on the target instruction, determine the feedback information of the target instruction, and send the feedback information of the target instruction to the UFS controller.

[0089] Subsequently, the UFS controller can obtain feedback information from the target instruction and store it in a preset storage location within a preset storage space. In response to storing the feedback information in the preset storage location, the UFS controller sends a stop command to the software module. Following this, the software module, upon receiving the stop command from the UFS controller, stops its current processing operation and reads the feedback information from the preset storage space based on the storage address at the preset storage location. Then, based on the read feedback information, the software module can determine the instruction execution status and result of the target instruction and release the task tag.

[0090] From the above, it can be concluded that the method provided in this disclosure simplifies multiple memory access operations into a single operation of transmitting dynamic information, directly omitting memory access operations and SQ read operations. This allows hardware implementation to replace memory access operations under the MCQ mechanism, simplifying the interaction between software and hardware and reducing the CPU load. Correspondingly, it can also accelerate instruction execution speed and reduce instruction execution latency. Furthermore, since no memory access operations are required and no software module is needed to assemble data packets, bandwidth consumption is saved, providing greater bandwidth for data transmission and reducing the CPU load. Moreover, feedback information can be directly written into the UFS controller's internal memory instead of memory. The software module only needs to read the feedback information based on a preset storage address, reducing the resource consumption of the software module and the number of memory accesses by the UFS controller. Additionally, in multi-core CPUs, for cores with insufficient performance, the method provided in this disclosure allows the instruction execution process to proceed normally, reducing the probability of instruction execution failure.

[0091] An instruction execution method, executed by an electronic device according to an exemplary embodiment, includes the following steps: S1. The software module can send first information to the control module. The first information is used to characterize the dynamically changing information in the target instruction to be executed by the control module.

[0092] S2. The control module receives the first information sent by the software module, and determines the target instruction based on the first information and the second information pre-stored in the control module. The second information is used to characterize the fixed information in the target instruction.

[0093] S3. The control module can send target instructions to the storage module.

[0094] S4. Based on the target instruction, the storage module executes the target operation corresponding to the target instruction on the preset storage medium, determines the feedback information of the target instruction, and sends the feedback information of the target instruction to the control module.

[0095] S5. The control module can obtain feedback information from the target instruction and store the feedback information in a preset storage location in the preset storage space.

[0096] S6. In response to the control module storing the feedback information to the preset storage location in the preset storage space, the control module sends a stop command to the software module.

[0097] S7. When the software module receives a stop command from the control module, it stops the current processing operation and reads feedback information from the preset storage space based on the preset storage address.

[0098] Figure 4 This is a block diagram illustrating an instruction execution device according to an exemplary embodiment, configured in an electronic device. See also... Figure 4 The device includes: Software module 401 is configured to send first information to the control module, the first information being used to characterize dynamically changing information in the target instruction to be executed by the control module; The control module 402 is configured to receive first information sent by the software module, and determine the target instruction based on the first information and second information pre-stored in the control module. The second information is used to characterize the fixed information in the target instruction. The control module 402 is also configured to send the target instruction to the storage module; The storage module 403 is configured to perform the target operation corresponding to the target instruction on the preset storage medium based on the target instruction.

[0099] In some embodiments, the control module 402 is configured to: Based on the format information and / or protocol information of the target instruction, the first information and the second information are encapsulated into the target instruction.

[0100] In some embodiments, the control module 402 is further configured to: The system acquires feedback information from the target instruction and stores it in a preset storage location within a preset storage space. The feedback information includes the completion status of the target instruction and / or the response information of the target instruction. The preset storage space is located in the control module.

[0101] In some embodiments, the software module 401 is configured with a storage address of a preset storage location, and the software module 401 is further configured as follows: Based on the storage address of the preset storage location, the feedback information is read from the preset storage space.

[0102] In some embodiments, the control module 402 is further configured to: In response to the control module storing feedback information to a preset storage location in the preset storage space, a stop command is sent to the software module; the stop command is used to stop the processing operation of the software module. Software module 401 is configured as follows: When the software module receives a stop command from the control module, it stops the current processing operation and reads feedback information from the preset storage space based on the preset storage address.

[0103] In some embodiments, the first information includes at least one of the following: the instruction execution start position of the target instruction, the instruction execution direction of the target instruction, and the amount of data during the execution of the target instruction.

[0104] In some embodiments, the second information includes at least one of the following: the service type of the target instruction, the instruction set type of the target instruction, the interface identifier of the interface corresponding to the target instruction, the storage area identifier of the preset storage medium, and the instruction control identifier of the target instruction.

[0105] Regarding the apparatus in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated upon here.

[0106] This disclosure also provides an electronic device, including: a processor; a memory for storing processor-executable instructions; wherein the processor is configured to execute the instruction execution method described in the above embodiments.

[0107] Figure 5 This is a block diagram of an electronic device 500 according to an exemplary embodiment.

[0108] Reference Figure 5The electronic device 500 may include one or more of the following components: processing component 502, memory 504, power supply component 506, multimedia component 508, audio component 510, input / output (I / O) interface 512, sensor component 514, and communication component 516.

[0109] Processing component 502 typically controls the overall operation of electronic device 500, such as operations associated with display, telephone calls, data communication, camera operation, and recording. Processing component 502 may include one or more processors 520 to execute instructions to perform all or part of the steps of the methods described above. Furthermore, processing component 502 may include one or more modules to facilitate interaction between processing component 502 and other components. For example, processing component 502 may include a multimedia module to facilitate interaction between multimedia component 508 and processing component 502.

[0110] Memory 504 is configured to store various types of data to support the operation of electronic device 500. Examples of this data include instructions for any application or method operating on electronic device 500, contact data, phonebook data, messages, pictures, videos, etc. Memory 504 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.

[0111] Power supply component 506 provides power to various components of electronic device 500. Power supply component 506 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to electronic device 500.

[0112] Multimedia component 508 includes a screen that provides an output interface between the electronic device 500 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touchscreen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensors may sense not only the boundaries of the touch or swipe action but also the duration and pressure associated with the touch or swipe operation. In some embodiments, multimedia component 508 includes a front-facing camera and / or a rear-facing camera. When the electronic device 500 is in an operating mode, such as a shooting mode or a video mode, the front-facing camera and / or the rear-facing camera may receive external multimedia data. Each front-facing camera and rear-facing camera may be a fixed optical lens system or have focal length and optical zoom capabilities.

[0113] Audio component 510 is configured to output and / or input audio signals. For example, audio component 510 includes a microphone (MIC) configured to receive external audio signals when electronic device 500 is in an operating mode, such as call mode, recording mode, and voice recognition mode. The received audio signals may be further stored in memory 504 or transmitted via communication component 516. In some embodiments, audio component 510 also includes a speaker for outputting audio signals.

[0114] I / O interface 512 provides an interface between processing component 502 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to, home buttons, volume buttons, start buttons, and lock buttons.

[0115] Sensor assembly 514 includes one or more sensors for providing state assessments of various aspects of electronic device 500. For example, sensor assembly 514 may detect the on / off state of electronic device 500, the relative positioning of components such as the display and keypad of electronic device 500, changes in position of electronic device 500 or a component of electronic device 500, the presence or absence of user contact with electronic device 500, orientation or acceleration / deceleration of electronic device 500, and temperature changes of electronic device 500. Sensor assembly 514 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. Sensor assembly 514 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, sensor assembly 514 may also include an accelerometer, gyroscope, magnetometer, pressure sensor, or temperature sensor.

[0116] Communication component 516 is configured to facilitate wired or wireless communication between electronic device 500 and other devices. Electronic device 500 can access wireless networks based on communication standards, such as WiFi, 2G, or 3G, or combinations thereof. In one exemplary embodiment, communication component 516 receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, communication component 516 also includes a near-field communication (NFC) module to facilitate short-range communication. For example, the NFC module may be implemented based on radio frequency identification (RFID) technology, Infrared Data Association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.

[0117] In an exemplary embodiment, the electronic device 500 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the methods described above.

[0118] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 504 including instructions, which can be executed by a processor 520 of an electronic device 500 to perform the above-described method. For example, the non-transitory computer-readable storage medium may be a ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device, etc.

[0119] A non-transitory computer-readable storage medium, when instructions in the storage medium are executed by a processor of an electronic device, enables the electronic device to perform the instruction execution method provided in exemplary embodiments of this disclosure.

[0120] This disclosure also provides a computer program product, including a computer program that, when executed by a processor, implements the instruction execution method described in the above embodiments.

[0121] This disclosure also provides a chip configured to implement the instruction execution method described in the above embodiments.

[0122] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the following claims.

[0123] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of this disclosure. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.

[0124] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this disclosure, "a plurality of" means at least two, such as two, three, etc., unless otherwise explicitly specified.

[0125] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this disclosure can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution disclosed in this disclosure can be achieved, and this is not limited herein.

[0126] The specific embodiments described above do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure should be included within the scope of protection of this disclosure.

[0127] The examples in this document may involve user data, data acquisition, and / or use. All of these aspects comply with relevant laws, regulations, and rules. In the examples, all data collection, acquisition, processing, manipulation, forwarding, and use are conducted with the user's knowledge and confirmation. Accordingly, when implementing each example, the type, scope of use, and usage scenarios of any data or information that may be involved should be communicated to the user and their authorization obtained through appropriate means, in accordance with relevant laws and regulations. The specific methods of notification and / or authorization can vary depending on the actual situation and application scenario; the scope of the solution is not limited in this regard.

[0128] In this manual and the sample solutions, any processing of personal information will be conducted only under legal grounds (such as obtaining the consent of the data subject or being necessary for the performance of a contract) and will only be carried out within the scope stipulated or agreed upon. A user's refusal to process personal information beyond what is necessary for basic functions will not affect the user's use of basic functions.

Claims

1. A method for executing instructions, characterized in that, include: The software module sends first information to the control module, the first information being used to characterize the dynamically changing information in the target instruction to be executed by the control module; The control module receives the first information sent by the software module, and determines the target instruction based on the first information and the second information pre-stored in the control module, wherein the second information is used to characterize the fixed information in the target instruction; The control module sends the target instruction to the storage module; The storage module executes the target operation corresponding to the target instruction on the preset storage medium based on the target instruction.

2. The instruction execution method according to claim 1, characterized in that, Determining the target instruction based on the first information and the second information pre-stored in the control module includes: The control module encapsulates the first information and the second information into the target instruction based on the format information and / or protocol information of the target instruction.

3. The instruction execution method according to claim 1, characterized in that, After the storage module executes the target operation corresponding to the target instruction on the preset storage medium based on the target instruction, the method further includes: The control module acquires feedback information from the target instruction and stores the feedback information in a preset storage location within a preset storage space; the feedback information includes the completion status of the target instruction and / or the response information of the target instruction, and the preset storage space is located within the control module.

4. The instruction execution method according to claim 3, characterized in that, The software module is configured with the storage address of the preset storage location, and the method further includes: The software module reads the feedback information from the preset storage space based on the storage address of the preset storage location.

5. The instruction execution method according to claim 4, characterized in that, The method further includes: In response to storing the feedback information in a preset storage location within the preset storage space, the control module sends a stop command to the software module; the stop command is used to stop the processing operation of the software module. The software module reads the feedback information from the preset storage space based on the storage address of the preset storage location, including: In response to receiving the stop command from the control module, the software module stops the current processing operation and reads the feedback information from the preset storage space based on the storage address of the preset storage location.

6. The instruction execution method according to claim 1, characterized in that, The first information includes at least one of the following: the instruction execution start position of the target instruction, the instruction execution direction of the target instruction, and the amount of data during the execution of the target instruction.

7. The instruction execution method according to claim 1, characterized in that, The second information includes at least one of the following: the service type of the target instruction, the instruction set type of the target instruction, the interface identifier of the interface corresponding to the target instruction, the storage area identifier of the preset storage medium, and the instruction control identifier of the target instruction.

8. An instruction execution device, characterized in that, include: The software module is configured to send first information to the control module, the first information being used to characterize dynamically changing information in the target instruction to be executed by the control module; The control module is configured to receive the first information sent by the software module, and determine the target instruction based on the first information and the second information pre-stored in the control module, wherein the second information is used to characterize the fixed information in the target instruction; The control module is also configured to send the target instruction to the storage module; The storage module is configured to perform the target operation corresponding to the target instruction on the preset storage medium based on the target instruction.

9. The instruction execution device according to claim 8, characterized in that, The control module is configured as follows: Based on the format information and / or protocol information of the target instruction, the first information and the second information are encapsulated into the target instruction.

10. The instruction execution apparatus according to claim 8, characterized in that, The control module is also configured to: The system acquires feedback information of the target instruction and stores the feedback information in a preset storage location within a preset storage space. The feedback information includes the completion status of the target instruction and / or the response information of the target instruction. The preset storage space is located in the control module.

11. The instruction execution apparatus according to claim 10, characterized in that, The software module is configured with the storage address of the preset storage location, and the software module is further configured to: The feedback information is read from the preset storage space based on the storage address of the preset storage location.

12. An electronic device, characterized in that, include: processor; Memory used to store processor-executable instructions; The processor is configured to execute the instruction execution method as described in any one of claims 1-7.

13. A non-transitory computer-readable storage medium, characterized in that, When the instructions in the storage medium are executed by the processor of the electronic device, the electronic device is able to perform the instruction execution method as described in any one of claims 1-7.

14. A computer program product, characterized in that, It includes a computer program that, when executed by a processor, implements the instruction execution method as described in any one of claims 1-7.

15. A chip, characterized in that, The chip is configured to execute the instruction execution method as described in any one of claims 1-7.