Engineering quantity calculation method, device, equipment and readable storage medium for engineering systems
Through the method of separation of the main process and the computing process, a database associated with the target area identification is built and a new thread is created, which solves the problem of low efficiency in engineering quantity calculation in the existing technology, and realizes efficient parallel computing of engineering quantity and system stability.
Patent Information
- Application Number
- CN202210368771.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-08
- Publication Date
- 2025-08-05
- Estimated Expiration
- 2042-04-08
AI Technical Summary
In the prior art, engineering quantity calculation efficiency is low, manual quantity calculation or calculation software calculation time-consuming and inefficient, and low degree of automation, which may lead to increased server data processing pressure and system crash.
Using the method of separation between the main process and the computing process, the main process constructs the target area to identify the associated database and allocates data memory to the computing process. The computing process creates a new thread for calculating element information. The main process obtains and counts the engineering quantity results to realize parallel calculation of the engineering quantity.
It improves the efficiency of engineering quantity calculation, reduces the pressure of data calling, avoids confusion of element information, and improves the accuracy of calculation and system stability.
Smart Images

Figure CN114647514B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of construction engineering quantity calculation, and in particular to an engineering quantity calculation method, device, equipment and readable storage medium for an engineering system. Background Art
[0002] With the rapid development of construction projects, the number of projects is also increasing. Quantity calculation, as a fundamental step in the entire project, is a crucial basis for construction companies to prepare construction work plans, rationalize construction schedules, and organize on-site labor, materials, and machinery. Quantity calculation refers to the physical quantity of construction work. Its calculation method is characterized by being large, cumbersome, time-consuming, and meticulous. It accounts for approximately 50-70% of the total quantity required to prepare a project budget, and its accuracy and speed directly impact the quality and speed of the budget. Therefore, quantity calculation plays a vital role in the entire project.
[0003] The existing method of calculating engineering quantities generally uses manual operation to calculate the engineering quantities of each installed building component in the drawings. This method is time-consuming and has a low degree of automation. There are also some solutions that use quantity calculation software, which often require first identifying the drawings to obtain the graphic element information, and then calculating each graphic element information one by one. This calculation solution can only calculate the next graphic element information after the calculation of one graphic element information is completed. After all the graphic element information is calculated, the engineering quantity corresponding to each graphic element information is finally output. This method is also time-consuming and inefficient. At the same time, the identification process and the calculation process are in the same process. The two processes affect each other, which increases the data processing pressure of the server and may cause the system to crash.
[0004] There is currently no effective solution to the technical problem of low efficiency in using manual quantity calculation or quantity calculation software in existing engineering quantity calculation technologies. Summary of the Invention
[0005] The purpose of the present invention is to provide a method, device, equipment and readable storage medium for calculating the engineering quantity of an engineering system, which can solve the technical problem of low efficiency in the existing engineering quantity calculation using manual calculation or calculation software.
[0006] One aspect of the present invention provides a method for calculating the engineering quantity of an engineering system, wherein the engineering system includes a main process and a calculation process, and the method includes: the main process responds to a triggered calculation request for calculating the engineering quantity of the engineering system, constructs a database associated with the target area identifier carried in the calculation request, and allocates the data memory of the database to an associated available calculation process; the associated calculation process obtains all target graphic element information pointed to by the target area identifier, and creates a new thread for calculating the engineering quantity of the target graphic element information based on the target graphic element information; the main process obtains the engineering quantity calculation results of each new thread, and performs statistics to obtain the engineering quantity required for the calculation request.
[0007] Optionally, in response to a triggered calculation request for calculating the engineering quantity of the engineering system, the main process constructs a database associated with the target area identifier carried in the calculation request, including: searching for identification information corresponding to the target area identifier in the database of the main process, wherein the database of the main process stores all graphic element information in the engineering system and identification information of each graphic element information; obtaining the graphic element information corresponding to the searched identification information, using the graphic element information as data memory to construct a database, and using the constructed database as the database associated with the target area identifier carried in the calculation request.
[0008] Optionally, the associated computing process obtains the target graphic element information pointed to by the target area identifier, and creates a new thread for calculating the engineering quantity of the target graphic element information based on the target graphic element information, including the steps of: determining the amount of graphic element information in the associated database; and determining the number of new threads to be created for calculating the engineering quantity of the target graphic element information based on the amount of graphic element information in the associated database.
[0009] Optionally, the step of determining the number of new threads to be created for calculating the workload of target graphic element information based on the number of graphic element information in the associated database includes: if the number of graphic element information in the associated database is less than or equal to a preset threshold, creating new threads equal to the number of graphic element information in the associated database, each new thread calculating the workload of one graphic element information; if the number of graphic element information in the associated database is greater than the preset threshold, creating new threads equal to the preset threshold, marking the graphic element information in the associated database with sequence numbers, and determining whether the graphic element information shares a new thread created with other graphic element information based on the sequence number, wherein if the sequence number of the graphic element information is less than or equal to the preset threshold, it is determined that the graphic element information does not need to share a new thread created with other graphic element information, and a new thread is directly assigned to the graphic element information to calculate the workload; if the sequence number of the graphic element information is greater than the preset threshold, it is determined that the graphic element information needs to share a new thread created with other graphic element information, and the graphic element information is placed in a waiting sequence pool for waiting; when there is an idle new thread among the created new threads, the graphic element information waiting in the waiting sequence pool is assigned to the idle new thread, until the workload calculation of each graphic element information is completed.
[0010] Optionally, after obtaining the engineering quantity calculation results of each new thread and performing statistics to obtain the engineering quantity required for the calculation request, the method also includes: the associated calculation process sends the calculation results to the main process, and switches the running state to a waiting state that can be used to calculate new target graphic element information; the main process stores the received calculation results in the database of the main process, and switches the running state to a waiting state to respond to the calculation request for calculating the engineering quantity of the engineering system that is triggered next time.
[0011] Optionally, after the main process stores the received calculation results in the database of the main process and switches the running state to the waiting state, the method further includes: the main process clearing the data memory of the associated database.
[0012] Optionally, after the associated calculation process obtains all target graphic element information pointed to by the target area identifier and creates a new thread for calculating the engineering quantity of the target graphic element information based on the target graphic element information, the method also includes: when the associated calculation process detects that any new thread created completes the calculation of the engineering quantity of the target graphic element information, the calculation result is sent to the main process; the main process visualizes the calculation result to display the calculation progress and calculation content of the engineering system.
[0013] Another aspect of the present invention provides an engineering quantity calculation device for an engineering system, characterized in that the engineering system includes a main process and a calculation process, and the device includes: a construction module, used to control the main process to respond to the triggered calculation request for calculating the engineering quantity of the engineering system, build a database associated with the target area identifier carried in the calculation request, and allocate the data memory of the database to an associated available calculation process; a creation module, used to control the associated calculation process to obtain all target graphic element information pointed to by the target area identifier, and create a new thread for calculating the engineering quantity of the target graphic element information based on the target graphic element information; a generation module, used to control the main process to obtain the engineering quantity calculation results of each new thread, and perform statistics to obtain the engineering quantity required for the calculation request.
[0014] Another aspect of the present invention provides a computer device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, and is characterized in that when the processor executes the computer program, the method for calculating the engineering quantity of the engineering system of any of the above-mentioned embodiments is implemented.
[0015] Another aspect of the present invention provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the method for calculating engineering quantities for an engineering system according to any of the aforementioned embodiments. Furthermore, the computer-readable storage medium may primarily include a program storage area and a data storage area. The program storage area may store an operating system, applications required for at least one function, and the data storage area may store data generated based on the use of blockchain nodes.
[0016] The engineering quantity calculation method, device, equipment, and readable storage medium provided by the present invention set the engineering system for statistical engineering quantities into two processing processes, namely a main process and a calculation process. The two processes work together to complete the calculation of engineering quantities. In specific implementation, when a user uses the engineering system to perform an engineering quantity statistical operation and triggers a calculation request, the main process responds to the triggered calculation request and builds a database associated with the target area identifier carried in the calculation request, and allocates the data memory of the database to an associated available calculation process. In other words, the main process of the engineering system builds a database containing primitive information for the calculation process based on the calculation request, which alleviates the pressure on the engineering system during the data call process. At the same time, because the database associated with the calculation process only contains the primitive information corresponding to the calculation request, the storage information is small and confusion with primitive information of other regions is avoided, which facilitates primitive information call and improves the efficiency of engineering quantity calculation. The associated calculation process obtains the target primitive information pointed to by the target area identifier and creates a new thread for calculating the engineering quantity of the target primitive information based on the target primitive information. The engineering quantity calculation results of each new thread are obtained and statistically analyzed to obtain the engineering quantity required for the calculation request. Different calculation requests may correspond to different target primitive information. By creating threads based on the target primitive information, the method for calculating the engineering quantity of the target primitive information can be intelligently selected to avoid wasting engineering system resources. Simultaneously, the newly created threads can calculate the engineering quantities of the target primitive information simultaneously, improving computational efficiency. This application solves the technical problem of low efficiency in conventional engineering quantity calculations using manual calculations or calculation software, effectively improving the efficiency of engineering quantity calculations in engineering systems. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Various other advantages and benefits will become apparent to those skilled in the art upon reading the detailed description of the preferred embodiment below. The accompanying drawings are for illustration purposes only and are not to be considered as limiting the present invention. The same reference symbols are used throughout the drawings to represent the same components. In the drawings:
[0018] Figure 1 An optional flow chart of a method for calculating the engineering quantity of an engineering system provided in the first embodiment of the present invention is shown;
[0019] Figure 2 A schematic diagram showing an optional application of the method for calculating the engineering quantity of an engineering system provided in the first embodiment of the present invention is shown;
[0020] Figure 3 A schematic diagram showing another optional application of the method for calculating the engineering quantity of an engineering system provided in the first embodiment of the present invention;
[0021] Figure 4A schematic diagram showing another optional application of the method for calculating the engineering quantity of an engineering system provided in the first embodiment of the present invention;
[0022] Figure 5 Another optional flow chart of the method for calculating the engineering quantity of an engineering system provided in the first embodiment of the present invention is shown;
[0023] Figure 6 An optional structural block diagram of an engineering quantity calculation device for an engineering system provided in the second embodiment of the present invention is shown; and
[0024] Figure 7 A block diagram of an optional computer device suitable for implementing the engineering quantity calculation method of an engineering system provided in the third embodiment of the present invention is shown. DETAILED DESCRIPTION
[0025] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0026] It should be noted that, in this document, the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or apparatus comprising a series of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or apparatus comprising the element.
[0027] Example 1
[0028] The first embodiment of the present invention provides a method for calculating the engineering quantity of an engineering system, wherein the engineering system in the embodiment of the present invention is configured to include a main process and a calculation process. Specifically, Figure 1 A flow chart showing a method for calculating the engineering quantity of an engineering system is shown in FIG. Figure 1 As shown, the engineering quantity calculation method of the engineering system may include steps S1 to S3, wherein:
[0029] In step S1, the main process responds to a triggered calculation request for the amount of work in the calculation engineering system, constructs a database associated with the target area identifier carried in the calculation request, and allocates the data memory of the database to an associated available calculation process.
[0030] Usually, when using quantity calculation software to calculate the engineering quantities covered in the drawings of business projects, all the graphic element information of the drawings is first identified, and then the engineering quantities contained in each graphic element information are calculated in turn. Finally, the engineering quantities of all the graphic elements are summarized to obtain the engineering quantities of the entire drawing. However, since the entire business project contains thousands of graphic element information, calculating one graphic element information in turn is too inefficient for the entire project engineering. Moreover, the identification process and the calculation process of each graphic element information are in the same process. The two processes affect each other and may cause the entire server to crash. In order to solve this situation, the main process is decoupled. The main process is responsible for the graphic element information identification process, and a new calculation process is created outside the main process to independently complete the engineering quantity calculation part, and the calculation results are returned to the main process. This method allows each part of the entire process to independently perform the corresponding functions without affecting each other, ensuring the normal operation of the system, thereby improving the success rate of engineering quantity calculation.
[0031] Since different project stages have different engineering quantity calculation requirements, the corresponding graphic element information is extracted for calculation according to different scenario requirements, making the calculation process targeted and in line with real business needs.
[0032] Specifically, the engineering system includes a main process and a calculation process. When it is necessary to perform engineering quantity calculation, the main process responds to the engineering quantity calculation request triggered by the engineering system front end, receives and parses the calculation request, obtains the target area identifier, and simultaneously builds a database associated with the target area identifier. The database memory is allocated to an associated available calculation process, so that the primitive information corresponding to the calculation request is stored separately, which facilitates the engineering quantity calculation call and improves data calculation efficiency. Among them, the available calculation process is an idle process, and can only be started to perform the corresponding calculation operation when the calculation process is idle. The target area identifier is the corresponding area name of the engineering quantity to be calculated by the calculation request. Preferably, the location name can be a specific floor name. The main process responds to the calculation request and starts the associated calculation process, starting the corresponding engineering quantity calculation operation. The target area identifier obtained by parsing is selected in the main process to complete the predetermination of the calculation range.
[0033] Figure 2 A schematic diagram of an application of a method for calculating the quantity of engineering a system is shown. Figure 2 As shown, a quantity calculation request is generated by a click operation on the front-end page of the engineering system. When the main process detects the calculation request, it generates a response to start the calculation process. Specifically, the quantity to be calculated for the calculation request is the first-layer element information and additional manually defined data. Therefore, on the summary calculation page of the engineering system front-end, click the "First Layer" item and the "Summary Change Quantity" item, and finally click the "Calculate" item to start the associated calculation process.
[0034] In an optional implementation, this embodiment further provides a preferred solution in which the main process in step S1 responds to a triggered calculation request for calculating the engineering system engineering quantity and constructs a database associated with the target area identifier carried in the calculation request. Specifically, step S1 may include the following steps S11 to S12:
[0035] Step S11: searching for identification information corresponding to the target area identification in the database of the main process, wherein the database of the main process stores all graphic element information in the engineering system and identification information of each graphic element information;
[0036] Step S12: obtaining the graphic element information corresponding to the searched identification information, using the graphic element information as data memory to construct a database, and using the constructed database as a database associated with the target area identification carried in the calculation request.
[0037] After the main process identifies the drawings in the engineering system, all the graphic element information of the drawings and the identification information of each graphic element information are stored in the database of the main process. Preferably, the identification information of each graphic element information is the name of the area to which the graphic element information belongs. After obtaining the target area identifier carried in the calculation request, the database of the main process is traversed to match the target area identifier with all the identification information. When the target area identifier is the same as a certain identification information, all the graphic element information corresponding to the identification information is extracted, and a database is constructed using the graphic element information as data memory. The constructed database is used as the database associated with the target area identifier carried in the calculation request, thereby obtaining the calculation object of the calculation process.
[0038] Since the database of the main process contains a large amount of graphic element information and the calling program is heavy, a database containing graphic element information is separately constructed for the calculation process according to the calculation request, which alleviates the pressure on the engineering system during the data call process. At the same time, since the database associated with the calculation process only contains the graphic element information corresponding to the calculation request, the graphic element information is less than the graphic element information stored in the main process, the calling speed is faster, and the calculation efficiency of the engineering quantity is improved.
[0039] Step S2: The associated calculation process obtains all target primitive information pointed to by the target area identifier, and creates a new thread for calculating the engineering workload of the target primitive information according to the target primitive information.
[0040] The associated calculation process obtains all target element information from the associated database, and creates corresponding new threads based on the target element information to calculate the engineering quantity of the target element information. Threads are created in a targeted manner based on specific element information to avoid wasting system resources. At the same time, multiple new threads can calculate the engineering quantity of the target element information at the same time, thereby improving calculation efficiency.
[0041] In another optional implementation, this embodiment further provides a preferred solution in which the calculation process associated with step S2 obtains all target primitive information pointed to by the target area identifier and creates a new thread for calculating the engineering quantity of the target primitive information based on the target primitive information. Specifically, step S2 may include the following steps S21 to S22:
[0042] Step S21, determining the amount of graphic element information in the associated database;
[0043] Step S22 : determining the number of new threads to be created for calculating the engineering workload of the target graphic element information according to the number of graphic element information in the associated database.
[0044] The number of graphic element information in the associated database is counted, and the number of new threads created for calculating the engineering workload of the target graphic element information is determined based on the statistical results, making the thread creation method more flexible and avoiding wasting system resources.
[0045] In another optional implementation, this embodiment further provides a preferred solution for determining, in step S22, the number of new threads to be created for calculating the engineering workload of the target graphic element information based on the number of graphic element information in the associated database. Specifically, step S22 may include the following steps A1 to A2:
[0046] Step A1: if the number of graphic element information in the associated database is less than or equal to a preset threshold, create new threads with the same number as the number of graphic element information in the associated database, and each new thread calculates the engineering workload of one graphic element information;
[0047] Step A2: If the number of graphic element information in the associated database is greater than a preset threshold, create new threads with the same number as the preset threshold, mark the graphic element information in the associated database with serial numbers, and determine whether the graphic element information shares the created new thread with other graphic element information based on the serial number of each graphic element information. If the serial number of the graphic element information is less than or equal to the preset threshold, it is determined that the graphic element information does not need to share the created new thread with other graphic element information, and a created new thread is directly assigned to the graphic element information to calculate the engineering quantity. If the serial number of the graphic element information is greater than the preset threshold, it is determined that the graphic element information needs to share the created new thread with other graphic element information, and the graphic element information is placed in the waiting sequence pool for waiting. When there is an idle new thread among the created new threads, the graphic element information waiting in the waiting sequence pool is assigned to the idle new thread until the engineering quantity calculation of each graphic element information is completed.
[0048] Compare the number of graphic element information in the associated database with a preset threshold, and select a calculation method for the corresponding engineering quantity based on the comparison result. Preferably, the preset threshold can be the maximum number of threads for the calculation process. For example, if the number of graphic element information in the associated database is less than or equal to the maximum number of threads, it indicates that the engineering system still has remaining resources to process the engineering quantity of the target graphic element information. Then, create new threads with the same number as the number of graphic element information in the associated database, and each new thread calculates the engineering quantity of one graphic element information. If the number of graphic element information in the associated database is greater than the maximum number of threads, it indicates that the engineering system resources cannot calculate all graphic element information at the same time. Create new threads with the same number as the preset threshold to ensure that system resources are fully utilized, and mark the graphic element information in the associated database with serial numbers. The serial numbers correspond to the order in which each graphic element information is extracted from the associated database, and determine whether the graphic element information is shared with other graphic element information based on the serial number of each graphic element information. Sharing means that the graphic element information is directly created as a thread for processing or waiting for the calculation of other graphic element information to be completed. Then the corresponding idle thread is used for processing, wherein, when the sequence number of the graphic element information is less than or equal to the preset threshold, it is determined that the graphic element information does not need to share the new thread created with other graphic element information, for example, the preset threshold is 9, and the sequence number corresponding to the graphic element information is 6 (the 6th graphic element information extracted from the associated database), and there are still remaining system resources, and a new thread is directly assigned to the graphic element information to calculate the engineering volume. When the sequence number of the graphic element information is greater than the preset threshold, for example, the preset threshold is 9, and the sequence number corresponding to the graphic element information is 11, the system resources have been fully used, and it is determined that the graphic element information needs to share the new thread created with other graphic element information, and the graphic element information is placed in the waiting sequence pool for waiting. When there is an idle new thread among the created new threads, the graphic element information waiting in the waiting sequence pool is assigned to the idle new thread, until the engineering volume calculation of each graphic element information is completed.
[0049] The thread creation method fully considers the inherent nature of the engineering system. There is no need to set the number of threads to be equal to the number of element information in the associated database, which would increase system processing pressure. Threads are created based on the number of element information in the associated database. The calculation method for the element information engineering quantity can be intelligently selected and adjusted accordingly for different calculation requirements. There is no need to set a fixed number of threads to calculate element information, avoiding wasting system resources when the number of threads exceeds the number of element information. The calculation method is flexible and diverse. This avoids wasting system resources and increases the correct utilization rate of system resources.
[0050] In step S3, the main process obtains the engineering workload calculation results of each new thread and performs statistics to obtain the engineering workload required for the calculation request.
[0051] The main process obtains the engineering quantity calculation results of each new thread in the associated calculation process and summarizes them to generate the engineering quantity required for the calculation request, which is convenient for business project statistics.
[0052] Figure 3 A schematic diagram of an application of a method for calculating the quantity of engineering a system is shown. Figure 3 As shown, it can be seen that the figure is the calculation result of the fire hydrant engineering quantity of Dejing Building No. 7. In the project name, "Dejing Building No. 7" is the target area, and "fire hydrant" is the graphic element information of the target area. Among them, the graphic element information includes multiple component elements such as "45° elbow", "clamp", "elbow", "oblique four-way", "straight four-way" and the model of each component element, and the engineering quantity of the above component elements is 1000, 227000, 7000, 1000 and 1000.
[0053] Optionally, after obtaining the engineering workload calculation results of each new thread and performing statistics to obtain the engineering workload required for the calculation request in step S3, the method further includes steps B1 to B2, wherein:
[0054] Step B1: The associated computing process sends the computing result to the main process and switches the running state to a waiting state for computing new target primitive information.
[0055] In step B2, the main process stores the received calculation results in the database of the main process and switches the running state to the waiting state to respond to the next triggered calculation request for the engineering system engineering quantity.
[0056] After obtaining the engineering quantity required for the calculation request, the calculation process sends the calculation result to the main process and switches the running state to a waiting state that can be used to calculate new target graphic element information; the main process stores the received calculation result in the database and switches the running state to a waiting state. If a new calculation request is generated by the front-end page of the engineering system, the main process will respond and continue to build the database pointed to by the target area identifier carried by the new calculation request, and allocate the database memory to an updated calculation process to calculate the engineering quantity required for the new calculation request.
[0057] Figure 4 Another optional application diagram of the method for calculating the engineering quantity of an engineering system is shown in FIG. Figure 4As shown, it can be seen that the execution order of each process when calculating the engineering quantity in the engineering system is as follows: the main process starts the calculation process after responding to the calculation request, the calculation process calls the calculation process interface to perform calculation operations, and the calculation process interface returns the progress message of the engineering quantity of the target graphic element information to the calculation process. The calculation process then returns the progress message of the engineering quantity of the target graphic element information to the main process so that the front-end page of the engineering system can perform data statistics. If the engineering quantity calculation of the target graphic element information is completed, the calculation process returns the "calculation process end" instruction to the main process, and the main process switches the running state to the waiting state, waiting for the next triggering operation of the calculation request. The calculation interface returns the "calculation end" instruction to the calculation process, and the calculation process switches the running state to the waiting state to form an available calculation process, waiting for the next start instruction issued by the main process.
[0058] Optionally, after executing the main process in step B2 to store the received calculation results in the database of the main process and switching the running state to the waiting state, the method further includes step C1:
[0059] In step C1, the main process clears the data memory of the associated database.
[0060] Furthermore, the main process stores the received calculation results in the database of the main process, and controls the associated calculation process to clear the associated database memory to realize real-time update of the calculation process storage information, avoid data confusion when storing the target graphic element information of the new calculation request, increase the processing pressure of the engineering system, and update the storage information of the calculation process so that only the target graphic element information corresponding to the current calculation request is stored in the database, which is convenient for calling and improves the efficiency of engineering quantity calculation.
[0061] Optionally, after executing the associated calculation process in step S2 to obtain all target primitive information pointed to by the target area identifier and creating a new thread for calculating the engineering quantity of the target primitive information according to the target primitive information, the method further includes steps D1 and D2:
[0062] Step D1: When the associated calculation process detects that any newly created thread has completed the calculation of the engineering quantity of the target primitive information, the calculation result is sent to the main process;
[0063] In step D2, the main process outputs the calculation results in a visual format to display the calculation progress and content of the engineering system.
[0064] When a new thread is used within a computational process to calculate the engineering quantities of target element information, once any newly created thread is detected to have completed the computation of the engineering quantities for the target element information, the computation result is sent to the main process, which then visually outputs the result, displaying the real-time computation progress and content of the engineering system. Furthermore, the computation parameters for the target element information, including element category and computation progress, can be obtained in real time. The calculated target element information is categorized and summarized by element category to obtain target element information of different categories. The computation progress of each thread is weighted and summed to generate the computation progress of the target element information engineering quantities. The target element information of each category and the corresponding computation progress are then visually output. This visual output allows for an intuitive display of the computational process, clearly showing how much engineering quantities of element information have been calculated at different times, the categories of the completed element information, and the number of completed element information in each category, facilitating data statistics.
[0065] Figure 5 Another optional flow chart of the engineering quantity calculation method of the engineering system is shown as follows: Figure 5 As shown, when the engineering system receives a request to calculate the engineering quantity, it responds to the calculation request, starts the summary calculation, selects the calculation floor and the calculation summary change engineering quantity according to the calculation request, and executes the calculation operation. During the calculation process, the background will visualize the calculation results and display the calculation progress in real time. If the calculation progress shows that all graphic element information has been calculated, the calculation ends.
[0066] In the actual engineering field, each graphic element information has its actual physical meaning, and the engineering components corresponding to each graphic element information are relatively independent in the dimension of engineering quantity calculation. When the present invention performs engineering quantity calculation by setting up two parts, namely the main process and the calculation process, it does not use multi-process and multi-threading to perform simple parallel calculation of the engineering quantity, nor does it simply disassemble the entire engineering quantity calculation process, with each part performing its own function. Instead, the two processes cooperate with each other to jointly process the calculation process of the graphic element information engineering quantity, so that the various processing links of the graphic element information establish a connection relationship, and each processing part has its own meaning and is indispensable to ensure the accuracy of the calculation of the engineering quantity of the graphic element information.
[0067] The engineering quantity calculation method of the engineering system provided in this embodiment sets the engineering system for statistical engineering quantities into two processing processes, namely a main process and a calculation process. The two processes work together to complete the calculation of engineering quantities. In specific implementation, when a user uses the engineering system to perform an engineering quantity statistical operation and triggers a calculation request, the main process responds to the triggered calculation request, builds a database associated with the target area identifier carried in the calculation request, and allocates the data memory of the database to an associated available calculation process. In other words, the main process of the engineering system builds a database containing primitive information for the calculation process based on the calculation request, which alleviates the pressure on the engineering system during the data call process. At the same time, because the database associated with the calculation process only contains the primitive information corresponding to the calculation request, the storage information is small and confusion with primitive information in other areas is avoided, which facilitates primitive information call and improves the efficiency of engineering quantity calculation. The associated calculation process obtains the target primitive information pointed to by the target area identifier and creates a new thread for calculating the engineering quantity of the target primitive information based on the target primitive information. The engineering quantity calculation results of each new thread are obtained and statistically analyzed to obtain the engineering quantity required for the calculation request. Different calculation requests may correspond to different target primitive information. By creating threads based on the target primitive information, the method for calculating the engineering quantity of the target primitive information can be intelligently selected to avoid wasting engineering system resources. Simultaneously, the newly created threads can calculate the engineering quantities of the target primitive information simultaneously, improving computational efficiency. This application solves the technical problem of low efficiency in conventional engineering quantity calculations using manual calculations or calculation software, effectively improving the efficiency of engineering quantity calculations in engineering systems.
[0068] Example 2
[0069] The second embodiment of the present invention further provides an engineering quantity calculation device for an engineering system, which corresponds to the engineering quantity calculation method for an engineering system provided in the first embodiment above. The corresponding technical features and technical effects will not be described in detail in this embodiment, and the relevant parts can be referred to the first embodiment above. Specifically, Figure 6 The following is a structural diagram of an engineering quantity calculation device for an engineering system. Figure 6 As shown, the engineering system includes a main process and a calculation process. The engineering quantity calculation device 600 of the engineering system includes a construction module 601, a creation module 602 and a generation module 603, wherein:
[0070] A construction module 601 is used to control the main process to respond to a triggered calculation request for calculating the engineering system engineering quantity, construct a database associated with the target area identifier carried in the calculation request, and allocate the database data memory to an associated available calculation process;
[0071] The creation module 602 is connected to the construction module 601 and is used to control the associated calculation process to obtain all target primitive information pointed to by the target area identifier, and to create a new thread for calculating the engineering quantity of the target primitive information according to the target primitive information;
[0072] The generation module 603 is connected to the creation module 602 and is used to control the main process to obtain the engineering quantity calculation results of each new thread and perform statistics to obtain the engineering quantity required for the calculation request.
[0073] Optionally, the construction module includes: an acquisition submodule, used to search for identification information corresponding to the target area identifier in the database of the main process, wherein the database of the main process stores all graphic element information in the engineering system and the identification information of each graphic element information; a statistical submodule, used to obtain the graphic element information corresponding to the searched identification information, use the graphic element information as data memory to build a database, and use the constructed database as a database associated with the target area identifier carried in the calculation request.
[0074] Optionally, the creation module includes: a first determination submodule, used to determine the amount of graphic element information in the associated database; a second determination submodule, used to determine the number of new threads to be created for calculating the engineering workload of the target graphic element information based on the amount of graphic element information in the associated database.
[0075] Optionally, when the second determination submodule executes the step of determining the number of new threads to be created for calculating the engineering quantity of target graphic element information according to the number of graphic element information in the associated database, it is specifically used to: if the number of graphic element information in the associated database is less than or equal to a preset threshold, create new threads with the same number as the number of graphic element information in the associated database, and each new thread calculates the engineering quantity of one graphic element information; if the number of graphic element information in the associated database is greater than the preset threshold, create new threads with the same number as the preset threshold, mark the graphic element information in the associated database with serial numbers, and determine the graphic element information according to the serial number of each graphic element information. Whether the new thread created is shared with other graphic element information, where if the sequence number of the graphic element information is less than or equal to the preset threshold, it is determined that the graphic element information does not need to share the new thread created with other graphic element information, and a new thread is directly assigned to the graphic element information to calculate the engineering quantity. If the sequence number of the graphic element information is greater than the preset threshold, it is determined that the graphic element information needs to share the new thread created with other graphic element information, and the graphic element information is put into the waiting sequence pool for waiting. When there is an idle new thread among the created new threads, the graphic element information waiting in the waiting sequence pool is assigned to the idle new thread until the engineering quantity calculation of each graphic element information is completed.
[0076] Optionally, the device also includes a switching module, which is specifically used to: the associated calculation process sends the calculation result to the main process, and switches the running state to a waiting state that can be used to calculate new target graphic element information; the main process stores the received calculation result in the database of the main process, and switches the running state to a waiting state to respond to the calculation request of the engineering system engineering quantity triggered next time.
[0077] Optionally, the device further includes a cleaning module, specifically configured to: enable the main process to clear the data memory of the associated database.
[0078] Optionally, the device also includes a display module, which is specifically used to: when the associated calculation process detects that any new thread created completes the calculation of the engineering quantity of the target graphic element information, the calculation result is sent to the main process; the main process outputs the calculation result visually to display the calculation progress and calculation content of the engineering system.
[0079] Example 3
[0080] Figure 7 The block diagram of a computer device suitable for implementing the engineering quantity calculation method of an engineering system provided by the third embodiment of the present invention is shown. In this embodiment, the computer device 700 can be a smart phone, tablet computer, laptop computer, desktop computer, rack server, blade server, tower server or cabinet server (including an independent server or a server cluster composed of multiple servers) that executes a program. Figure 7 As shown, the computer device 700 of this embodiment includes at least but not limited to: a memory 701, a processor 702, and a network interface 703 that can be interconnected via a system bus. It should be noted that Figure 7 Computer device 700 is shown having only components 701 - 703 , but it is understood that implementing all of the illustrated components is not a requirement, and more or fewer components may alternatively be implemented.
[0081] In this embodiment, the memory 703 includes at least one type of computer-readable storage medium, including flash memory, hard disk, multimedia card, card-type memory (e.g., SD or DX memory), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic storage, magnetic disk, optical disk, etc. In some embodiments, the memory 701 can be an internal storage unit of the computer device 700, such as the hard disk or memory of the computer device 700. In other embodiments, the memory 701 can also be an external storage device of the computer device 700, such as a plug-in hard disk equipped on the computer device 700, a smart memory card (SMC), a secure digital (SD) card, a flash memory card, etc. Of course, the memory 701 can also include both the internal storage unit of the computer device 700 and its external storage device. In this embodiment, the memory 701 is generally used to store the operating system and various application software installed on the computer device 700, such as the program code of the engineering quantity calculation method of the engineering system.
[0082] In some embodiments, processor 702 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chip. Processor 702 is typically used to control the overall operation of computer device 700. For example, it performs control and processing related to data exchange or communication with computer device 700. In this embodiment, processor 702 is used to execute the program code for the steps of the engineering quantity calculation method for the engineering system stored in memory 701.
[0083] In this embodiment, the engineering quantity calculation method of the engineering system stored in the memory 701 can also be divided into one or more program modules and executed by one or more processors (processor 702 in this embodiment) to complete the present invention.
[0084] The network interface 703 may include a wireless network interface or a wired network interface. The network interface 703 is generally used to establish a communication link between the computer device 700 and other computer devices. For example, the network interface 703 is used to connect the computer device 700 to an external terminal via a network, and to establish a data transmission channel and a communication link between the computer device 700 and the external terminal. The network can be a wireless or wired network such as an intranet, the Internet, the Global System of Mobile Communications (GSM), Wideband Code Division Multiple Access (WCDMA), a 4G network, a 5G network, Bluetooth, or Wi-Fi.
[0085] Example 4
[0086] This embodiment also provides a computer-readable storage medium, including flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, disk, optical disk, server, App application store, etc., on which a computer program is stored, and when the computer program is executed by a processor, the steps of the engineering quantity calculation method of the engineering system are implemented.
[0087] Obviously, those skilled in the art should understand that the various modules or steps of the above-mentioned embodiments of the present invention can be implemented using a general-purpose computing device, they can be concentrated on a single computing device, or distributed across a network composed of multiple computing devices. Alternatively, they can be implemented using program code executable by the computing device, so that they can be stored in a storage device and executed by the computing device. In some cases, the steps shown or described can be performed in a different order than herein, or they can be made into separate integrated circuit modules, or multiple modules or steps can be made into a single integrated circuit module for implementation. Thus, the embodiments of the present invention are not limited to any specific combination of hardware and software.
[0088] It should be noted that the serial numbers of the embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0089] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above embodiment methods can be implemented by means of software plus the necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method.
[0090] The above are only preferred embodiments of the present invention and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention description and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A method for calculating the engineering quantity of an engineering system, characterized in that: The engineering system includes a main process and a calculation process, and the method includes: The main process, in response to a triggered calculation request for calculating the engineering system engineering quantity, constructs a database associated with the target area identifier carried in the calculation request, and allocates data memory of the database to an associated available calculation process; The associated calculation process obtains all target primitive information pointed to by the target area identifier, and creates a new thread for calculating the engineering quantity of the target primitive information according to the target primitive information; wherein the associated database only contains the target primitive information corresponding to the calculation request; The main process obtains the engineering workload calculation results of each of the new threads and performs statistics to obtain the engineering workload required for the calculation request.
2. The method according to claim 1, characterized in that The main process, in response to a triggered calculation request for calculating engineering system engineering quantities, constructs a database associated with a target area identifier carried in the calculation request, including: Searching for identification information corresponding to the target area identifier in a database of the main process, wherein the database of the main process stores all graphic element information in the engineering system and identification information of each graphic element information; Obtain the graphic element information corresponding to the identified information found, use the graphic element information as data memory to construct a database, and use the constructed database as a database associated with the target area identifier carried in the calculation request.
3. The method according to claim 2, characterized in that The associated calculation process obtains the target primitive information pointed to by the target area identifier, and creates a new thread for calculating the engineering workload of the target primitive information according to the target primitive information, including: Determining the amount of graphic element information in the associated database; The number of new threads created for calculating the workload of the target graphic element information is determined according to the number of graphic element information in the associated database.
4. The method according to claim 3, characterized in that The determining, according to the amount of graphic element information in the associated database, the number of new threads to be created for calculating the engineering workload of the target graphic element information includes: If the amount of graphic element information in the associated database is less than or equal to a preset threshold, creating new threads with the same number as the amount of graphic element information in the associated database, each of the new threads calculating the engineering workload of one graphic element information; If the number of graphic element information in the associated database is greater than the preset threshold, create new threads with the same number as the preset threshold, mark the graphic element information in the associated database with serial numbers, and determine whether the graphic element information shares the new thread created with other graphic element information based on the serial number of each graphic element information. If the serial number of the graphic element information is less than or equal to the preset threshold, it is determined that the graphic element information does not need to share the new thread created with other graphic element information, and the graphic element information is directly assigned to the created new thread to calculate the engineering volume. If the serial number of the graphic element information is greater than the preset threshold, it is determined that the graphic element information needs to share the new thread created with other graphic element information, and the graphic element information is put into the waiting sequence pool for waiting. When there is an idle new thread among the created new threads, the graphic element information waiting in the waiting sequence pool is assigned to the idle new thread until the engineering volume calculation of each graphic element information is completed.
5. The method according to claim 1, wherein After obtaining the engineering workload calculation results of each of the new threads and performing statistics to obtain the engineering workload required for the calculation request, the method further includes: The associated calculation process sends the calculation result to the main process, and switches the running state to a waiting state that can be used to calculate new target primitive information; The main process stores the received calculation results in the database of the main process, and switches the running state to the waiting state to respond to the calculation request of the engineering system engineering quantity triggered next time.
6. The method according to claim 5, characterized in that After the main process stores the received calculation result in the database of the main process and switches the running state to the waiting state, the method further includes: The main process clears the data memory of the associated database.
7. The method according to claim 1, characterized in that After the associated calculation process obtains all target primitive information pointed to by the target area identifier and creates a new thread for calculating the engineering workload of the target primitive information according to the target primitive information, the method further includes: When the associated calculation process detects that any of the newly created threads completes the calculation of the engineering quantity of the target primitive information, the calculation result is sent to the main process; The main process outputs the calculation results in a visual manner to display the calculation progress and calculation content of the engineering system.
8. An engineering quantity calculation device for an engineering system, characterized in that: The engineering system includes a main process and a calculation process, and the device includes: a construction module, configured to control the main process to respond to a triggered calculation request for calculating the engineering system engineering quantity, construct a database associated with the target area identifier carried in the calculation request, and allocate data memory of the database to an associated available calculation process; a creation module, configured to control the associated calculation process to obtain all target primitive information pointed to by the target region identifier, and to create a new thread for calculating the engineering quantity of the target primitive information based on the target primitive information; wherein the associated database only contains the target primitive information corresponding to the calculation request; The generation module is used to control the main process to obtain the engineering quantity calculation results of each new thread and perform statistics to obtain the engineering quantity required for the calculation request.
9. A computer device, comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.