Function implementation method, storage device and computer readable storage medium

By receiving and verifying functional data in the storage device and passing object data into program data as functional parameters to execute, the problem of single function of the storage device is solved, and diversification and dynamic expansion of the storage device functions are realized.

CN119494091APending Publication Date: 2025-02-21SHENZHEN LONGSYS ELECTRONICS CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311024683.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-08-14
Publication Date
2025-02-21

AI Technical Summary

Technical Problem

The existing storage devices have single functions and lack diversified functional implementation methods.

Method used

By receiving functional data and object data in the storage device, verifying the program data based on the program verification data, and after the verification is successful, the object data is passed into the program data as functional parameters to perform the corresponding function.

Benefits of technology

The execution of external programs in the storage device is realized, the functional diversity of the storage device is enhanced, and the functions can be dynamically expanded according to different needs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119494091A_ABST
    Figure CN119494091A_ABST
Patent Text Reader

Abstract

The invention discloses a function implementation method, a storage device and a computer readable storage medium. The method is applied to the storage device and comprises the steps that the storage device receives function data and object data; the storage device verifies the program data based on the program verification data in response to the fact that the function data comprises the program data and the program verification data; and after verification succeeds, the storage device transmits function parameters obtained based on the object data into the program data to execute corresponding functions to obtain a target result. In this way, the technical problem that the storage device has few functions can be solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of storage, and in particular to a function implementation method, a storage device, and a computer-readable storage medium. Background Art

[0002] With the development of science and technology, storage devices are applied in more and more fields. However, usually, storage devices only have a storage function, which is relatively simple. Summary of the invention

[0003] The main purpose of this application is to provide a function implementation method, a storage device and a computer-readable storage medium, which can solve the technical problem that the storage device has fewer functions.

[0004] In order to solve the above technical problems, the first technical solution adopted by the present application is to provide a function realization method. The method is applied to a storage device, and the method includes: the storage device receives function data and object data; in response to the function data including program data and program verification data, the storage device verifies the program data based on the program verification data; after successful verification, the storage device transfers the function parameters obtained based on the object data to the program data to execute the corresponding function and obtain the target result.

[0005] To solve the above technical problem, the second technical solution adopted by the present application is to provide a storage device. The storage device includes a memory and a processor, the memory is used to store program data, and the program data can be executed by the processor to implement the method described in the first technical solution.

[0006] To solve the above technical problems, the third technical solution adopted by the present application is to provide a computer-readable storage medium. The computer-readable storage medium stores program data and can be executed by a processor to implement the method described in the first technical solution.

[0007] The beneficial effects of the present application are as follows: the storage device acquires the function data and the object data. When the function data includes the program data and the program verification data, the storage device verifies the program data according to the program verification data to determine whether the program data is correct and complete. After the verification is successful, the object data is passed into the program data as a function parameter for execution to realize the corresponding function and obtain the target result. In the above manner, the execution of the external program in the storage device is realized, and the diversification of the storage device function is realized. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0009] Figure 1 It is a flowchart of the first embodiment of the method for realizing the functions of the present application;

[0010] Figure 2 is a structural schematic diagram of a specific embodiment of a storage device;

[0011] Figure 3 is a structural diagram of a specific embodiment of an extended function module in a storage device;

[0012] Figure 4 is a schematic structural diagram of a first embodiment of a storage device of the present application;

[0013] Figure 5 It is a structural diagram of the first embodiment of the computer-readable storage medium of the present application. DETAILED DESCRIPTION

[0014] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0015] The terms "first", "second", etc. in this application are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally includes steps or units that are not listed, or optionally includes other steps or units inherent to these processes, methods, products or devices.

[0016] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0017] Reference Figure 1 , Figure 1 This is a flow chart of the first embodiment of the method for implementing the functions of this application. The method is applied to a storage device and includes the following steps:

[0018] S11: Receive function data and object data.

[0019] The storage device acquires function data and object data. Function data is data information related to the realization of one or more functions. Object data is data information related to the execution object itself required for the execution of the function.

[0020] S12: In response to the function data including the program data and the program verification data, verifying the program data based on the program verification data.

[0021] When it is determined that the function data contains program data and program verification data, the program data is verified according to the program verification data to determine whether the acquired program data is correct and complete program data.

[0022] S13: After successful verification, the storage device transfers the function parameters obtained based on the object data into the program data to execute the corresponding function and obtain the target result.

[0023] If the verification is successful, it means that the program data is correct and can be executed normally. Then the function parameters will be obtained based on the object data, and the function parameters will be passed into the program data for execution to obtain the target result. The function parameters are the data information of the execution object itself.

[0024] In this embodiment, the storage device obtains the function data and the object data. When the function data includes the program data and the program verification data, the storage device verifies the program data according to the program verification data to determine whether the program data is correct and complete. After the verification is successful, the object data is passed into the program data as a function parameter for execution to realize the corresponding function and obtain the target result. In the above manner, the execution of the external program in the storage device is realized, and the diversification of the storage device function is realized.

[0025] In one embodiment, the object data is data information of the execution object itself. Therefore, after the program data is successfully verified, the storage device directly transfers the object data as a function parameter into the program data for execution to obtain the target result.

[0026] In one embodiment, the object data includes address information. After the program data is successfully verified, the storage device determines the target data according to the address information, and the target data is the data information of the execution object itself. The storage device obtains the target data from its own storage unit according to the address information, and then uses the target data as a function parameter and transfers it to the program data for execution to obtain the target result.

[0027] The address information may include the logical address of the data information of the execution object itself, or include the starting logical address and address length of the data information of the execution object itself.

[0028] In one embodiment, the object data includes address information and first target data. After the program data is successfully verified, the storage device determines the second target data according to the address information, and the second target data is the data information of the execution object itself. The first target data is also the data information of the execution object itself, but the first target data and the second target data are data information of different execution objects. After the storage device obtains the second target data from its own storage unit according to the address information, it uses the first target data and the second target data as function parameters, and passes them into the program data for execution to obtain the target result.

[0029] In one embodiment, after the program data is successfully verified, the storage device will save the program data for subsequent calls. The corresponding program data can be called according to the corresponding identification information during subsequent calls, thereby avoiding receiving and verifying the complete program data.

[0030] When program data is saved, the program identifier corresponding to the program data or the program function identifier corresponding to the program data can be saved at the same time. The program identifier corresponds to the program data one by one and is used to identify different program data. The program function identifier is used to identify program data of different functions and can further identify the priority of different program data under the same function.

[0031] In one embodiment, in response to the function data including a program identifier, the program data is acquired according to the program identifier; the function parameters obtained based on the object data are transferred to the program data to execute the corresponding function and obtain the target result.

[0032] The program identifier is an identifier that uniquely corresponds to the program data. When the function data contains the program identifier, the program data corresponding to the program identifier is obtained from the program data stored in the storage unit according to the program identifier, and the program data is used as the program data for execution. The function parameters obtained based on the object data are passed into the program data to obtain the target result.

[0033] In one embodiment, in response to the function data including a program identifier, first program data, and program verification data, the storage device obtains the second program data according to the program identifier, and verifies the first program data based on the program verification data; after successful verification, the function parameters obtained based on the object data are transferred to the first program data and / or the second program data to execute the corresponding function and obtain the target result.

[0034] The function data includes both the program identifier and the first program data. The storage device needs to verify the first program data to determine whether it is available, and the second program data obtained from the storage unit through the program identifier does not need to be verified. After the first program data is successfully verified, it indicates that all program data are available. The storage device then transfers the function parameters obtained based on the object data to the first program data and / or the second program data for execution to obtain the target result.

[0035] The program verification information includes at least one of a program size check, a CRC check, a checksum, an extended function flag check, and a binary format alignment check.

[0036] In one embodiment, after verification fails, the storage device sends a response message to remind the user of the program data transmission error.

