A method, device, electronic device and storage medium for generating BB files
By automatically generating BB files, using preset configuration information and code generation rules, the problem of manual code writing in the prior art is solved, and the problem of relying on professionals is achieved more efficient and accurate BB file generation.
Patent Information
- Application Number
- CN202110958758.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-08-20
- Publication Date
- 2025-02-18
- Estimated Expiration
- 2041-08-20
AI Technical Summary
In the prior art, generating BB files requires manual code writing, which makes the generation process time-consuming and dependent on professionals, affecting efficiency and accuracy.
By responding to the user's editing instructions, we can determine whether the initial BB file exists. If it does not exist, we will determine the variable to be input based on the preset BB file configuration information, obtain the variable information and generate the BB file code according to the preset code generation rules, and finally configure it Generate a complete BB file.
Reduce dependence on professionals, save manpower and time, avoid code writing errors, and improve the generation efficiency and accuracy of BB files.
Smart Images

Figure CN113626390B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to computer technology, and in particular to a method, device, electronic device and storage medium for generating a BB file. Background Art
[0002] BB files are development files with the suffix .bb. For example, BB files can be used in Yocto, an open source project that helps developers create Linux-based systems for different hardware architectures. In Yocto projects, parsing BB files ultimately generates specific target files.
[0003] The BB file describes where to get the source code, how to configure the source code, how to compile the source code, and how to install the target file to a specific path. In the current development process, staff are required to manually write BB files. The BB file syntax is complex and heavily relies on developers with rich experience in writing BB files. The process of generating BB files wastes a lot of manpower and time, affecting the accuracy and efficiency of BB file generation. Summary of the invention
[0004] The embodiment of the present invention provides a method, device, electronic device and storage medium for generating a BB file, so as to improve the generation efficiency and accuracy of the BB file.
[0005] In a first aspect, an embodiment of the present invention provides a method for generating a BB file, the method comprising:
[0006] In response to a user's editing instruction for a BB file to be generated, determining whether the BB file to be generated has an initial BB file, and if not, determining variables to be input based on preset BB file configuration information;
[0007] Obtaining variable information of the variable to be input, and generating a BB file code associated with the variable to be input according to the variable information and a preset code generation rule;
[0008] In response to the BB file generation instruction, it is determined whether the variables to be input all correspond to variable information. If so, the BB file to be generated is configured according to the BB file code.
[0009] In a second aspect, an embodiment of the present invention further provides a device for generating a BB file, the device comprising:
[0010] A module for determining variables to be input, for responding to a user's editing instruction for a BB file to be generated, determining whether the BB file to be generated has an initial BB file, and if not, determining variables to be input based on preset BB file configuration information;
[0011] A file code generation module, used for obtaining variable information of the variable to be input, and generating a BB file code associated with the variable to be input according to the variable information and a preset code generation rule;
[0012] The BB file generation module is used to respond to the BB file generation instruction, determine whether the variables to be input all correspond to variable information, and if so, configure the BB file to be generated according to the BB file code.
[0013] In a third aspect, an embodiment of the present invention further provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the method for generating a BB file as described in any embodiment of the present invention is implemented.
[0014] In a fourth aspect, an embodiment of the present invention further provides a storage medium comprising computer executable instructions, wherein the computer executable instructions are used to execute the method for generating a BB file as described in any embodiment of the present invention when executed by a computer processor.
[0015] The embodiment of the present invention judges whether an initial BB file already exists by responding to the user's editing instruction for the BB file, and generates the BB file if it does not exist. When generating the BB file, the user only needs to input the variable information of the variable to be input, and the variable information is supplemented into the preset code according to the preset code generation rule to generate a complete BB file code. In response to the user's file generation instruction, each BB file code is combined into a complete BB file. The problem of manually writing BB file codes in the prior art is solved. The staff only needs to input the variable information of the variable to be input, which reduces the dependence on professionals, saves manpower and time, avoids code writing errors, and improves the generation efficiency and accuracy of the BB file. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 It is a flowchart of a method for generating a BB file in Embodiment 1 of the present invention;
[0017] Figure 2 It is a flow chart of a method for generating a BB file in Embodiment 2 of the present invention;
[0018] Figure 3 It is a structural block diagram of a device for generating a BB file in Embodiment 3 of the present invention;
[0019] Figure 4 It is a structural schematic diagram of a BB file generation device in Embodiment 4 of the present invention. DETAILED DESCRIPTION
[0020] The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the present invention, rather than to limit the present invention. It should also be noted that, for ease of description, only parts related to the present invention, rather than all structures, are shown in the accompanying drawings.
[0021] Embodiment 1
[0022] Figure 1 The flowchart of a method for generating a BB file provided by the first embodiment of the present invention is shown in FIG. This embodiment is applicable to the case of writing a BB file, and the method can be executed by a device for generating a BB file. Figure 1 As shown, the method specifically comprises the following steps:
[0023] Step 110 , in response to the user's editing instruction for the BB file to be generated, determining whether the BB file to be generated has an initial BB file, if not, determining the variables to be input based on the preset BB file configuration information.
[0024] Among them, a BB file generation tool can be used to automatically generate BB files. The BB file generation tool can be implemented using a shell script and can be a tool with a graphical interface. As a system recipe file, the BB file describes where to obtain source code, how to configure source code, how to compile source code, and how to install target files to a specific path when the system is applied. The user can issue an editing instruction for the BB file on the graphical interface of the BB file generation tool. The editing instruction can include the file name of the BB file. For example, the file name can be "ap". After obtaining the file name, it can be determined whether the file "ap.bb" already exists in the system. If it does, it means that the file name is the initial BB file that has been generated. If it does not exist, start generating the BB file.
[0025] If it is determined that there is no initial BB file, the preset BB file configuration information is retrieved, and the variables to be input that need to be configured are determined from the BB file configuration information, that is, the BB file configuration information can include the names of the variables to be input. The variables to be input are the variables required to generate the BB file. For example, the variables to be input can include SUMMARY (a brief summary of the binary software package of the system), a license list of the recipe, dependencies when the recipe is built, a revision number of the recipe, a list of source files, an installation path, and DESCRIPTION (a simple description of the recipe), etc. The recipe refers to the content of the BB file. By default, if DESCRIPTION is not set in the BB recipe file, SUMMARY is used to define the DESCRIPTION variable. The dependencies when the recipe is built refer to the contents of other files that the BB recipe file needs to rely on when it is built, for example, header files and shared libraries, etc. The revision number of the recipe can be defaulted to "r0", and the subsequent revisions of the BB recipe file can be "r1" and "r2", etc. The source file list can tell the construction system which software packages need to be obtained and how to obtain them, for example, locally or remotely. In this embodiment, the BB recipe file refers to the BB file.
[0026] In this embodiment, optionally, if not, the variables to be input are determined based on the preset BB file configuration information, including: if the initial BB file does not exist, calling the BB file configuration information preset by the user; wherein the BB file configuration information includes the name of the variable to be input, at least one candidate language and the code generation rule of the candidate language; and displaying the name of the variable to be input and the category of the candidate language on a graphical interface.
[0027] Specifically, the user can manually input the file name of the BB file to be generated to determine whether there is a file with the same name. For example, the file name of the BB file to be generated is "ap.bb", the user inputs "ap.bb", and searches for the file of "ap.bb". If there is a file with the same name, the existing file is the initial BB file of the file name; if there is no file with the same name, it is determined that there is no initial BB file of the BB file to be generated. If there is no initial BB file of the BB file to be generated, it is determined that the BB file to be generated with the same name needs to be generated. The configuration information for generating the BB file is stored in advance, and the variables in the BB file and the syntax of the code language in the BB file are set in the configuration information. That is, the BB file configuration information may include the name of the variable to be input, at least one candidate language, and the code generation rules of the candidate language. The variable to be input is the variable that the user needs to input when generating the BB file. The candidate language is the language of the BB file code, which may include C language, C++, Java, etc. The code generation rules of the candidate language are the syntax of the generated code of each candidate language. After the BB file configuration information is retrieved, the name of the variable to be input and the category of each candidate language can be displayed on a graphical interface for the user to select and view. For example, the categories of candidate languages can be displayed on the graphical interface for the user to select, and the names of the variables to be input can be displayed on the graphical interface for the user to input the variable information at the position corresponding to the variable name to be input. The beneficial effect of such a setting is that the user can be prompted with the information to be input, so as to avoid the user missing the variables to be input, and a variety of code languages can be provided to improve the flexibility and efficiency of BB file generation.
[0028] Step 120: Obtain variable information of the variable to be input, and generate BB file code associated with the variable to be input according to the variable information and preset code generation rules.
[0029] Among them, the user enters the variable information of each variable to be input according to the name of the variable to be input prompted on the interface. The variable information is the specific content of the variable, for example, the variable information can be the description content of the installation path and the BB recipe file, etc. The code generation rules of each candidate language are pre-set. After obtaining the information of the variable input by the user, the variable information is filled into the preset code statement according to the variable information and the code generation rules, and the BB file code associated with the variable to be input of the variable information is generated. For example, when the graphical interface displays "Assign Description variable", the user can enter "Realtek Automotive Switch driver for the R-Car Gen3" at the corresponding position. According to the preset code generation rules, a BB code statement can be generated as "DESCRIPTION = "Realtek Automotive Switchdriver for the R-Car Gen3"".
[0030] In this embodiment, optionally, before obtaining variable information of the variable to be input and generating the BB file code associated with the variable to be input according to the variable information and preset code generation rules, it also includes: responding to a target language determination instruction issued by a user, determining the target language from at least two preset candidate languages.
[0031] Specifically, when generating a BB file, a default language can be used, or the target language can be determined by the user. For example, the user can select one of the candidate languages on the graphical interface as the target language, and the user's selection instruction is the target language determination instruction. The user can also enter a language category as the target language determination instruction. If the language category is pre-stored, the language entered by the user is determined as the target language; if there is no such language category, the user is prompted to redefine the target language. The beneficial effect of such a setting is that the user can select the target language according to actual needs, so that the language of the generated BB file code is a language category that is familiar to the user, which is convenient for viewing the BB file code, and improves the flexibility of BB file code generation and the efficiency of subsequent code viewing.
[0032] In this embodiment, optionally, a BB file code associated with the variable to be input is generated according to the variable information and the preset code generation rules, including: determining the code generation rules of the target language from the preset code generation rules of the candidate languages according to the target language; and obtaining the BB file code associated with the variable to be input according to the variable information and the code generation rules of the target language.
[0033] Specifically, after determining the target language, the code generation rule of the target language can be determined from the code generation rules of all preset candidate languages as the target code generation rule. According to the variable to be input corresponding to the variable information, the code statement associated with the variable to be input is searched from the target code generation rule, and the variable information is filled in the code statement to obtain the BB file code associated with the variable to be input. Each variable to be input can correspond to one or more BB file codes. If the target language is different, the BB file code generated can be different. The beneficial effect of setting like this is that, for different target languages, corresponding BB file codes can be generated, reducing the requirements for professionals, saving manpower and time. The staff only needs to input the variable information to avoid coding errors and improve the generation efficiency and precision of the BB file code.
[0034] Step 130, in response to the BB file generation instruction, determine whether all variables to be input have corresponding variable information, and if so, configure the BB file to be generated according to the BB file code.
[0035] Wherein, after all variable information of variables to be input are input, the BB file code corresponding to each variable to be input is obtained. Each time a user inputs a variable information, the corresponding BB file code can be generated, or all BB file codes can be generated after the user inputs the variable information of all variables to be input. The BB file code can be automatically generated, or it can be generated in response to the user's code generation instruction. For example, each time a user inputs a variable information of a variable to be input, the BB file code of the variable to be input is automatically generated, or it can be that the user inputs a variable information of a variable to be input, and then a code generation instruction is issued to generate the BB file code. After obtaining all BB file codes, the user can issue a BB file generation instruction. In response to the BB file generation instruction, it is judged whether all variables to be input have corresponding variable information, or it is judged whether all variables to be input have corresponding BB file codes. If so, based on the preset code generation rule, the BB file code is combined and configured to obtain a complete BB file to be generated. The code generation rule can include the generation rule of each code corresponding to each variable to be input, and can also include the code combination rule of the overall BB file. The BB file to be generated is saved. The file name of the BB file to be generated is the file name input by the user in step 110, so as to facilitate subsequent editing and modification of the BB file to be generated.
[0036] In this embodiment, optionally, after determining whether all variables to be input have corresponding variable information, it also includes: if there are variables to be input that have no corresponding variable information, a prompt message is issued on the graphical interface to prompt the user to continue inputting the variable information of the variables to be input.
[0037] Specifically, if there are one or more variables to be input without corresponding variable information, that is, when the user inputs the variable information, the input of the variable information is omitted, that is, there is at least one variable to be input without a corresponding BB file code, then a prompt message can be issued to the user on the graphical interface, informing the user of the name of the variable to be input without variable information, and prompting the user to continue to input the variable information of the variable to be input. After the user has entered the variable information, a BB file generation instruction is issued again. If it is determined that all variables to be input have variable information, a BB file to be generated is generated. The beneficial effect of such a setting is that the BB file to be generated will be generated only after ensuring that all variables to be input have corresponding variable information, avoiding the generation of erroneous BB files, improving the accuracy and completeness of the BB file to be generated, and improving the user experience.
[0038] The technical solution of this embodiment judges whether the initial BB file already exists by responding to the user's editing instruction for the BB file, and generates the BB file if it does not exist. When generating the BB file, the user only needs to input the variable information of the variable to be input, and according to the preset code generation rule, the variable information is supplemented into the preset code to generate a complete BB file code. In response to the user's file generation instruction, each BB file code is combined into a complete BB file. The problem of manually writing BB file codes in the prior art is solved. The staff only needs to input the variable information of the variable to be input, which reduces the dependence on professionals, saves manpower and time, avoids code writing errors, and improves the generation efficiency and accuracy of BB files.
[0039] Embodiment 2
[0040] Figure 2 The flowchart of a method for generating a BB file provided by the second embodiment of the present invention is further optimized based on the above embodiment. The method can be executed by a device for generating a BB file. Figure 2 As shown, the method specifically comprises the following steps:
[0041] Step 210: In response to the user's editing instruction for the BB file to be generated, it is determined whether there is an initial BB file for the BB file to be generated.
[0042] Step 220: If the initial BB file exists, the current variables and current variable information in the initial BB file are displayed on the graphical interface, and the current language used by the code in the initial BB file is determined.
[0043] Among them, the user inputs the file name, and determines whether there is a BB file with the file name. If there is a BB file with the file name, it is determined that the BB file is an initial BB file. If there is an initial BB file, each variable in the initial BB file is used as the current variable, the specific information of each variable is used as the current variable information, and the language used by the code in the initial BB file is used as the current language. The current variable, the current variable information and the current language are displayed on a graphical interface for users to view. That is, there is no need to display the entire code content, and the user does not need to view the current variable information from the overall code, which saves the user's viewing time, avoids omissions, reduces professional requirements, and improves viewing accuracy and efficiency.
[0044] Step 230: Determine the target variable information and the target variable corresponding to the target variable information according to the user's modification instruction for the current variable information.
[0045] The user can edit and modify the current variable information, for example, the file version and installation path can be modified. The user selects the current variable information to be modified, issues a modification instruction, and enters the new variable information, where the new variable information entered is the target variable information. In response to the user's modification instruction for the current variable information, the modified target variable information is obtained, and the target variable corresponding to the target variable information is determined. For example, the current variable is the revision number of the recipe, and the current variable information is "r1". If the revision number is modified, the revision number of the recipe is the target variable, and the target variable information is "r2".
[0046] Step 240: Generate target code associated with the target variable according to the target variable information and the code generation rule of the current language.
[0047] Among them, the current language used by the code in the initial BB file is determined, and the code generation rules of the preset current language are obtained. After the target variable information is determined, the target code associated with the target variable is generated according to the code generation rules of the current language. The user does not need to manually change the code, but only needs to input the updated target variable information, which reduces user operations, avoids user code writing errors, and improves the generation efficiency and accuracy of the target code.
[0048] Step 250: In response to the BB file generation instruction, a target BB file is configured according to the target code.
[0049] After all variables have been modified, the user can issue a BB file generation instruction. In response to the BB file generation instruction, the newly generated target code and the code of the current variable whose current variable information has not been modified are obtained. According to the code generation rules, the target code and the code of the current variable that has not been modified are combined and configured to obtain the target BB file. The target BB file is saved for easy calling and modification next time.
[0050] The embodiment of the present invention judges whether an initial BB file already exists by responding to a user's editing instruction for a BB file. If so, the initial BB file can be modified. The user only needs to modify the variable information without re-editing the code, and the target code of the target variable can be generated after the modification. After determining that the variable information modification is completed, the target BB file is generated in response to the user's BB file generation instruction. The problem of the prior art that the staff needs to manually write the BB file code is solved, the modification process of the BB file code is reduced, manpower and time are saved, and the generation efficiency and accuracy of the BB file are improved.
[0051] Embodiment 3
[0052] Figure 3 This is a structural block diagram of a BB file generation device provided in the third embodiment of the present invention, which can execute a BB file generation method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method. Figure 3 As shown, the device specifically includes:
[0053] The module 301 for determining variables to be input is used to determine whether the BB file to be generated has an initial BB file in response to the user's editing instruction for the BB file to be generated, and if not, determine the variables to be input based on the preset BB file configuration information;
[0054] A file code generation module 302 is used to obtain variable information of the variable to be input, and generate a BB file code associated with the variable to be input according to the variable information and a preset code generation rule;
[0055] The BB file generation module 303 is used to respond to the BB file generation instruction and determine whether the variables to be input all correspond to variable information. If so, configure the BB file to be generated according to the BB file code.
[0056] Optionally, the module 301 for determining variables to be input is specifically used for:
[0057] If the initial BB file does not exist, the BB file configuration information preset by the user is retrieved; wherein the BB file configuration information includes the name of the variable to be input, at least one candidate language and the code generation rule of the candidate language;
[0058] The name of the variable to be input and the category of the candidate language are displayed on a graphical interface.
[0059] Optionally, the device further comprises:
[0060] The target language determination module is used to determine the target language from at least two preset candidate languages in response to a target language determination instruction issued by a user before obtaining the variable information of the variable to be input and generating the BB file code associated with the variable to be input according to the variable information and a preset code generation rule.
[0061] Optionally, the file code generation module 302 includes:
[0062] A code rule determination unit, configured to determine, according to the target language, a code generation rule for the target language from code generation rules for preset candidate languages;
[0063] The code obtaining unit is used to obtain the BB file code associated with the variable to be input according to the variable information and the code generation rule of the target language.
[0064] Optionally, candidate languages include: C, C++ and Java.
[0065] Optionally, the device further comprises:
[0066] The prompt issuing unit is used to issue a prompt message on a graphical interface after determining whether all the variables to be input have corresponding variable information, if there is a variable to be input without corresponding variable information, to prompt the user to continue to input the variable information of the variable to be input.
[0067] Optionally, the device further comprises:
[0068] An initial file determination module is used for, after determining whether the BB file to be generated has an initial BB file, if the initial BB file exists, displaying the current variables and current variable information in the initial BB file on a graphical interface, and determining the current language used by the code in the initial BB file;
[0069] A variable information modification module, used to determine target variable information and a target variable corresponding to the target variable information according to a user's modification instruction for the current variable information;
[0070] A target code generation module, used to generate a target code associated with the target variable according to the target variable information and the code generation rule of the current language;
[0071] The target file configuration module is used to configure a target BB file in response to a BB file generation instruction according to the target code.
[0072] The embodiment of the present invention judges whether an initial BB file already exists by responding to the user's editing instruction for the BB file, and generates the BB file if it does not exist. When generating the BB file, the user only needs to input the variable information of the variable to be input, and the variable information is supplemented into the preset code according to the preset code generation rule to generate a complete BB file code. In response to the user's file generation instruction, each BB file code is combined into a complete BB file. The problem of manually writing the BB file code in the prior art is solved. The staff only needs to input the variable information of the variable to be input, which reduces the dependence on professionals, saves manpower and time, avoids code writing errors, and improves the generation efficiency and accuracy of the BB file.
[0073] Embodiment 4
[0074] Figure 4 BB file generation device is a schematic diagram of the structure of a BB file generation device provided by the fourth embodiment of the present invention. The BB file generation device is an electronic device, Figure 4 A block diagram of an exemplary electronic device 400 suitable for implementing embodiments of the present invention is shown. Figure 4 The electronic device 400 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0075] like Figure 4 As shown, the electronic device 400 is in the form of a general computing device. The components of the electronic device 400 may include, but are not limited to: one or more processors or processing units 401, a system memory 402, and a bus 403 connecting different system components (including the system memory 402 and the processing unit 401). In this embodiment, the electronic device 400 may also include a graphics processor.
[0076] Bus 403 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor or a local bus using any of a variety of bus structures. For example, these architectures include but are not limited to Industry Standard Architecture (ISA) bus, Micro Channel Architecture (MAC) bus, Enhanced ISA bus, Video Electronics Standards Association (VESA) local bus and Peripheral Component Interconnect (PCI) bus.
[0077] The electronic device 400 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by the electronic device 400, including volatile and non-volatile media, removable and non-removable media.
[0078] System memory 402 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 404 and / or cache memory 405. Electronic device 400 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, storage system 406 may be used to read and write non-removable, non-volatile magnetic media ( Figure 4 not shown, usually called a "hard drive"). Although Figure 4 Not shown in the figure, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk"), and an optical disk drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, a DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to bus 403 via one or more data medium interfaces. Memory 402 may include at least one program product having a set (e.g., at least one) of program modules that are configured to perform the functions of various embodiments of the present invention.
[0079] A program / utility 408 having a set (at least one) of program modules 407 may be stored, for example, in memory 402, such program modules 407 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment. Program modules 407 generally perform the functions and / or methods of the embodiments described herein.
[0080] The electronic device 400 may also communicate with one or more external devices 409 (e.g., keyboard, pointing device, display 410, etc.), one or more devices that enable a user to interact with the electronic device 400, and / or any device that enables the electronic device 400 to communicate with one or more other computing devices (e.g., network card, modem, etc.). Such communication may be performed through an input / output (I / O) interface 411. Furthermore, the electronic device 400 may also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN) and / or public network, such as the Internet) through a network adapter 412. Figure 4 As shown, the network adapter 412 communicates with other modules of the electronic device 400 via the bus 403. It should be understood that although Figure 4 Not shown, other hardware and / or software modules may be used in conjunction with electronic device 400, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0081] The processing unit 401 executes various functional applications and data processing by running the program stored in the system memory 402, for example, a method for generating a BB file provided in an embodiment of the present invention, including:
[0082] In response to a user's editing instruction for a BB file to be generated, determining whether the BB file to be generated has an initial BB file, and if not, determining variables to be input based on preset BB file configuration information;
[0083] Obtaining variable information of the variable to be input, and generating a BB file code associated with the variable to be input according to the variable information and a preset code generation rule;
[0084] In response to the BB file generation instruction, it is determined whether the variables to be input all correspond to variable information. If so, the BB file to be generated is configured according to the BB file code.
[0085] Embodiment 5
[0086] Embodiment 5 of the present invention further provides a storage medium containing computer executable instructions, on which a computer program is stored. When the program is executed by a processor, a method for generating a BB file provided in the embodiment of the present invention is implemented, including:
[0087] In response to a user's editing instruction for a BB file to be generated, determining whether the BB file to be generated has an initial BB file, and if not, determining variables to be input based on preset BB file configuration information;
[0088] Obtaining variable information of the variable to be input, and generating a BB file code associated with the variable to be input according to the variable information and a preset code generation rule;
[0089] In response to the BB file generation instruction, it is determined whether the variables to be input all correspond to variable information. If so, the BB file to be generated is configured according to the BB file code.
[0090] The computer storage medium of the embodiment of the present invention can adopt any combination of one or more computer-readable media. The computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium can be, for example, but not limited to, a system, device or device of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination of the above. More specific examples (non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this document, a computer-readable storage medium can be any tangible medium containing or storing a program, which can be used by an instruction execution system, a device or a device or used in combination with it.
[0091] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, which carry computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0092] The program code embodied on the computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
[0093] Computer program code for performing the operations of the present invention may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0094] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present invention, and the scope of the present invention is determined by the scope of the appended claims.
Claims
1. A method for generating a BB file, characterized in that: include: In response to a user's editing instruction for a BB file to be generated, determining whether there is an initial BB file for the BB file to be generated, and if there is no initial BB file, retrieving BB file configuration information preset by the user; wherein the BB file configuration information includes the name of a variable to be input, at least one candidate language, and a code generation rule for the candidate language; Displaying the name of the variable to be input and the category of the candidate language on a graphical interface; In response to a target language determination instruction issued by a user, determining a target language from at least two preset candidate languages; Obtaining variable information of the variable to be input, and determining a code generation rule of the target language from preset code generation rules of candidate languages according to the target language; According to the variable information and the code generation rule of the target language, a BB file code associated with the variable to be input is obtained; In response to the BB file generation instruction, it is determined whether the variables to be input all correspond to variable information, and if so, the BB file to be generated is configured according to the BB file code; After determining whether the BB file to be generated has an initial BB file, the method further includes: If the initial BB file exists, displaying the current variables and current variable information in the initial BB file on a graphical interface, and determining the current language used by the code in the initial BB file; Determining target variable information and a target variable corresponding to the target variable information according to a user's modification instruction for the current variable information; Generate a target code associated with the target variable according to the target variable information and a code generation rule of the current language; In response to the BB file generation instruction, a target BB file is configured according to the target code.
2. The method according to claim 1, characterized in that The candidate languages include: C, C++ and Java.
3. The method according to claim 1, characterized in that After determining whether all the variables to be input have corresponding variable information, the method further includes: If there is a variable to be input that has no corresponding variable information, a prompt message is issued on the graphical interface to prompt the user to continue inputting the variable information of the variable to be input.
4. A BB file generation device, characterized in that: include: a module for determining variables to be input, for responding to a user's editing instruction for a BB file to be generated, determining whether the BB file to be generated has an initial BB file, and if the initial BB file does not exist, retrieving BB file configuration information preset by the user; wherein the BB file configuration information includes the name of the variable to be input, at least one candidate language, and a code generation rule for the candidate language; and displaying the name of the variable to be input and the category of the candidate language on a graphical interface; A target language determination module, configured to determine a target language from at least two preset candidate languages in response to a target language determination instruction issued by a user; A code rule determination module, used to obtain the variable information of the variable to be input, and determine the code generation rule of the target language from the code generation rules of the preset candidate languages according to the target language; A code obtaining unit, used for obtaining a BB file code associated with the variable to be input according to the variable information and a code generation rule of a target language; A BB file generation module, for responding to a BB file generation instruction, determining whether all the variables to be input have corresponding variable information, and if so, configuring the BB file to be generated according to the BB file code; An initial file determination module is used for, after determining whether the BB file to be generated has an initial BB file, if the initial BB file exists, displaying the current variables and current variable information in the initial BB file on a graphical interface, and determining the current language used by the code in the initial BB file; A variable information modification module, used to determine target variable information and a target variable corresponding to the target variable information according to a user's modification instruction for the current variable information; A target code generation module, used to generate a target code associated with the target variable according to the target variable information and the code generation rule of the current language; The target file configuration module is used to configure a target BB file in response to a BB file generation instruction according to the target code.
5. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the method for generating a BB file as described in any one of claims 1 to 3 is implemented.
6. A storage medium containing computer executable instructions, characterized in that: The computer executable instructions are used to execute the BB file generation method as described in any one of claims 1 to 3 when executed by a computer processor.
Citation Information
Patent Citations
Program code generator and program
US20030110468A1
Method and system for generating program code
US20200201608A1