Scheme project parameter acquisition method and device, electronic equipment and storage medium
By looping through the first project index to obtain weighted values in the two-dimensional array, the complexity and omissions of project parameter acquisition in complex solutions are solved, and convenient, accurate and complete project parameter acquisition is achieved.
Patent Information
- Application Number
- CN202510578429.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-07
- Publication Date
- 2025-08-15
AI Technical Summary
When obtaining the weighted values of each project portfolio in complex solutions, the existing technology requires complex retrieval, resulting in large workloads and easy missed related project parameters, which cannot be accurately obtained.
Through a circular traversal based on the first project index, the weighted values of all second projects under the first project are quickly locked, and the two-dimensional array is used for automatic acquisition until the numerical values specified by the index reach the total number, ensuring the completeness and accuracy of the acquisition.
It realizes convenient, accurate and complete acquisition of project parameters, avoids complex retrieval and omission, and improves the efficiency of the acquisition process.
Smart Images

Figure CN120492455A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing, and specifically to a method, device, electronic device and storage medium for obtaining solution project parameters. Background Art
[0002] Complex solutions include multiple project combinations. Each project combination includes different first projects and second projects under each first project. There are also multiple second projects under each first project, which makes the project combination forms diverse. To quickly know the loss of multiple project combinations in a complex solution, you need to know the weighted value of each second project, so as to calculate the total loss value of each project combination.
[0003] However, obtaining the weighted value of the related second project requires a complex search in a complex solution, which is labor-intensive and difficult to obtain accurately. At the same time, during the related search process, the second project under the related first project is easily missed, resulting in missing project parameters. Summary of the Invention
[0004] In view of the above problems, the present application provides a method, device, electronic device and storage medium for obtaining scheme project parameters, so as to quickly lock the corresponding first project in a cyclic manner based on the first project index and obtain the weighted values of all the second projects under it, thereby ensuring the convenience, accuracy and completeness of project parameter acquisition.
[0005] According to one aspect of the present application, a method for obtaining scheme project parameters is provided, the obtaining method comprising: detecting whether the numerical value referred to by the first project index is less than the total number of elements in the project weighted array; wherein the project weighted array is a two-dimensional array composed of a first project and a second project, and the second project is a sub-project subordinate to the first project; if less than, obtaining the weighted values of all second projects under the first project corresponding to the numerical value from the project weighted array, and updating the first project index to obtain the updated numerical value referred to by the first project index; if the updated numerical value is less than the total number, obtaining the weighted values of all second projects under the first project corresponding to the updated numerical value from the project weighted array, until the updated numerical value referred to by the first project index is greater than or equal to the total number.
[0006] In an optional manner, the acquisition method further includes: combining the second items in different first items to obtain multiple schemes; wherein each scheme includes one second item in each first item; summing the weighted values of all second items in each scheme, and printing the calculated sum and the original values of the second items in each scheme; wherein the original value is obtained from the original array of items based on the first item index and the second item index.
[0007] In an optional manner, the acquisition method further includes: in response to the project configuration information input by the user, taking each first item in the project configuration information as a first-dimensional element, and taking the second item under each first item as a second-dimensional element; based on the first-dimensional element corresponding to each first item, and the respective corresponding second-dimensional elements, constructing the initial array elements corresponding to each first item, and inserting the original values of the second items under each first item into the corresponding initial array elements to obtain the original value array elements corresponding to each first item; based on the original value array elements corresponding to each first item, constructing the original array of the project.
[0008] In an optional manner, the acquisition method also includes: multiplying the original value of each second item in the project configuration information by the weight coefficient of the first project to which it belongs, to obtain the weighted value of each second item; inserting the weighted value of the second item under each first item into the corresponding initial array element, to obtain the weighted value array element corresponding to each first item; based on the weighted value array elements corresponding to each first item, constructing the project weight array.
[0009] In an optional manner, the acquisition method further includes: in response to the project configuration information updated by the user, constructing an updated initial array element based on the first item and the second item in the updated project configuration information; multiplying the original value of each second item in the updated project configuration information by the weight coefficient of the first item to which it belongs to obtain the updated weighted value of each second item; and updating the project weighted array based on the updated weighted value of each second item and the updated initial array element.
[0010] In an optional manner, the first item index is updated to obtain an updated value referred to by the first item index, including: adding one to the value referred to by the first item index, and using the added value as the updated value referred to by the first item index.
[0011] In an optional manner, the weighted values of all second items under the first item corresponding to the numerical value are obtained from the item weighted array, including: determining the target first item corresponding to the numerical value referred to by the first item index in the item weighted array; traversing each second item in the target first item based on the second item index, and obtaining the weighted values of the traversed second items to obtain the weighted values of all second items under the target first item.
[0012] According to another aspect of the present application, a device for acquiring scheme project parameters is provided, the acquisition device comprising: a detection module for detecting whether the numerical value referred to by the first project index is less than the total number of elements in the project weighted array; wherein the project weighted array is a two-dimensional array composed of a first project and a second project, and the second project is a sub-project subordinate to the first project; a first acquisition module for, if less than, acquiring the weighted values of all second projects subordinate to the first project corresponding to the numerical value from the project weighted array, and updating the first project index to obtain the updated numerical value referred to by the first project index; a second acquisition module for, if the updated numerical value is less than the total number, acquiring the weighted values of all second projects subordinate to the first project corresponding to the updated numerical value from the project weighted array, until the updated numerical value referred to by the first project index is greater than or equal to the total number.
[0013] According to one aspect of the present application, an electronic device is provided, including: a controller; and a memory for storing one or more programs, wherein when the one or more programs are executed by the controller, the above-mentioned acquisition method is executed.
[0014] According to one aspect of the present application, a computer-readable storage medium is further provided, on which computer-readable instructions are stored. When the computer-readable instructions are executed by a processor of a computer, the computer executes the above-mentioned acquisition method.
[0015] According to one aspect of the present application, a computer program product or computer program is also provided, the computer program product or computer program including computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the above-described acquisition method.
[0016] In the present application, if it is detected that the value indicated by the first project index is less than the total number of elements in the project weighted array, the weighted values of all the second projects under the first project corresponding to the value are obtained one by one in a targeted and cyclic manner from the weighted array, thereby ensuring the accuracy of the project parameter acquisition process, while avoiding missing weighted values and ensuring the acquisition of complete project parameters. The present application does not require complicated data retrieval, but automatically locks the corresponding first project through the first project index, that is, the value of the first project index is updated in a timely manner, thereby cyclically obtaining the weighted values of all the second projects under each first project, until the updated value indicated by the first project index is greater than or equal to the total number of elements in the project weighted array, thereby achieving the purpose of cyclically automatically obtaining relevant project parameters, thereby making the acquisition process more convenient and quick.
[0017] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] The accompanying drawings are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present application, and together with the specification, are used to explain the principles of the present application. Obviously, the drawings described below are only some embodiments of the present application, and it is clear that a person of ordinary skill in the art can derive other drawings based on these drawings without inventive effort.
[0019] Figure 1 It is a flowchart of a method for obtaining project parameters of a solution shown in an exemplary embodiment of the present application.
[0020] Figure 2 is based on Figure 1 The exemplary embodiment shown is a flow chart of another method for obtaining project parameters.
[0021] Figure 3 This is an editing page for users to configure project information, shown in an exemplary embodiment of the present application.
[0022] Figure 4 It is a structural diagram of a device for obtaining scheme project parameters shown in an exemplary embodiment of the present application.
[0023] Figure 5 It is a structural diagram of a computer system of an electronic device shown in an exemplary embodiment of the present application. DETAILED DESCRIPTION
[0024] Exemplary embodiments will be described in detail herein, with examples illustrated in the accompanying drawings. When the following description refers to the drawings, identical numerals in different figures represent identical or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments are not intended to represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.
[0025] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically separate entities. That is, these functional entities may be implemented in software, in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.
[0026] The flowcharts shown in the accompanying drawings are for illustrative purposes only and do not necessarily include all contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps may be decomposed, while others may be combined or partially combined. Therefore, the actual execution order may vary depending on the actual situation.
[0027] In this application, "plurality" refers to two or more. "And / or" describes the relationship between related objects, indicating that three possible relationships exist. For example, "A and / or B" can mean: A exists alone, A and B exist simultaneously, and B exists alone. The character " / " generally indicates that the related objects are in an "or" relationship.
[0028] Complex plans include various project combinations. Each project combination includes different first projects and second projects under each first project. Due to the large number of project combinations, it is necessary to obtain the weighted values of all second projects in the relevant project combinations to calculate the total loss value of each project combination.
[0029] However, obtaining the weighted value of the related second project requires a complex search in a complex solution, which is labor-intensive and difficult to obtain accurately. At the same time, during the related search process, the second project under the related first project is easily missed, resulting in missing project parameters.
[0030] To this end, one aspect of this application provides a method for obtaining program project parameters. Figure 1 , Figure 1 This is a flow chart of a method for obtaining project parameters according to an exemplary embodiment of the present application. The method includes at least S110 to S130, which are described in detail as follows:
[0031] S110: Detect whether the value indicated by the first item index is less than the total number of elements in the item weighted array; wherein the item weighted array is a two-dimensional array composed of the first item and the second item, and the second item is a sub-item of the first item.
[0032] The first item index is used to traverse the first item. The first item index can be used to quickly lock the first item corresponding to the value it refers to. For example, if the first item index is 1, the first item it locks to is first item 1; if the first item index is 2, the first item it locks to is first item 2. The first item index is not limited to locking and traversing the first item in the item weighted array; it can also be used to lock and traverse parameters in other arrays.
[0033] The total number of elements in the project weighted array of the present application is the same as the total number of first items in the project weighted array. For example, the first item in the project weighted array includes: first item A, first item B, and first item C, then the total number of elements in the project weighted array is three.
[0034] The item weighted array includes multiple arrays. This application only limits the number of elements to the same as the number of first items, and does not limit whether the number of elements in the item weighted array is the same as the number of arrays in the item weighted array. The number of arrays can be the same as the number of elements or different, and needs to be distinguished according to the specific definition of the array in the item weighted array:
[0035] For example, the number of elements is the same as the number of arrays: the element is the array, and the number of elements in the item weighted array is the same as the number of arrays. For example, the item weighted array includes the array [A, 1] and the array [B, 1]; wherein, the array [A, 1] indicates that the first item is A, and it has only one second item under it, and the array [B, 1] indicates that the first item is B, and it has only one second item under it.
[0036] Another exemplary case is when the number of elements is the same as the number of arrays: each array corresponds to a corresponding first item, that is, an array can be understood as a collection of weighted values of all second items under a first item. For example, the item weighted array includes the array [A, a] of the first item A, the array [B, b] of the first item B, and the array [C, c] of the first item C; wherein each array includes the weighted values of all second items under it, for example, [A, a] includes the weighted values of three second items, [B, b] includes the weighted values of two second items, and [C, c] includes the weighted value of one second item.
[0037] Another exemplary case where the number of elements is different from the number of arrays: the item weighted array includes the arrays [A, 1] and [A, 2] of the first item A, the arrays [B, 1] and [B, 2] of the first item B, and the array [C, 1] of the first item C, that is, the number of arrays in the item weighted array is 5. In this scenario, the number of first items in the item weighted array is 3, that is, the number of elements in the item weighted array is 3. Obviously, the number of elements is different from the number of arrays.
[0038] In some embodiments, before S110, it is necessary to detect whether the total number of elements in the item weighted array is zero, that is, to detect whether the number of first items is zero; if it is zero, the characterization scheme is empty, and there are no items in the scheme. There is no need to execute the acquisition method of this application, and the empty value result is directly output; if it is not zero, the acquisition method of this application is executed.
[0039] S120: If it is less than, obtain the weighted values of all second items under the first item corresponding to the value from the item weight array, and update the first item index to obtain the updated value indicated by the first item index.
[0040] Among them, the weighted value of each second item is calculated based on its own original value and the weighting coefficient of the first item to which it belongs. For example, the original value of the second item a in the first item A is 10, and the weighting coefficient of the first item A is 20%, then the calculated weighted value of the second item a is 2.
[0041] If it is less than, it indicates that the first item index has not yet reached the boundary of the item weighted array, and there are still first items that have not been traversed, that is, the weighted values of the second items under the first item have not been fully obtained. In the item weighted array, the first item corresponding to the current value pointed to by the first item index is locked, and the weighted values of each second item under it are obtained one by one in a loop. The value of the first item index is updated in a timely manner to obtain the updated value pointed to by the first item index, and the array boundary is judged in a loop based on the updated value.
[0042] An example of how to obtain the weighted value of the second item is as follows: in the item weight array, determine the target first item corresponding to the numerical value indicated by the first item index; traverse each second item in the target first item based on the second item index, and obtain the weighted value of the traversed second item to obtain the weighted values of all second items under the target first item.
[0043] That is, in the item weight array, the array corresponding to the target first item specified by the current first item index (i.e., the set of weighted values of all second items under the target first item) is locked, and the weighted value of each second item in the array is traversed in sequence based on the second item index, thereby cyclically obtaining the weighted values of all second items under the target first item. Among them, the second item index and the first item index are both variable indexes. Based on the change of the variable, the corresponding objects are traversed one by one to ensure that the corresponding objects are accurately locked.
[0044] To illustrate how to update the first item index, the value indicated by the first item index is incremented by 1, and the incremented value is used as the updated value indicated by the first item index. This is done by incrementally updating the value indicated by the first item index with an incrementing gradient of 1, ensuring that all first items are traversed one by one.
[0045] S130: If the updated value is less than the total number, obtain the weighted values of all second items under the first item corresponding to the updated value from the item weight array until the updated value indicated by the first item index is greater than or equal to the total number.
[0046] For example, the original value is 1, the total number is 6, and the current updated value is 2. Since 2 is less than 6, the weighted values of all second items under the first item corresponding to "2" can still be obtained from the item weight array until the updated value indicated by the first item index is greater than or equal to the total number. The initial value indicated by the first item index can be 0 or 1; if the initial value indicated by the first item index is 0, the condition for loop termination is "the updated value indicated by the first item index is equal to the total number", and if the initial value indicated by the first item index is 1, the condition for loop termination is "the updated value indicated by the first item index is greater than the total number".
[0047] The present application timely updates the numerical value referred to by the first project index, and cyclically obtains the weighted values of all second projects under each first project based on the updated numerical value until the updated numerical value referred to by the first project index is greater than or equal to the total number of elements in the project weighted array, that is, until the first project index reaches the boundary of the project weighted array, thereby achieving the purpose of cyclically automatically obtaining relevant project parameters, thereby making the acquisition process more convenient and quick.
[0048] In this embodiment, if it is detected that the value indicated by the first project index is less than the total number of elements in the project weighted array, the weighted values of all second projects under the first project corresponding to the value are obtained one by one in a targeted and cyclical manner from the weighted array, thereby ensuring the accuracy of the project parameter acquisition process, while avoiding missing weighted values and ensuring the acquisition of complete project parameters. This embodiment does not require complicated data retrieval, but automatically locks the corresponding first project through the first project index, that is, the value of the first project index is updated in a timely manner, thereby cyclically obtaining the weighted values of all second projects under each first project, until the updated value indicated by the first project index is greater than or equal to the total number of elements in the project weighted array, thereby achieving the purpose of cyclically automatically obtaining relevant project parameters, thereby making the acquisition process more convenient and quick.
[0049] For the analysis of multiple project combinations in a plan, it is necessary to record and print the relevant parameters of each project combination, including but not limited to the original value of the second project in each project combination, and the consumption value of each project combination. However, the relevant recursive function cannot implement this printing function.
[0050] Any acquisition method in this application can record and print out the relevant parameters required for the analysis scheme. In another exemplary embodiment of this application, it is described in detail how to print the original value of the second item in each scheme and the consumption value of each scheme. Please refer to Figure 2 , Figure 2 is based on Figure 1 The exemplary embodiment shown is a flow chart of another method for obtaining project parameters. Figure 1 Based on the S110 to S130 shown, at least S210 to S220 are also included, which are detailed as follows:
[0051] S210: Combining the second items in different first items to obtain multiple solutions; wherein each solution includes one second item in each first item.
[0052] Each solution includes at least one first item and any second item in the first item.
[0053] For example, the first project includes Project A and Project B; Project A includes Second Projects 1 and 2, and Project B includes Second Projects 3 and 4. Selecting Second Projects 1 and 3 from Projects A and B, respectively, constitutes one solution; selecting Second Projects 1 and 4 from Projects A and B, respectively, constitutes another solution; and so on, a total of four different solutions can be formed.
[0054] S220: Sum the weighted values of all second items in each solution, and print the summed value and the original value of each second item in each solution; wherein the original value is obtained from the original array of items based on the first item index and the second item index.
[0055] Exemplarily, the first project includes project A and project B; project A includes second projects 1 and 2, the original value of second project 1 is 40, the weighted value is 4, the original value of second project 2 is 60, and the weighted value is 6; project B includes second projects 3 and 4, the original value of second project 3 is 20, the weighted value is 18, the original value of second project 4 is 80, and the weighted value is 72.
[0056] The consumption value of Plan 1 (second items 1 and 3) = 4+18=22, and the original values of the second items are 40 and 20 respectively; the consumption value of Plan 2 (second items 1 and 4) = 4+72=76, and the original values of the second items are 40 and 80 respectively; the consumption value of Plan 1 (second items 2 and 3) = 6+18=24, and the original values of the second items are 60 and 20 respectively; the consumption value of Plan 1 (second items 2 and 4) = 6+72=78, and the original values of the second items are 60 and 80 respectively.
[0057] The project primitive array is a two-dimensional array constructed based on the project configuration information entered by the user. The following is a detailed description of the construction process of the project primitive array:
[0058] In response to the project configuration information input by the user, each first item in the project configuration information is used as a first-dimensional element, and the second item under each first item is used as a second-dimensional element; based on the first-dimensional element corresponding to each first item and the respective corresponding second-dimensional elements, the initial array elements corresponding to each first item are constructed, and the original values of the second items under each first item are inserted into the corresponding initial array elements to obtain the original value array elements corresponding to each first item; based on the original value array elements corresponding to each first item, the original array of the project is constructed.
[0059] Users can use Figure 3The editing page shown is constructed by adding and combining relevant modules and entering relevant parameters to form project configuration information. When the execution entity of this application receives the project configuration information, it can perform corresponding preprocessing on it, including but not limited to unifying the data format and filtering invalid data. Then, in response to the preprocessed project configuration information, each first item in the project configuration information is filled into the row information in Table 1 as the first dimension element, and each second item under the first item is filled into the column information in Table 1 as the second dimension element; based on Table 1 after filling in the parameters, the initial array elements corresponding to all first items are constructed, and the original values of the second items under each first item are inserted into the corresponding initial array elements, thereby quickly generating the original array of the project. Among them, the initial array elements are [A,1], [A,2], [B,1], etc. shown in Table 1. They are array elements with empty values. After inserting the parameters, they correspond to the corresponding parameter values. The original array of the project can be directly composed of [A,1], [A,2], [A,3], [B,1]... after inserting the original values, that is, the number of arrays in the original array of the project is the same as the number of array elements.
[0060] The original array of the item can also be composed of a set of merged array elements, that is, an array in the original array of the item represents a set of array elements. For example, the array elements of each first item are merged separately: the array elements [A,1], [A,2], [A,3] after inserting the original values are merged into [A, a], the array elements [B,1], [B,2], [B,3] after inserting the original values are merged into [B, b], and the array elements [C,1], [C,2], [C,3] after inserting the original values are merged into [C, c]. Then the number of arrays in the original array of the item is the same as the number of the first items, that is, the same as the above-mentioned "elements".
[0061] Table 1: Example array element generation table
[0062] Second Item 1 Second item 2 Second item 3 …… First Project A [A,1] [A,2] [A,3] …… First Project B [B,1] [B,2] [B,3] …… First Project C [C,1] [C,2] [C,3] …… …… …… …… …… ……
[0063] Similarly, the project weighted array is also a two-dimensional array constructed based on the configuration information input by the user, which is described in detail as follows: multiply the original value of each second item in the project configuration information by the weight coefficient of the first item to which it belongs to obtain the weighted value of each second item; insert the weighted value of the second item under each first item into the corresponding initial array element to obtain the weighted value array element corresponding to each first item; based on the weighted value array elements corresponding to each first item, construct the project weighted array.
[0064] An example of weighted value calculation is as follows: Item A has two subordinate items, Item 1 and Item 2. Item A's weight coefficient is 20%, Item 1's original value is 40, and Item 2's original value is 60. The calculated weighted value for Item 1 is 20% × 40 = 8, and the weighted value for Item 2 is 20% × 60 = 12. Similarly, the weighted values for all subordinate items are calculated. The concept of the array in the item weight array refers to the concept of the item original array described above and can be selected accordingly based on the actual situation.
[0065] In another exemplary embodiment of the present application, how to update the project weight array after the user updates the project configuration information is described in detail as follows:
[0066] In response to the project configuration information updated by the user, an updated initial array element is constructed based on the first item and the second item in the updated project configuration information; the original value of each second item in the updated project configuration information is multiplied by the weight coefficient of the first item to which it belongs to obtain the updated weighted values of each second item; and the project weighted array is updated based on the updated weighted values of each second item and the updated initial array element.
[0067] Users can add and delete related first and second items. In order to avoid erroneous acquisition of related parameters, this application promptly responds to the user's updated project configuration information, thereby constructing an updated initial array element, calculating the weighted value of the updated second item, and updating the item weighted array for a comprehensive update, thereby ensuring that the parameter update is not missed.
[0068] In some embodiments, key parameters in the updated project configuration information may be compared with parameters in the project weight array to determine the parameters in the project weight array that need to be updated urgently, and then partially updated to improve update efficiency.
[0069] In another exemplary embodiment of the present application, the application scenarios of the above-mentioned multiple acquisition methods are exemplarily described. The acquisition method of the present application can be mapped into an execution code of the Swift language. The relevant computer processor serves as the execution subject and loads the execution code to execute the acquisition method. The execution code example is as follows:
[0070] var array total = dealtOutterArr.count
[0071] var rowIndex = 0
[0072] var result = 0
[0073]
[0074]
[0075] Conventional recursive functions can only meet data calculation requirements, but cannot meet storage and printing requirements. As can be seen from the above exemplary execution code, this application can meet data acquisition requirements, data storage requirements, data calculation requirements, and data printing requirements. This application can adjust the upper limit of requirements by setting n, and use the principle of maximizing the number of loops. At the same time, a threshold (n) is used to control not to reach the maximum, so the efficiency is higher.
[0076] Another aspect of the present application also provides a device for obtaining program project parameters, such as Figure 4 As shown, Figure 4 1 is a schematic diagram of a device for obtaining project parameters according to an exemplary embodiment of the present application. The obtaining device 400 includes:
[0077] A detection module 410 is configured to detect whether the value indicated by the first item index is less than the total number of elements in an item weight array, wherein the item weight array is a two-dimensional array consisting of a first item and a second item, where the second item is a subitem of the first item;
[0078] The first acquisition module 430 is configured to, if less than, obtain the weighted values of all second items under the first item corresponding to the value from the item weight array, and update the first item index to obtain the updated value indicated by the first item index;
[0079] The second acquisition module 450 is used to obtain the weighted values of all second items under the first item corresponding to the updated value from the item weight array if the updated value is less than the total number, until the updated value indicated by the first item index is greater than or equal to the total number.
[0080] In another exemplary embodiment, the acquisition device 400 further includes:
[0081] a combining module, configured to combine the second items in different first items to obtain a plurality of solutions, wherein each solution includes one second item in each first item;
[0082] A printing module is used to sum the weighted values of all second items in each solution, and print the calculated sum and the original values of each second item in each solution; wherein the original values are obtained from the original array of items based on the first item index and the second item index.
[0083] In another exemplary embodiment, the acquisition device 400 further includes:
[0084] a response module, configured to respond to the project configuration information input by the user, take each first item in the project configuration information as a first dimension element, and take a second item under each first item as a second dimension element;
[0085] an original value insertion module, configured to construct, based on the first-dimensional elements corresponding to each first item and the second-dimensional elements corresponding to each first item, an initial array element corresponding to each first item, and insert the original value of the second item under each first item into the corresponding initial array element to obtain an original value array element corresponding to each first item;
[0086] The first construction module is used to construct an original array of items based on the original value array elements corresponding to each first item.
[0087] In another exemplary embodiment, the acquisition device 400 further includes:
[0088] a calculation module, configured to multiply the original value of each second item in the item configuration information by the weight coefficient of the first item to which it belongs, to obtain a weighted value of each second item;
[0089] A weighted value insertion module, configured to insert the weighted value of each second item under each first item into the corresponding initial array element, to obtain a weighted value array element corresponding to each first item;
[0090] The second construction module is used to construct an item weight array based on the weight value array elements corresponding to each first item.
[0091] In another exemplary embodiment, the acquisition device 400 further includes:
[0092] In response to the project configuration information updated by the user, constructing an updated initial array element based on the first item and the second item in the updated project configuration information;
[0093] Multiplying the original value of each second item in the updated item configuration information by the weight coefficient of the first item to which it belongs, to obtain an updated weighted value of each second item;
[0094] The item weight array is updated based on the updated weight values of the respective second items and the updated initial array elements.
[0095] In another exemplary embodiment, the first acquisition module includes:
[0096] The updating unit is used to add one to the value indicated by the first item index, and use the added value as the updated value indicated by the first item index.
[0097] In another exemplary embodiment, the first acquisition module includes:
[0098] a determining unit, configured to determine, in the item weighted array, a target first item corresponding to a value indicated by a first item index;
[0099] The traversal acquisition unit is used to traverse each second project in the target first project based on the second project index and acquire the weighted value of the traversed second project to obtain the weighted values of all second projects under the target first project.
[0100] The acquisition device of the present application, if it is detected that the value referred to by the first project index is less than the total number of elements in the project weighted array, then the weighted values of all second projects under the first project corresponding to the value are obtained one by one in a targeted and cyclic manner from the weighted array, thereby ensuring the accuracy of the project parameter acquisition process, while avoiding missing weighted values, and ensuring the acquisition of complete project parameters. The acquisition device of the present application does not require complicated data retrieval, but automatically locks the corresponding first project through the first project index, that is, timely updates the value of the first project index, thereby cyclically acquiring the weighted values of all second projects under each first project, until the updated value referred to by the first project index is greater than or equal to the total number of elements in the project weighted array, thereby achieving the purpose of cyclically automatically acquiring relevant project parameters, thereby making the acquisition process more convenient and quick.
[0101] It should be noted that the acquisition device provided in the above embodiment and the acquisition method provided in the above embodiment belong to the same concept, and the specific manner in which each module and unit performs operations has been described in detail in the method embodiment and will not be repeated here.
[0102] Another aspect of the present application provides an electronic device, comprising: a controller; and a memory for storing one or more programs, which, when executed by the controller, executes the above-mentioned acquisition method.
[0103] See also Figure 5 , Figure 5 1 is a schematic diagram of the structure of a computer system of an electronic device shown in an exemplary embodiment of the present application, which shows a schematic diagram of the structure of a computer system of an electronic device suitable for implementing an embodiment of the present application.
[0104] It should be noted that Figure 5 The computer system 500 of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0105] like Figure 5As shown, the computer system 500 includes a central processing unit (CPU) 501, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 502 or the program loaded from the storage part 508 into the random access memory (RAM) 503, such as executing the method in the above embodiment. Various programs and data required for system operation are also stored in the RAM 503. The CPU 501, ROM 502 and RAM 503 are connected to each other via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.
[0106] The following components are connected to the I / O interface 505: an input section 506 including a keyboard, a mouse, and the like; an output section 507 including devices such as a cathode ray tube (CRT), a liquid crystal display (LCD), and a speaker; a storage section 508 including a hard disk and the like; and a communication section 509 including a network interface card such as a LAN (Local Area Network) card or a modem. The communication section 509 performs communication processing via a network such as the Internet. A drive 510 is also connected to the I / O interface 505 as needed. Removable media 511, such as a magnetic disk, an optical disk, a magneto-optical disk, or a semiconductor memory, is installed in the drive 510 as needed, so that computer programs read therefrom can be installed into the storage section 508 as needed.
[0107] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a computer program for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network via the communication section 509, and / or installed from a removable medium 511. When the computer program is executed by the central processing unit (CPU) 501, the various functions defined in the system of the present application are executed.
[0108] It should be noted that the computer-readable medium shown in the embodiments of the present application can be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium can be, for example, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media can include, but are not limited to: 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), a 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 the present application, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present application, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, which carries a computer-readable computer program. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. A computer program embodied on a computer-readable medium may be transmitted using any suitable medium, including but not limited to wireless, wired, or any suitable combination thereof.
[0109] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present application. Among them, each box in the flowchart or block diagram can represent a module, program segment, or part of the code, and the above-mentioned module, program segment, or part of the code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in an order different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0110] The units involved in the embodiments described in this application may be implemented by software or hardware, and the units described may also be set in a processor. In some cases, the names of these units do not constitute limitations on the units themselves.
[0111] Another aspect of the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the aforementioned acquisition method. The computer-readable storage medium may be included in the electronic device described in the above embodiments, or may exist independently without being incorporated into the electronic device.
[0112] Another aspect of the present application further provides a computer program product or computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the acquisition method provided in each of the above embodiments.
[0113] According to one aspect of an embodiment of the present application, a computer system is further provided, including a central processing unit (CPU), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) or a program loaded from a storage portion into a random access memory (RAM), such as executing the method in the above embodiment. Various programs and data required for system operation are also stored in the RAM. The CPU, ROM, and RAM are connected to each other via a bus. An input / output (I / O) interface is also connected to the bus.
[0114] The following components are connected to the I / O interface: an input section including a keyboard, mouse, etc.; an output section including a cathode ray tube (CRT), liquid crystal display (LCD), and speakers; a storage section including a hard disk; and a communication section including a network interface card such as a LAN (Local Area Network) card and a modem. The communication section performs communication processing via a network such as the Internet. A drive is also connected to the I / O interface as needed. Removable media such as magnetic disks, optical disks, magneto-optical disks, semiconductor memories, etc. are installed in the drive as needed so that computer programs read from them can be installed into the storage section as needed.
[0115] The above content is only a preferred exemplary embodiment of the present application and is not intended to limit the implementation scheme of the present application. Ordinary technicians in this field can easily make corresponding changes or modifications based on the main ideas and spirit of the present application. Therefore, the scope of protection of the present application shall be based on the scope of protection required by the claims.
Claims
1. A method for obtaining parameters of a program project, characterized in that: The acquisition method includes: detecting whether the value indicated by the first item index is less than the total number of elements in an item weight array, wherein the item weight array is a two-dimensional array consisting of a first item and a second item, wherein the second item is a subitem of the first item; If it is less than, obtaining the weighted values of all second items under the first item corresponding to the value from the item weight array, and updating the first item index to obtain the updated value referred to by the first item index; If the updated value is less than the total number, the weighted values of all second items under the first item corresponding to the updated value are obtained from the item weight array until the updated value indicated by the first item index is greater than or equal to the total number.
2. The acquisition method according to claim 1, characterized in that The acquisition method further includes: Combining the second items in different first items to obtain multiple solutions, wherein each solution includes one second item in each first item; The weighted values of all second items in each solution are summed up, and the summed value and the original value of each second item in each solution are printed; wherein the original value is obtained from the original array of items based on the first item index and the second item index.
3. The acquisition method according to claim 2, characterized in that The acquisition method further includes: In response to project configuration information input by a user, each first project in the project configuration information is used as a first dimension element, and a second project under each first project is used as a second dimension element; Based on the first-dimensional elements corresponding to each first item and the respective second-dimensional elements, construct an initial array element corresponding to each first item, and insert the original value of the second item under each first item into the corresponding initial array element to obtain the original value array element corresponding to each first item; Based on the original value array elements corresponding to each first item, the original array of the item is constructed.
4. The acquisition method according to claim 3, characterized in that The acquisition method further includes: Multiplying the original value of each second item in the item configuration information by the weight coefficient of the first item to which it belongs to obtain a weighted value of each second item; Inserting the weighted value of the second item under each first item into the corresponding initial array element to obtain the weighted value array element corresponding to each first item; The item weight array is constructed based on the weight value array elements corresponding to each first item.
5. The acquisition method according to claim 4, characterized in that: The acquisition method further includes: In response to the project configuration information updated by the user, constructing an updated initial array element based on the first item and the second item in the updated project configuration information; Multiplying the original value of each second item in the updated item configuration information by the weight coefficient of the first item to which it belongs, to obtain an updated weighted value of each second item; The item weight array is updated based on the updated weight values of the respective second items and the updated initial array elements.
6. The acquisition method according to any one of claims 1 to 5, characterized in that: Updating the first item index to obtain an updated value indicated by the first item index includes: The value indicated by the first item index is incremented by one, and the incremented value is used as the updated value indicated by the first item index.
7. The acquisition method according to any one of claims 1 to 5, characterized in that: Obtaining, from the item weight array, weighted values of all second items subordinate to the first item corresponding to the value, including: In the item weighted array, determining a target first item corresponding to the value indicated by the first item index; Each second project in the target first project is traversed based on the second project index, and the weighted value of the traversed second project is obtained to obtain the weighted values of all second projects under the target first project.
8. A device for obtaining parameters of a program project, characterized in that: The acquisition device includes: a detection module, configured to detect whether the value indicated by the first item index is less than the total number of elements in an item weight array; wherein the item weight array is a two-dimensional array consisting of a first item and a second item, wherein the second item is a subitem of the first item; A first obtaining module is configured to obtain, from the item weight array, the weighted values of all second items subordinate to the first item corresponding to the value, if less than, and update the first item index to obtain an updated value indicated by the first item index; The second acquisition module is used to obtain the weighted values of all second items under the first item corresponding to the updated value from the item weight array if the updated value is less than the total number, until the updated value referred to by the first item index is greater than or equal to the total number.
9. An electronic device, characterized in that: include: Controller; The memory is used to store one or more programs, and when the one or more programs are executed by the controller, the controller implements the acquisition method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that Computer-readable instructions are stored thereon, and when the computer-readable instructions are executed by a processor of a computer, the computer is caused to execute the acquisition method according to any one of claims 1 to 7.