Hardware link management method and device
By configuring and verifying the parameters of hardware submodules in the hardware link, the integrity of the image processing hardware link is ensured, and the task execution failure caused by incomplete dynamic hardware link configuration is solved, which improves the efficiency and accuracy of image processing.
Patent Information
- Application Number
- CN202411001304.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-24
- Publication Date
- 2024-12-03
AI Technical Summary
In image processing, the configuration of dynamic hardware links is not completely caused by task execution failure, and the prior art is difficult to detect submodules that have not been configured before task execution, affecting processing efficiency and accuracy.
By determining the hardware link for performing the pending task, including the input link and the output link, the parameters of the hardware submodule are respectively configured and verified, the first and second parameters are generated, and the hardware link is verified based on these parameters. Integrity, ensures that all submodules perform tasks before configuration.
It improves the success rate and efficiency of task execution, avoids the phenomenon of task execution failure, and ensures that the hardware link can effectively process image data before configuration is completed.
Smart Images

Figure CN119067830A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the technical field of hardware link management, and in particular to a hardware link management method and device. Background Art
[0002] In image processing, pipeline usually refers to a series of image processing steps connected in sequence. Each processing step is implemented by a piece of hardware, and a series of steps corresponds to a hardware link for image processing. Each step performs a specific operation on the image. These steps can include image preprocessing, feature extraction, segmentation, classification, object detection, etc. In the field of computer vision and image processing, building an efficient image processing pipeline is very important for achieving accurate image recognition and analysis.
[0003] Dynamic pipeline refers to a method of processing tasks or data using variable and flexible processes in computer system or software development. Unlike static pipeline, dynamic pipeline allows the order, logic and resource allocation of task execution to be dynamically adjusted at runtime according to actual needs and conditions. Dynamic pipeline can be dynamically adjusted according to different inputs, states and needs, making the processing process more flexible and adaptable.
[0004] When reading and writing the public data of the pipeline, locks must be used to protect it, otherwise it is easy to cause pipeline confusion; there are multiple image processing hardware modules inside the input layer of the pipeline. Since the pipeline tools process image data in a serial manner, these hardware modules inside the input layer need to be configured (even if the transparent transmission function is configured), otherwise the image data may not be transmitted to the backend. Summary of the invention
[0005] The present invention provides a hardware link management method and device capable of managing the operation of a hardware link to improve data processing speed.
[0006] In order to solve the above technical problems, an embodiment of the present invention provides a hardware link management method, including:
[0007] Determine a first hardware link for executing the task to be processed, wherein the first hardware link includes an input link, a data processing hardware module, and an output link, wherein the input link includes one or more first hardware sub-modules with different processing functions, and the output link includes one or more second hardware sub-modules with different processing functions;
[0008] In response to the completion of configuration of each hardware in the first hardware link, a first parameter and a second parameter are obtained, wherein the first parameter represents that the configuration of all first hardware sub-modules is completed, and the second parameter represents that the configuration of all second hardware sub-modules is completed;
[0009] The first parameter and the second parameter are verified respectively based on the first hardware submodule and the second hardware submodule in the first hardware link. If the verification passes, it indicates that the first hardware link has completed configuration and can execute the task to be processed.
[0010] In some embodiments, in response to completing the configuration of each hardware in the first hardware link, obtaining the first parameter includes:
[0011] In response to completion of configuration of each of the first hardware submodules in the first hardware link, generating a first value in sequence, wherein the first values corresponding to different first hardware submodules are the same or different;
[0012] When the configuration of all the first hardware sub-modules is completed in sequence, a first parameter consisting of a plurality of first values arranged in sequence is obtained.
[0013] In some embodiments, the first parameter is a binary value;
[0014] The step of obtaining the first parameter in response to completion of configuration of each hardware in the first hardware link includes:
[0015] In response to completion of configuration of each of the first hardware sub-modules in the first hardware link, assigning values to different binary bits of a first parameter, wherein the different binary bits of the first parameter correspond to different first hardware sub-modules respectively;
[0016] When the configuration of all the first hardware sub-modules is completed, the first parameter whose value is completely assigned is obtained.
[0017] In some embodiments, in response to completion of configuration of each of the first hardware sub-modules in the first hardware link, assigning values to different binary bits of the first parameter includes:
[0018] In response to completion of configuration of the first hardware submodule of the first priority in the first hardware link, assigning a value of 1 to the 0th binary bit of the first parameter;
[0019] In response to completion of configuration of the first hardware submodule of the second order in the first hardware link, assigning a value of 1 to a first binary bit of the first parameter based on a shift statement;
[0020] Repeat the above steps until the configuration of the last first hardware submodule in response to the first hardware link is completed, and assign 1 to the binary bit corresponding to the first hardware submodule in the first parameter based on the shift statement.
[0021] In some embodiments, in response to completing the configuration of each hardware in the first hardware link, obtaining the second parameter includes:
[0022] In response to the completion of configuration of each of the second hardware submodules in the first hardware link, second values are generated in sequence, where the second values corresponding to different second hardware submodules are the same or different;
[0023] When the configuration of all the second hardware sub-modules is completed in sequence, a second parameter consisting of a plurality of second values arranged in sequence is obtained.
[0024] In some embodiments, the second parameter is a binary value;
[0025] The step of obtaining the second parameter in response to completion of configuration of each hardware in the first hardware link includes:
[0026] In response to completion of configuration of each of the second hardware submodules in the first hardware link, assigning values to different binary bits of the second parameter, where the different binary bits of the second parameter correspond to different second hardware submodules respectively;
[0027] When the configuration of all the second hardware sub-modules is completed, the second parameter with completed assignment is obtained.
[0028] In some embodiments, in response to completion of configuration of each of the second hardware submodules in the first hardware link, assigning values to different binary bits of the second parameter includes:
[0029] In response to completion of configuration of the second hardware submodule of the first priority in the first hardware link, assigning a value of 1 to the 0th binary bit of the second parameter;
[0030] In response to completion of configuration of the second hardware submodule of the second order in the first hardware link, assigning a value of 1 to a first binary bit of the second parameter based on a shift statement;
[0031] Repeat the above steps until the configuration of the second hardware submodule in response to the last bit in the first hardware link is completed, and assign 1 to the binary bit corresponding to the second hardware submodule in the second parameter based on the shift statement.
[0032] In some embodiments, the verifying the first parameter and the second parameter based on the first hardware submodule and the second hardware submodule in the first hardware link, respectively, includes:
[0033] Determine a first verification code based on the number of first hardware sub-modules in the first hardware link;
[0034] Verifying the first parameter based on the first verification code;
[0035] Determine a second verification code based on the number of second hardware sub-modules in the first hardware link;
[0036] Verifying the second parameter based on the second verification code;
[0037] Among them, the first verification code is a binary code corresponding to the number of the first hardware sub-modules or a digital code equal to the number of the first hardware sub-modules, and the second verification code is a binary code corresponding to the number of the second hardware sub-modules or a digital code equal to the number of the second hardware sub-modules.
[0038] In some embodiments, the method further comprises:
[0039] Matching and storing an identity identifier of each input link and a first verification code, where the first verification code is related to the number of the first hardware sub-module;
[0040] Matching and storing the identity identifier and the second verification code of each output link, where the second verification code is related to the number of the second hardware sub-modules;
[0041] The verifying the first parameter and the second parameter based on the first hardware submodule and the second hardware submodule in the first hardware link respectively includes:
[0042] Determining an identity of an input link including a first hardware submodule in the first hardware link;
[0043] Determining an identity of an output link including a second hardware submodule in the first hardware link;
[0044] Based on the identity identifier of the input link and the identity identifier of the output link, matching and searching for the corresponding first verification code and second verification code in the pre-stored data;
[0045] Verifying the first parameter based on the first verification code;
[0046] The second parameter is verified based on the second verification code.
[0047] Another embodiment of the present invention also provides a hardware link management device, including:
[0048] a determination module, configured to determine a first hardware link for executing a task to be processed, wherein the first hardware link comprises an input link, a data processing hardware module, and an output link, wherein the input link comprises one or more first hardware sub-modules with different processing functions, and the output link comprises one or more second hardware sub-modules with different processing functions;
[0049] A response module, configured to obtain a first parameter and a second parameter in response to completion of configuration of each hardware in the first hardware link, wherein the first parameter represents completion of configuration of all first hardware sub-modules, and the second parameter represents completion of configuration of all second hardware sub-modules;
[0050] The verification module is used to verify the first parameter and the second parameter respectively according to the first hardware submodule and the second hardware submodule in the first hardware link. If the verification is successful, it indicates that the first hardware link has completed the configuration and can execute the task to be processed.
[0051] Based on the disclosure of the above embodiments, it can be known that the beneficial effects possessed by the embodiments of the present invention include matching the tasks to be processed through multiple hardware sub-modules with different processing functions, determining a first hardware sub-module and multiple second hardware sub-modules for participating in the processing of the tasks to be processed, and the sub-modules can cooperate to form a first hardware link. After the system completes the functional configuration of each sub-module in the hardware link, the system can verify the specified parameters of each sub-module in the hardware link to quickly determine whether the sub-module has completed the configuration and can perform task processing. Compared with the previous method of only knowing which modules have not completed the configuration when the task execution fails during the execution of the task, the scheme of this embodiment can complete the verification before the task is executed, determine the sub-modules that have not completed the configuration, avoid the phenomenon of subsequent task execution failure, and improve the task execution success rate and execution efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings in the following description are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0053] Figure 1 The figure is a schematic diagram of the structure of a hardware system of an embodiment of the existing solution.
[0054] Figure 2 It is a structural diagram of the hardware system of another embodiment of the existing solution.
[0055] Figure 3It is a structural diagram of the hardware system of another embodiment of the existing solution.
[0056] Figure 4 It is a structural diagram of the hardware system of another embodiment of the existing solution.
[0057] Figure 5 It is a structural diagram of the hardware system of another embodiment of the existing solution.
[0058] Figure 6 It is a structural diagram of the hardware system of another embodiment of the existing solution.
[0059] Figure 7 It is a flowchart of the hardware link management method in an embodiment of the present invention.
[0060] Figure 8 The figure is a schematic diagram of the application process of the hardware link management method in the embodiment of the present invention.
[0061] Fig. 9 FIG. 4 is a hardware system structure diagram of the hardware link management method in an embodiment of the present invention.
[0062] Fig.10 It is a structural block diagram of a hardware link management device in an embodiment of the present invention. DETAILED DESCRIPTION
[0063] The specific embodiments of the present invention are described in detail below with reference to the accompanying drawings, but are not intended to limit the present invention.
[0064] It should be understood that various modifications may be made to the embodiments disclosed herein. Therefore, the following description should not be considered as limiting, but merely as an example of an embodiment. Other modifications within the scope and spirit of the present disclosure will occur to those skilled in the art.
[0065] The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate embodiments of the present disclosure and, together with the general description of the present disclosure given above and the detailed description of the embodiments given below, serve to explain the principles of the present disclosure.
[0066] These and other characteristics of the invention will become apparent from the following description of a preferred form of embodiment given as a non-limiting example, with reference to the accompanying drawings.
[0067] It should also be understood that, although the invention has been described with reference to some specific examples, those skilled in the art will be able to realize many other equivalent forms of the invention that have the characteristics recited in the claims and are therefore within the scope of protection defined thereby.
[0068] The above and other aspects, features and advantages of the present disclosure will become more apparent from the following detailed description when taken in conjunction with the accompanying drawings.
[0069] Specific embodiments of the present disclosure are described hereinafter with reference to the accompanying drawings; however, it should be understood that the disclosed embodiments are merely examples of the present disclosure, which may be implemented in a variety of ways. Well-known and / or repeated functions and structures are not described in detail to avoid obscuring the present disclosure with unnecessary or redundant details. Therefore, the specific structural and functional details disclosed herein are not intended to be limiting, but merely serve as a basis and representative basis for the claims to teach those skilled in the art to use the present disclosure in a variety of ways with substantially any suitable detailed structure.
[0070] This specification may use the phrases "in one embodiment," "in another embodiment," "in a further embodiment," or "in other embodiments," all of which may refer to one or more of the same or different embodiments according to the present disclosure.
[0071] The embodiments of the present invention are described in detail below with reference to the accompanying drawings.
[0072] Taking the data to be processed as image data as an example, the hardware system used to implement the image data processing can be a processing platform, such as a platform for real-time conversion of live video images, game image processing, etc. The hardware system / platform has multiple input layers / input modules, and image processing hardware modules with multi-layer synthesis functions, such as G2D image processing hardware accelerator, VSP (video signal processor), etc. It includes multiple layers or multiple functional modules for completing different types of data processing respectively. Figure 1 As shown, the hardware system has 5 input layers and G2D for synthesis. Figure 2 As shown in FIG, it shows an internal structure diagram of an input layer with three image processing function submodules (crop, scaler, and csc (yuv---->rgb format conversion)). Figure 3 As shown in the figure, it shows an internal block diagram of an output layer with two image processing function submodules (csc (rgb----->yuv format conversion), yuvdown (yuv444---->yuv422 or yuv420)). In practical applications, there are many possible compositions of Pipeline, for example, Figure 4 As shown, it has only one input layer structure, such as Figure 5 and Figure 6 As shown, it is a structure with multiple input layers, such as a structure with two input layers and three input layers.
[0073] Based on the above introduction to the hardware system structure, Figure 7As shown, an embodiment of the present invention provides a hardware link management method, which is applied to a hardware system having the above structural characteristics, and the method includes:
[0074] S1: Determine a first hardware link for executing a task to be processed, wherein the first hardware link includes an input link, a data processing hardware module, and an output link, wherein the input link includes one or more first hardware sub-modules with different processing functions, and the output link includes one or more second hardware sub-modules with different processing functions;
[0075] S2: in response to the completion of configuration of each hardware in the first hardware link, a first parameter and a second parameter are obtained, wherein the first parameter represents that the configuration of all first hardware sub-modules is completed, and the second parameter represents that the configuration of all second hardware sub-modules is completed;
[0076] S3: Verify the first parameter and the second parameter based on the first hardware submodule and the second hardware submodule in the first hardware link respectively. If the verification is successful, it indicates that the first hardware link has completed configuration and can execute the task to be processed.
[0077] Exemplarily, the hardware system in this embodiment has multiple hardware modules, each of which has different functions. The multiple hardware modules form an input layer, a processing layer, and an output layer based on their functions. The input layer, the processing layer, and the output layer have multiple sub-modules. Different sub-modules corresponding to different layers can cooperate to form a hardware link for performing a processing task, such as completing a series of processing of an image. When the hardware system receives a task to be processed, such as an image processing task, the hardware system will determine the hardware link for completing the processing based on the characteristic parameters of the task to be processed, that is, the first hardware link. For example, if the image is cropped, discolored, and other processing is completed, the first hardware link is formed by multiple sub-modules with matching functions that are currently in an idle state. The first hardware link includes an input link, a data processing hardware module, and an output link. The input link includes one or more first hardware sub-modules with different processing functions, and the output link includes one or more second hardware sub-modules with different processing functions. The number of the first hardware sub-module and the second hardware sub-module is indefinite. After determining the first hardware link, the user can configure the parameters of each hardware sub-module in the first hardware link, or the system can configure the parameters of each hardware sub-module in the first hardware link according to the user input or preset data. When the configuration is completed, the system will obtain the first parameter and the second parameter. The first parameter represents the completion of the configuration of all the first hardware sub-modules, and the second parameter represents the completion of the configuration of the second hardware sub-module. The first parameter and the second parameter are verified based on the first hardware sub-module and the second hardware sub-module in the first hardware link, for example, based on the relevant data of the first hardware sub-module and the second hardware sub-module, including data that can be directly obtained or data that requires certain calculations to be processed to verify the first parameter and the second parameter. If the verification is passed, it means that all sub-modules in the first hardware link have completed the configuration and can execute the task to be processed.
[0078] Based on the above embodiments, it can be known that this embodiment matches the tasks to be processed through multiple hardware sub-modules with different processing functions, and determines the first hardware sub-module and multiple second hardware sub-modules for participating in the processing of the tasks to be processed, and the sub-modules can cooperate to form a first hardware link. After the system completes the functional configuration of each sub-module in the hardware link, the system can verify the specified parameters of each sub-module in the hardware link to quickly determine whether the sub-module has completed the configuration and can perform task processing. Compared with the previous method of only knowing which modules have not completed the configuration when the task execution fails during the execution of the task, the solution of this embodiment can complete the verification before the task is executed, determine the sub-modules that have not completed the configuration, avoid the phenomenon of subsequent task execution failure, and improve the task execution success rate and execution efficiency.
[0079] In one embodiment, the input layer structure of the first hardware link is variable and may have multiple combinations, while the output layer structure is uniquely fixed, such as being formed by only a fixed number of second hardware sub-modules, while the input layer may be formed by one or more first hardware sub-modules.
[0080] The step of obtaining the first parameter in response to completion of configuration of each hardware in the first hardware link includes:
[0081] S4: in response to the completion of configuration of each of the first hardware sub-modules in the first hardware link, generating first values in sequence, where the first values corresponding to different first hardware sub-modules are the same or different;
[0082] S5: When configuration of all the first hardware sub-modules is completed in sequence, a first parameter consisting of a plurality of first values arranged in sequence is obtained.
[0083] For example, in response to the completion of the configuration of each first hardware submodule in the first hardware link, the system will generate a first value in sequence. Assuming that there are three first hardware submodules in the first hardware link, then in the case of sequence, each time the configuration of a first hardware submodule is completed, the system will generate a first value. Therefore, after the three first hardware submodules are completed, three first values will be generated in sequence, and the arrangement order of the three first values conforms to the arrangement order of the three first hardware submodules. The first values corresponding to different first hardware submodules can be the same or different. When the configuration of all first hardware submodules is completed in sequence, a first parameter formed by three first values arranged in sequence will be obtained. If the first values are all 1, then the first parameter formed is 111.
[0084] In this embodiment, the form of the first parameter is not limited, and it can be an array. The array can be an array generated corresponding to the number of first hardware sub-modules when the first hardware link is determined, and the array has multiple digits, and the number of digits is consistent with the number of first hardware sub-modules. Each digit can have an initial value. After the configuration of each first hardware sub-module is completed, the initial value of the corresponding digit will be reset to the first value until the initial values of all digits are reset to the first value. Alternatively, an array is preset, which has multiple digits, and the number of digits is the maximum number of hardware sub-modules that can be accommodated in the first hardware link, and each digit has an initial value. Whenever a first hardware link is determined, the system allocates one of the arrays, and whenever the configuration of a sub-module is completed, the initial value of the corresponding digit is updated to the first value.
[0085] Alternatively, in another embodiment, the first parameter is a binary value;
[0086] The step of obtaining the first parameter in response to completion of configuration of each hardware in the first hardware link includes:
[0087] S6: in response to the configuration of each of the first hardware sub-modules in the first hardware link being completed, assigning values to different binary bits of the first parameter, where the different binary bits of the first parameter correspond to different first hardware sub-modules respectively;
[0088] S7: When the configuration of all the first hardware sub-modules is completed, the first parameter with completed assignment is obtained.
[0089] For example, after determining the first hardware link, the system can assign a binary number to it, and the binary number has multiple binary bits, and the number of binary bits is consistent with the number of first hardware sub-modules, or is greater than the number of first hardware sub-modules. In response to the completion of the configuration of each first hardware sub-module in the first hardware link, the corresponding binary bit of the first parameter is assigned a value, or the value is updated. Different binary bits of the first parameter correspond to different first hardware sub-modules, respectively. When the configuration of all the first hardware sub-modules is completed, all the corresponding binary bits are assigned values, and the first parameter is obtained, that is, the first parameter with completed assignment is obtained.
[0090] The step of assigning values to different binary bits of the first parameter in response to completion of configuration of each of the first hardware sub-modules in the first hardware link includes:
[0091] S8: in response to the configuration of the first hardware submodule of the first order in the first hardware link being completed, assigning a value of 1 to the 0th binary bit of the first parameter;
[0092] S9: in response to the completion of configuration of the first hardware submodule of the second order in the first hardware link, assigning a value of 1 to the first binary bit of the first parameter based on a shift statement;
[0093] S10: Repeat the above steps until the configuration of the last first hardware submodule in response to the first hardware link is completed, and assign 1 to the binary bit corresponding to the first hardware submodule in the first parameter based on a shift statement.
[0094] Specifically, the binary value starts with bit 0, i.e., 0, 1, 2, 3, etc. In response to the completion of the configuration of the first hardware submodule of the first order in the first hardware link, the 0th binary bit of the first parameter is assigned 1. When the configuration of the second hardware submodule of the second order is completed, in response to the completion of the configuration of the first hardware submodule of the second order, the first binary bit of the first parameter is assigned 1 based on the shift statement algorithm. The above steps are repeated until the configuration of the last first hardware submodule in the first hardware link is completed. Similarly, based on the shift statement algorithm, the binary bit corresponding to the last first hardware submodule in the first parameter is assigned 1, thereby obtaining the first parameter.
[0095] In another embodiment, in response to completion of configuration of each hardware in the first hardware link, obtaining the second parameter includes:
[0096] S11: in response to completion of configuration of each of the second hardware sub-modules in the first hardware link, generating a second value in sequence, wherein the second values corresponding to different second hardware sub-modules are the same or different;
[0097] S12: When configuration of all the second hardware sub-modules is completed in sequence, a second parameter consisting of a plurality of second values arranged in sequence is obtained.
[0098] For example, in response to the completion of the configuration of each second hardware submodule in the first hardware link, the system will generate a second value in sequence. Assuming that there are three second hardware submodules in the first hardware link, then in the case of sequence, each time the configuration of a second hardware submodule is completed, the system will generate a second value. Therefore, after completing the three second hardware submodules, three second values will be generated in sequence, and the arrangement order of the three second values conforms to the arrangement order of the three second hardware submodules. The second values corresponding to different second hardware submodules can be the same or different. When the configuration of all second hardware submodules is completed in sequence, a second parameter formed by the three second values arranged in sequence will be obtained. If the second values are all 1, then the formed second parameter is 111.
[0099] In this embodiment, like the first parameter, the second parameter is not limited in form and can be an array. The array can be generated when the first hardware link is determined, corresponding to the number of second hardware sub-modules, and has multiple digits, and the number of digits is consistent with the number of second hardware sub-modules. Each digit can have an initial value. After the configuration of each second hardware sub-module is completed, the initial value of the corresponding digit will be reset to the first value until the initial values of all digits are reset to the first value. Alternatively, an array is preset, which has multiple digits, and the number of digits is the maximum number of hardware sub-modules that can be accommodated in the first hardware link, and each digit has an initial value. Whenever a first hardware link is determined, the system allocates one of the arrays, and whenever the configuration of a sub-module is completed, the initial value of the corresponding digit is updated to the second value.
[0100] Alternatively, in another embodiment, the second parameter is a binary value;
[0101] The step of obtaining the second parameter in response to completion of configuration of each hardware in the first hardware link includes:
[0102] S13: in response to the configuration of each of the second hardware sub-modules in the first hardware link being completed, assigning values to different binary bits of the second parameter, where the different binary bits of the second parameter correspond to different second hardware sub-modules respectively;
[0103] S14: When the configuration of all the second hardware sub-modules is completed, the second parameter with completed assignment is obtained.
[0104] For example, after determining the first hardware link, the system can assign a binary number to it, and the binary number has multiple binary bits, and the number of binary bits is consistent with the number of second hardware sub-modules, or is greater than the number of second hardware sub-modules. In response to the completion of the configuration of each second hardware sub-module in the first hardware link, the corresponding binary bit of the second parameter is assigned a value, or the value is updated. Different binary bits of the second parameter correspond to different second hardware sub-modules. When the configuration of all the second hardware sub-modules is completed, all the corresponding binary bits are assigned values, and the second parameter is obtained, that is, the second parameter with completed assignment is obtained.
[0105] The step of assigning values to different binary bits of the second parameter in response to completion of configuration of each of the second hardware submodules in the first hardware link includes:
[0106] S15: in response to the configuration of the second hardware submodule of the first priority in the first hardware link being completed, assigning a value of 1 to the 0th binary bit of the second parameter;
[0107] S16: in response to the configuration of the second hardware submodule of the second order in the first hardware link being completed, assigning a value of 1 to the first binary bit of the second parameter based on a shift statement;
[0108] S17: Repeat the above steps until the configuration of the second hardware submodule in response to the last bit in the first hardware link is completed, and assign 1 to the binary bit corresponding to the second hardware submodule in the second parameter based on the shift statement.
[0109] Specifically, the binary value starts with bit 0, i.e., 0, 1, 2, 3, etc. In response to the completion of the configuration of the second hardware submodule of the first order in the first hardware link, the 0th binary bit of the second parameter is assigned 1. When the configuration of the second hardware submodule of the second order is completed, in response to the completion of the configuration of the second hardware submodule of the second order, the first binary bit of the second parameter is assigned 1 based on the shift statement algorithm. The above steps are repeated until the configuration of the last second hardware submodule in the first hardware link is completed. Similarly, based on the shift statement algorithm, the binary bit corresponding to the last second hardware submodule in the second parameter is assigned 1 to obtain the second parameter.
[0110] Further, after the system obtains the first parameter and the second parameter, the system verifies the first parameter and the second parameter based on the first hardware submodule and the second hardware submodule in the first hardware link, respectively, including:
[0111] S18: Determine a first verification code based on the number of first hardware sub-modules in the first hardware link;
[0112] S19: Verify the first parameter based on the first verification code;
[0113] S20: Determine a second verification code based on the number of second hardware sub-modules in the first hardware link;
[0114] S21: verifying the second parameter based on the second verification code;
[0115] Among them, the first verification code is a binary code corresponding to the number of the first hardware sub-modules or a digital code equal to the number of the first hardware sub-modules, and the second verification code is a binary code corresponding to the number of the second hardware sub-modules or a digital code equal to the number of the second hardware sub-modules.
[0116] Exemplarily, the first verification code may be a code with corresponding digits determined based on the number of first hardware sub-modules in the first hardware link. For example, if the number of first hardware sub-modules is 3, then the first verification code may be 111 or 000, etc., without specific limitation. Alternatively, the first verification code may be the number value of the first hardware sub-module. For example, if the number of first hardware sub-modules is 3, then the first verification code may be 3. Alternatively, the first verification code may be a binary code corresponding to the number of first hardware sub-modules, such as 0b000 or 0b111, etc., without specific limitation. When the system verifies the first parameter, it verifies the first parameter based on the first verification code. If the verification passes, the first parameter is strongly correlated with the first verification code, or is the same. Based on the same generation method as the first verification code, the system determines the second verification code based on the number of second hardware sub-modules in the first hardware link, and verifies the second parameter based on the second verification code.
[0117] For better explanation, the following is described in conjunction with specific embodiments. Figure 8As shown, for example, the task to be processed is an image processing task. The number of the first hardware sub-modules inside the input link is three, namely the cropping module, the scaling module, and the format conversion module. Based on this, the system sets the first verification code plane->mask corresponding to the input link to, for example, 3, or other arrays with three digits. The first parameter plane->ready can be set to 0b--- (binary value), where each bit represents a first hardware sub-module. Here, taking the bits from low to high representing (bit0 - cropping, bit1 - scaling, bit2 - format conversion) three sub-modules as an example for explanation. After configuring a first hardware sub-module, the system uses the shift statement (1<<bit_index) to assign a value to plane->ready. Finally, the obtained first parameter is 0b111. After obtaining the first parameter, the system determines whether the plane is ready to be given to the MLC (multi-layer composition) module for subsequent image processing operations by checking whether the value of plane->ready is the same as the value of plane->mask, or whether the number of bit positions assigned to a specified value, such as 1, is the same as the value of plane->mask.
[0118] The number of the second sub-modules inside the output layer is two (or other values), so the second verification code plane->mask is set to 2 or other arrays with two digits. The second parameter plane->ready can be assigned a value of 0b-- (binary value), where each bit represents a second hardware sub-module. Here, taking the bits from low to high representing (bit0 - format conversion, bit1 - scaling) two sub-modules as an example for explanation. After configuring a second hardware sub-module, the shift statement (1<<bit_index) is used to assign a value to 0b--, and finally the second parameter 0b11 is obtained. Then, the system determines whether the output layer / output link is ready to receive the image data synthesized by the MLC by checking whether the value of plane->ready is equal to the value of plane->mask, or whether the number of bit positions with a specified value is equal to the value of plane->mask.
[0119] For the entire pipeline, that is, the system can also verify the first hardware link as a whole. That is, instead of separately detecting the first parameter and the second parameter, the first parameter and the second parameter are fused to form a third parameter. The third parameter contains multiple digits, and the number is the same as or exceeds the sum of the number of the first hardware sub-modules and the second hardware sub-modules. Each time the system completes the configuration of a hardware sub-module, the corresponding digit in the third parameter can be assigned a value until all hardware sub-modules are configured and all digits of the third parameter are assigned values;
[0120] As Fig. 9 shown, for the first hardware link with multiple input links, when performing configuration detection on this type of first hardware link, the first parameters of each input link can be detected based on the aforementioned method. At the same time, the system will configure a fourth parameter for all input links in the hardware link, which has multiple digits, and the quantity is the same as or greater than the sum of the quantities of all input links. Whenever the verification of an input link is completed, or whenever an input link is configured, the corresponding digit of the fourth parameter can be assigned a specified value. After all the assignments of the fourth parameter are completed, the system can verify the fourth parameter and the previously determined quantity of input links. Specifically:
[0121] Use 0 as the index (initial value) to mark the input links, start accumulating from 1, and assign an index as a mark to each input link participating in the pipeline. When the preparation work of each input link is completed, that is, after the configuration is completed, use the shift statement (1 << index) to let the system know that the input link represented by this index is ready. When the system believes that all input links participating in the composition of this pipeline are ready, the pipeline can start running, and each hardware starts to perform specific image processing operations.
[0122] In practical applications, for example, as Fig. 9 shown, this figure shows a hardware link, including three input links and one output link. The index of input0 = 1;
[0123] The index of input1 = 2;
[0124] The index of input2 = 3;
[0125] pipeline->input_num = 3;
[0126] The index of output = 0;
[0127] After each hardware sub-module is ready, pipeline->ready = (1 << 1) | (1 << 2) | (1 << 3) | (1 << 0) = 0b1111 (binary value);
[0128] mask = (((1 << 3) - 1) << 1) | (1 << 0) = 0b1111 (binary value);
[0129] Therefore, pipeline->ready = mask, indicating that this pipeline can start running.
[0130] In another embodiment, the method further includes:
[0131] S22: Match and store the identity identifier of each input link and the first verification code, where the first verification code is related to the number of the first hardware sub-module;
[0132] S23: Match and store the identity identifier and the second verification code of each output link, where the second verification code is related to the number of the second hardware sub-modules;
[0133] The verifying the first parameter and the second parameter based on the first hardware submodule and the second hardware submodule in the first hardware link respectively includes:
[0134] S24: Determine the identity of the input link including the first hardware submodule in the first hardware link;
[0135] S25: Determine the identity of the output link of the second hardware submodule included in the first hardware link;
[0136] S26: searching for the corresponding first verification code and second verification code in the pre-stored data based on the identity identifier of the input link and the identity identifier of the output link;
[0137] S27: Verify the first parameter based on the first verification code;
[0138] S28: Verify the second parameter based on the second verification code.
[0139] Since the hardware system includes multiple hardware links, that is, multiple first hardware links, and each first hardware link is composed of different input links and output links, and the hardware configuration in each input link and output link is fixed, that is, the hardware sub-modules included are fixed, the system can match and store the identity of each input link and output link and the corresponding first verification code and second verification code, because the first verification code and the second verification code are both related to the number of modules in the corresponding link, so when the number of modules is fixed, the verification code is also fixed. When the system performs parameter verification on the hardware sub-modules in a first hardware link, it can first determine the identity of the input link or output link where each hardware sub-module is located, and then determine the corresponding first verification code and second verification code in the stored data based on the identity. After obtaining the corresponding verification code, the system only needs to wait for the generation of the first parameter and the second parameter, and after obtaining the two parameters, it can perform verification based on the corresponding verification code, which is simple and fast.
[0140] Among them, based on the aforementioned embodiments, it can be known that since each hardware sub-module has a corresponding digit in each parameter, when the verification fails, the system can quickly determine which hardware sub-module has not completed the configuration based on the assignment in the first parameter or the second parameter, which is accurate and efficient, and can help the user or the system quickly complete the configuration of the corresponding module.
[0141] like Fig.10 As shown, another embodiment of the present invention also provides a hardware link management device 100, including:
[0142] a determination module, configured to determine a first hardware link for executing a task to be processed, wherein the first hardware link comprises an input link, a data processing hardware module, and an output link, wherein the input link comprises one or more first hardware sub-modules with different processing functions, and the output link comprises one or more second hardware sub-modules with different processing functions;
[0143] A response module, configured to obtain a first parameter and a second parameter in response to completion of configuration of each hardware in the first hardware link, wherein the first parameter represents completion of configuration of all first hardware sub-modules, and the second parameter represents completion of configuration of all second hardware sub-modules;
[0144] The verification module is used to verify the first parameter and the second parameter respectively according to the first hardware submodule and the second hardware submodule in the first hardware link. If the verification is successful, it indicates that the first hardware link has completed the configuration and can execute the task to be processed.
[0145] In some embodiments, in response to completing the configuration of each hardware in the first hardware link, obtaining the first parameter includes:
[0146] In response to completion of configuration of each of the first hardware submodules in the first hardware link, generating a first value in sequence, wherein the first values corresponding to different first hardware submodules are the same or different;
[0147] When the configuration of all the first hardware sub-modules is completed in sequence, a first parameter consisting of a plurality of first values arranged in sequence is obtained.
[0148] In some embodiments, the first parameter is a binary value;
[0149] The step of obtaining the first parameter in response to completion of configuration of each hardware in the first hardware link includes:
[0150] In response to completion of configuration of each of the first hardware sub-modules in the first hardware link, assigning values to different binary bits of a first parameter, wherein the different binary bits of the first parameter correspond to different first hardware sub-modules respectively;
[0151] When the configuration of all the first hardware sub-modules is completed, the first parameter whose value is completely assigned is obtained.
[0152] In some embodiments, in response to completion of configuration of each of the first hardware sub-modules in the first hardware link, assigning values to different binary bits of the first parameter includes:
[0153] In response to completion of configuration of the first hardware submodule of the first priority in the first hardware link, assigning a value of 1 to the 0th binary bit of the first parameter;
[0154] In response to completion of configuration of the first hardware submodule of the second order in the first hardware link, assigning a value of 1 to a first binary bit of the first parameter based on a shift statement;
[0155] Repeat the above steps until the configuration of the last first hardware submodule in response to the first hardware link is completed, and assign 1 to the binary bit corresponding to the first hardware submodule in the first parameter based on the shift statement.
[0156] In some embodiments, in response to completing the configuration of each hardware in the first hardware link, obtaining the second parameter includes:
[0157] In response to the completion of configuration of each of the second hardware submodules in the first hardware link, second values are generated in sequence, where the second values corresponding to different second hardware submodules are the same or different;
[0158] When the configuration of all the second hardware sub-modules is completed in sequence, a second parameter consisting of a plurality of second values arranged in sequence is obtained.
[0159] In some embodiments, the second parameter is a binary value;
[0160] The step of obtaining the second parameter in response to completion of configuration of each hardware in the first hardware link includes:
[0161] In response to completion of configuration of each of the second hardware submodules in the first hardware link, assigning values to different binary bits of the second parameter, where the different binary bits of the second parameter correspond to different second hardware submodules respectively;
[0162] When the configuration of all the second hardware sub-modules is completed, the second parameter with completed assignment is obtained.
[0163] In some embodiments, in response to completion of configuration of each of the second hardware submodules in the first hardware link, assigning values to different binary bits of the second parameter includes:
[0164] In response to completion of configuration of the second hardware submodule of the first priority in the first hardware link, assigning a value of 1 to the 0th binary bit of the second parameter;
[0165] In response to completion of configuration of the second hardware submodule of the second order in the first hardware link, assigning a value of 1 to a first binary bit of the second parameter based on a shift statement;
[0166] Repeat the above steps until the configuration of the second hardware submodule in response to the last bit in the first hardware link is completed, and assign 1 to the binary bit corresponding to the second hardware submodule in the second parameter based on the shift statement.
[0167] In some embodiments, the verifying the first parameter and the second parameter based on the first hardware submodule and the second hardware submodule in the first hardware link, respectively, includes:
[0168] Determine a first verification code based on the number of first hardware sub-modules in the first hardware link;
[0169] Verifying the first parameter based on the first verification code;
[0170] Determine a second verification code based on the number of second hardware sub-modules in the first hardware link;
[0171] Verifying the second parameter based on the second verification code;
[0172] Among them, the first verification code is a binary code corresponding to the number of the first hardware sub-modules or a digital code equal to the number of the first hardware sub-modules, and the second verification code is a binary code corresponding to the number of the second hardware sub-modules or a digital code equal to the number of the second hardware sub-modules.
[0173] In some embodiments, the apparatus further comprises:
[0174] A first storage module, used for matching and storing an identity identifier and a first verification code of each input link, where the first verification code is related to the number of the first hardware sub-module;
[0175] A second storage module, used for matching and storing an identity identifier and a second verification code of each output link, where the second verification code is related to the number of the second hardware sub-modules;
[0176] The verifying the first parameter and the second parameter based on the first hardware submodule and the second hardware submodule in the first hardware link respectively includes:
[0177] Determining an identity of an input link including a first hardware submodule in the first hardware link;
[0178] Determining an identity of an output link including a second hardware submodule in the first hardware link;
[0179] Based on the identity identifier of the input link and the identity identifier of the output link, matching and searching for the corresponding first verification code and second verification code in the pre-stored data;
[0180] Verifying the first parameter based on the first verification code;
[0181] The second parameter is verified based on the second verification code.
[0182] Another embodiment of the present invention further provides an electronic device, comprising a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps in the hardware link management method as described in any one of the above embodiments are implemented.
[0183] Another embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps in the hardware link management method described in any of the above embodiments are implemented.
[0184] It should be noted that the computer storage medium of the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access storage medium (RAM), a read-only storage medium (ROM), an erasable programmable read-only storage medium (EPROM or flash memory), an optical fiber, a portable compact disk read-only storage medium (CD-ROM), an optical storage medium, a magnetic storage medium, or any suitable combination of the above. In the present application, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate or transmit a program configured to be used by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, antenna, optical cable, RF, etc., or any suitable combination of the above.
[0185] A person skilled in the art should understand that the discussion of any of the above embodiments is merely illustrative and is not intended to imply that the scope of protection of the present application is limited to these examples. In line with the concept of the present application, the technical features in the above embodiments or different embodiments may be combined, the steps may be implemented in any order, and there are many other variations of different aspects of one or more embodiments of the present application as described above, which are not provided in detail for the sake of simplicity.
[0186] One or more embodiments of the present application are intended to cover all such substitutions, modifications and variations that fall within the broad scope of the present application. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of one or more embodiments of the present application should be included in the protection scope of the present application.
Claims
1. A hardware link management method, It is characterized in that include: Determine a first hardware link for executing the task to be processed, wherein the first hardware link includes an input link, a data processing hardware module, and an output link, wherein the input link includes one or more first hardware sub-modules with different processing functions, and the output link includes one or more second hardware sub-modules with different processing functions; In response to the completion of configuration of each hardware in the first hardware link, a first parameter and a second parameter are obtained, wherein the first parameter represents that the configuration of all first hardware sub-modules is completed, and the second parameter represents that the configuration of all second hardware sub-modules is completed; The first parameter and the second parameter are verified respectively based on the first hardware submodule and the second hardware submodule in the first hardware link. If the verification passes, it indicates that the first hardware link has completed configuration and can execute the task to be processed.
2. The hardware link management method according to claim 1, It is characterized in that The step of obtaining the first parameter in response to completion of configuration of each hardware in the first hardware link includes: In response to completion of configuration of each of the first hardware submodules in the first hardware link, generating a first value in sequence, wherein the first values corresponding to different first hardware submodules are the same or different; When the configuration of all the first hardware sub-modules is completed in sequence, a first parameter consisting of a plurality of first values arranged in sequence is obtained.
3. The hardware link management method according to claim 1, It is characterized in that The first parameter is a binary value; The step of obtaining the first parameter in response to completion of configuration of each hardware in the first hardware link includes: In response to completion of configuration of each of the first hardware sub-modules in the first hardware link, assigning values to different binary bits of a first parameter, wherein the different binary bits of the first parameter correspond to different first hardware sub-modules respectively; When the configuration of all the first hardware sub-modules is completed, the first parameter whose value is completely assigned is obtained.
4. The hardware link management method according to claim 3, It is characterized in that In response to the configuration of each of the first hardware sub-modules in the first hardware link being completed, assigning values to different binary bits of the first parameter includes: In response to completion of configuration of the first hardware submodule of the first priority in the first hardware link, assigning a value of 1 to the 0th binary bit of the first parameter; In response to completion of configuration of the first hardware submodule of the second order in the first hardware link, assigning a value of 1 to a first binary bit of the first parameter based on a shift statement; Repeat the above steps until the configuration of the last first hardware submodule in response to the first hardware link is completed, and assign 1 to the binary bit corresponding to the first hardware submodule in the first parameter based on the shift statement.
5. The hardware link management method according to claim 1, It is characterized in that The step of obtaining the second parameter in response to completion of configuration of each hardware in the first hardware link includes: In response to the completion of configuration of each of the second hardware submodules in the first hardware link, second values are generated in sequence, where the second values corresponding to different second hardware submodules are the same or different; When the configuration of all the second hardware sub-modules is completed in sequence, a second parameter consisting of a plurality of second values arranged in sequence is obtained.
6. The hardware link management method according to claim 1, It is characterized in that The second parameter is a binary value; The step of obtaining the second parameter in response to completion of configuration of each hardware in the first hardware link includes: In response to completion of configuration of each of the second hardware submodules in the first hardware link, assigning values to different binary bits of the second parameter, where the different binary bits of the second parameter correspond to different second hardware submodules respectively; When the configuration of all the second hardware sub-modules is completed, the second parameter with completed assignment is obtained.
7. The hardware link management method according to claim 6, It is characterized in that In response to the configuration of each of the second hardware submodules in the first hardware link being completed, assigning values to different binary bits of the second parameter includes: In response to completion of configuration of the second hardware submodule of the first priority in the first hardware link, assigning a value of 1 to the 0th binary bit of the second parameter; In response to completion of configuration of a second hardware submodule of a second order in the first hardware link, assigning a value of 1 to a first binary bit of the second parameter based on a shift statement; Repeat the above steps until the configuration of the second hardware submodule in response to the last bit in the first hardware link is completed, and assign 1 to the binary bit corresponding to the second hardware submodule in the second parameter based on the shift statement.
8. The hardware link management method according to claim 1, It is characterized in that The verifying the first parameter and the second parameter based on the first hardware submodule and the second hardware submodule in the first hardware link respectively includes: Determine a first verification code based on the number of first hardware sub-modules in the first hardware link; Verifying the first parameter based on the first verification code; Determine a second verification code based on the number of second hardware sub-modules in the first hardware link; Verifying the second parameter based on the second verification code; Among them, the first verification code is a binary code corresponding to the number of the first hardware sub-modules or a digital code equal to the number of the first hardware sub-modules, and the second verification code is a binary code corresponding to the number of the second hardware sub-modules or a digital code equal to the number of the second hardware sub-modules.
9. The hardware link management method according to claim 1, It is characterized in that The method further comprises: Matching and storing an identity identifier of each input link and a first verification code, where the first verification code is related to the number of the first hardware sub-module; Matching and storing the identity identifier and the second verification code of each output link, where the second verification code is related to the number of the second hardware sub-modules; The verifying the first parameter and the second parameter based on the first hardware submodule and the second hardware submodule in the first hardware link respectively includes: Determining an identity of an input link including a first hardware submodule in the first hardware link; Determining an identity of an output link including a second hardware submodule in the first hardware link; Based on the identity identifier of the input link and the identity identifier of the output link, matching and searching for the corresponding first verification code and second verification code in the pre-stored data; Verifying the first parameter based on the first verification code; The second parameter is verified based on the second verification code.
10. A hardware link management device, It is characterized in that include: a determination module, configured to determine a first hardware link for executing a task to be processed, wherein the first hardware link comprises an input link, a data processing hardware module, and an output link, wherein the input link comprises one or more first hardware sub-modules with different processing functions, and the output link comprises one or more second hardware sub-modules with different processing functions; A response module, configured to obtain a first parameter and a second parameter in response to completion of configuration of each hardware in the first hardware link, wherein the first parameter represents completion of configuration of all first hardware sub-modules, and the second parameter represents completion of configuration of all second hardware sub-modules; The verification module is used to verify the first parameter and the second parameter respectively according to the first hardware submodule and the second hardware submodule in the first hardware link. If the verification is successful, it indicates that the first hardware link has completed the configuration and can execute the task to be processed.
