CN111597364B - Engineering quantity calculation middle layer generation method and device, storage medium and electronic equipment - Google Patents

Engineering quantity calculation middle layer generation method and device, storage medium and electronic equipment Download PDF

Info

Publication number
CN111597364B
CN111597364B CN202010227732.XA CN202010227732A CN111597364B CN 111597364 B CN111597364 B CN 111597364B CN 202010227732 A CN202010227732 A CN 202010227732A CN 111597364 B CN111597364 B CN 111597364B
Authority
CN
China
Prior art keywords
primitive
data
file
storing
identifier
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010227732.XA
Other languages
Chinese (zh)
Other versions
CN111597364A (en
Inventor
秦国海
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Glodon Co Ltd
Original Assignee
Glodon Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Glodon Co Ltd filed Critical Glodon Co Ltd
Priority to CN202010227732.XA priority Critical patent/CN111597364B/en
Publication of CN111597364A publication Critical patent/CN111597364A/en
Application granted granted Critical
Publication of CN111597364B publication Critical patent/CN111597364B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/50Information retrieval; Database structures therefor; File system structures therefor of still image data
    • G06F16/51Indexing; Data structures therefor; Storage structures

Abstract

The embodiment of the invention relates to a method and a device for generating an engineering quantity calculation middle layer, a storage medium and electronic equipment, wherein the method comprises the following steps: when a target project is operated, creating a main thread timer corresponding to the target project; acquiring a first identifier of a primitive contained in the target project, and storing the first identifier into a primitive list to be generated; when the main thread timer is triggered, generating first primitive data corresponding to the first identifier in the primitive list to be generated; and storing the first primitive data into a file according to a preset storage mode.

Description

Engineering quantity calculation middle layer generation method and device, storage medium and electronic equipment
Technical Field
The embodiment of the invention relates to the technical field of engineering quantity calculation, in particular to a method and a device for generating an engineering quantity calculation middle layer, a storage medium and electronic equipment.
Background
With the increasing demands of engineering computing performance, it is desirable to have as little computing time as possible in the process of computing and to be able to implement real-time computing, so various solutions such as multi-threaded computing, distributed computing, cloud computing, etc. have emerged.
However, because the data volume of the engineering volume calculation design is relatively large, the processing links are relatively more, and especially for some relatively large engineering, for example, relatively common relatively large engineering comprises 10 ten thousand primitives, 20 ten thousand primitives and the like, the calculation needs several ten minutes or even several hours once, the calculation efficiency is low, and the user experience is poor.
Disclosure of Invention
In view of the above, in order to solve the above technical problems or part of the technical problems, an embodiment of the present invention provides a method, an apparatus, a storage medium, and an electronic device for generating an engineering quantity calculation intermediate layer.
In a first aspect, an embodiment of the present invention provides a method for generating an engineering quantity calculation intermediate layer, where the method includes:
when a target project is operated, creating a main thread timer corresponding to the target project;
acquiring a first identifier of a primitive contained in the target project, and storing the first identifier into a primitive list to be generated;
when the main thread timer is triggered, generating first primitive data corresponding to the first identifier in the primitive list to be generated;
and storing the first primitive data into a file according to a preset storage mode.
In one possible embodiment, the method further comprises:
when the model in the target project is edited, determining a second identification of the edited primitive from the primitives contained in the target project, and storing the second identification into a primitive update list;
generating second primitive data corresponding to the second identifier in a primitive update list when the main thread timer is triggered;
and updating the second primitive data into a file.
In one possible implementation manner, the storing the first primitive data in a file according to a preset storage manner includes:
storing the first primitive data into a cache;
and when the number of the first primitive data in the cache exceeds a preset threshold, storing the first primitive data in the cache into a file according to a preset storage mode.
In one possible implementation manner, the storing the first primitive data in a file according to a preset storage manner includes:
and the first primitive data is distributed evenly and stored in a plurality of files.
In one possible implementation manner, the generating, when the main thread timer triggers, first primitive data corresponding to the first identifier in the primitive list to be generated includes:
monitoring whether the main thread is in an idle state;
if the main thread is in an idle state, triggering the main thread timer;
and when the main thread timer is triggered, generating first primitive data corresponding to the first identifier in the primitive list to be generated.
In a second aspect, an embodiment of the present invention provides an engineering quantity calculation intermediate layer generating apparatus, including:
the timer creation module is used for creating a main thread timer corresponding to the target project when the target project is operated;
the identification storage module is used for acquiring a first identification of the primitive contained in the target project and storing the first identification into a primitive list to be generated;
the first generation module is used for generating first primitive data corresponding to the first identifier in the primitive list to be generated when the main thread timer is triggered;
and the data storage module is used for storing the first primitive data into a file according to a preset storage mode.
In one possible embodiment, the apparatus further comprises:
the identification determining module is used for determining a second identification of the edited primitive from the primitives contained in the target project when the model in the target project is edited, and storing the second identification into a primitive update list;
the second generation module is used for generating second primitive data corresponding to the second identifier in the primitive update list when the main thread timer is triggered;
and the data updating module is used for updating the second primitive data into the file.
In one possible implementation, the data storage module is specifically configured to:
storing the first primitive data into a cache;
and when the number of the first primitive data in the cache exceeds a preset threshold, storing the first primitive data in the cache into a file according to a preset storage mode.
In a third aspect, embodiments of the present invention provide a storage medium storing one or more programs executable by one or more processors to implement the foregoing engineering calculation middle layer generation method.
In a fourth aspect, an embodiment of the present invention provides an electronic device, including: the system comprises a processor and a memory, wherein the processor is used for executing an engineering quantity calculation middle layer generating program stored in the memory so as to realize the engineering quantity calculation middle layer generating method.
According to the technical scheme provided by the embodiment of the invention, the first identification of the primitive contained in the target project is obtained by creating the main thread timer corresponding to the target project and is stored in the primitive list to be generated, when the main thread timer is triggered, the first primitive data corresponding to the first identification in the primitive list to be generated is generated, and the first primitive data is stored in the file according to the preset storage mode, so that the project calculation middle layer is generated based on the primitive, and the calculation efficiency and the user experience are improved.
Drawings
In order to more clearly illustrate the embodiments of the present description or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments described in the embodiments of the present description, and other drawings may be obtained according to these drawings for a person having ordinary skill in the art.
FIG. 1 is a schematic diagram showing a specific construction of an engineering quantity calculation intermediate layer according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of a specific construction of primitive data according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of an implementation flow of a method for generating an engineering quantity calculation intermediate layer according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of storing primitive data according to an embodiment of the present invention;
FIG. 5 is a schematic diagram of a primitive update according to an embodiment of the present invention;
FIG. 6 is a schematic diagram of a construction of an engineering calculation middle layer generating apparatus according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is apparent that the described embodiments are some embodiments of the present invention, but not all embodiments of the present invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
For the purpose of facilitating an understanding of the embodiments of the present invention, reference will now be made to the following description of specific embodiments, taken in conjunction with the accompanying drawings, which are not intended to limit the embodiments of the invention.
In the embodiment of the present invention, first, the inventive concept of the embodiment of the present invention is described, and the engineering quantity calculating intermediate layer is composed of graphic metadata, component data, engineering setting information, calculation setting information, and the like, where the graphic metadata occupies most of the engineering quantity calculating intermediate layer, and occupies almost all of the engineering quantity calculating intermediate layer to be generated, as shown in fig. 1, and is a specific composition of the engineering quantity calculating intermediate layer.
Through analysis, the engineering quantity calculation middle layer shown in fig. 1 has smaller data quantity except the primitive data, but the logic relationship is very complex, the extracted increment is difficult to generate, and the primitive data with the largest occupation ratio is seen in a focus point, as shown in fig. 2, which is a specific composition of the primitive data.
As can be seen from fig. 2, the primitive data itself mainly comprises two parts of primitive attribute data and primitive geometry data, and the primitive geometry data in the actual calculation model is calculated from the attribute data, so that in theory, only the primitive attribute data needs to be monitored. The embodiment of the invention is mainly based on an incremental updating scheme (a specific method is shown in the following), the relationship between the graphic element and other data of the middle layer and the relationship between the graphic element and the whole engineering are combed around the graphic element, the data required by the graphic element, such as component data and floor data, are generated and all come into a monitoring range, and the synchronization and the correctness of the data are kept at all times; the data which is irrelevant to the generation of the middle layer, such as calculation setting, form input and the like, can be completely omitted, so that the incremental processing of the main data is ensured, and the complexity of the whole scheme is reduced as far as possible.
As shown in fig. 3, a schematic implementation flow chart of a method for generating an engineering quantity calculation intermediate layer according to an embodiment of the present invention may specifically include the following steps:
s301, when a target project is operated, creating a main thread timer corresponding to the target project;
in the embodiment of the invention, because the calculation model is complex, the special creation of a thread in the background processing can involve a large amount of multithread asynchronous processing risks, and data access abnormality is very easy to occur. Therefore, the internal timer technology of the thread is adopted, and the timer is triggered to process when the modeling thread is idle, so that at least one graphic element is processed each time, and the graphic element is generally within 10 milliseconds, so that the modeling thread is not affected perceptibly, the data processing safety is ensured, and the user operation experience is not affected.
Based on the above, when the target project is run, a main thread timer corresponding to the target project is created. Wherein it may be that the timer may implement a timed trigger specification function within the current thread.
S302, acquiring a first identifier of a primitive contained in the target project, and storing the first identifier into a primitive list to be generated;
after the main thread timer corresponding to the target project is created, a first identifier of the primitive contained in the target project can be acquired and stored in a primitive list to be generated. The first identifier may be an ID of the primitive, which is not limited in the embodiment of the present invention.
S303, when the main thread timer is triggered, generating first primitive data corresponding to the first identifier in the primitive list to be generated;
when the main thread timer is triggered, generating first primitive data corresponding to the first identifier in the primitive list to be generated, which may specifically be generating the corresponding primitive data one by one.
In the embodiment of the invention, whether the main thread is in an idle state is monitored; if the main thread is in an idle state, triggering the main thread timer; and when the main thread timer is triggered, generating first primitive data corresponding to the first identifier in the primitive list to be generated.
S304, storing the first primitive data into a file according to a preset storage mode.
The main data of the engineering calculation middle layer is the primitive data, and the primitives have no relation, so that the incremental generation of the whole middle layer (namely the engineering calculation middle layer) is basically realized as long as the incremental generation of the primitives is realized, and other small amount of data can be generated in real time during the click calculation, and the basic principle is shown in fig. 4.
Therefore, the generated first primitive data can be stored into a file according to a preset storage mode. Wherein, the primitive buffer technology is utilized, namely, the first primitive data is stored in a buffer; and when the number of the first primitive data in the cache exceeds a preset threshold, storing the first primitive data in the cache into a file according to a preset storage mode.
For example, in the embodiment of the present invention, instead of writing a file once for every primitive data generated, the data generated at present is first cached in a cache list, and is not written into the file once until the number of cached primitives reaches a certain number (for example, 1000 primitives are already reached), so that the problem of performance consumption of writing the file frequently is reduced by this method.
In addition, when the model in the target project is edited, determining a second identification of the edited primitive from the primitives contained in the target project, and storing the second identification into a primitive update list; generating second primitive data corresponding to the second identifier in a primitive update list when the main thread timer is triggered; and updating the second primitive data into a file.
For example, when a user modifies or adds and deletes primitive data, the change of the primitive data is monitored to determine which primitives need to be regenerated or deleted, and the specific mode can be through monitoring a database or monitoring a modeling model, wherein the primitive change related message of the modeling model is monitored, after the primitive change message is obtained, the ID of the modified primitive is obtained, and then the ID is added into a primitive update list;
when a user modifies or adds and deletes component data, the ID of the modified component is obtained through a monitoring component, then all the corresponding primitive IDs are obtained through the component ID, and then the primitive IDs are added into a primitive update list;
when the primitive exists in the primitive updating list, traversing all primitive IDs in the primitive updating list, searching through the stored primitive list, and if the primitive does not exist, directly generating the data of the primitive and adding the data into a storage file; if the primitive does not exist in the modeling model, directly finding the stored data of the primitive and deleting the stored data; if the primitive is already in the stored primitive list, the data of the primitive is first generated, and the file in which the primitive is located and the position of the primitive in the file are found for updating.
Incremental updates involve updates to already generated primitive data, update efficiency is an important indicator of the present invention, and how to guarantee update efficiency is an important part of the present invention.
The method realizes the rapid updating of the graphic metadata by a multi-file storage and single-file updating method. The specific method is that the graphic metadata is divided into a plurality of parts, each part is about 1 megabyte, and when the size of one storage file exceeds 1 megabyte, another file is newly built for storage.
When the primitive data is changed, the invention meets the requirement of the primitive data update on the performance by a whole memory copying method based on the memory mapping. The overall detailed description is as follows:
acquiring a change primitive ID;
generating middle memory data according to the ID;
streaming into byte streams;
finding the file in which the data are located according to the ID;
opening an original file in a memory mapping mode;
creating a new file, opening the new file in a memory mapping mode, and setting the file length of the new file through calculation;
copying the data before the primitive to a new file according to the initial position of the primitive;
writing byte stream data corresponding to the current graphic element into the end of a new file;
copying the data after the primitive to the end of a new file according to the end position of the primitive;
and saving the file to finish updating.
The updating schematic diagram shown in fig. 5 is used to facilitate understanding of the principle, and based on different file sizes, the statistics of time for updating the primitives once are as follows, wherein about 0.02 seconds is required for 1 megafile to be updated once, about 0.05 seconds is required for 10 megafiles to be updated once, about 0.8 seconds is required for 100 megafiles to be updated once, and about 6 seconds is required for 500 megafiles to be updated once.
The primitive list in the embodiment of the invention needs to meet two requirements, namely, quick searching and high-efficiency updating. The embodiment of the invention can be quickly searched by using a conventional map mapping table, and the embodiment of the invention is efficiently updated by a custom linked list structure. Conventionally, the embodiment of the present invention records a file in which primitive information is located, and records a start position and an end position of the primitive in the file, which has a problem that when updating data of one primitive, the embodiment of the present invention needs to calculate and update the start position and the end position of all subsequent primitives, so that the embodiment of the present invention specifically designs a linked list data structure only recording the length of the primitive data, where:
struct EDOInfo{
int fileNum;
int length;
EDOInfo*preEDO;
EDOInfo*nextEDO;
int elementID;
}
the structure body records basic belonging file information and belonging component information, and simultaneously records the length of the graphic element data and the front-back associated graphic element. Therefore, the starting position and the ending position of each graphic element are not dependent on the starting information and the ending information recorded by the graphic element, but are dependent on the information of the graphic element before the graphic element, so that the embodiment of the invention only needs to change the information of the graphic element when changing the current graphic element information, and if the graphic element is deleted, only two graphic elements related before and after the graphic element are changed, thereby greatly improving the updating efficiency of the graphic element data.
The position information of each graphic element only depends on the stored length information and the information of the graphic element at the front side, when the initial position of a graphic element needs to be calculated, the initial position of the graphic element can be calculated by adding the lengths of all graphic elements at the front side of the graphic element, and the end position of the graphic element can be calculated by adding the lengths of the graphic element.
StartPosition=length1+length2+…+length(n-1);
EndPosition=StartPosition+lengthn;
Therefore, the updating speed of the structure is very fast in theory, and only the information of one primitive needs to be updated whenever the one primitive is changed, and the embodiment of the invention becomes very efficient when the local primitive is updated again by combining the efficient file updating technology realized in the above.
Through the description of the technical scheme provided by the embodiment of the invention, the first identification of the primitive contained in the target project is obtained by creating the main thread timer corresponding to the target project and is stored in the primitive list to be generated, when the main thread timer is triggered, the first primitive data corresponding to the first identification in the primitive list to be generated is generated, and the first primitive data is stored in the file according to the preset storage mode, so that the project calculation middle layer is generated based on the primitive, and the calculation efficiency and the user experience are improved.
Compared with the method embodiment, the embodiment of the invention also provides an embodiment of an engineering quantity calculation middle layer generating device, as shown in fig. 6, the device can comprise: a timer creation module 610, an identification storage module 620, a first generation module 630, a data storage module 640.
A timer creation module 610, configured to create a main thread timer corresponding to a target project when the target project is run;
the identifier storage module 620 is configured to obtain a first identifier of a primitive included in the target project, and store the first identifier in a primitive list to be generated;
a first generating module 630, configured to generate, when the main thread timer triggers, first primitive data corresponding to the first identifier in the primitive list to be generated;
the data storage module 640 is configured to store the first primitive data into a file according to a preset storage manner.
Fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present invention, and an electronic device 700 shown in fig. 7 includes: at least one processor 701, memory 702, at least one network interface 704, and other user interfaces 703. The various components in the electronic device 700 are coupled together by a bus system 705. It is appreciated that the bus system 705 is used to enable connected communications between these components. The bus system 705 includes a power bus, a control bus, and a status signal bus in addition to the data bus. But for clarity of illustration, the various buses are labeled as bus system 705 in fig. 7.
The user interface 703 may include, among other things, a display, a keyboard, or a pointing device (e.g., a mouse, a trackball, a touch pad, or a touch screen, etc.).
It is to be appreciated that memory 702 in embodiments of the invention may be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile memory may be a Read-only memory (ROM), a programmable Read-only memory (ProgrammableROM, PROM), an erasable programmable Read-only memory (ErasablePROM, EPROM), an electrically erasable programmable Read-only memory (ElectricallyEPROM, EEPROM), or a flash memory, among others. The volatile memory may be a random access memory (RandomAccessMemory, RAM) that acts as an external cache. By way of example, and not limitation, many forms of RAM are available, such as Static RAM (SRAM), dynamic random access memory (DynamicRAM, DRAM), synchronous dynamic random access memory (SynchronousDRAM, SDRAM), double data rate synchronous dynamic random access memory (DoubleDataRateSDRAM, DDRSDRAM), enhanced synchronous dynamic random access memory (EnhancedSDRAM, ESDRAM), synchronous link dynamic random access memory (SynchlinkDRAM, SLDRAM), and direct memory bus random access memory (DirectRambusRAM, DRRAM). The memory 702 described herein is intended to comprise, without being limited to, these and any other suitable types of memory.
In some implementations, the memory 702 stores the following elements, executable units or data structures, or a subset thereof, or an extended set thereof: an operating system 7021 and application programs 7022.
The operating system 7021 contains various system programs, such as a framework layer, a core library layer, a driver layer, and the like, for implementing various basic services and processing hardware-based tasks. The application programs 7022 include various application programs such as a media player (MediaPlayer), a Browser (Browser), and the like for realizing various application services. A program for implementing the method of the embodiment of the present invention may be contained in the application program 7022.
In the embodiment of the present invention, the processor 701 is configured to execute the method steps provided by the method embodiments by calling a program or an instruction stored in the memory 702, specifically, a program or an instruction stored in the application program 7022, for example, including: when a target project is operated, creating a main thread timer corresponding to the target project; acquiring a first identifier of a primitive contained in the target project, and storing the first identifier into a primitive list to be generated; when the main thread timer is triggered, generating first primitive data corresponding to the first identifier in the primitive list to be generated; and storing the first primitive data into a file according to a preset storage mode.
The method disclosed in the above embodiment of the present invention may be applied to the processor 701 or implemented by the processor 701. The processor 701 may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware in the processor 701 or by instructions in the form of software. The processor 701 described above may be a general purpose processor, a digital signal processor (DigitalSignalProcessor, DSP), an application specific integrated circuit (ApplicationSpecificIntegratedCircuit, ASIC), an off-the-shelf programmable gate array (FieldProgrammableGateArray, FPGA) or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component. The disclosed methods, steps, and logic blocks in the embodiments of the present invention may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of the method disclosed in connection with the embodiments of the present invention may be embodied directly in the execution of a hardware decoding processor, or in the execution of a combination of hardware and software elements in a decoding processor. The software elements may be located in a random access memory, flash memory, read-only memory, programmable read-only memory or electrically erasable programmable memory, registers, etc. as well known in the art. The storage medium is located in a memory 702, and the processor 701 reads information in the memory 702 and performs the steps of the method in combination with its hardware.
It is to be understood that the embodiments described herein may be implemented in hardware, software, firmware, middleware, microcode, or a combination thereof. For a hardware implementation, the processing units may be implemented within one or more application specific integrated circuits (ApplicationSpecificIntegratedCircuits, ASIC), digital signal processors (DigitalSignalProcessing, DSP), digital signal processing devices (dspev), programmable logic devices (ProgrammableLogicDevice, PLD), field programmable gate arrays (Field-ProgrammableGateArray, FPGA), general purpose processors, controllers, micro-controllers, microprocessors, other electronic units configured to perform the functions described herein, or a combination thereof.
For a software implementation, the techniques described herein may be implemented by means of units that perform the functions described herein. The software codes may be stored in a memory and executed by a processor. The memory may be implemented within the processor or external to the processor.
The electronic device provided in this embodiment may be an electronic device as shown in fig. 7, and may perform all the steps of the method for generating the engineering quantity calculation middle layer as shown in fig. 3, so as to achieve the technical effects of the method for generating the engineering quantity calculation middle layer as shown in fig. 3, and specifically please refer to the related description of fig. 3, which is not repeated herein for brevity.
The embodiment of the invention also provides a storage medium (computer readable storage medium). The storage medium here stores one or more programs. Wherein the storage medium may comprise volatile memory, such as random access memory; the memory may also include non-volatile memory, such as read-only memory, flash memory, hard disk, or solid state disk; the memory may also comprise a combination of the above types of memories.
When one or more programs in the storage medium are executable by one or more processors, the above-described engineering quantity calculation intermediate layer generating method executed on the engineering quantity calculation intermediate layer generating apparatus side is implemented.
The processor is configured to execute an engineering quantity calculation middle layer generation program stored in the memory to implement the following steps of an engineering quantity calculation middle layer generation method executed on an engineering quantity calculation middle layer generation apparatus side:
when a target project is operated, creating a main thread timer corresponding to the target project; acquiring a first identifier of a primitive contained in the target project, and storing the first identifier into a primitive list to be generated; when the main thread timer is triggered, generating first primitive data corresponding to the first identifier in the primitive list to be generated; and storing the first primitive data into a file according to a preset storage mode.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative elements and steps are described above generally in terms of function in order to clearly illustrate the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied in hardware, in a software module executed by a processor, or in a combination of the two. The software modules may be disposed in Random Access Memory (RAM), memory, read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
The foregoing description of the embodiments has been provided for the purpose of illustrating the general principles of the invention, and is not meant to limit the scope of the invention, but to limit the invention to the particular embodiments, and any modifications, equivalents, improvements, etc. that fall within the spirit and principles of the invention are intended to be included within the scope of the invention.

Claims (8)

1. An engineering quantity calculation intermediate layer generation method, characterized in that the method comprises the following steps:
when a target project is operated, creating a main thread timer corresponding to the target project;
acquiring a first identifier of a primitive contained in the target project, and storing the first identifier into a primitive list to be generated;
when the main thread timer is triggered, generating first primitive data corresponding to the first identifier in the primitive list to be generated;
storing the first primitive data into a file according to a preset storage mode;
when the user is detected to edit the model in the target project, determining a second identification of the edited primitive from the primitives contained in the target project, and storing the second identification into a primitive update list;
generating middle layer memory data of the edited graphic element according to the second identifier, and streaming the middle layer memory data into byte stream data corresponding to the edited graphic element;
generating second primitive data corresponding to the second identifier in a primitive update list when the main thread timer is triggered;
finding an original file in which the edited primitive is located according to the second identifier, and opening the original file in a memory mapping mode;
creating a new file in the original file, and opening the new file in a memory mapping mode;
determining a primitive starting position and a primitive ending position of the new file by calculating and setting the file length of the new file;
copying data before the edited graphic element into the new file according to the graphic element starting position, writing byte stream data corresponding to the edited graphic element into the end of the new file, and copying data after the edited graphic element to the end of the new file according to the graphic element ending position;
saving the new file to complete the updating of the primitive data;
the method further comprises the steps of:
and generating a linked list data structure for recording the length of the graphic primitive data, wherein the linked list data structure records the file information and the member information of the graphic primitive data, and the length of the graphic primitive data and the front and back associated graphic primitives.
2. The method of claim 1, wherein storing the first primitive data in a file according to a preset storage manner includes:
storing the first primitive data into a cache;
and when the number of the first primitive data in the cache exceeds a preset threshold, storing the first primitive data in the cache into a file according to a preset storage mode.
3. The method of claim 1, wherein storing the first primitive data in a file according to a preset storage manner includes:
and the first primitive data is distributed evenly and stored in a plurality of files.
4. The method of claim 1, wherein the generating first primitive data corresponding to the first identification in the to-be-generated primitive list when the main thread timer is triggered comprises:
monitoring whether the main thread is in an idle state;
if the main thread is in an idle state, triggering the main thread timer;
and when the main thread timer is triggered, generating first primitive data corresponding to the first identifier in the primitive list to be generated.
5. An engineering calculation intermediate layer generating apparatus, characterized in that the apparatus comprises:
the timer creation module is used for creating a main thread timer corresponding to the target project when the target project is operated;
the identification storage module is used for acquiring a first identification of the primitive contained in the target project and storing the first identification into a primitive list to be generated;
the first generation module is used for generating first primitive data corresponding to the first identifier in the primitive list to be generated when the main thread timer is triggered;
the data storage module is used for storing the first primitive data into a file according to a preset storage mode;
the device is also for:
when the user is detected to edit the model in the target project, determining a second identification of the edited primitive from the primitives contained in the target project, and storing the second identification into a primitive update list;
generating middle layer memory data of the edited graphic element according to the second identifier, and streaming the middle layer memory data into byte stream data corresponding to the edited graphic element;
generating second primitive data corresponding to the second identifier in a primitive update list when the main thread timer is triggered;
finding an original file in which the edited primitive is located according to the second identifier, and opening the original file in a memory mapping mode;
creating a new file in the original file, and opening the new file in a memory mapping mode;
determining a primitive starting position and a primitive ending position of the new file by calculating and setting the file length of the new file;
copying data before the edited graphic element into the new file according to the graphic element starting position, writing byte stream data corresponding to the edited graphic element into the end of the new file, and copying data after the edited graphic element to the end of the new file according to the graphic element ending position;
saving the new file to complete the updating of the primitive data;
the device is also for:
and generating a linked list data structure for recording the length of the graphic primitive data, wherein the linked list data structure records the file information and the member information of the graphic primitive data, and the length of the graphic primitive data and the front and back associated graphic primitives.
6. The apparatus of claim 5, wherein the data storage module is specifically configured to:
storing the first primitive data into a cache;
and when the number of the first primitive data in the cache exceeds a preset threshold, storing the first primitive data in the cache into a file according to a preset storage mode.
7. An electronic device, comprising: a processor and a memory, the processor being configured to execute the engineering quantity calculation intermediate layer generation program stored in the memory to implement the engineering quantity calculation intermediate layer generation method according to any one of claims 1 to 4.
8. A storage medium storing one or more programs executable by one or more processors to implement the engineering quantity calculation intermediate layer generation method of any one of claims 1 to 4.
CN202010227732.XA 2020-03-27 2020-03-27 Engineering quantity calculation middle layer generation method and device, storage medium and electronic equipment Active CN111597364B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010227732.XA CN111597364B (en) 2020-03-27 2020-03-27 Engineering quantity calculation middle layer generation method and device, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010227732.XA CN111597364B (en) 2020-03-27 2020-03-27 Engineering quantity calculation middle layer generation method and device, storage medium and electronic equipment

Publications (2)

Publication Number Publication Date
CN111597364A CN111597364A (en) 2020-08-28
CN111597364B true CN111597364B (en) 2024-01-30

Family

ID=72185436

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010227732.XA Active CN111597364B (en) 2020-03-27 2020-03-27 Engineering quantity calculation middle layer generation method and device, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN111597364B (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103514112A (en) * 2012-06-29 2014-01-15 浙江大华技术股份有限公司 Data storage method and system
CN103617073A (en) * 2013-11-01 2014-03-05 广东电网公司茂名供电局 Method for analyzing and displaying picture file of electrical power system
CN104240148A (en) * 2014-08-28 2014-12-24 国家电网公司 Power grid visualization method based on plugins
CN105404785A (en) * 2015-12-10 2016-03-16 国网山东省电力公司经济技术研究院 System and method for calculating engineering quantity of basic hole
GB201714836D0 (en) * 2017-09-15 2017-11-01 Advanced Risc Mach Ltd Forward killing of threads corresponding to graphics fragments obscured by later graphics fragments
CN109587264A (en) * 2018-12-20 2019-04-05 新华三技术有限公司 Data monitoring method, device and cloud platform server
CN109634724A (en) * 2018-10-16 2019-04-16 深圳壹账通智能科技有限公司 Collecting method, device, equipment and computer storage medium
CN110580188A (en) * 2019-09-05 2019-12-17 珠海格力电器股份有限公司 multithreading network distribution method and storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10032245B2 (en) * 2015-10-27 2018-07-24 Nvidia Corporation Techniques for maintaining atomicity and ordering for pixel shader operations

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103514112A (en) * 2012-06-29 2014-01-15 浙江大华技术股份有限公司 Data storage method and system
CN103617073A (en) * 2013-11-01 2014-03-05 广东电网公司茂名供电局 Method for analyzing and displaying picture file of electrical power system
CN104240148A (en) * 2014-08-28 2014-12-24 国家电网公司 Power grid visualization method based on plugins
CN105404785A (en) * 2015-12-10 2016-03-16 国网山东省电力公司经济技术研究院 System and method for calculating engineering quantity of basic hole
GB201714836D0 (en) * 2017-09-15 2017-11-01 Advanced Risc Mach Ltd Forward killing of threads corresponding to graphics fragments obscured by later graphics fragments
CN109634724A (en) * 2018-10-16 2019-04-16 深圳壹账通智能科技有限公司 Collecting method, device, equipment and computer storage medium
CN109587264A (en) * 2018-12-20 2019-04-05 新华三技术有限公司 Data monitoring method, device and cloud platform server
CN110580188A (en) * 2019-09-05 2019-12-17 珠海格力电器股份有限公司 multithreading network distribution method and storage medium

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
张鹏 ; 马琦 ; 聂镭 ; .网络环境中GIS图层信息的实时共享.兵工自动化.2005,(第06期),第62-63页. *
林献坤 ; 冯万浩 ; 聂成 ; 朱琳 ; .融合机器视觉的制造过程监控组态平台研究.制造技术与机床.2017,(第02期),第94-97页. *
郭立君,袁满,高升,文必龙.基于Epicentre数据模型的图形数据存取规范及实现.大庆石油学院学报.2001,(第02期),第47-49页. *

Also Published As

Publication number Publication date
CN111597364A (en) 2020-08-28

Similar Documents

Publication Publication Date Title
CN109643273B (en) Computer system, method, hardware storage device for recording playable traces
JP3123025B2 (en) Cut and paste filter in data processing system
US9244839B2 (en) Methods and apparatus for supporting persistent memory
US9996394B2 (en) Scheduling accelerator tasks on accelerators using graphs
CN111881135A (en) Data aggregation method, device, equipment and computer readable storage medium
KR20200122364A (en) Resource scheduling method and terminal device
Lee et al. ActiveSort: Efficient external sorting using active SSDs in the MapReduce framework
TW202107276A (en) Data structure processing
EP3391224B1 (en) Method and apparatus for data mining from core traces
US7308681B2 (en) Control flow based compression of execution traces
US10180799B2 (en) Efficient retrieval of memory values during trace replay
CN111597364B (en) Engineering quantity calculation middle layer generation method and device, storage medium and electronic equipment
CN116775507B (en) Hardware acceleration block selection method and device in garbage collection of solid state disk controller
CN113448977A (en) Distributed cache updating method and device based on database Binlog
US11874753B2 (en) Log compression
CN114490856A (en) Database WAL (Web independent language) disk-dropping method and system based on IOURING technology
CN114911790A (en) Data synchronization method and device, electronic equipment and storage medium
KR20220054605A (en) Command processor with multiple string copy engines for decompression systems
CN110688239A (en) Model calling method, device, equipment and computer readable storage medium
US20180004412A1 (en) DISK I/O Attribution
CN117251118B (en) Virtual NVMe simulation and integration supporting method and system
CN116662140B (en) Automatic acquisition and playback method, device and equipment for simulation data
Park et al. Optimizing Fsync Performance with Dynamic Queue Depth Adaptation
CN107818017B (en) Multithreading computing system, data processing method and device thereof and computer readable storage medium
Zhu Application-Specific Software Defined Memory

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant