Editor-based budget template configuration method, device, equipment, and storage medium
Through the editor-based budget template configuration method, users can disassemble and reorganize the reference budget template and build a target budget template, which solves the problem of low budget template configuration efficiency in the property field and realizes rapid custom editing and real-time configuration of budget templates.
Patent Information
- Application Number
- CN202411389331.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-08
- Publication Date
- 2025-01-21
- Estimated Expiration
- 2044-10-08
AI Technical Summary
Budget templates in the property field require professional developers to write code, resulting in a long development cycle and the inability to quickly configure budget templates, affecting the efficiency of budget analysis.
Provide a budget template configuration method based on the editor. By constructing a template editor, analyzing the template source code of the reference budget template, it breaks it into the template data unit and the template operation unit. The user can choose and combine these units to build the target budget to build the target budget template.
When users do not have development capabilities, rapid custom editing and real-time configuration of budget templates are achieved, improving the efficiency of budget analysis.
Smart Images

Figure CN118897674B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, and in particular to an editor-based budget template configuration method, device, equipment, and storage medium. Background Art
[0002] In the field of property management, it is often necessary to calculate various budget expenditures. Traditional technology mainly relies on manual calculations by relevant financial personnel. However, the budget in the field of property management not only needs to process static data, but also needs to effectively analyze real-time data. Manual calculations can no longer meet the needs of efficiency and accuracy. As property management begins to adopt online systems, various data are connected to property servers for unified management and analysis. In some related technologies, multiple budget templates will be configured on the server. Users can select the corresponding budget template according to their own needs, and then the budget template will automatically import relevant data for budget calculation.
[0003] However, there are many kinds of funds in the property field, and the budget calculation method will change according to actual needs. The budget template requires professional developers to write code, and there is a certain development cycle. If there is a temporary budget calculation demand, the budget template cannot be configured quickly, affecting the efficiency of budget analysis. Summary of the invention
[0004] The present invention aims to solve at least one of the technical problems existing in the prior art. To this end, the present invention proposes a budget template configuration method, device, equipment, and storage medium based on an editor, which can configure the budget template in real time and improve the efficiency of budget analysis.
[0005] In a first aspect, an embodiment of the present invention provides an editor-based budget template configuration method, which is applied to a property management system. The method includes:
[0006] Constructing a template editor, wherein the template editor displays a template configuration button and at least one pre-configured reference budget template;
[0007] In response to the template configuration button being clicked, parsing the template source code of each reference budget template, decomposing the reference budget template into a plurality of template data units and a plurality of template operation units, wherein the template data unit is the smallest data unit of the reference budget template, and the template operation unit is used to represent the data operation logic;
[0008] Displaying each of the template data units and each of the template operation units in the template editor;
[0009] Based on a first selection operation of a user, determining at least one of the template data units as a target data unit, and determining at least one of the template operation units as a target operation unit;
[0010] Acquire a first source code of the target data unit and a second source code of the target operation unit from the corresponding template source code;
[0011] In response to the user's sorting and combining operations on the target data units and the target operation units, at least one target lexical unit is constructed based on the first source code and the second source code, and a target budget template is constructed based on all the target lexical units.
[0012] According to some embodiments of the present invention, the property system is in communication with a first database and a second database, the first database is used to store static business data, the second database is used to store real-time business data, and each of the template data units and each of the template operation units are displayed in the template editor, including:
[0013] Determining the template service data corresponding to each of the template data units;
[0014] Determine the template data unit storing the template service data in the first database as a first data unit, and determine the template data unit storing the template service data in the second database as a second data unit;
[0015] The first data units, the second data units, and the template operation units are displayed in the template editor, wherein the display styles of the first data units and the second data units are different.
[0016] According to some embodiments of the present invention, displaying each of the template data units and each of the template operation units in the template editor includes:
[0017] Acquire the first description information of the template data unit and the second description information of the template operation unit from the template source code, and acquire the operation source code of each of the template operation units;
[0018] When the template business data corresponding to at least two of the template data units are the same, and the respective first description information is different, displaying the respective first description information in the template editor;
[0019] When the template business data corresponding to at least two of the template data units are the same, and the respective operation source codes are different, each of the second description information is displayed in the template editor.
[0020] According to some embodiments of the present invention, after constructing the target budget template based on all the target lexical units, the method further includes:
[0021] Displaying editing options of the target data unit and the target operation unit in the template editor;
[0022] When first description update information based on the target data unit is obtained, updating the first description information in the corresponding first source code;
[0023] When obtaining the second description update information of the user based on the target operation unit, updating the second description information in the corresponding second source code;
[0024] The target budget template is determined as the reference budget template.
[0025] According to some embodiments of the present invention, constructing at least one target lexical unit based on the first source code and the second source code includes:
[0026] Deleting blank characters and code comments from the first source code and the second source code;
[0027] Performing semantic analysis and grammatical analysis on the first source code and the second source code in sequence to obtain a target analysis result;
[0028] When the target analysis result is used to indicate that the code is correct, extracting template variable names and template numerical constants from the first source code, and extracting template functions from the second source code;
[0029] The target lexical unit is constructed based on the template variable name, the template numerical constant and the template function.
[0030] According to some embodiments of the present invention, after constructing the target budget template based on all the target lexical units, the method further includes:
[0031] Determine the superior-subordinate relationship of each of the target lexical units based on the user's sorting operation;
[0032] Constructing a syntax tree based on the superior-subordinate relationship, wherein each node of the syntax tree is the target lexical unit;
[0033] The syntax tree is associated with the target budget template.
[0034] According to some embodiments of the present invention, after the template editor displays a template configuration button and at least one preconfigured reference budget template, the method further includes:
[0035] When any of the reference budget templates is selected and the template configuration button is double-clicked, the selected reference budget template is determined as an edited budget template;
[0036] Parsing the template source code of each of the reference budget templates except the edited budget template to obtain a plurality of the template data units and a plurality of the template operation units;
[0037] Determine the plurality of target lexical units of the editing budget template as editing lexical units, arrange the editing lexical units based on the syntax tree of the editing budget template, and display the target data units and the target operation units corresponding to the editing lexical units;
[0038] Based on the first selection operation of the user, determining at least one newly added data unit among the plurality of template data units, and determining at least one newly added operation unit among the plurality of template operation units;
[0039] Based on the user's second selection operation, each of the newly added data units and the newly added operation units is added to at least one of the edited lexical units;
[0040] The target budget template is constructed after updating each of the edited lexical units.
[0041] In a second aspect, an embodiment of the present invention provides an editor-based budget template configuration device, comprising at least one control processor and a memory for communicating with the at least one control processor; the memory stores instructions executable by the at least one control processor, and the instructions are executed by the at least one control processor to enable the at least one control processor to execute the editor-based budget template configuration method as described in the first aspect above.
[0042] In a third aspect, an embodiment of the present invention provides an electronic device, comprising the editor-based budget template configuration device as described in the second aspect above.
[0043] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium storing computer-executable instructions, wherein the computer-executable instructions are used to execute the editor-based budget template configuration method as described in the first aspect above.
[0044] According to the editor-based budget template configuration method of the embodiment of the present invention, there are at least the following beneficial effects: constructing a template editor, displaying a template configuration button and at least one pre-configured reference budget template in the template editor; in response to the template configuration button being clicked, parsing the template source code of each of the reference budget templates, and decomposing the reference budget template into multiple template data units and multiple template operation units, wherein the template data unit is the minimum data unit of the reference budget template, and the template operation unit is used to characterize the data operation logic; displaying each of the template data units and each of the template operation units in the template editor; based on the user's first selection operation, determining at least one of the template data units as a target data unit, and determining at least one of the template operation units as a target operation unit; obtaining a first source code of the target data unit and a second source code of the target operation unit from the corresponding template source code; in response to the user's sorting operation and combination operation on each of the target data units and each of the target operation units, constructing at least one target lexical unit based on the first source code and the second source code, and constructing a target budget template based on all of the target lexical units. According to the technical solution of the embodiment of the present invention, when the user does not have development capabilities, the template editor can be used to disassemble and reorganize the existing reference budget template, and the preset code segments can be automatically spliced to obtain the target budget template, thereby realizing real-time configuration of the budget template and improving the efficiency of budget analysis. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] Figure 1 is a schematic diagram of a budget template configuration method based on an editor provided by an embodiment of the present invention;
[0046] Figure 2 is a flowchart of a budget template configuration method based on an editor provided by another embodiment of the present invention;
[0047] Figure 3 is a complete flow chart of a budget template configuration method based on an editor provided by another embodiment of the present invention;
[0048] Figure 4 It is a structural diagram of an editor-based budget template configuration device provided by another embodiment of the present invention. DETAILED DESCRIPTION
[0049] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and cannot be understood as limiting the present invention.
[0050] In the description of the present invention, it should be understood that descriptions involving orientations, such as up, down, front, back, left, right, etc., and orientations or positional relationships indicated are based on the orientations or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be understood as a limitation on the present invention.
[0051] In the description of the present invention, "several" means one or more, "more" means more than two, "greater than", "less than", "exceed" etc. are understood as not including the number itself, and "above", "below", "within" etc. are understood as including the number itself. If there is a description of "first" or "second", it is only used for the purpose of distinguishing the technical features, and cannot be understood as indicating or implying the relative importance or implicitly indicating the number of the indicated technical features or implicitly indicating the order of the indicated technical features.
[0052] In the description of the present invention, unless otherwise clearly defined, terms such as setting, installing, connecting, etc. should be understood in a broad sense, and technicians in the relevant technical field can reasonably determine the specific meanings of the above terms in the present invention based on the specific content of the technical solution.
[0053] The embodiments of the present invention provide a budget template configuration method, apparatus, device, and storage medium based on an editor, wherein the budget template configuration method based on an editor includes: constructing a template editor, displaying a template configuration button and at least one pre-configured reference budget template in the template editor; in response to the template configuration button being clicked, parsing the template source code of each reference budget template, and decomposing the reference budget template into multiple template data units and multiple template operation units, wherein the template data unit is the minimum data unit of the reference budget template, and the template operation unit is used to characterize the data operation logic; displaying each template data unit and each template operation unit in the template editor; based on a first selection operation of a user, determining at least one template data unit as a target data unit, and determining at least one template operation unit as a target operation unit; obtaining a first source code of the target data unit and a second source code of the target operation unit from the corresponding template source code; in response to a user's sorting operation and a combination operation on each target data unit and each target operation unit, constructing at least one target lexical unit based on the first source code and the second source code, and constructing a target budget template based on all the target lexical units. According to the technical solution of the embodiment of the present invention, when the user does not have development capabilities, the template editor can be used to disassemble and reorganize the existing reference budget template, and the preset code segments can be automatically spliced to obtain the target budget template, thereby realizing real-time configuration of the budget template and improving the efficiency of budget analysis.
[0054] First, refer to Figure 1 , Figure 1A schematic diagram of an editor-based budget template configuration method provided in an embodiment of the present invention. The user of this embodiment is a property management personnel who does not have code development capabilities. A template editor is preset in the property system. Developers can pre-set multiple reference budget templates in the template editor so that each template data unit and template operation unit in the reference budget template can have a corresponding code segment. During use, the user only needs to select any number of reference budget templates in the template editor, and the reference budget template can be disassembled into multiple template data units and template operation units through the template editor. The user selects at least one target data unit and target operation unit through a first selection operation, and constructs a combination of the target data unit and the target operation unit through a simple permutation and combination operation. The template editor automatically constructs a target lexical unit based on the first source code and the second source code in the reference budget template, thereby obtaining a functional component composed of a data source and an operation mode, and then combines multiple target lexical units into a target budget template, thereby realizing rapid custom editing of the budget template and improving the efficiency of budget analysis.
[0055] Reference Figure 2 , Figure 2 A flowchart of a budget template configuration method based on an editor is provided in an embodiment of the present invention. The budget template configuration method based on an editor includes but is not limited to the following steps:
[0056] S10, constructing a template editor, and displaying a template configuration button and at least one pre-configured reference budget template in the template editor;
[0057] S20, in response to the template configuration button being clicked, parsing the template source code of each reference budget template, decomposing the reference budget template into a plurality of template data units and a plurality of template operation units, wherein the template data unit is the smallest data unit of the reference budget template, and the template operation unit is used to represent the data operation logic;
[0058] S30, displaying each template data unit and each template operation unit in the template editor;
[0059] S40, based on the user's first selection operation, determining at least one template data unit as a target data unit, and determining at least one template operation unit as a target operation unit;
[0060] S50, acquiring a first source code of a target data unit and a second source code of a target operation unit from a corresponding template source code;
[0061] S60, in response to the user's sorting and combining operations on each target data unit and each target operation unit, construct at least one target lexical unit based on the first source code and the second source code, and construct a target budget template based on all the target lexical units.
[0062] It should be noted that the reference budget template is pre-set by a developer with coding ability, so that the template editor has a code basis for multiple template data units and template operation units. The reference budget template can involve various projects and data in property management, so that each data type and data operation in the database can have a code basis in the template editor, and users can achieve data and function reorganization through the template editor. Each reference budget template has different content or different calculation methods, and the template data units and template operation units involved can overlap, and a budget calculation function can be achieved through a reference budget template.
[0063] For example, Figure 1 As shown, resident care template 1, resident care template 2 and resident care template 3 are all used to calculate the budget for resident care. Therefore, the three templates can simultaneously have template data units representing resident information and template operation units representing summary calculations. The difference between the three can be the different care methods. For example, resident care template 1 is used to distribute condolence money, resident care template 2 is used to reduce property management fees, and resident care template 3 is used to purchase condolence gifts. No further limitations are made here.
[0064] For example, continue to refer to Figure 1 The template data units of the resident care template 1 and the maintenance fee template 1 are different. The template data unit of the resident care template 1 includes care expenditure A, and the template data unit of the maintenance fee template 1 includes maintenance expenditure. The template operation units may be partially the same, for example, both include summary calculations, while the resident care template 1 also includes taking the average value, and the maintenance fee template 1 also includes an output list.
[0065] It should be noted that when the template configuration button is clicked, the template editor decomposes each reference budget template into corresponding template data units and template operation units through code parsing. The template data unit is the smallest data unit that references a data type, for example Figure 1 The household information shown in is used to obtain the household information of each household in the community from the database. Figure 1 The maintenance expenditure is used to obtain information such as material cost and labor cost of maintenance expenditure from the database. The template operation unit is the data operation logic for a data set, for example Figure 1 The summary calculation, averaging, etc. shown in , can execute certain operation logic on the data obtained by the template data unit.
[0066] It is worth noting that the template data unit is used to obtain data from the database, and the template operation unit is used to operate and process the data, so the template operation unit and the template data unit can be combined in any way and in any number of combinations. For example, two template data units and one template operation unit can be selected in one target lexical unit to perform the same processing on two data, or one template data unit and two template operation units can be selected to perform two processing on one data. This embodiment displays the description information of the template data unit and the template operation unit in the template editor to ensure that the user can select the correct combination to obtain the correct budget calculation result.
[0067] It should be noted that the first selection operation may be to select from a list of options, such as Figure 1 As shown, the template data unit and the template operation unit are displayed in the list, and any number of target operation units and target data units can be selected by clicking.
[0068] It should be noted that, according to the description of the above embodiment, the reference budget template is a pre-developed template, so it has a code base. When the reference budget template is disassembled, the template source code can be directly split into the source codes of each template data unit and template operation unit. The source code of the template data unit is used to obtain the corresponding data from the database, and the source code of the template operation unit is used to execute the data operation logic. After determining the target data unit and the target operation unit, the first source code of the target data unit and the second source code of the target operation unit can be directly obtained. The first source code and the second source code are not displayed in the template editor, but are saved in the background as a backup. The user can arrange and combine the selected target data unit and target operation unit to obtain multiple target lexical units, each target lexical unit is a functional unit of a data operation, and the target lexical unit can be a Token in the editor. The template editor combines and compiles the source code of the target data unit and the target operation unit in the same combination to obtain the corresponding Token, which is the target lexical unit.
[0069] For example, Figure 1 As shown, the target data units selected by the user include care expenditure A, care expenditure B and maintenance expenditure, and the selected target operation units include summary calculation, calculation of balance after allocation, balance allocation and output list. Care expenditure A and calculation of balance after allocation are combined into lexical unit 1, balance allocation, care expenditure B and calculation of balance after allocation are combined into lexical unit 2, and balance allocation, maintenance expenditure, summary calculation and output list are combined into lexical unit 3, thereby obtaining 3 target lexical units, each of which can realize a data processing function.
[0070] It should be noted that this embodiment combines multiple target lexical units into a target budget template so that the target budget template can realize the data processing function reorganized by the user. After obtaining the target budget template, the template can be run to realize the configured data processing process. The specific template application is not described in detail here.
[0071] Through the technical solution of this embodiment, a developer with code development capabilities pre-sets multiple reference budget templates in the template editor, so that the template editor has the code basis of all optional template data units and template operation units. During use, the user does not need to have code development capabilities, and only needs to select any number of reference budget templates in the template editor, and the reference budget template can be disassembled into multiple template data units and template operation units through the template editor. The user selects at least one target data unit and target operation unit through the first selection operation, and after simple permutations and combinations, the template editor automatically constructs a target lexical unit based on the first source code and the second source code in the reference budget template, thereby obtaining a functional component composed of a data source and an operation mode, and then combining multiple target lexical units into a target budget template, thereby realizing rapid custom editing of the budget template and improving the efficiency of budget analysis.
[0072] In addition, in one embodiment, the property system is connected to a first database and a second database, the first database is used to store static business data, and the second database is used to store real-time business data. Figure 3 Step S30 specifically includes but is not limited to the following steps:
[0073] S31, determining the template business data corresponding to each template data unit;
[0074] S32, determining a template data unit storing template service data in the first database as a first data unit, and determining a template data unit storing template service data in the second database as a second data unit;
[0075] S33, displaying each first data unit, each second data unit and each template operation unit in the template editor, wherein the display styles of the first data unit and the second data unit are different.
[0076] It should be noted that the first database and the second database store different types of data respectively, and different storage resources and transmission resources are configured for the first database and the second database, so as to improve resource utilization. For example, a larger storage resource is allocated to the first database for storing static business data, and a higher transmission resource is allocated to the second database, so as to achieve timely transmission of real-time data. Static business data refers to data with a low frequency of change in property management, such as household information, staff information, etc. Real-time business data refers to data with a high frequency of change in property management, such as real-time care expenses, maintenance expenses, and management fees paid by users.
[0077] It should be noted that in order to distinguish between static business data and dynamic business data, after splitting out the template data units, this embodiment further determines the storage area of the template business data based on the data reference address of each template data unit. When the template business data is stored in the first database, it is determined as the first data unit, and when it is stored in the second database, it is determined as the second data unit. The first data unit and the second data unit are displayed in different styles in the template editor, for example, by different font colors for distinguishing display. The specific display style is not limited here.
[0078] In addition, in one embodiment, referring to Figure 3 Step S30 specifically includes but is not limited to the following steps:
[0079] S34, acquiring first description information of the template data unit and second description information of the template operation unit from the template source code, and acquiring operation source code of each template operation unit;
[0080] S35, when the template business data corresponding to at least two template data units are the same, and the respective first description information is different, displaying the respective first description information in the template editor;
[0081] S36, when the template business data corresponding to at least two template data units are the same and their respective operation source codes are different, each second description information is displayed in the template editor.
[0082] It should be noted that the template data unit and the template operation unit will record corresponding attributes in the template source code. In this embodiment, the first description information and the second description information are added to the data attributes, and the first description information is used as the data description of the template data unit. For example Figure 1 The "household information" shown is used as the first description information, and the "aggregate calculation" is used as the second description information, so that the user can determine the data corresponding to the template data unit based on the first description information, and determine the operation corresponding to the template operation unit based on the second description information. The specific first description information and the second description information can be set according to actual needs, and no limitation is made here.
[0083] It is worth noting that different reference budget templates may involve the same template data unit, but the same template data unit may be described with different first description information in different reference budget templates, and the same is true for the template operation unit. Figure 1 As shown, the reference budget template includes resident care template 1 and resident care template 2. The two templates are respectively used by the finance department and the customer service department of property management. The template business data of care expenses is involved in both templates, but the first description information defined in resident care template 1 is care expenditure A, and the first description information defined in resident care template 2 is care expenditure B, which is used to distinguish the customary description methods of the finance department and the customer service department. After disassembling the two reference budget templates, although the template business data corresponding to care expenditure A and care expenditure B are the same, the first description information is different. Therefore, the two first description information are displayed in the template editor at the same time, so that users in each department can select the corresponding target data unit according to their own habits, thereby improving ease of use.
[0084] In addition, in one embodiment, referring to Figure 3 After executing step S60, the following steps are also included but not limited to:
[0085] S71, displaying editing options of the target data unit and the target operation unit in the template editor;
[0086] S72, when the first description update information based on the target data unit is obtained, the first description information is updated in the corresponding first source code;
[0087] S73, when the second description update information based on the target operation unit is obtained, the second description information is updated in the corresponding second source code;
[0088] S74, determining the target budget template as the reference budget template.
[0089] It should be noted that after determining the target data unit and the target operation unit, this embodiment displays an editing option in the template editor, and each of the first description information and the second description information can be updated to improve the convenience of use.
[0090] It should be noted that after obtaining the first description update information and the second description update information, the reference preset template corresponding to the target data unit is knowable, so the corresponding first source code or the second source code can be located, so that the corresponding attributes can be modified in the corresponding code, so that the updated description information is displayed in the template editor after being decomposed, thereby realizing the name customization of the template data unit and the template operation unit.
[0091] In addition, in one embodiment, referring to Figure 3 Step S60 specifically includes but is not limited to the following steps:
[0092] S61, deleting blank characters and code comments of the first source code and the second source code respectively;
[0093] S62, performing semantic analysis and grammatical analysis on the first source code and the second source code in sequence to obtain a target analysis result;
[0094] S63, when the target analysis result is used to indicate that the code is correct, extract the template variable name and the template value constant from the first source code, and extract the template function from the second source code;
[0095] S64, construct a target lexical unit based on the template variable name, template numerical constant and template function.
[0096] It should be noted that after selecting the target data unit and the target operation unit, the code needs to be reconstructed to combine them to obtain the target lexical unit. This embodiment first deletes the blank characters and code comments in the first source code and the second source code, and deletes the content that does not belong to the code.
[0097] It should be noted that after deleting the content other than the code, the first source code can be semantically analyzed in turn to check the consistency of the source code semantics to ensure that each definition, variable and function conforms to the semantics specified by the relevant language, such as whether the variables in the first source code or the second source code have been declared and whether the types match.
[0098] It should be noted that the grammatical analysis can be completed by a common grammatical analyzer, which outputs the word information units corresponding to the first source code and the second source code, and analyzes the word information units according to the grammatical rules of the language to ensure the accuracy of the grammatical hierarchy. For example, a target operation unit references multiple layers of data, each layer of data corresponds to a target data unit, and the reference order of each target data unit is correct, then the grammatical hierarchy is accurate.
[0099] It should be noted that when the target analysis result characterizes the code correctly, it can be determined that the first source code and the second source code can be combined, and the template variable name and template value constant are extracted from the first source code, and the corresponding template business data are represented by the variable name and constant, and the template function is extracted from the second source code, and the operation logic is represented by the template function, and the template variable name, template value constant and template function are reconstructed into the target lexical unit. When the user does not involve code editing, the reorganization of the code module is completed through the template editor to obtain a new customized target budget template, thereby improving the efficiency of template construction.
[0100] In addition, in one embodiment, referring to Figure 3After executing step S60, the following steps are also included but not limited to:
[0101] S81, determining the superior-subordinate relationship of each target lexical unit based on the user's sorting operation;
[0102] S82, constructing a syntax tree based on the superior-subordinate relationship, wherein each node of the syntax tree is a target lexical unit;
[0103] S83, associating the syntax tree with the target budget template.
[0104] It should be noted that, in the related art, the construction of the syntax tree is usually completed during syntax analysis, and the syntax tree of the target budget template of this embodiment involves multiple target lexical units. Therefore, after constructing each target lexical unit, this embodiment constructs a syntax tree based on the superior-subordinate relationship of the target lexical units. Each node of the syntax tree is a target lexical unit, so that the operation chain of the target budget template is recorded through the syntax tree.
[0105] For example, Figure 1 As shown, after constructing lexical unit 1, lexical unit 2 and lexical unit 3, lexical unit 1 is placed in the first place by dragging, lexical unit 2 is placed after lexical unit 1, and lexical unit 3 is placed after lexical unit 2. When constructing a syntax tree, each target lexical unit is at the same level, and there is an order of execution. This embodiment uses the order of precedence as the superior-subordinate relationship, and constructs three layers of nodes in the syntax tree, and each node corresponds to a target lexical unit.
[0106] In addition, in one embodiment, referring to Figure 3 After step S10, the following steps are also included but not limited to:
[0107] S11, when any reference budget template is selected and the template configuration button is double-clicked, the selected reference budget template is determined as the edited budget template;
[0108] S12, parsing the template source code of each reference budget template except the edited budget template to obtain a plurality of template data units and a plurality of template operation units;
[0109] S13, determining multiple target lexical units of the edit budget template as edit lexical units, arranging the edit lexical units based on the syntax tree of the edit budget template, and displaying the target data units and target operation units corresponding to the edit lexical units;
[0110] S14, based on the user's first selection operation, determining at least one newly added data unit from a plurality of template data units, and determining at least one newly added operation unit from a plurality of template operation units;
[0111] S15, based on the user's second selection operation, adding each newly added data unit and each newly added operation unit to at least one edited lexical unit;
[0112] S16, building a target budget template after updating each edited lexical unit.
[0113] It should be noted that the template editor includes various reference budget templates. This embodiment not only can disassemble and reorganize all reference budget templates to obtain new target budget templates, but also can directly use the reference budget template as the target budget template, or further edit the reference budget template into a target budget template.
[0114] It should be noted that in the scenario where the reference budget template is further edited to become a target budget template, the user can click on any reference budget template in the template editor, and distinguish it from the reference budget module by double-clicking it. After double-clicking, the reference budget template is determined as the edited budget template, and the remaining other reference budget templates are disassembled to obtain the template data unit and template operation unit described in the above embodiment. The template data unit and template operation unit are used as functional plug-ins to insert the selected new data unit and new operation unit into the edited budget template, thereby adding or modifying the functions of the edited budget template to make the template editable.
[0115] It should be noted that after disassembling each reference budget template, this embodiment expands the structure of the edited budget template in the template editor, expands multiple edited lexical units of the edited budget template, and arranges the edited lexical units according to the syntax tree obtained when constructing the edited budget template, thereby reflecting the data processing level of the edited budget template. On this basis, after further determining the newly added data unit and the newly added operation unit through the first selection operation (clicking the option), they are added to the edited lexical unit through the second selection operation, and the second selection operation can be a drag operation.
[0116] It should be noted that after adding the new data unit and the new operation unit to the editing lexical unit, semantic analysis and syntactic analysis can be performed according to the above embodiment, and then the source code corresponding to the new data unit and the new operation unit can be added on the basis of the editing lexical unit to obtain a new editing lexical unit.
[0117] It should be noted that after the functional update of editing lexical units is implemented, since the syntax tree is determined, the new target budget template is directly rebuilt according to the syntax tree, thereby updating the reference budget template and improving the flexibility of template editing. It is also possible to add new functions to the existing reference budget template and reduce the complexity of template configuration.
[0118] like Figure 4 As shown, Figure 4: is a structural diagram of a budget template configuration device based on an editor provided by an embodiment of the present invention. The present invention also provides a budget template configuration device based on an editor, comprising:
[0119] The processor 401 may be implemented by a general-purpose central processing unit (CPU), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present application;
[0120] The memory 402 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 402 can store an operating system and other application programs. When the technical solution provided in the embodiment of this specification is implemented by software or firmware, the relevant program code is stored in the memory 402, and the processor 401 calls and executes the budget template configuration method based on the editor in the embodiment of this application;
[0121] Input / output interface 403, used to implement information input and output;
[0122] Communication interface 404, used to realize communication interaction between the device and other devices, which can be realized through wired mode (such as USB, network cable, etc.) or wireless mode (such as mobile network, WIFI, Bluetooth, etc.);
[0123] A bus 405 that transmits information between various components of the device (e.g., processor 401, memory 402, input / output interface 403, and communication interface 404);
[0124] The processor 401 , the memory 402 , the input / output interface 403 and the communication interface 404 are connected to each other in communication within the device via the bus 405 .
[0125] An embodiment of the present application also provides an electronic device, comprising the editor-based budget template configuration device as described above.
[0126] An embodiment of the present application further provides a storage medium, which is a computer-readable storage medium and stores a computer program. When the computer program is executed by a processor, the above-mentioned editor-based budget template configuration method is implemented.
[0127] As a non-transient computer-readable storage medium, the memory can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage devices. In some embodiments, the memory may optionally include a memory remotely arranged relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned networks include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof. The device embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and are implemented to be located in one place, or may also be distributed to multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the present embodiment.
[0128] It will be appreciated by those skilled in the art that all or some of the steps and systems in the methods disclosed above may be implemented as software, firmware, hardware, and appropriate combinations thereof. Some or all physical components may be implemented as software executed by a processor, such as a central processing unit, a digital signal processor, or a microprocessor, or as hardware, or as an integrated circuit, such as an application-specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or non-transitory medium) and a communication medium (or transient medium). As known to those skilled in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disk (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, disk storage or other magnetic storage devices, or any other medium that can be used to store desired information and can be accessed by a computer. Furthermore, it is well known to those skilled in the art that communication media typically include computer readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.
[0129] The above is a specific description of the preferred implementation of the present invention, but the present invention is not limited to the above-mentioned implementation mode. Technical personnel familiar with the field can also make various equivalent deformations or substitutions under the shared conditions without violating the spirit of the present invention. These equivalent deformations or substitutions are all included in the scope defined by the claims of the present invention.
Claims
1. A budget template configuration method based on an editor, characterized in that: Applied to a property system, the method includes: Constructing a template editor, wherein the template editor displays a template configuration button and at least one pre-configured reference budget template; In response to the template configuration button being clicked, parsing the template source code of each reference budget template, decomposing the reference budget template into a plurality of template data units and a plurality of template operation units, wherein the template data unit is the smallest data unit of the reference budget template, and the template operation unit is used to represent the data operation logic; Displaying each of the template data units and each of the template operation units in the template editor; Based on a first selection operation of a user, determining at least one of the template data units as a target data unit, and determining at least one of the template operation units as a target operation unit; Acquire a first source code of the target data unit and a second source code of the target operation unit from the corresponding template source code; In response to the user's sorting and combining operations on each of the target data units and each of the target operation units, at least one target lexical unit is constructed based on the first source code and the second source code, and a target budget template is constructed based on all of the target lexical units; Constructing at least one target lexical unit based on the first source code and the second source code includes: Deleting blank characters and code comments from the first source code and the second source code; Performing semantic analysis and grammatical analysis on the first source code and the second source code in sequence to obtain a target analysis result; When the target analysis result is used to indicate that the code is correct, extracting template variable names and template numerical constants from the first source code, and extracting template functions from the second source code; Constructing the target lexical unit based on the template variable name, the template numerical constant and the template function; After constructing the target budget template based on all the target lexical units, the method further includes: Determine the superior-subordinate relationship of each of the target lexical units based on the user's sorting operation; Constructing a syntax tree based on the superior-subordinate relationship, wherein each node of the syntax tree is the target lexical unit; associating the syntax tree to the target budget template; After the template editor displays a template configuration button and at least one preconfigured reference budget template, the method further includes: When any of the reference budget templates is selected and the template configuration button is double-clicked, the selected reference budget template is determined as an edited budget template; Parsing the template source code of each of the reference budget templates except the edited budget template to obtain a plurality of the template data units and a plurality of the template operation units; Determine the plurality of target lexical units of the editing budget template as editing lexical units, arrange the editing lexical units based on the syntax tree of the editing budget template, and display the target data units and the target operation units corresponding to the editing lexical units; Based on the first selection operation of the user, determining at least one newly added data unit from the plurality of template data units, and determining at least one newly added operation unit from the plurality of template operation units; Based on the user's second selection operation, each of the newly added data units and the newly added operation units is added to at least one of the edited lexical units; The target budget template is constructed after updating each of the edited lexical units.
2. The editor-based budget template configuration method according to claim 1, characterized in that: The property system is connected to a first database and a second database in communication, the first database is used to store static business data, and the second database is used to store real-time business data. The template editor displays each of the template data units and each of the template operation units, including: Determining the template service data corresponding to each of the template data units; Determine the template data unit storing the template service data in the first database as a first data unit, and determine the template data unit storing the template service data in the second database as a second data unit; The first data units, the second data units, and the template operation units are displayed in the template editor, wherein the display styles of the first data units and the second data units are different.
3. The editor-based budget template configuration method according to claim 2, characterized in that: Displaying each of the template data units and each of the template operation units in the template editor includes: Acquire the first description information of the template data unit and the second description information of the template operation unit from the template source code, and acquire the operation source code of each of the template operation units; When the template business data corresponding to at least two of the template data units are the same, and the respective first description information is different, displaying the respective first description information in the template editor; When the template business data corresponding to at least two of the template data units are identical and the respective operation source codes are different, each of the second description information is displayed in the template editor.
4. The editor-based budget template configuration method according to claim 3, characterized in that: After constructing the target budget template based on all the target lexical units, the method further includes: Displaying editing options of the target data unit and the target operation unit in the template editor; When first description update information based on the target data unit is obtained, updating the first description information in the corresponding first source code; When obtaining the second description update information of the user based on the target operation unit, updating the second description information in the corresponding second source code; The target budget template is determined as the reference budget template.
5. A budget template configuration device based on an editor, characterized in that: It includes at least one control processor and a memory for communicating with the at least one control processor; the memory stores instructions that can be executed by the at least one control processor, and the instructions are executed by the at least one control processor to enable the at least one control processor to execute the editor-based budget template configuration method as described in any one of claims 1 to 4.
6. An electronic device, characterized in that: Includes the editor-based budget template configuration device described in claim 5.
7. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable a computer to execute the editor-based budget template configuration method according to any one of claims 1 to 4.
Citation Information
Patent Citations
Interface generation method and device, equipment and medium
CN118012431A