[0037] In one embodiment, after the program data verification fails, in response to the function data including a program function identifier, the storage device obtains the program data of the corresponding function according to the program function identifier; the storage device passes the function parameters obtained based on the object data into the program data to execute the corresponding function to obtain the target result.

[0038] The received functional data may further include a program function identifier, which is used to indicate the function of the program. After the received program data fails to be verified, the program function identifier is used to find out whether there is program data that implements the same function in the saved program data. If it exists, the program data is called, and the function parameters obtained based on the object data are passed into the program data for execution to obtain the target result. Finally, the target result and the response information of the verification failure are sent to the external device together, which not only reminds the user that the program data transmission fails, but also gives the target result based on the same function, saving the user's time.

[0039] Furthermore, the program function identifier may also have a corresponding priority. For example, the program function identifier is A1, A identifies the function implemented by the program data, and 1 identifies the priority of the program data in the A function program. When the received program data identified as A1 fails to be verified, the storage device searches for program data identified as A in the saved program data according to the program function identifier. Suppose program data identified as A2, A3 and A4 are obtained. 1 to 4 indicate the priority from high to low, and the program data corresponding to the A2 identifier is selected to execute the function to obtain the target result.

[0040] A specific embodiment is given below to illustrate the technical solution of the present application in more detail.

[0041] like Figure 2 As shown, Figure 2 The structure diagram of a specific embodiment of a storage device is shown in FIG. The storage device may include a power management module, a system management module, a flash memory management module, a peripheral management module, and an extended function module, etc. The extended function module is independent and does not affect the normal operation of other modules.

[0042] like Figure 3 As shown, Figure 3 It is a structural diagram of a specific embodiment of an extended function module in a storage device.

[0043] Among them, the execution module is the part that executes the extended program, the communication module mainly transmits data with the host, the loading module is used to load the code of the extensible program, and the verification and authentication module verifies and authenticates the code of the extensible program to determine whether it is the program code generated by the present invention.

[0044] Based on the above storage device, a data comparison function is implemented as an example to compare whether two pictures are the same. The host side first implements the picture comparison program writing, and the host compiles the picture comparison program to compile a picture comparison program file that can be run by the SSD main control. In addition, a program for compilation inspection is also attached. This program is used for dynamic detection of the main control code, PCLint compilation inspection, and authentication flags. After completion, it is sent to the storage device SSD through DMA transmission, where the host and SSD exchange data through the communication interface. The data is sent to the DMA buffer. After the communication interface receives the command, it starts the DMA transmission, reads the program data from the DMA buffer, completes the reception, completes the DMA transmission of the data, and replies to the host. After the SSD receives the picture comparison program, it first verifies and authenticates the picture comparison program file, where the verification and authentication methods can include the size of the verification program, CRC check and checksum check, as well as flag verification, whether it is an executable program generated by the present invention, and binary file format alignment verification. After confirmation, execute the code for dynamic detection to verify whether the program is normal. After completion, you can save the program for the next startup, or you can save it and re-issue it each time to run the image comparison program. Then load the comparison program into RAM (which can be PRAM, SRAM, DRAM) and run it. When the image comparison program is executed, the LAB address and corresponding size of the two images sent by the host are read out by the storage device SSD, and the two image data are passed into the image comparison program to compare whether they are the same, and the result is returned to the host.

[0045] like Figure 4 As shown, Figure 4 This is a schematic structural diagram of the first embodiment of the storage device of the present application.

[0046] The storage device includes a processor 110 and a memory 120 .

[0047] The processor 110 controls the operation of the storage device, and the processor 110 may also be referred to as a CPU (Central Processing Unit). The processor 110 may be an integrated circuit chip having the ability to process a signal sequence. The processor 110 may also be a general-purpose processor, a digital signal sequence 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. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.

[0048] The memory 120 stores instructions and program data required for the processor 110 to operate.

[0049] The processor 110 is used to execute instructions to implement the method provided by any one of the first to third embodiments of the data synchronization method described above in the present application and any possible combination thereof.

