Code-based multi-model software function coding method and device

Through the code-based multi-mode software function coding method, the visual interface and compilation templates are used to generate functional codes, the problem of difficult and high error rate of multi-mode software function coding management is solved, and efficient and safe model management is achieved.

CN120353452AActive Publication Date: 2025-07-22SHANGHAI ZHUODAO MEDICAL TECH CO LTD +1
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202510845325.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-23
Publication Date
2025-07-22
Estimated Expiration
2045-06-23

AI Technical Summary

Technical Problem

In the prior art, the coding management of multi-model software functions is difficult, and manual modification is prone to errors, and lacks a verification mechanism.

Method used

The function selection information is obtained through the visual function model selection interface, function encoding is performed based on attribute values and function information, and function code is generated using preset compilation templates, including reverse calculation and comparison mechanisms to ensure the correctness of the code.

Benefits of technology

It reduces operation difficulty, improves the efficiency of software function coding management, and enhances the security and accuracy of model management.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120353452A_ABST
    Figure CN120353452A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a code-based multi-model software function coding method and device, and relates to the technical field of software function coding technologies. The method comprises the following steps: acquiring function selection information; determining an attribute value and function information according to the function selection information; performing function coding based on the attribute value and the function information to obtain a function; and generating the function code based on the function code and a preset compiling template. By means of the method and device, the problem that software coding management is difficult is solved, and then the effect of improving software coding management efficiency is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present invention relate to the field of software functions. Specifically, it relates to a method and device for encoding software functions of multiple models based on code. Background Art

[0002] In the product differentiation strategy, manufacturers will make differentiations in hardware specifications and software functions, such as the Lite and Pro models of mobile phones; regarding software functions, currently, the differentiated software functions in different models are extracted and transformed into independent functions that are not coupled to each other; however, when the function code needs to be modified, this method requires the modifier to have certain programming skills, and for products with many functions and many models, the workload is greatly increased, and manual filling and modification are extremely error-prone, and there is a lack of a verification mechanism for the function code.

[0003] In response to the above problems, there is currently no good solution. Summary of the Invention

[0004] Embodiments of the present invention provide a method and device for encoding software functions of multiple models based on code, so as to at least solve the problem of difficult function coding management in related technologies.

[0005] According to an embodiment of the present invention, a method for encoding software functions of multiple models based on code is provided, including: Obtaining function selection information, where the function selection information is collected by interacting and selecting on a preset visual function model selection interface; Determining an attribute value and function information according to the function selection information; Performing function coding based on the attribute value and function information to obtain a function code; Generating function code based on the function code and a preset compilation template.

[0006] In an exemplary embodiment, before generating the function code based on the function code and the preset compilation template, the method further includes: Performing reverse calculation on the function code to obtain first function selection information corresponding to the function code; Comparing the function information with the first function selection information, and when the comparison result is consistent, determining that the function code is normal, otherwise determining it as abnormal.

[0007] In an exemplary embodiment, generating the function code based on the function code and the preset compilation template includes: Constructing a function table based on the function code and the function selection information; Filling the data in the function table into the structure body of the compilation template one by one according to a preset order; Read the model information and function codes in the function table in the preset order, combine the model information and the function codes, and fill the combination result into the compilation template.

[0008] In an exemplary embodiment, after determining the attribute value and function information according to the function selection information, the method further includes: Determine the encoding parameters according to the attribute value and function information, where the encoding parameters include a model identifier, a basic function coefficient, a model enhancement coefficient, a function switch vector, and a weight matrix corresponding to the function switch vector; Based on the encoding parameters, determine the performance value corresponding to the function code.

[0009] According to another embodiment of the present invention, there is provided a multi-model software function encoding device based on code, including: An information acquisition module, configured to acquire function selection information, where the function selection information is acquired by interactively selecting a preset visual function model selection interface; An information determination module, configured to determine an attribute value and function information according to the function selection information; A function encoding module, configured to perform function encoding based on the attribute value and function information to obtain a function code; A code encoding module, configured to generate a function code based on the function code and a preset compilation template.

[0010] In an exemplary embodiment, it further includes: A reverse calculation module, configured to perform a reverse calculation on the function code to obtain the first function selection information corresponding to the function code before generating the function code based on the function code and a preset compilation template; A comparison module, configured to compare the function information with the first function selection information, and determine that the function code is normal when the comparison result is consistent, otherwise determine it as abnormal.

[0011] In an exemplary embodiment, generating the function code based on the function code and a preset compilation template includes: Construct a function table based on the function code and the function selection information; Fill the data in the function table into the structure of the compilation template one by one in a preset order; Read the model information and function codes in the function table in the preset order, combine the model information and the function codes, and fill the combination result into the compilation template.

[0012] In an exemplary embodiment, the device further includes: After determining the attribute value and function information according to the function selection information, determine encoding parameters according to the attribute value and function information, where the encoding parameters include a model identifier, a basic function coefficient, a model enhancement coefficient, a function switch vector, and a weight matrix corresponding to the function switch vector; Based on the encoding parameters, determine the performance value corresponding to the function code.

[0013] According to another embodiment of the present invention, there is also provided a computer-readable storage medium storing a computer program, wherein the computer program is configured to execute the steps in any one of the above method embodiments when running.

[0014] According to another embodiment of the present invention, there is also provided an electronic device including a memory and a processor, where a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0015] Through the present invention, since visual editing is performed through a function model selection interface, model management can be made more intuitive, greatly reducing the operation difficulty. At the same time, a function code verification function can be provided to improve the security of model management and reduce the possibility of errors. Moreover, by automatically generating function code, it can be copied and used immediately, reducing the workload. Therefore, the problem of difficult software function coding management can be solved, and the effect of improving the efficiency of software function coding management can be achieved. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] Figure 1 is a flowchart of a method for multi-model software function coding based on code according to an embodiment of the present invention; Figure 2 is a schematic diagram according to a specific embodiment of the present invention Figure 1 ; Figure 3 is a schematic diagram according to a specific embodiment of the present invention Figure 2 ; Figure 4 is a structural block diagram of a multi-model software function coding device based on code according to an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0017] Next, the technical solutions in the embodiments of the present application will be described with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments.

[0018] Hereinafter, the terms "first", "second", etc. are for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the quantity of the indicated technical features. Thus, features defined with "first", "second", etc. may explicitly or implicitly include one or more of such features. In the description of this application, unless otherwise specified, the meaning of "a plurality" is two or more.

[0019] In addition, in this application, orientation terms such as "upper", "lower", "left", "right", etc. may include but are not limited to being defined relative to the schematic placement of components in the drawings. It should be understood that these directional terms can be relative concepts, and they are used for relative description and clarification, and they can change correspondingly according to the change in the orientation of the components placed in the drawings.

[0020] In this application, unless otherwise clearly specified and limited, the term "connection" should be understood in a broad sense. For example, "connection" can be a fixed connection, a detachable connection, or integrated; it can be directly connected or indirectly connected through an intermediate medium. In addition, the term "coupling" can be a way of realizing electrical connection for signal transmission.

[0021] As used herein, "about", "substantially" or "approximate" includes the stated value and the average value within an acceptable deviation range of the specific value, where the acceptable deviation range is determined by those of ordinary skill in the art considering the measurement being discussed and the errors associated with the measurement of the specific quantity (i.e., the limitations of the measurement system).

[0022] In this embodiment, a method for encoding software functions of multiple models based on code is provided. Figure 1 It is a flowchart of a method for encoding software functions of multiple models based on code according to an embodiment of the present invention, as Figure 1 shown, and this process includes the following steps: Step S11, obtaining function selection information, where the function selection information is collected after interactive selection on a preset visual function model selection interface; In this embodiment, the user directly selects functions according to the visual interface, and then directly encodes functions according to the functions selected by the user, so there is no need for manual re-encoding, greatly reducing the development difficulty, reducing the amount of manual work, and improving the project development efficiency.

[0023] Specifically, a visual interface can be generated in a table format as Figure 2 shown; the titles of rows and columns can be modified according to the required functions and the project name, and the options support being selected or not selected, and the corresponding function diagrams are as Figure 3 shown.

[0024] It should be noted that when generating the table visualization interface, first add functions (table headers) and models (contents of the first column) to the table, then manually input the functions of each row, and after right-clicking and selecting "Save", it will be stored in the.csv format for loading historical content when opening next time.

[0025] Step S12, determine the attribute value and function information according to the function selection information; In this embodiment, after checking the relevant functions, the function attributes and corresponding function information are confirmed by identifying the check results.

[0026] Specifically, a checkbox component is nested in the table of the visualization interface, and the attribute values true / false of each option are read through this component to confirm the checked situation and the corresponding function information.

[0027] Step S13, perform function coding based on the attribute value and function information to obtain a function code; In this embodiment, the functions to be generated are determined through the function code, so as to generate the required functions; for example, 3 functions are selected in the first row, and the function code is A after calculation (such as Figure 3 the function code "0xf0" in Figure 3 ), if only 2 functions are selected, the function code is B (such as

[0028] the function code "0xff" in ), and subsequently, the selected functions and the number of selected functions can be determined through the function code, improving the coding efficiency. In the formula is the i-th function in any row of the table, and n is the total number of functions.

[0029] Step S14, generate function code based on the function code and a preset compilation template.

[0030] In this embodiment, after determining the function code, the function code is directly compiled and generated according to the corresponding compilation template, greatly improving the coding efficiency.

[0031] Specifically, after obtaining the function code, select the "Generate Code" button to issue a code generation instruction, thereby generating the corresponding function code.

[0032] Through the above steps, since visual editing is performed through the function model selection interface, model management can be made more intuitive, greatly reducing the operation difficulty. At the same time, a function code verification function can be provided to enhance the security of model management and reduce the possibility of errors. Moreover, by automatically generating function code, it can be copied and used immediately, reducing the workload, solving the problem of difficult management of software function coding, and improving the efficiency of software function coding management.

[0033] In an optional embodiment, before generating the function code based on the function code and a preset compilation template, the method further includes: Step S1401, perform reverse calculation on the function code to obtain first function selection information corresponding to the function code; Step S1402, compare the function information with the first function selection information. When the comparison result is consistent, determine that the function code is normal; otherwise, determine it as abnormal.

[0034] In this embodiment, to ensure the correct rate of code compilation, it is necessary to detect function codes and the like.

[0035] Specifically, after obtaining the function code (for example, constexpr union BMLicense::FunctionCode bm01 = 0x0C), after inputting or modifying the function code in the foregoing table interface, according to the value of each bit of the function code (0 / 1, 0 corresponds to false, 1 corresponds to true), the checked state of the corresponding function is reversely calculated and displayed in the table interface, so that the on / off status of the function can be intuitively understood.

[0036] In an optional embodiment, the generating the function code based on the function code and a preset compilation template includes: Step S141, construct a function table based on the function code and the function selection information; Step S142, fill the data in the function table into the structure body of the compilation template one by one in a preset order; Step S143, sequentially read the model information and the function code in the function table in a preset order, combine the model information and the function code, and fill the combination result into the compilation template.

[0037] In this embodiment, after the table is constructed, read the table header and the preset compilation template (assumed to be the FunctionCode template), and add the read data to the struct structure of the template one by one; then sequentially read the content of each row of the table. For each row, first read the first column of the row (i.e., the model in the table); then read the last column of the row (i.e., the function code in the table), and combine them into the initial function code: constexpr union BMLicense::FunctionCode model = functionCode; After writing the combined code into a file, the function code is obtained.

[0038] In an optional embodiment, after determining the attribute value and function information according to the function selection information, the method further includes: Step S131, determining encoding parameters according to the attribute value and function information, where the encoding parameters include a model identifier, a basic function coefficient, a model enhancement coefficient, a function switch vector, and a weight matrix corresponding to the function switch vector; Step S132, determining a performance value corresponding to the function code based on the encoding parameters.

[0039] In this embodiment, the calculation of the performance value S can be implemented by the following formula: (Formula 1) In the formula, Bc is the basic function coefficient shared by all models, such as the basic computing power of the standard algorithm, Ef is the model enhancement coefficient adjusted according to the hardware differences of the models, is a function switch vector matrix used to represent whether the control function is enabled, is the weight matrix, where, is used to represent the basic performance value of each model after encoding; is used to represent the function value that each model can be extended and superimposed; based on the above formula, the user can adjust the relevant function coefficients as needed, so as to dynamically modify the parameters, so that the final compiled code can achieve the target performance.

