Method for generating machine room three-dimensional model based on drawing recognition and related equipment
The computer room drawings are automatically processed through graphic and text recognition models to generate three-dimensional models, which solves the problems of low modeling efficiency and insufficient accuracy in existing technologies and realizes efficient and accurate three-dimensional model construction.
Patent Information
- Application Number
- CN202510791661.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-13
- Publication Date
- 2025-09-12
AI Technical Summary
In the existing technology, the modeling efficiency of the three-dimensional model of the communication room is low and the accuracy is insufficient, which cannot meet the scale requirements. It relies on manual drawing and is time-consuming and labor-intensive.
By obtaining the two-dimensional drawings of the computer room, using the pre-trained graphic recognition model and text recognition model, the graphic features and text information in the drawings are automatically identified, and a three-dimensional model is generated based on the layout of the computer room.
The modeling efficiency and accuracy of the computer room 3D model are improved, manpower input is reduced, and the matching degree between the model and the actual computer room is improved.
Smart Images

Figure CN120633112A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of digital twin technology, and more specifically, to a method for generating a three-dimensional model of a computer room based on drawing recognition and related equipment. Background Art
[0002] The communications room is a key physical node that hosts communications network equipment and serves as a vital hub for the communications network. With the rapid development of 5G networks, the communication power capacity, rack space management, rack U-slot management, and pipeline resource allocation within the communications room have a significant impact on service launch, delivery, and operations. To ensure efficient operation and management of the room, digital twin technology is being used to create three-dimensional models of the room, its equipment, and its layout. This integration of multi-source data enables comprehensive monitoring and intelligent management of the room. Digital twin technology simulates, replicates, and optimizes physical entities in a digital space.
[0003] Currently, digital twinning of computer rooms is performed by modeling engineers, who create three-dimensional models based on on-site measurements of the equipment room data. However, given the large number of communication equipment rooms, existing model construction processes are time-consuming and labor-intensive. Furthermore, the degree of twinning between the 3D model and the equipment room itself depends on the modeling engineers' skill level, making this approach inadequate for large-scale twinning of communication equipment rooms. Consequently, improving the efficiency and accuracy of 3D models of computer rooms has become a pressing issue. Summary of the Invention
[0004] In view of the above problems, this application provides a method and related equipment for generating a three-dimensional model of a computer room based on drawing recognition, so as to achieve the purpose of improving the modeling efficiency and accuracy of the three-dimensional model of the computer room. The specific solution is as follows:
[0005] A first aspect of the present application provides a method for generating a three-dimensional model of a computer room based on drawing recognition, comprising:
[0006] Obtain the two-dimensional drawing of the computer room to be modeled;
[0007] Calling a pre-trained graphic recognition model to perform graphic recognition on the two-dimensional drawing to obtain two-dimensional graphic features of the computer room to be modeled, wherein the two-dimensional graphic features include at least: an outline of the computer room, and the size and position coordinates of each rectangular cabinet in the computer room. The graphic recognition model is trained using the drawing sample as a feature value and the two-dimensional graphic features corresponding to the drawing sample as a target value;
[0008] Calling a pre-trained text recognition model to perform text recognition processing on the two-dimensional drawing to obtain text information in the two-dimensional drawing, the text information including at least text boxes and the position coordinates and character strings of each text box, the text recognition model being trained using image samples as feature values and text boxes in the image samples as target values;
[0009] Matching the position coordinates of the text box with the position coordinates of the rectangular cabinet to obtain modeling information corresponding to each rectangular cabinet, the modeling information including at least: the size, position coordinates, the text box, and the character string in the text box;
[0010] According to the layout of the computer room and the modeling information of the rectangular cabinets in each computer room, a pre-set three-dimensional structure template is processed to generate a three-dimensional model of the computer room to be modeled.
[0011] In a possible implementation, calling a pre-trained text recognition model to perform text recognition processing on the two-dimensional drawing to obtain text information in the two-dimensional drawing includes:
[0012] Identifying an initial size of the two-dimensional drawing and determining whether the initial size is larger than a preset drawing identification size;
[0013] If the initial size is larger than the preset drawing recognition size, the two-dimensional drawing is divided into two pieces to obtain at least two target drawings;
[0014] Identifying a target text box in each target drawing and the position coordinates of each text box in the two-dimensional drawing;
[0015] Determining an overlap ratio between every two text boxes based on the position coordinates of each text box in the two-dimensional drawing;
[0016] Merging the two text boxes whose overlap rate is greater than a preset threshold to obtain all target text boxes and the target position coordinates of each target text box in the corresponding target drawing;
[0017] A pre-trained text recognition model is called to perform text recognition on the target text box at the target position coordinates in the target drawing, and obtain text information corresponding to the two-dimensional drawing output by the text recognition model.
[0018] In a possible implementation, the dividing the two-dimensional drawing to obtain at least two target drawings includes:
[0019] Obtaining the size of each text box in the two-dimensional drawing, and determining a reference size that characterizes the central tendency of the sizes of all the text boxes, the reference size including: a reference width value in the horizontal direction and a reference height value in the vertical direction;
[0020] Determining a drawing overlap value based on the reference size, the drawing overlap value including: an overlap width value and an overlap height value;
[0021] According to the preset drawing cutting size and the drawing overlap value, the two-dimensional drawing is cut in the horizontal direction and the vertical direction of the two-dimensional drawing to obtain at least two target drawings, the size of the target drawings is equal to the preset drawing cutting size, and any two adjacent target drawings obtained by cutting in the horizontal direction have an overlapping area with a width value of the overlap width value in the horizontal direction, and any two adjacent target drawings obtained by cutting in the vertical direction have an overlapping area with a height value of the overlap height value in the vertical direction.
[0022] In a possible implementation, the method further includes:
[0023] In a case where the text information further includes: semantic content of the character string in the text box, determining whether the character string satisfies an error correction condition, the error correction condition at least including: missing characters in the character string, or an error in a character in the character string;
[0024] If the character string satisfies the error correction condition, determining the text type of the character string based on the semantic content of the character string;
[0025] Obtaining a preset completion rule corresponding to the text type;
[0026] Based on the preset completion rule, the character string is modified to obtain a target character string;
[0027] The character string in the text information is updated according to the target character string to obtain the text information of the computer room to be modeled.
[0028] In a possible implementation, the method further includes:
[0029] Based on the semantic content of each character string, determining a character string whose semantic content represents the name of the computer room to be modeled as the model name of the three-dimensional model;
[0030] The three-dimensional model of the computer room to be modeled and the model name are stored together in a preset storage address.
[0031] In one possible implementation, the process of training the graphic recognition model includes:
[0032] Acquire a drawing sample set, the drawing sample set comprising: at least one drawing sample;
[0033] Based on the sliding window cutting method, the drawing sample is locally analyzed to obtain the two-dimensional graphic features of the drawing sample;
[0034] Based on the drawing samples and the two-dimensional graphic features corresponding to each drawing sample, an initial graphic recognition model is trained to obtain a graphic recognition model. The training process includes: using the drawing samples as feature values and the two-dimensional graphic features corresponding to the drawing samples as target values for training, so that the graphic recognition model can output the two-dimensional graphic features corresponding to the drawing based on the input drawing.
[0035] In one possible implementation, the process of training the text recognition model includes:
[0036] Acquire an image set, the image set comprising: at least one image containing a text box;
[0037] Editing the image to obtain a new image, wherein the editing process at least includes: cutting, rotating and assembling;
[0038] Taking the image and the new image as image samples, and performing text recognition on each of the image samples to obtain a text box corresponding to each of the image samples;
[0039] Based on the image samples and the text boxes corresponding to each image sample, an initial text recognition model is trained to obtain a text recognition model. The training process includes: using the image samples as feature values and the text boxes corresponding to the image samples as target values for training, so that the text recognition model can output a text box corresponding to the image based on the input image.
[0040] The second aspect of the present application provides a device for generating a three-dimensional model of a computer room based on drawing recognition.
[0041] A drawing acquisition unit, used to acquire a two-dimensional drawing of the computer room to be modeled;
[0042] a graphic recognition unit, configured to call a pre-trained graphic recognition model to perform graphic recognition on the two-dimensional drawing to obtain two-dimensional graphic features of the computer room to be modeled, wherein the two-dimensional graphic features include at least: an outline of the computer room, and the size and position coordinates of each rectangular cabinet in the computer room; the graphic recognition model is trained using a drawing sample as a feature value and the two-dimensional graphic features corresponding to the drawing sample as a target value;
[0043] a text recognition unit, configured to call a pre-trained text recognition model to perform text recognition processing on the two-dimensional drawing to obtain text information in the two-dimensional drawing, wherein the text information at least includes: text boxes and the position coordinates and character strings of each text box, wherein the text recognition model is trained using image samples as feature values and text boxes in the image samples as target values;
[0044] an information matching unit, configured to match the position coordinates of the text box with the position coordinates of the rectangular cabinet to obtain modeling information corresponding to each rectangular cabinet, the modeling information including at least: the size, position coordinates, the text box, and the character string in the text box;
[0045] The model building unit is used to process a preset three-dimensional structure template according to the layout of the computer room and the modeling information of the rectangular cabinets in each computer room to generate a three-dimensional model of the computer room to be modeled.
[0046] A fourth aspect of the present application provides an electronic device, comprising at least one processor and a memory connected to the processor, wherein:
[0047] The memory is used to store computer programs;
[0048] The processor is used to execute the computer program so that the electronic device can implement the method of generating a three-dimensional model of a computer room based on drawing recognition according to the first aspect or any implementation of the first aspect.
[0049] In a fifth aspect, the present application provides a computer storage medium, which carries one or more computer programs. When the one or more computer programs are executed by an electronic device, the electronic device can implement the method of generating a three-dimensional model of a computer room based on drawing recognition according to the above-mentioned first aspect or any implementation of the first aspect.
[0050] It can be seen from the above technical solutions that the method for generating a three-dimensional model of a computer room based on drawing recognition provided by the embodiment of the present application, the present application uses a pre-trained graphic recognition model and a text recognition model to intelligently recognize the computer room drawings to obtain two-dimensional graphic information and text information of the computer room. Compared with the manual on-site collection of computer room data in the prior art, the recognition efficiency of the embodiment of the present application is higher. At the same time, the position of the recognized text box is matched with the rectangular cabinet, so that each rectangular cabinet of almost the same shape can be distinguished according to the text characters, which facilitates the subsequent differential modeling of the rectangular cabinet and improves the accuracy of the three-dimensional model. Furthermore, based on the above-mentioned computer room layout and the modeling information of the rectangular cabinet, the pre-set three-dimensional structure template is laid out, sized, etc. to obtain a three-dimensional model of the computer room, so that the three-dimensional model can be adaptively adjusted and generated on the basis of the three-dimensional structure template. Compared with the manual drawing of the prior art, the modeling efficiency of the embodiment of the present application is greatly improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are merely embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without any creative work.
[0052] Figure 1 A flowchart of a method for generating a three-dimensional model of a computer room based on drawing recognition provided by an embodiment of the present application;
[0053] Figure 2 A schematic diagram of the cutting of a two-dimensional drawing provided in an embodiment of the present application;
[0054] Figure 3 A schematic diagram of a two-dimensional drawing of a computer room to be modeled provided in an embodiment of the present application;
[0055] Figure 4 An optional system architecture diagram for implementing the method for generating a three-dimensional model of a computer room based on drawing recognition provided in an embodiment of the present application;
[0056] Figure 5 A schematic diagram of the structure of a device for generating a three-dimensional model of a computer room based on drawing recognition provided in an embodiment of the present application;
[0057] Figure 6 A structural schematic diagram of an electronic device for generating a three-dimensional model of a computer room based on drawing recognition provided in an embodiment of the present application. DETAILED DESCRIPTION
[0058] The following describes the embodiments of the present application in conjunction with the accompanying drawings. The terms used in the implementation methods of the present application are only used to explain the specific embodiments of the present application and are not intended to limit the present application.
[0059] The embodiments of the present application are described below in conjunction with the accompanying drawings. Those skilled in the art will appreciate that, with the development of technology and the emergence of new scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
[0060] The terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequential order. It should be understood that the terms used in this way can be interchangeable under appropriate circumstances, and this is merely a way of distinguishing the objects of the same attributes when describing them in the embodiments of the present application. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, so that the process, method, system, product or equipment comprising a series of units need not be limited to those units, but may include other units that are not clearly listed or inherent to these processes, methods, products or equipment.
[0061] In order to solve the technical problems raised by the above-mentioned background technology, an embodiment of the present application provides a method for generating a three-dimensional model of a computer room based on drawing recognition.
[0062] Reference Figure 1 , Figure 1 A flow chart of a method for generating a three-dimensional model of a computer room based on drawing recognition provided in an embodiment of the present application is shown as follows: Figure 1 As shown, the method of generating a three-dimensional model of a computer room based on drawing recognition provided in an embodiment of the present application may include steps 110 to 150, and these steps are described in detail below.
[0063] It should be noted that the present application can be applied to, but is not limited to, applications with image data processing and three-dimensional modeling capabilities or cloud services provided by cloud-side servers.
[0064] Step S110: obtaining a two-dimensional drawing of the computer room to be modeled.
[0065] Two-dimensional drawings are technical documents that accurately describe the shape, structure, process requirements and technical parameters of an object through plane geometric figures, symbols, text, dimensioning and other elements. Its essence is the result of abstracting a three-dimensional entity into a two-dimensional projection.
[0066] There are many ways to obtain two-dimensional drawings of the computer room to be modeled, such as scanning and vectorizing engineering drawings, exporting them from CAD software, extracting projections from reverse engineering, and generating BIM models. Furthermore, two-dimensional plan drawings of the computer room to be modeled can be collected in real life through drone oblique photography combined with point cloud processing technology. The present embodiment of the application does not impose a single limitation on the method for obtaining the two-dimensional drawings of the computer room to be modeled, and the acquisition method can be adaptively adjusted based on actual circumstances.
[0067] Step S120 calls a pre-trained pattern recognition model to perform pattern recognition on the 2D drawing to obtain the 2D pattern features of the computer room to be modeled. The 2D pattern features include at least the computer room outline and the dimensions and position coordinates of each rectangular cabinet within the computer room. The pattern recognition model is trained using the drawing sample as feature values and the corresponding 2D pattern features as target values.
[0068] This embodiment of the present application uses the processing of a CAD drawing of a computer room to be modeled as an example, wherein the CAD drawing is a two-dimensional drawing of the computer room to be modeled, which is exported by CAD software. Step S120 is used to identify and extract the two-dimensional graphic features of the computer room to be modeled in the CAD drawing. The two-dimensional graphic features include the computer room outline, computer room layout, rack graphics, rack positions, and the graphics and positions of other equipment that appear as polygons in the two-dimensional drawing.
[0069] Specifically, a pre-trained graphics recognition model is invoked to perform graphics recognition on the CAD drawings to obtain the two-dimensional graphic features of the computer room to be modeled. Alternatively, the graphics recognition model can be optimized by optimizing existing image processing models or object detection models to enable it to recognize graphics in computer room drawings. Alternatively, a new model can be constructed and trained to enable it to recognize graphics in computer room drawings.
[0070] In one possible implementation, the process of training a graphic recognition model may include: obtaining a drawing sample set, the drawing sample set including: at least one drawing sample; performing local analysis on the drawing sample based on a sliding window cutting method to obtain two-dimensional graphic features of the drawing sample; training an initial graphic recognition model based on the drawing sample and the two-dimensional graphic features corresponding to each drawing sample to obtain a graphic recognition model, wherein the training process includes: using the drawing sample as a feature value and the two-dimensional graphic features corresponding to the drawing sample as a target value for training, so that the graphic recognition model can output two-dimensional graphic features corresponding to the drawing based on the input drawing.
[0071] Obtain a drawing sample set. Optionally, the format of the drawing samples in the drawing sample set can be determined according to the drawing format processed in the actual application. For example, if only CAD drawings are recognized in the actual application, the drawing samples can all be two-dimensional drawings in the CAD drawing format. Optionally, drawing samples in multiple different formats can also be used for training to improve the flexibility of the model's drawing recognition.
[0072] Furthermore, the two-dimensional graphic features in each drawing sample are annotated. Optionally, a sliding window cutting method is used, such as a method for sliding a fixed-size window across the drawing sample, and the drawing sample is cropped separately according to a set step size to obtain multiple sub-images. Each region of each sub-image is then traversed to extract the two-dimensional graphic features in each sub-image to obtain the two-dimensional graphic features corresponding to the drawing sample. This application uses a sliding window cutting method to transform the global problem of identifying drawing samples into a local problem, thereby improving the accuracy of graphic recognition.
[0073] Constructing a graphic recognition model, optionally, the model architecture can use a neural network (CNN) model, a YOLO (You Only Look Once) series model, etc. In the embodiment of the present application, the YOLO5 target detection algorithm is used to construct a graphic recognition model. The YOLO5 target detection algorithm includes an input end, a backbone, a neck, and a prediction. The input end is used to complete preprocessing and data enhancement of the input drawing sample, the backbone is used to extract image features of the drawing sample processed by the input end, the neck is used to perform multi-scale fusion of the extracted image features, and the prediction is used to perform target category prediction and coordinate frame position regression on the fused image features. It can be understood that the graphic recognition model constructed based on the YOLO5 target detection algorithm can identify the graphic features in the input drawing and predict the target category of each graphic, for example, a rectangular graphic is a rack, an irregular graphic is a room outline, etc., and according to the position of each graphic in the drawing, the coordinate position of the object corresponding to the target type of the graphic is determined, and the set of other information such as the position and category corresponding to each graphic is determined as the graphic feature information of the drawing.
[0074] Furthermore, the drawing samples of the computer room are used as input data of the graphic recognition model, and the constructed graphic recognition model is trained. According to the difference between the training results and the two-dimensional graphic features corresponding to the input data, the graphic recognition model is optimized until the error between the training results and the two-dimensional graphic features corresponding to the input data meets the conditions, or the number of training times reaches a preset number, and the training of the graphic recognition model is stopped.
[0075] Based on this, when subsequently identifying the two-dimensional drawings of the computer room to be modeled, the above-mentioned trained graphic recognition model can be called, and the two-dimensional drawings can be input into the graphic recognition model. The graphic recognition model will feedback the detection results of the two-dimensional drawings, that is, the two-dimensional graphic features.
[0076] Optionally, the computer room recognition result in the two-dimensional graphic features output by the graphic recognition model can be referred to as follows:
[0077] [{
[0078] "Result": [{
[0079] "vertices": [{
[0080] "x": 4302,
[0081] "y": 2059
[0082] },
[0083] {
[0084] "x": 5368,
[0085] "y": 2059
[0086] },
[0087] {
[0088] "x": 5368,
[0089] "y": 3620
[0090] },
[0091] {
[0092] "x": 4302,
[0093] "y": 3620
[0094] }
[0095] ],
[0096] "name": "Computer Room 403",
[0097] "id": "26abfbeb-8923-49d6-aa73-32af5e628133",
[0098] "roomId": "d820fffe-4df9-4288-81e6-c650d4cd57f6"
[0099] }, ]
[0101] }]
[0102] Among them, "vertices" represents the coordinates of the vertices of the identified graphic, where "x" and "y" refer to the X-axis coordinate and the Y-axis coordinate, respectively, and "name" is the name of the computer room referred to by the identified graphic, or the name of the equipment in the referred computer room. "id" represents the identification code corresponding to the graphic, and "roomId" represents the identification code of the room where the cabinet, rack, or other equipment corresponding to the identified graphic is located. Therefore, based on the graphic feature information output above, it can be determined that the graphic outline of the computer room 403 is a rectangle with four vertices, and the coordinates of the four vertices are (5368, 2059), (5368, 2059), (5368, 3620), and (4302, 3620), respectively. The id and roomId corresponding to the computer room 403 can also be determined.
[0103] The rack position recognition results in the two-dimensional graphic features output by the graphic recognition model can be found below:
[0104] {
[0105] "Des": "OK", / / Execution status description (indicates successful detection)
[0106] "ModelId": "", / / Model identifier. This example does not configure a model version, so this is empty.
[0107] "Result": [ / / Test result collection
[0108] {
[0109] "box": [720,170,746,196], / / Detected rectangular box coordinates
[0110] "class": "rec_l", / / The category of the object executed by the rectangular box
[0111] "group": 0, / / Group ID
[0112] "score": "0.97" / / Confidence level, indicating that the image recognition model is 97% confident in the detection result.
[0113] },
[0114] {
[0115] "box": [1255,234,1268,265],
[0116] "class": "rec_r",
[0117] "group": 33,
[0118] "score": "0.29"
[0119] }
[0120] ],
[0121] "Status": "Ok" / / Status code corresponding to "Des", double verification operation status
[0122] }
[0123] Based on the output graphic feature information, it can be determined that the rectangle with coordinates (720, 170, 746, 196) in the two-dimensional drawing belongs to the rack of the rec_1 category in the computer room and belongs to the rack group numbered 0. Furthermore, this embodiment of the present application can also filter out graphics that may contain model false positives based on the confidence levels corresponding to the various detection boxes in the two-dimensional graphic features output by the model. Based on this, the information corresponding to the rectangle with a confidence level of 0.29 in the above information can be filtered out, thereby improving the accuracy of identifying graphics in the two-dimensional drawing.
[0124] Step S130: Calling a pre-trained text recognition model to perform text recognition on the two-dimensional drawing to obtain text information within the two-dimensional drawing. The text information includes at least text boxes, the location coordinates of each text box, and a string. The text recognition model is trained using the image sample as a feature value and the text boxes within the image sample as a target value.
[0125] Step S130 is used to recognize the text box and the character string in the text box in the two-dimensional drawing to obtain text information. Based on this, the text information contained in the two-dimensional drawing is recognized, such as the computer room area identification, equipment number and name, equipment installation spacing, etc.
[0126] Specifically, a pre-trained text recognition model is called to identify the two-dimensional drawings of the computer room to be modeled, and the text information of the computer room to be modeled is obtained. Optionally, the text recognition model can use text identification tools such as PPOCRLabel and CVAT to identify text information in the two-dimensional drawings. In another possible implementation, a new model is constructed and trained to enable it to have the function of identifying text information on the computer room drawings. Optionally, the process of training the text recognition model includes: obtaining an image set, the image set includes: at least one image containing a text box; editing the image to obtain a new image, and the editing process includes at least: cutting, rotating and assembling; using the image and the new image as image samples, and performing text recognition on each image sample to obtain the text box corresponding to each image sample; based on the image sample and the text box corresponding to each image sample, the initial text recognition model is trained to obtain a text recognition model. The training process includes: using the image sample as the feature value and the text box corresponding to the image sample as the target value for training, so that the text recognition model can output the text box corresponding to the image based on the input image.
[0127] As described in step S120 above, the image set used to train the text recognition model can use the same sample set of drawings used to train the graphic recognition model. This allows for targeted training and improves the accuracy of the text recognition model in recognizing computer room drawings. Optionally, images that do not contain text boxes can be filtered out to improve training efficiency.
[0128] Furthermore, each image in the image collection is segmented, rotated, and assembled to generate new images, thereby expanding the training data for the text recognition model. Text boxes or strings are recognized in the images in the image collection and in the new images generated by editing, obtaining the text box corresponding to each image.
[0129] It is understandable that AI models require a large amount of data training to obtain the features of specific objects, so as to enable the model to accurately recognize two-dimensional drawings. Therefore, the embodiment of the present application generates a large amount of available training data by editing existing images, so that the text recognition model can learn the features of each word or text box in the computer room drawing during the training process.
[0130] Construct a text recognition model. Optionally, the text recognition model architecture can use a neural network (CNN) model, a YOLO (You Only Look Once) series model, etc., the same as the graphic recognition model. In the embodiment of the present application, a text recognition model is constructed based on YOLOv8-OCR to detect and recognize text targets in two-dimensional drawings, and to achieve accurate positioning of the area where the characters are located in the two-dimensional drawings and accurate recognition of the characters. When applying the text recognition model, the two-dimensional drawing of the computer room to be modeled is input into the model, and the model will feedback the recognized text object and the position of the text box in the drawing.
[0131] The text information corresponding to the 2D drawings output by the text recognition model can be found below:
[0132] {
[0133] 'data': [{
[0134] 'angle': 0, / / Text rotation angle (0 degrees means no horizontal rotation)
[0135] 'coordinate': [ / / Vertex coordinates of the text area (four-vertex closed box)
[0136] [106,47], [106,74], [148,74], [148,47]
[0137] ],
[0138] 'text': 'First column' / / Recognized text content
[0139] }, ]
[0141] }
[0142] Based on the above text information, it can be determined that the two-dimensional drawing includes a text box, the rotation angle of the text box is 0, and the four vertex coordinates of the rectangular text box are [106,47], [106,74], [148,74], [148,47], and the content in the text box is "first column".
[0143] In one possible implementation, a pre-trained text recognition model is called to perform text recognition processing on a two-dimensional drawing to obtain text information in the two-dimensional drawing, including: identifying an initial size of the two-dimensional drawing and determining whether the initial size is larger than a preset drawing recognition size; if the initial size is larger than the preset drawing recognition size, dividing the two-dimensional drawing to obtain at least two target drawings; identifying a target text box in each target drawing and the position coordinates of each text box in the two-dimensional drawing; determining an overlap rate between each two text boxes based on the position coordinates of each text box in the two-dimensional drawing; merging two text boxes with an overlap rate greater than a preset threshold to obtain all target text boxes and the target position coordinates of each target text box in the corresponding target drawing; calling the pre-trained text recognition model to perform text recognition on the target text box at the target position coordinates in the target drawing to obtain text information corresponding to the two-dimensional drawing output by the text recognition model.
[0144] It is understandable that when the scale of the computer room to be modeled is large, the size of the corresponding two-dimensional drawing will also increase, which may exceed the capability of the text recognition model, resulting in inaccurate text information obtained by recognition and the problem of missing text information. Based on this, the embodiment of the present application can adopt the edge overlapping segmentation method to perform text box recognition on two-dimensional drawings whose size exceeds the preset drawing recognition size. Optionally, first, the two-dimensional drawing is segmented to obtain at least two target drawings of the preset drawing segmentation size, wherein the preset drawing segmentation size is smaller than the preset drawing recognition size.
[0145] In a possible implementation, the process of slicing a two-dimensional drawing may include: obtaining the size of each text box in the two-dimensional drawing, and determining a reference size that represents the central trend of the sizes of all text boxes, the reference size including a reference width value in the horizontal direction and a reference height value in the vertical direction; determining a drawing overlap value based on the reference size, the drawing overlap value including an overlap width value and an overlap height value; and cutting the two-dimensional drawing in the horizontal and vertical directions according to a preset drawing slicing size and the drawing overlap value, respectively, to obtain at least two target drawings, the size of the target drawings being equal to the preset drawing slicing size, and any two adjacent target drawings obtained by slicing in the horizontal direction having an overlapping area with a width value of the overlap width value in the horizontal direction, and any two adjacent target drawings obtained by slicing in the vertical direction having an overlapping area with a height value of the overlap height value in the vertical direction.
[0146] Reference Figure 2 The schematic diagram of the two-dimensional drawing segmentation provided in the embodiments of this application exemplifies the segmentation process of the two-dimensional drawing. It should be noted that the drawing is usually a rectangular drawing. In the figure, the length in the horizontal direction (X) is called the width, and the length in the vertical direction (Y) is called the height.
[0147] First, identify the size of all text boxes in the two-dimensional drawing, and determine a reference size value that ultimately represents the central trend of the text box sizes in the two-dimensional drawing based on the sizes of all text boxes, such as taking the median, mean, or mode of the sizes of all text boxes as the reference size value, where the reference size value includes: a reference width value and a reference height value. Furthermore, based on the reference size of the text box, set the drawing overlap value when the two-dimensional drawing is cut. It can be understood that in order to avoid the situation where the text box is divided into two when the drawing is cut, a drawing overlap value greater than the reference size value can be set, such as: the overlap width value in the overlap value is twice the reference width value, and the overlap height value is three times the reference height value.
[0148] According to the drawing overlap value and the preset drawing cutting size, the 2D drawing is cut horizontally and vertically to obtain multiple target drawings. Figure 2 , set a split window with the same size as the preset drawing, for example, a split window of 1024x1024. The split window starts at the edge of the 2D drawing and slides horizontally or vertically. Each time the split window slides, a new drawing is created, the drawing selected by the split window, which is the target drawing.
[0149] Optional, see Figure 2 , the splitting window starts to slide from the lower right corner of the two-dimensional drawing. First, the target drawing ① is split, and then the splitting window is horizontally slid so that the splitting window and the target drawing ① have an overlapping area with a width equal to the overlap width value in the horizontal direction. Then, the target drawing ② and the target drawing ① have an overlapping area with a width equal to the overlap width value in the horizontal direction. Similarly, starting from the target drawing ①, the splitting window is vertically slid so that the splitting window and the target drawing ① have an overlapping area with a height equal to the overlap height value in the horizontal direction. Then, the target drawing ③ and the target drawing ① have an overlapping area with a height equal to the overlap height value in the vertical direction. This avoids the situation where the text box in the overlapping area of the target drawings ① and ② of the two-dimensional drawing is split.
[0150] Similarly, the two-dimensional drawing is divided to obtain at least two target drawings. Optionally, the target drawings can also be marked with the coordinate value of the upper left corner vertex of the target drawing on the two-dimensional drawing to locate the position of each target drawing on the two-dimensional drawing, which is convenient for restoring the drawings.
[0151] In addition, refer to Figure 2If the size of the area of the 2D drawing in the target drawing ④ does not reach the preset drawing segmentation size, you can use a blank method to expand the target drawing ④ to the preset drawing segmentation size. Alternatively, you can directly use the drawing that does not reach the preset drawing segmentation size as the target drawing.
[0152] Based on this, the large 2D drawing was segmented into multiple smaller target drawings to facilitate processing by the text recognition model. Furthermore, the text boxes within each target drawing were identified and their coordinates determined. Overlapping text boxes were then merged based on their coordinates to avoid incomplete text recognition caused by segmented text boxes.
[0153] Optionally, the degree of overlap between every two text boxes in all text boxes is calculated. When the overlap is greater than a preset threshold, such as greater than 0, it can be determined that the two text boxes overlap and can be merged. The overlapping situations can be divided into: cross-overlap of two text boxes, a text box being included by another text box, etc. The merging method can be adaptively adjusted for different overlapping situations. For example, if text box a is included by text box b, the included text box a is removed, or the text box with a smaller area is removed, and the retained text box b is used as the target text box. In addition, for text boxes that do not overlap, they can also be directly determined as target text boxes.
[0154] It is understandable that the target position coordinates of each target text box in its corresponding target drawing may be determined based on the positional relationship between the target text box and the target drawing.
[0155] Furthermore, the target text box and the target position coordinates of the target text box in its corresponding target drawing are input into the text recognition model, so that the text recognition model performs text recognition on the target text box at the target position coordinates in the target drawing to obtain the text information in the target text box. Based on this, the text information corresponding to all the target text boxes in the two-dimensional drawing is obtained.
[0156] In another possible implementation, it also includes: when the text information also includes: the semantic content of the string in the text box, judging whether the string meets the error correction condition, the error correction condition at least includes: missing characters in the string, or wrong characters in the string; if the string meets the error correction condition, determining the text type of the string based on the semantic content of the string; obtaining a preset completion rule corresponding to the text type; correcting the string based on the preset completion rule to obtain a target string; updating the string in the text information according to the target string to obtain text information of the computer room to be modeled.
[0157] Considering that there are missing characters in the two-dimensional drawings of the computer room to be modeled, or that the text recognition model does not fully recognize the text, the resulting text information may contain missing characters in the string of the text box, character recognition errors, etc. For example, the rack number is missing, or one of the digits in the number is missing, or the letter O is recognized as the number 0. Therefore, in the embodiment of the present application, based on the semantic content of the string in the text box contained in the text information, it is determined whether the string in the text box meets the error correction condition, that is, whether the above situation exists. For example, the semantic content corresponding to the text box is the rack number, and the rack number consists of 8 digits, while the string in the text box only has 7 digits. Therefore, it can be determined that there is a problem of missing characters.
[0158] Furthermore, based on the text type corresponding to the text string in the text box, the corresponding preset completion rule is determined. For example, the preset completion rule stipulates that if the rack number is missing, the numbers of all racks in the computer room are counted and the missing content is completed according to the numbering pattern. Based on this, the missing characters in the text box are completed according to the preset completion rule.
[0159] Step S140 , matching the position coordinates of the text box with the position coordinates of the rectangular cabinet to obtain modeling information corresponding to each rectangular cabinet, the modeling information at least including: size, position coordinates, text box, and character string in the text box.
[0160] The graphic recognition results and text recognition results of the two-dimensional drawings are matched to realize the binding of text and graphics in the drawings, so as to realize the marking of the computer room space, the graphic business differentiation marking of the rack position, etc., thereby realizing the accurate recognition and expression of the equipment rack position and numbering information, the computer room outline / computer room convenience and the computer room name in the two-dimensional drawings of the computer room to be modeled, and using this as the modeling information for the three-dimensional modeling of the computer room, thereby improving the high matching degree between the obtained three-dimensional model and the two-dimensional drawings.
[0161] Optionally, based on the identified graphic feature information, determine the layout of the racks in the computer room of the two-dimensional drawing, and refer to Figure 3 , the embodiment of the present application provides a schematic diagram of a two-dimensional drawing of the computer room to be modeled. For the two-dimensional drawing, the obtained graphic feature information includes: coordinate information of the computer room outline, the rectangular frame size and coordinates of each cabinet, based on which the layout of the cabinets in the computer room is determined.
[0162] Furthermore, based on the position of the text box in the identified text information, each text box is matched with the cabinet through the coordinate position of the computer room and the coordinate position of the text box, so that the rectangular box of the cabinet is respectively bound to the cabinet name or cabinet number in the text box, so that the cabinet and the cabinet name correspond one-to-one, and the relationship data between the graphic and the character string is obtained.
[0163] In one possible implementation, based on the semantic content of each character string, a character string whose semantic content represents the name of the computer room to be modeled is determined as the model name of the three-dimensional model; the three-dimensional model of the computer room to be modeled and the model name are stored together in a preset storage address.
[0164] Identify the meaning of the text represented by the character string in each text box. If the text content in the text box contains 'computer room', match the computer room graphic and the computer room name (the text block containing the computer room) as the model name of the subsequently generated 3D model.
[0165] Based on this, the graphic feature information and text information are integrated to obtain the modeling information that is ultimately used to generate the model. Optionally, the form of the modeling information can refer to the following:
[0166] {
[0167] "data": [{
[0168] "boxResult": { / / Rectangle recognition result
[0169] "Des": "OK",
[0170] "ModelId": "",
[0171] "Result": [{
[0172] "box": [720, 107, 747, 133], / / Rectangular box coordinates
[0173] "class": "rec_l",
[0174] "group": 0,
[0175] "score": "0.98",
[0176] "text": ["W"]
[0177] }
[0178] ],
[0179] "Status": "Ok"
[0180] },
[0181] "commonResult": {
[0182] "data": [{
[0183] "angle": 0,
[0184] "coordinate": [[1166, 667], [1166, 693],[1216,693], [1216,667]],
[0185] "text": "15th column" / / Text box coordinates and character contents in the text box
[0186] } ]
[0188] }
[0189] }
[0190] ],
[0191] "msg": null,
[0192] "pagination": null,
[0193] "success": true
[0194] }
[0195] The text information is matched with the corresponding rectangular box, thereby matching the character content in the text box with the device (such as a cabinet) indicated by the rectangular graphic.
[0196] Step S150 , processing a preset three-dimensional structure template based on the layout of the computer room and the modeling information of the rectangular cabinets in each computer room to generate a three-dimensional model of the computer room to be modeled.
[0197] A 3D model is created based on the computer room layout, room dimensions, cabinet dimensions, and cabinet locations, as reflected by the modeling information. Specifically, the walls of the 3D computer room are generated based on the polygons representing the computer room's outline. Similarly, a 3D model of the cabinet is generated based on the dimensions of the cabinet graphics. The 3D cabinet model is then placed within the 3D computer room based on the cabinet's location coordinates. This results in a 3D model of the computer room to be modeled. Optionally, the 3D model is transferred to a display device to visualize the 3D model.
[0198] In summary, the method for generating a three-dimensional model of a computer room based on drawing recognition provided by the embodiment of the present application, the present application intelligently recognizes the computer room drawings through a pre-trained graphic recognition model and a text recognition model to obtain two-dimensional graphic information and text information of the computer room. Compared with the manual on-site collection of computer room data in the prior art, the recognition efficiency of the embodiment of the present application is higher. At the same time, the position of the recognized text box is matched with the rectangular cabinet, so that each rectangular cabinet of almost the same shape can be distinguished according to the text characters, which facilitates the subsequent differential modeling of the rectangular cabinet and improves the accuracy of the three-dimensional model. Furthermore, based on the above-obtained computer room layout and the modeling information of the rectangular cabinet, the pre-set three-dimensional structure template is laid out, sized, etc. to obtain a three-dimensional model of the computer room, so that the three-dimensional model can be adaptively adjusted and generated on the basis of the three-dimensional structure template. Compared with the manual drawing in the prior art, the modeling efficiency of the embodiment of the present application is greatly improved.
[0199] Next, refer to Figure 4 , an optional system architecture diagram for implementing a method for generating a three-dimensional model of a computer room based on drawing recognition provided in an embodiment of the present application, exemplifies the practical application of the method for generating a three-dimensional model of a computer room based on drawing recognition proposed in the present application.
[0200] like Figure 4 The system includes an AI image recognition service module and a 3D model generation module. The AI image recognition service module first obtains a two-dimensional drawing of the computer room to be modeled. If the drawing is large, it performs image segmentation and calls the YOLO v5 / v8 object detection algorithm model. Using the model's Input Feature, Backbone, Neck, and Prediction functions, it performs image recognition and OCR text recognition on the two-dimensional drawing, obtaining the corresponding graphic feature information and text information.
[0201] The 3D model generation module acquires the graphical features and text information from the identified 2D drawings. Using Spring Boot, Spring Cloud, RESTful, Mybitis Plus, Http Client, and BASR64Encoder, it implements automated graphics processing services, including graphics transcoding, room boundary graphics filtering, automatic rack location numbering, GLB model storage, rack location graphics text filtering, and graphics binding. This module then obtains modeling information for generating a 3D model. Furthermore, based on this modeling information, a 3D model of the computer room is automatically generated.
[0202] In this example, each computer room 3D model and its corresponding graphic feature information, text information, etc. of the computer room to be modeled can also be stored in the database to facilitate tracing of each 3D model.
[0203] The above describes a method for generating a three-dimensional model of a computer room based on drawing recognition provided by an embodiment of the present application. The following describes an apparatus for executing the method for generating a three-dimensional model of a computer room based on drawing recognition.
[0204] See also Figure 5 , Figure 5 This is a schematic diagram of the structure of a device for generating a three-dimensional model of a computer room based on drawing recognition provided in an embodiment of the present application. Figure 5 As shown, the device for generating a three-dimensional model of a computer room based on drawing recognition includes:
[0205] The drawing acquisition unit 100 is used to acquire a two-dimensional drawing of the computer room to be modeled;
[0206] The drawing recognition unit 200 is configured to call a pre-trained graphic recognition model to perform graphic recognition on the two-dimensional drawing to obtain two-dimensional graphic features of the computer room to be modeled. The two-dimensional graphic features include at least the outline of the computer room and the size and position coordinates of each rectangular cabinet in the computer room. The graphic recognition model is trained using drawing samples as feature values and the two-dimensional graphic features corresponding to the drawing samples as target values.
[0207] A text recognition unit 300 is configured to call a pre-trained text recognition model to perform text recognition processing on the two-dimensional drawing to obtain text information in the two-dimensional drawing, wherein the text information includes at least text boxes, the position coordinates of each text box, and a character string. The text recognition model is trained using image samples as feature values and text boxes in the image samples as target values.
[0208] An information matching unit 400 is configured to match the position coordinates of the text box with the position coordinates of the rectangular cabinet to obtain modeling information corresponding to each rectangular cabinet, the modeling information including at least: the size, position coordinates, the text box, and the character string in the text box;
[0209] The model building unit 500 is used to process a preset three-dimensional structure template according to the layout of the computer room and the modeling information of the rectangular cabinets in each computer room to generate a three-dimensional model of the computer room to be modeled.
[0210] In a possible implementation, the text recognition unit 300 includes:
[0211] a size recognition subunit, configured to recognize an initial size of the two-dimensional drawing and determine whether the initial size is larger than a preset drawing recognition size;
[0212] a drawing cutting sub-unit, configured to cut the two-dimensional drawing into at least two target drawings if the initial size is larger than the preset drawing recognition size;
[0213] a text box identification subunit, configured to identify a target text box in each target drawing, and a position coordinate of each text box in the two-dimensional drawing;
[0214] an overlap ratio determining subunit, configured to determine an overlap ratio between every two text boxes based on the position coordinates of each text box in the two-dimensional drawing;
[0215] a text frame merging subunit, configured to merge two text frames whose overlap rate is greater than a preset threshold value, to obtain all target text frames and target position coordinates of each target text frame in the corresponding target drawing;
[0216] The text recognition subunit is used to call a pre-trained text recognition model to perform text recognition on the target text box at the target position coordinates in the target drawing, and obtain text information corresponding to the two-dimensional drawing output by the text recognition model.
[0217] In a possible implementation, the drawing is cut into sub-units, including:
[0218] a reference size determination subunit, configured to obtain the size of each text box in the two-dimensional drawing and determine a reference size representing a central tendency of the sizes of all the text boxes, the reference size including: a reference width value in the horizontal direction and a reference height value in the vertical direction;
[0219] an overlap value determining subunit, configured to determine a drawing overlap value based on the reference size, wherein the drawing overlap value includes an overlap width value and an overlap height value;
[0220] The cutting subunit is used to cut the two-dimensional drawing in the horizontal direction and the vertical direction of the two-dimensional drawing according to the preset drawing cutting size and the drawing overlap value, to obtain at least two target drawings, the size of the target drawings is equal to the preset drawing cutting size, and any two adjacent target drawings obtained by cutting in the horizontal direction have an overlapping area with a width value of the overlap width value in the horizontal direction, and any two adjacent target drawings obtained by cutting in the vertical direction have an overlapping area with a height value of the overlap height value in the vertical direction.
[0221] In a possible implementation, the method further includes:
[0222] an error correction judgment subunit, configured to, when the text information further includes: semantic content of the character string in the text box, determine whether the character string satisfies an error correction condition, the error correction condition including at least: missing characters in the character string, or incorrect characters in the character string;
[0223] a type determination subunit, configured to determine the text type of the character string based on the semantic content of the character string if the judgment result of the error correction judgment subunit is yes;
[0224] A rule acquisition subunit, configured to acquire a preset completion rule corresponding to the text type;
[0225] A character correction subunit, configured to correct the character string based on the preset completion rule to obtain a target character string;
[0226] The text determination subunit is used to update the character string in the text information according to the target character string to obtain the text information of the computer room to be modeled.
[0227] In a possible implementation, the method further includes:
[0228] a model name determination subunit, configured to determine, based on the semantic content of each character string, a character string whose semantic content represents the name of the computer room to be modeled, as the model name of the three-dimensional model;
[0229] The storage subunit is used to store the three-dimensional model of the computer room to be modeled and the model name in a preset storage address.
[0230] In one possible implementation, the functional unit for training the graphic recognition model includes:
[0231] A sample set acquisition unit is configured to acquire a drawing sample set, wherein the drawing sample set includes: at least one drawing sample;
[0232] a feature determination unit, configured to perform local analysis on the drawing sample based on a sliding window cutting method to obtain a two-dimensional graphic feature of the drawing sample;
[0233] A graphic recognition model training unit is used to train an initial graphic recognition model based on the drawing samples and the two-dimensional graphic features corresponding to each drawing sample to obtain a graphic recognition model. The training process includes: using the drawing samples as feature values and the two-dimensional graphic features corresponding to the drawing samples as target values for training, so that the graphic recognition model can output the two-dimensional graphic features corresponding to the drawing based on the input drawing.
[0234] In one possible implementation, the functional unit for training the text recognition model includes:
[0235] An image set acquisition unit, configured to acquire an image set, the image set comprising: at least one image containing a text box;
[0236] An image editing unit, configured to edit the image to obtain a new image, wherein the editing process at least includes: cutting, rotating, and assembling;
[0237] an image text recognition unit, configured to take the image and the new image as image samples, and perform text recognition on each of the image samples to obtain a text box corresponding to each of the image samples;
[0238] The text recognition model training unit is used to train the initial text recognition model based on the image samples and the text boxes corresponding to each image sample to obtain a text recognition model. The training process includes: using the image samples as feature values and the text boxes corresponding to the image samples as target values for training, so that the text recognition model can output the text box corresponding to the image based on the input image.
[0239] In summary, the device for generating a three-dimensional model of a computer room based on drawing recognition provided by the embodiment of the present application intelligently recognizes the computer room drawings through a pre-trained graphic recognition model and a text recognition model to obtain two-dimensional graphic information and text information of the computer room. Compared with the manual on-site collection of computer room data in the prior art, the recognition efficiency of the embodiment of the present application is higher. At the same time, the position of the recognized text box is matched with the rectangular cabinet, so that each rectangular cabinet of almost the same shape can be distinguished according to the text characters, which facilitates the subsequent differential modeling of the rectangular cabinet and improves the accuracy of the three-dimensional model. Furthermore, based on the above-obtained computer room layout and the modeling information of the rectangular cabinet, the pre-set three-dimensional structural template is laid out, sized, etc. to obtain a three-dimensional model of the computer room, so that the three-dimensional model can be adaptively adjusted and generated on the basis of the three-dimensional structural template. Compared with the manual drawing in the prior art, the modeling efficiency of the embodiment of the present application is greatly improved.
[0240] An electronic device is also provided in an embodiment of the present application. Figure 6 , which shows a schematic diagram of the structure of an electronic device suitable for implementing the embodiments of the present application. The electronic device in the embodiments of the present application may include, but is not limited to, fixed terminals such as mobile phones, laptops, PDAs (personal digital assistants), PADs (tablet computers), desktop computers, etc. Figure 6 The electronic device shown is merely an example and should not limit the functions and scope of use of the embodiments of the present application.
[0241] like Figure 6As shown, the electronic device may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 601, which can perform various appropriate actions and processes based on programs stored in a read-only memory (ROM) 602 or programs loaded from a storage device 608 into a random access memory (RAM) 603. When the electronic device is powered on, the RAM 603 also stores various programs and data required for the operation of the electronic device. The processing device 601, ROM 602, and RAM 603 are interconnected via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0242] Typically, the following devices may be connected to the I / O interface 605: an input device 606 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 607 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 608 including, for example, a memory card, a hard disk, etc.; and a communication device 609. The communication device 609 may allow the electronic device to communicate with other devices wirelessly or by wire to exchange data. Figure 6 The electronic device is shown with various devices, but it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed instead.
[0243] An embodiment of the present application also provides a computer program product including computer-readable instructions. When the computer-readable instructions are executed on an electronic device, the electronic device implements any one of the methods provided in the embodiments of the present application for generating a three-dimensional model of a computer room based on drawing recognition.
[0244] A computer-readable storage medium is also provided in an embodiment of the present application. The storage medium carries one or more computer programs. When one or more computer programs are executed by an electronic device, the electronic device can implement any one of the methods provided in the embodiment of the present application for generating a three-dimensional model of a computer room based on drawing recognition.
[0245] It should also be noted that the device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separate, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed across multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the present embodiment. In addition, in the drawings of the device embodiments provided in this application, the connection relationship between the modules indicates that there is a communication connection between them, which can be specifically implemented as one or more communication buses or signal lines.
[0246] Through the description of the above embodiments, those skilled in the art can clearly understand that the present application can be implemented by means of software plus necessary general hardware, and of course can also be implemented by special hardware including application-specific integrated circuits, special CPUs, special memories, special components, etc. In general, all functions performed by computer programs can be easily implemented with corresponding hardware, and the specific hardware structures used to implement the same function can also be diverse, such as analog circuits, digital circuits or special circuits, etc. However, for the present application, software program implementation is a better implementation method in most cases. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a readable storage medium, such as a computer's floppy disk, USB flash drive, mobile hard disk, ROM, RAM, magnetic disk or optical disk, etc., and includes a number of instructions to enable a computer device (which can be a personal computer, training equipment, or network equipment, etc.) to execute the methods described in each embodiment of the present application.
[0247] In the above embodiments, all or part of the embodiments may be implemented by software, hardware, firmware, or any combination thereof. When implemented by software, all or part of the embodiments may be implemented in the form of a computer program product.
[0248] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website, a computer, a training device or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website, a computer, a training device or a data center. The computer-readable storage medium can be any available medium that a computer can store or a data storage device such as a training device, a data center, etc. that includes one or more available media integrations. The available medium can be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive (SSD)).
Claims
1. A method for generating a three-dimensional model of a computer room based on drawing recognition, characterized in that: include: Obtain the two-dimensional drawing of the computer room to be modeled; Calling a pre-trained graphic recognition model to perform graphic recognition on the two-dimensional drawing to obtain two-dimensional graphic features of the computer room to be modeled, wherein the two-dimensional graphic features include at least: an outline of the computer room, and the size and position coordinates of each rectangular cabinet in the computer room. The graphic recognition model is trained using the drawing sample as a feature value and the two-dimensional graphic features corresponding to the drawing sample as a target value; Calling a pre-trained text recognition model to perform text recognition processing on the two-dimensional drawing to obtain text information in the two-dimensional drawing, the text information including at least text boxes and the position coordinates and character strings of each text box, the text recognition model being trained using image samples as feature values and text boxes in the image samples as target values; Matching the position coordinates of the text box with the position coordinates of the rectangular cabinet to obtain modeling information corresponding to each rectangular cabinet, the modeling information including at least: the size, position coordinates, the text box, and the character string in the text box; According to the layout of the computer room and the modeling information of the rectangular cabinets in each computer room, a pre-set three-dimensional structure template is processed to generate a three-dimensional model of the computer room to be modeled.
2. The method for generating a three-dimensional model of a computer room based on drawing recognition according to claim 1, characterized in that: The calling of a pre-trained text recognition model to perform text recognition processing on the two-dimensional drawing to obtain text information in the two-dimensional drawing includes: Identifying an initial size of the two-dimensional drawing and determining whether the initial size is larger than a preset drawing identification size; If the initial size is larger than the preset drawing recognition size, the two-dimensional drawing is divided into two pieces to obtain at least two target drawings; Identifying a target text box in each target drawing and the position coordinates of each text box in the two-dimensional drawing; Determining an overlap ratio between every two text boxes based on the position coordinates of each text box in the two-dimensional drawing; Merging the two text boxes whose overlap rate is greater than a preset threshold to obtain all target text boxes and the target position coordinates of each target text box in the corresponding target drawing; A pre-trained text recognition model is called to perform text recognition on the target text box at the target position coordinates in the target drawing, and obtain text information corresponding to the two-dimensional drawing output by the text recognition model.
3. The method for generating a three-dimensional model of a computer room based on drawing recognition according to claim 2, characterized in that: The step of dividing the two-dimensional drawing to obtain at least two target drawings includes: Obtaining the size of each text box in the two-dimensional drawing, and determining a reference size that characterizes the central tendency of the sizes of all the text boxes, the reference size including: a reference width value in the horizontal direction and a reference height value in the vertical direction; Determining a drawing overlap value based on the reference size, the drawing overlap value including: an overlap width value and an overlap height value; According to the preset drawing cutting size and the drawing overlap value, the two-dimensional drawing is cut in the horizontal direction and the vertical direction of the two-dimensional drawing to obtain at least two target drawings, the size of the target drawings is equal to the preset drawing cutting size, and any two adjacent target drawings obtained by cutting in the horizontal direction have an overlapping area with a width value of the overlap width value in the horizontal direction, and any two adjacent target drawings obtained by cutting in the vertical direction have an overlapping area with a height value of the overlap height value in the vertical direction.
4. The method for generating a three-dimensional model of a computer room based on drawing recognition according to claim 3, characterized in that: Also includes: In a case where the text information further includes: semantic content of the character string in the text box, determining whether the character string satisfies an error correction condition, the error correction condition at least including: missing characters in the character string, or an error in a character in the character string; If the character string satisfies the error correction condition, determining the text type of the character string based on the semantic content of the character string; Obtaining a preset completion rule corresponding to the text type; Based on the preset completion rule, the character string is modified to obtain a target character string; The character string in the text information is updated according to the target character string to obtain the text information of the computer room to be modeled.
5. The method for generating a three-dimensional model of a computer room based on drawing recognition according to claim 4 is characterized in that: Also includes: Based on the semantic content of each character string, determining a character string whose semantic content represents the name of the computer room to be modeled as the model name of the three-dimensional model; The three-dimensional model of the computer room to be modeled and the model name are stored together in a preset storage address.
6. The method for generating a three-dimensional model of a computer room based on drawing recognition according to any one of claims 1 to 5, characterized in that: The process of training the graphic recognition model includes: Acquire a drawing sample set, the drawing sample set comprising: at least one drawing sample; Based on the sliding window cutting method, the drawing sample is locally analyzed to obtain the two-dimensional graphic features of the drawing sample; Based on the drawing samples and the two-dimensional graphic features corresponding to each drawing sample, an initial graphic recognition model is trained to obtain a graphic recognition model. The training process includes: using the drawing samples as feature values and the two-dimensional graphic features corresponding to the drawing samples as target values for training, so that the graphic recognition model can output the two-dimensional graphic features corresponding to the drawing based on the input drawing.
7. The method for generating a three-dimensional model of a computer room based on drawing recognition according to any one of claims 1 to 5, characterized in that: The process of training the text recognition model includes: Acquire an image set, the image set comprising: at least one image containing a text box; Editing the image to obtain a new image, wherein the editing process at least includes: cutting, rotating and assembling; Taking the image and the new image as image samples, and performing text recognition on each of the image samples to obtain a text box corresponding to each of the image samples; Based on the image samples and the text boxes corresponding to each image sample, an initial text recognition model is trained to obtain a text recognition model. The training process includes: using the image samples as feature values and the text boxes corresponding to the image samples as target values for training, so that the text recognition model can output a text box corresponding to the image based on the input image.
8. A device for generating a three-dimensional model of a computer room based on drawing recognition, characterized in that: A drawing acquisition unit, used to acquire a two-dimensional drawing of the computer room to be modeled; a graphic recognition unit, configured to call a pre-trained graphic recognition model to perform graphic recognition on the two-dimensional drawing to obtain two-dimensional graphic features of the computer room to be modeled, wherein the two-dimensional graphic features include at least: an outline of the computer room, and the size and position coordinates of each rectangular cabinet in the computer room; the graphic recognition model is trained using a drawing sample as a feature value and the two-dimensional graphic features corresponding to the drawing sample as a target value; a text recognition unit, configured to call a pre-trained text recognition model to perform text recognition processing on the two-dimensional drawing to obtain text information in the two-dimensional drawing, wherein the text information at least includes: text boxes and the position coordinates and character strings of each text box, wherein the text recognition model is trained using image samples as feature values and text boxes in the image samples as target values; an information matching unit, configured to match the position coordinates of the text box with the position coordinates of the rectangular cabinet to obtain modeling information corresponding to each rectangular cabinet, the modeling information including at least: the size, position coordinates, the text box, and the character string in the text box; The model building unit is used to process a preset three-dimensional structure template according to the layout of the computer room and the modeling information of the rectangular cabinets in each computer room to generate a three-dimensional model of the computer room to be modeled.
9. An electronic device that generates a three-dimensional model of a computer room based on drawing recognition, characterized in that: comprising at least one processor and a memory connected to the processor, wherein: The memory is used to store computer programs; The processor is used to execute the computer program so that the electronic device can implement the method for generating a three-dimensional model of a computer room based on drawing recognition as described in any one of claims 1 to 7.
10. A computer storage medium, characterized in that The storage medium carries one or more computer programs. When the one or more computer programs are executed by an electronic device that generates a three-dimensional model of a computer room based on drawing recognition, the electronic device can implement the method for generating a three-dimensional model of a computer room based on drawing recognition as described in any one of claims 1 to 7.