[0050] like Figure 5 As shown, Figure 5 This is a schematic diagram of the structure of the first embodiment of the computer-readable storage medium of the present application.

[0051] An embodiment of a readable storage medium of the present application includes a memory 210, and the memory 210 stores program data. When the program data is executed, the method provided by any one of the first to third embodiments and possible combinations of the data method of the present application is implemented.

[0052] The memory 210 may include a medium that can store program instructions, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, or it may be a server that stores the program instructions. The server may send the stored program instructions to other devices for execution, or it may execute the stored program instructions itself.

[0053] In the present application, the storage device obtains the function data and the object data. When the function data includes the program data and the program verification data, the storage device verifies the program data according to the program verification data to determine whether the program data is correct and complete. After the verification is successful, the object data is passed into the program data as a function parameter for execution to realize the corresponding function and obtain the target result. In the above manner, the execution of the external program in the storage device is realized, and the diversification of the storage device function is realized.

[0054] In the several embodiments provided in this application, it should be understood that the disclosed methods and devices can be implemented in other ways. For example, the device implementation described above is only illustrative, for example, the division of the modules or units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed.

[0055] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0056] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0057] If the integrated units in the above other embodiments are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) or a processor (processor) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, RandomAccess Memory), disk or optical disk and other media that can store program codes.

[0058] The above descriptions are merely embodiments of the present application and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.

Claims

1. A function implementation method, applied to a storage device, characterized in that: The method comprises: receiving function data and object data; In response to the function data including program data and program verification data, verifying the program data based on the program verification data; After successful verification, the function parameters obtained based on the object data are passed into the program data to execute the corresponding functions and obtain the target results.

2. The method according to claim 1, characterized in that The step of transferring the function parameters obtained based on the object data into the program data to execute the corresponding function and obtain the target result includes: The object data is passed into the program data as the function parameter to execute the corresponding function and obtain the target result.

3. The method according to claim 1, characterized in that The object data includes address information, and the function parameters obtained based on the object data are passed into the program data to execute the corresponding function and obtain the target result, including: Target data is acquired according to the address information, and the target data is passed into the program data as the function parameter to execute the corresponding function and obtain the target result.

4. The method according to claim 1, characterized in that: The object data includes address information and first target data, and the function parameters obtained based on the object data are transferred into the program data to execute the corresponding function to obtain the target result, including: The second target data is acquired according to the address information, and the first target data and the second target data are passed into the program data as the function parameters to execute the corresponding function and obtain the target result.

5. The method according to claim 1, characterized in that After the verification is successful, it includes: The program data is saved for subsequent calling.

6. The method according to claim 1, characterized in that After receiving the function data and the object data, the method further comprises: In response to the function data including a program identifier, the program identifier uniquely corresponds to the program data; Acquire the program data according to the program identifier; The function parameters obtained based on the object data are passed into the program data to execute the corresponding function and obtain the target result.

7. The method according to claim 1, characterized in that After receiving the function data and the object data, the method further comprises: In response to the functional data including a program identification, first program data, and program verification data; acquiring second program data according to the program identifier, and verifying the first program data based on the program verification data; After successful verification, the function parameters obtained based on the object data are transferred to the first program data and / or the second program data to execute corresponding functions and obtain the target result.

8. The method according to claim 1, characterized in that The method further comprises: After the verification fails, in response to the function data including the program function identifier, acquiring the program data of the corresponding function according to the program function identifier; The function parameters obtained based on the object data are passed into the program data to execute the corresponding function to obtain the target result.

9. The method according to claim 1, characterized in that: The program verification information includes at least one of a program size check, a CRC check, a checksum, an extended function flag check, and a binary format alignment check.

10. A storage device, characterized in that: The invention comprises a memory and a processor, wherein the memory is used to store program data, and the program data can be executed by the processor to implement the method according to any one of claims 1 to 9.

11. A computer-readable storage medium, characterized in that: Program data is stored and can be executed by a processor to implement the method according to any one of claims 1 to 9.