[0040] For example, for the software of the image processing pipeline, the parameters of model A100 are: Bc = 30, Ef = 2.5, =[1, 1, 0], =[5, 3, 2], at this time its performance value S=(30×2.5)+(1×5 + 1×3 + 0×2)=75 + 8 = 83 FPS; the parameters of model B200 are, Bc = 30, Ef = 1.8, =[1, 0, 1], =[5, 3, 2], at this time its performance value S=(30×1.8)+(1×5 + 0×3 + 1×2)=54 + 7 = 61 FPS, so at this time it is indicated to encode according to the compilation template of model A100, and so on.

[0041] Through the description of the above embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by means of software plus a necessary general hardware platform. Of course, it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art can be embodied in the form of a software product. The computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes several instructions for causing a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in various embodiments of the present invention.

[0042] In this embodiment, a multi-model software function coding device based on code is further provided. This device is used to implement the above embodiments and preferred implementation manners, and those that have been described will not be repeated. As used below, the term "module" can be a combination of software and / or hardware that can implement a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, implementation in hardware, or a combination of software and hardware is also possible and contemplated.

[0043] Figure 4 is a structural block diagram of a multi-model software function coding device based on code according to an embodiment of the present invention. As Figure 4 shown, the device includes: An information acquisition module 41, configured to acquire function selection information, where the function selection information is acquired by interactively selecting a preset visual function model selection interface; An information determination module 42, configured to determine an attribute value and function information according to the function selection information; A function coding module 43, configured to perform function coding based on the attribute value and function information to obtain a function code; A code coding module 44, configured to generate function code based on the function code and a preset compilation template.

[0044] In an optional embodiment, it further includes: A reverse calculation module, configured to perform reverse calculation on the function code to obtain first function selection information corresponding to the function code before generating the function code based on the function code and a preset compilation template; A comparison module, configured to compare the function information with the first function selection information, and determine that the function code is normal when the comparison result is consistent, otherwise it is determined to be abnormal.

[0045] In an optional embodiment, the generating function code based on the function code and a preset compilation template includes: Construct a function table based on the function code and the function selection information; Fill the data in the function table into the structure body of the compilation template one by one in a preset order; Read the model information and function code in the function table in a preset order, combine the model information and the function code, and fill the combination result into the compilation template.

[0046] In an alternative embodiment, the apparatus further comprises: After determining the attribute value and function information according to the function selection information, determine the coding parameters according to the attribute value and function information, where the coding parameters include a model identifier, a basic function coefficient, a model enhancement coefficient, a function switch vector, and a weight matrix corresponding to the function switch vector; Determine the performance value corresponding to the function code based on the coding parameters.

[0047] It should be noted that the above-mentioned modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above-mentioned modules are all located in the same processor; or, the above-mentioned modules are respectively located in different processors in any combination form.

[0048] An embodiment of the present invention further provides a computer-readable storage medium, in which a computer program is stored, where the computer program is configured to execute the steps in any one of the above method embodiments when running.

[0049] In an exemplary embodiment, the above computer-readable storage medium may include, but is not limited to: USB flash drives, read-only memories (ROM for short), random access memories (RAM for short), mobile hard disks, magnetic disks, or optical discs and other various media that can store computer programs.

[0050] An embodiment of the present invention further provides an electronic device, including a memory and a processor, where a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0051] In an exemplary embodiment, the above electronic device may further include a transmission device and an input / output device, where the transmission device is connected to the above processor, and the input / output device is connected to the above processor.

[0052] Through the description of the above embodiments, those skilled in the art can clearly understand that for the convenience and conciseness of description, only the division of the above functional modules is used as an example. In actual applications, the above functions can be allocated to different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above.

[0053] In several embodiments provided in the present application, it should be understood that the disclosed device and method can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of modules or units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the displayed or discussed couplings or direct couplings or communication connections between each other can be through some interfaces. The indirect couplings or communication connections of devices or units can be in electrical, mechanical or other forms.

[0054] The units described as separate components may or may not be physically separated. The components displayed as units may be one physical unit or multiple physical units, that is, they can be located in one place or distributed to multiple different places. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0055] In addition, each functional unit in the various embodiments of the present application can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above integrated units can be implemented in the form of hardware or in the form of software functional units.

[0056] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiments of the present application, in essence, 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. The software product is stored in a storage medium and includes several instructions to enable a device (which can be a single-chip microcomputer, a chip, etc.) or a processor to execute all or part of the steps of the methods in the various embodiments of the present application. The foregoing storage medium includes: USB flash drives, mobile hard disks, read only memory (ROM), random access memory (RAM), magnetic disks or optical disks and other various media that can store program codes.

[0057] The above content is only a specific implementation manner of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application should be covered by the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims

1. A code-based multi-model software function coding method, characterized in that including: obtaining function selection information, where the function selection information is collected after interactive selection on a preset visual function model selection interface; determining an attribute value and function information according to the function selection information; performing function encoding based on the attribute value and function information to obtain a function code; generating function code based on the function code and a preset compilation template.

2. The method according to claim 1, wherein Before generating the function code based on the function code and the preset compilation template, the method further includes: performing reverse calculation on the function code to obtain first function selection information corresponding to the function code; comparing the function information with the first function selection information, and if the comparison result is consistent, determining that the function code is normal, otherwise determining it as abnormal.

3. The method according to claim 1, wherein The generating function code based on the function code and the preset compilation template includes: constructing a function table based on the function code and the function selection information; filling the data in the function table into the structure body of the compilation template one by one according to a preset order; sequentially reading the model information and function code in the function table according to a preset order, combining the model information and the function code, and filling the combination result into the compilation template.

4. The method according to claim 1, characterized in that, After determining the attribute value and function information according to the function selection information, the method further includes: determining encoding parameters according to the attribute value and function information, where the encoding parameters include a model identifier, a basic function coefficient, a model enhancement coefficient, a function switch vector, and a weight matrix corresponding to the function switch vector; determining a performance value corresponding to the function code based on the encoding parameters.

5. A code-based multi-model software function coding device, characterized in that including: an information collection module for obtaining function selection information, where the function selection information is collected after interactive selection on a preset visual function model selection interface; an information determination module for determining an attribute value and function information according to the function selection information; a function encoding module for performing function encoding based on the attribute value and function information to obtain a function code; a code encoding module for generating function code based on the function code and a preset compilation template.

6. The device according to claim 5, characterized in that further including: a reverse calculation module for performing reverse calculation on the function code to obtain first function selection information corresponding to the function code before generating the function code based on the function code and the preset compilation template; a comparison module for comparing the function information with the first function selection information, and if the comparison result is consistent, determining that the function code is normal, otherwise determining it as abnormal.

7. The device according to claim 5, characterized in that The generating function code based on the function code and the preset compilation template includes: constructing a function table based on the function code and the function selection information; filling the data in the function table into the structure body of the compilation template one by one according to a preset order; sequentially reading the model information and function code in the function table according to a preset order, combining the model information and the function code, and filling the combination result into the compilation template.

8. The device according to claim 5, characterized in that The device further includes: After determining the attribute value and function information according to the function selection information, determine the coding parameters according to the attribute value and function information, where the coding parameters include a model identifier, a basic function coefficient, a model enhancement coefficient, a function switch vector, and a weight matrix corresponding to the function switch vector; Based on the coding parameters, determine the performance value corresponding to the function code.

9. A computer-readable storage medium, characterized in that, A computer program is stored in the computer-readable storage medium, where the computer program is configured to execute the method described in any one of claims 1 to 4 when running.

10. An electronic device, comprising a memory and a processor, characterized in that, A computer program is stored in the memory, and the processor is configured to run the computer program to execute the method described in any one of claims 1 to 4.

Citation Information

Patent Citations

  • Multi-platform data generation method and device and equipment based on visualization and medium

    CN109814853A

  • Software configuration code generation method, device and electronic equipment

    CN110413265A

  • RiscV MCU compiling method and device

    CN116339740A

  • Code generation based on spreadsheet data models

    US20120239592A1

  • Automated code generation for functional testing of software applications

    US20200110584A1