Fast compilation method, device, storage medium and electronic equipment

CN115794113BActive Publication Date: 2026-10-30深圳开鸿数字产业发展有限公司
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211471573.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-21
Publication Date
2026-10-30
Estimated Expiration
2042-11-21

AI Technical Summary

Technical Problem

代码量过多,将会导致设备在对编译文件进行编译的时候需要花费较多的时间,编译效率低下

Benefits of technology

[0035]本申请实施例提供的快速编译方法,在生成编译文件对应的编译依赖关系树后,先生成编译依赖关系树中各个节点对应的校验码,在对编译依赖关系树中的待编译节点进行编译时,判断其它分布式设备中的同一编译依赖关系树中是否存在有与至少任一待编译节点对应的校验码相同的目标校验码,若存在,则判断目标校验码对应的目标节点在对应的目标分布式设备中是否已被编译,若已被编译,则从目标分布式设备中获取目标节点的目标输出文件作为待编译节点的输出文件,不再对待编译节点进行编译,然后对其它还未生成输出文件的待编译节点进行编译,从而生成编译文件对应的完整的输出文件,从而提高了设备对编译文件的编译效率。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115794113B_ABST
    Figure CN115794113B_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a fast compiling method, device, storage medium and electronic equipment, the method comprising: when detecting that a user starts a program compiling command, obtaining a compiling file corresponding to the program compiling command; scanning the compiling file to generate a compiling dependency relationship tree corresponding to the compiling file; generating a first check code corresponding to each node in the compiling dependency relationship tree; judging whether there is a target check code same as the first check code corresponding to at least any to-be-compiled node in the compiling dependency relationship tree in other distributed devices; if there is, judging whether a target node corresponding to the target check code has been compiled in a corresponding target distributed device; if yes, obtaining a target output file of the target node from the target distributed device as an output file of the to-be-compiled node, and not compiling the to-be-compiled node; and compiling other to-be-compiled nodes which have not generated the output file, to generate a complete output file corresponding to the compiling file.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a rapid compilation method, apparatus, storage medium, and electronic device. Background Technology

[0002] In the information age, with the continuous improvement and expansion of software system functions, software scales have become extremely large, with large-scale system software code reaching millions or even tens of millions of lines. Excessive code volume leads to longer compilation times for devices, resulting in low compilation efficiency. Therefore, improving the compilation efficiency of devices is a pressing issue that needs to be addressed. Summary of the Invention

[0003] This application provides a fast compilation method, apparatus, storage medium, and electronic device, which can improve the compilation efficiency of the device for compilation files.

[0004] This application provides a fast compilation method, the method comprising:

[0005] When a user initiates a program compilation command, the compiled file corresponding to the program compilation command is obtained;

[0006] Scan the compiled files to generate the compilation dependency tree corresponding to the compiled files;

[0007] Generate the first checksum corresponding to each node in the compilation dependency tree, wherein the first checksum corresponding to different nodes is different;

[0008] Determine whether there exists a target check code in the compilation dependency tree of other distributed devices that is the same as the first check code corresponding to at least any node to be compiled;

[0009] If it exists, then determine whether the target node corresponding to the target verification code has been compiled in the corresponding target distributed device;

[0010] If so, the target output file of the target node is obtained from the target distributed device as the output file of the node to be compiled, and the node to be compiled is not compiled.

[0011] Compile the other nodes that have not yet generated output files to generate complete output files corresponding to the compiled files.

[0012] In the fast compilation method described in this application embodiment, generating the checksum corresponding to each node in the compilation dependency tree includes:

[0013] Generate the parent checksum corresponding to the first-level node in the compilation dependency tree. After the parent checksum is generated, generate the child checksum corresponding to the node in each level of the compilation dependency tree in sequence according to the dependency relationship of the node in each level of the compilation dependency tree, so as to obtain the first checksum corresponding to each node in the compilation dependency tree.

[0014] In the fast compilation method described in this application embodiment, determining whether there is at least one target checksum in the compilation dependency tree of other distributed devices that is identical to the first checksum corresponding to the node to be compiled includes:

[0015] Obtain the second checksum corresponding to each node in the compilation dependency tree of each of the distributed devices;

[0016] Compare each of the second check codes with the first check codes corresponding to each node to be compiled;

[0017] If there exists a second check code that is the same as the first check code corresponding to at least any of the nodes to be compiled, then it is determined that there exists a target check code in the compilation dependency tree of the other distributed devices that is the same as the first check code corresponding to at least any of the nodes to be compiled.

[0018] If there is no second check code that is the same as the first check code corresponding to at least any of the nodes to be compiled, then it is determined that there is no target check code in the compilation dependency tree of the other distributed devices that is the same as the first check code corresponding to at least any of the nodes to be compiled.

[0019] In the fast compilation method described in this application embodiment, the step of determining whether there is a target checksum in the compilation dependency tree of other distributed devices that is the same as the first checksum corresponding to at least any node to be compiled further includes:

[0020] Send all the first verification codes to each of the distributed devices;

[0021] If a device receives a message from at least one of the distributed devices indicating that there exists a checksum in its compilation dependency tree that is identical to the first checksum corresponding to at least any of the nodes to be compiled, then it is determined that there exists a target checksum in the compilation dependency tree of the distributed device that is identical to the first checksum corresponding to at least any of the nodes to be compiled.

[0022] If all the distributed devices send a message indicating that there is no checksum in the compilation dependency tree of this device that is the same as the first checksum corresponding to at least any of the nodes to be compiled, then it is determined that there is no target checksum in the compilation dependency tree of the distributed device that is the same as the first checksum corresponding to at least any of the nodes to be compiled.

[0023] In the fast compilation method described in the embodiments of this application, the step of determining whether the target node corresponding to the target check code has been compiled in the corresponding target distributed device if it exists includes:

[0024] If it exists, then determine whether the target output file exists in the corresponding target distributed device of the target node corresponding to the target verification code;

[0025] If the target output file exists, it is determined that the target node corresponding to the target checksum has been compiled in the corresponding target distributed device;

[0026] If the target output file does not exist, it is determined that the target node corresponding to the target check code has not been compiled in the corresponding target distributed device.

[0027] In the fast compilation method described in the embodiments of this application, after generating the first checksum corresponding to each node in the compilation dependency tree, the method further includes:

[0028] Retrieve the start and end compilation nodes selected by the user;

[0029] Based on the starting compilation node, the ending compilation node, and the dependencies of each node in the compilation dependency tree, the node to be compiled is determined.

[0030] In the fast compilation method described in the embodiments of this application, after determining whether the target node corresponding to the target check code has been compiled in the corresponding target distributed device if it exists, the method further includes:

[0031] If not, then the node to be compiled is compiled to generate the output file of the node to be compiled.

[0032] This application also provides a rapid compilation apparatus, which includes a processor and a memory. The memory stores a computer program, and the processor executes the rapid compilation method described in any of the above embodiments by calling the computer program stored in the memory.

[0033] This application also provides a computer-readable storage medium storing a computer program that, when run on a computer, causes the computer to execute the rapid compilation method described in any of the above embodiments.

[0034] This application also provides an electronic device, which includes the rapid compilation device described in the above embodiments.

[0035] The fast compilation method provided in this application first generates the checksum corresponding to each node in the compilation dependency tree after generating the compilation dependency tree corresponding to the compilation file. When compiling the node to be compiled in the compilation dependency tree, it determines whether there is a target checksum in the same compilation dependency tree in other distributed devices that is the same as the checksum corresponding to at least any node to be compiled. If so, it determines whether the target node corresponding to the target checksum has been compiled in the corresponding target distributed device. If it has been compiled, it obtains the target output file of the target node from the target distributed device as the output file of the node to be compiled, and no longer compiles the node to be compiled. Then, it compiles other nodes to be compiled that have not yet generated output files, thereby generating the complete output file corresponding to the compilation file, thereby improving the compilation efficiency of the device for the compilation file. Attached Figure Description

[0036] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0037] Figure 1 This is a flowchart illustrating the rapid compilation method provided in an embodiment of this application.

[0038] Figure 2 This is a schematic diagram of the structure of the rapid compilation device provided in the embodiments of this application.

[0039] Figure 3 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0040] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the protection scope of this application.

[0041] This application provides a rapid compilation method that can be applied to electronic devices, such as computers.

[0042] Please see Figure 1 , Figure 1 This is a flowchart illustrating the rapid compilation method provided in an embodiment of this application. The rapid compilation method, applied in an electronic device, may include the following steps:

[0043] Step 101: When a user starts a program compilation command, obtain the compilation file corresponding to the program compilation command.

[0044] For example, when a user wants to compile a source file on an electronic device into an executable file, they only need to start the program compilation command on the electronic device, and the electronic device will obtain the source file, which is the compiled file.

[0045] Step 102: Scan the compiled files to generate the compilation dependency tree corresponding to the compiled files.

[0046] The compiler dependency tree is used to provide an explicit compilation order, thereby reducing the problem of duplicate dependency lookups caused by messy compilation orders during compilation.

[0047] Step 103: Generate the first checksum corresponding to each node in the compilation dependency tree, wherein the first checksum corresponding to different nodes is different.

[0048] The first checksum can be an SHA1 checksum.

[0049] In some embodiments, generating the checksum corresponding to each node in the compilation dependency tree includes:

[0050] Generate the parent checksum corresponding to the first-level node in the compilation dependency tree. After the parent checksum is generated, generate the child checksum corresponding to the node in each level of the compilation dependency tree in sequence according to the dependency relationship of the node in each level of the compilation dependency tree, so as to obtain the first checksum corresponding to each node in the compilation dependency tree.

[0051] In a compiler dependency tree, there are multiple levels, each containing at least one node. Subsequent levels directly or indirectly depend on the first level. For example, if the compiler dependency tree has only two levels, with one node in the first level and multiple nodes in the second level that depend on the node in the first level, then the node in the first level is called the parent node, and the multiple nodes in the second level are called the child nodes of the node in the first level. The checksum corresponding to the parent node is called the parent checksum, and the checksum corresponding to the child node is called the child checksum.

[0052] In some embodiments, after generating the first checksum corresponding to each node in the compilation dependency tree, the method further includes:

[0053] Retrieve the start and end compilation nodes selected by the user;

[0054] Based on the starting compilation node, the ending compilation node, and the dependencies of each node in the compilation dependency tree, the node to be compiled is determined.

[0055] Users can manipulate the compilation dependency tree on the device's screen, such as selecting the starting and ending compilation nodes. The device only needs to start compiling from the starting node and stop compiling after the ending node is completed. No further compilation actions are required, which avoids invalid compilation and greatly saves the compilation time of the compiled files.

[0056] Step 104: Determine whether there is a target check code in the compilation dependency tree of other distributed devices that is the same as the first check code corresponding to at least any node to be compiled.

[0057] Among them, the distributed devices can be connected through a distributed soft bus, which can use P2P technology to enable direct connection (P2P) between the distributed devices.

[0058] In this context, nodes with the same checksum in the same dependency tree across different distributed devices are considered the same node. For example, if node 'a' in the dependency tree of device A and node 'b' in the dependency tree of device B have the same checksum, then node 'a' and node 'b' are the same node, and the output files of the same node are identical.

[0059] In some embodiments, determining whether there exists a target checksum in the compilation dependency tree of other distributed devices that is identical to the first checksum corresponding to at least any node to be compiled includes:

[0060] Obtain the second checksum corresponding to each node in the compilation dependency tree of each of the distributed devices;

[0061] Compare each of the second check codes with the first check codes corresponding to each node to be compiled;

[0062] If there exists a second check code that is the same as the first check code corresponding to at least any of the nodes to be compiled, then it is determined that there exists a target check code in the compilation dependency tree of the other distributed devices that is the same as the first check code corresponding to at least any of the nodes to be compiled.

[0063] If there is no second check code that is the same as the first check code corresponding to at least any of the nodes to be compiled, then it is determined that there is no target check code in the compilation dependency tree of the other distributed devices that is the same as the first check code corresponding to at least any of the nodes to be compiled.

[0064] That is, this device determines whether there is a checksum in other distributed devices that is the same as the first checksum corresponding to at least any node to be compiled by obtaining the checksums of each node in the compilation dependency tree of other distributed devices.

[0065] In some embodiments, determining whether there exists a target checksum in the compilation dependency tree of other distributed devices that is identical to the first checksum corresponding to at least any node to be compiled, further includes:

[0066] Send all the first verification codes to each of the distributed devices;

[0067] If a device receives a message from at least one of the distributed devices indicating that there exists a checksum in its compilation dependency tree that is identical to the first checksum corresponding to at least any of the nodes to be compiled, then it is determined that there exists a target checksum in the compilation dependency tree of the distributed device that is identical to the first checksum corresponding to at least any of the nodes to be compiled.

[0068] If all the distributed devices send a message indicating that there is no checksum in the compilation dependency tree of this device that is the same as the first checksum corresponding to at least any of the nodes to be compiled, then it is determined that there is no target checksum in the compilation dependency tree of the distributed device that is the same as the first checksum corresponding to at least any of the nodes to be compiled.

[0069] That is, this device sends its own first checksum to other distributed devices, allowing the other distributed devices to determine whether there is a checksum in their own device that is the same as the received first checksum. Then, the distributed devices return the judgment result to this device, which can then determine whether there is a target checksum in the compilation dependency tree of the distributed devices that is the same as the first checksum corresponding to at least any node to be compiled.

[0070] Step 105: If it exists, determine whether the target node corresponding to the target check code has been compiled in the corresponding target distributed device.

[0071] For example, if the first checksum of a node to be compiled in device A is ABC, and a checksum ABC also exists in distributed device B connected to this device, then the checksum ABC in distributed device B is the target checksum mentioned above. The node corresponding to the target checksum ABC is the target node, and the target distributed device corresponding to the target node is distributed device B.

[0072] In some embodiments, the step of determining whether the target node corresponding to the target checksum has been compiled in the corresponding target distributed device if it exists includes:

[0073] If it exists, then determine whether the target output file exists in the corresponding target distributed device of the target node corresponding to the target verification code;

[0074] If the target output file exists, it is determined that the target node corresponding to the target checksum has been compiled in the corresponding target distributed device;

[0075] If the target output file does not exist, it is determined that the target node corresponding to the target check code has not been compiled in the corresponding target distributed device.

[0076] If a node has an output file, it means that the node has been compiled. Therefore, it is only necessary to check whether a node has been compiled to determine whether the node has an output file.

[0077] In some embodiments, after determining whether the target node corresponding to the target check code has been compiled in the corresponding target distributed device if it exists, the method further includes:

[0078] If not, then the node to be compiled is compiled to generate the output file of the node to be compiled.

[0079] Even if other distributed devices have a checksum (target checksum) that is the same as the first checksum in this device, the target node corresponding to the target checksum has not been compiled. Therefore, it is necessary to compile the node to be compiled and generate the output file of the node to be compiled.

[0080] In some embodiments, after determining whether there is a target checksum in the compilation dependency tree of other distributed devices that is identical to the first checksum corresponding to at least any node to be compiled, the method further includes:

[0081] If it does not exist, then all the nodes to be compiled are compiled to generate the complete output file corresponding to the compiled file.

[0082] Step 106: If yes, then obtain the target output file of the target node from the target distributed device as the output file of the node to be compiled, and do not compile the node to be compiled.

[0083] In other words, if the target node corresponding to the target checksum has already been compiled on the corresponding target distributed device, it means that the node to be compiled has already been compiled on the target distributed device. In this case, there is no need to compile the node again; the output file of the node to be compiled can be directly obtained from the target distributed device, saving compilation time and improving the compilation efficiency of the compiled files. Similarly, nodes in the compilation dependency tree that have already been compiled on other distributed devices do not need to be compiled again; the corresponding compiled files can be directly obtained from those other distributed devices.

[0084] For example, if a node 'a' in device A has already been compiled in distributed device B, then device A does not need to compile node 'a' again. It can directly obtain the compilation file corresponding to node 'a' from distributed device B, thereby saving the compilation time of node 'a'.

[0085] Step 107: Compile the other nodes to be compiled that have not yet generated output files to generate a complete output file corresponding to the compiled file.

[0086] Since some nodes to be compiled may not have been compiled on other distributed devices, they need to be compiled themselves to obtain the complete output file corresponding to the compiled file. The output file is an executable file.

[0087] All of the above-mentioned optional technical solutions can be combined in any way to form the optional embodiments of this application, and will not be described in detail here.

[0088] In practice, this application is not limited by the execution order of the described steps. Without causing conflicts, some steps may be performed in other orders or simultaneously.

[0089] As can be seen from the above, the fast compilation method provided in this application first generates the checksum corresponding to each node in the compilation dependency tree after generating the compilation dependency tree corresponding to the compilation file. When compiling the node to be compiled in the compilation dependency tree, it is determined whether there is a target checksum in the same compilation dependency tree in other distributed devices that is the same as the checksum corresponding to at least any node to be compiled. If so, it is determined whether the target node corresponding to the target checksum has been compiled in the corresponding target distributed device. If it has been compiled, the target output file of the target node is obtained from the target distributed device as the output file of the node to be compiled, and the node to be compiled is no longer compiled. Then, the other nodes to be compiled that have not yet generated output files are compiled, thereby generating the complete output file corresponding to the compilation file, thereby improving the compilation efficiency of the device for the compilation file.

[0090] This application also provides a rapid compilation device, which can be integrated into an electronic device. The electronic device can be a computer or similar device.

[0091] Please see Figure 2 , Figure 2 This is a schematic diagram of the structure of a rapid compilation apparatus provided in an embodiment of this application. The rapid compilation apparatus 30 includes a memory 120, one or more processors 180, and one or more application programs, wherein the one or more application programs are stored in the memory 120 and configured to be executed by the processors 180; the memory 120 can be used to store application programs and data. The application programs stored in the memory 120 contain executable code. The application programs can form various functional modules. The processor 180 executes various functional applications and data processing by running the application programs stored in the memory 120. Furthermore, the memory 120 may include high-speed random access memory and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, the memory 120 may also include a memory controller to provide the processor 180 with access to the memory 120.

[0092] The processor 180 is the control center of the device, connecting various parts of the terminal through various interfaces and lines. It performs various functions and processes data by running or executing applications stored in the memory 120 and calling data stored in the memory 120, thereby providing overall monitoring of the device. Optionally, the processor 180 may include one or more processing cores; preferably, the processor 180 may integrate an application processor and a modem processor, wherein the application processor mainly handles the operating system, user interface, and applications.

[0093] Specifically, in this embodiment, the memory 120 stores a computer program, and the processor 180 executes the fast compilation method described in any of the above embodiments by calling the computer program stored in the memory 120.

[0094] Please see Figure 3 , Figure 3 A schematic diagram of the structure of an electronic device provided in an embodiment of this application is shown. This electronic device can be used to implement the rapid compilation method provided in the above embodiments. The electronic device 1200 can be a computer or other device.

[0095] like Figure 3 As shown, the electronic device 1200 may include an RF (Radio Frequency) circuit 110, a memory 120 including one or more (only one is shown in the figure) computer-readable storage media, an input unit 130, a display unit 140, a sensor 150, an audio circuit 160, a transmission module 170, a processor 180 including one or more (only one is shown in the figure) processing cores, and a power supply 190, etc. Those skilled in the art will understand that... Figure 3 The structure of the electronic device 1200 shown does not constitute a limitation on the electronic device 1200, and may include more or fewer components than shown, or combine certain components, or have different component arrangements. Wherein:

[0096] RF circuit 110 is used to receive and transmit electromagnetic waves, realizing the mutual conversion between electromagnetic waves and electrical signals, thereby enabling communication with communication networks or other devices. RF circuit 110 may include various existing circuit elements used to perform these functions, such as antennas, radio frequency transceivers, digital signal processors, encryption / decryption chips, Subscriber Identity Module (SIM) cards, memory, etc. RF circuit 110 can communicate with various networks such as the Internet, corporate intranets, and wireless networks, or communicate with other devices via wireless networks.

[0097] The memory 120 can be used to store software programs and modules, such as program instructions / modules corresponding to the rapid compilation method in the above embodiments. The processor 180 executes various functional applications and data processing by running the software programs and modules stored in the memory 120, thereby improving the efficiency of human motion posture recognition. The memory 120 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 120 may further include memory remotely located relative to the processor 180, and these remote memories can be connected to the electronic device 1200 via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.

[0098] The input unit 130 can be used to receive input digital or character information, and to generate keyboard, mouse, joystick, optical, or trackball signal inputs related to user settings and function control. Specifically, the input unit 130 may include a touch-sensitive surface 131 and other input devices 132. The touch-sensitive surface 131, also known as a touch display screen or touchpad, can collect touch operations performed by the user on or near it (such as operations performed by the user using a finger, stylus, or any suitable object or accessory on or near the touch-sensitive surface 131), and drive the corresponding connection device according to a pre-set program. Optionally, the touch-sensitive surface 131 may include two parts: a touch detection device and a touch controller. The touch detection device detects the user's touch position and the signal generated by the touch operation, and transmits the signal to the touch controller; the touch controller receives touch information from the touch detection device, converts it into touch point coordinates, sends it to the processor 180, and can receive and execute commands from the processor 180. In addition, the touch-sensitive surface 131 can be implemented using various types such as resistive, capacitive, infrared, and surface acoustic wave. In addition to the touch-sensitive surface 131, the input unit 130 may also include other input devices 132. Specifically, other input devices 132 may include, but are not limited to, one or more of the following: physical keyboard, function keys (such as volume control buttons, power buttons, etc.), trackball, mouse, joystick, etc.

[0099] Display unit 140 can be used to display information input by the user or information provided to the user, as well as various graphical user interfaces of electronic device 1200. These graphical user interfaces can be composed of graphics, text, icons, video, and any combination thereof. Display unit 140 may include display panel 141, optionally configured as LCD (Liquid Crystal Display), OLED (Organic Light-Emitting Diode), etc. Further, touch-sensitive surface 131 may cover display panel 141. When touch-sensitive surface 131 detects a touch operation on or near it, it transmits the information to processor 180 to determine the type of touch event. Subsequently, processor 180 provides corresponding visual output on display panel 141 according to the type of touch event. Although in Figure 3 In this embodiment, the touch-sensitive surface 131 and the display panel 141 are implemented as two separate components to realize input and output functions. However, in some embodiments, the touch-sensitive surface 131 and the display panel 141 can be integrated to realize input and output functions.

[0100] The electronic device 1200 may also include at least one sensor 150, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor and a proximity sensor. The ambient light sensor can adjust the brightness of the display panel 141 according to the ambient light level, and the proximity sensor can turn off the display panel 141 and / or backlight when the electronic device 1200 is moved to the ear. As a type of motion sensor, a gravity acceleration sensor can detect the magnitude of acceleration in various directions (generally three axes). When stationary, it can detect the magnitude and direction of gravity and can be used for applications that identify the posture of the electronic device (such as landscape / portrait switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometers, taps), etc. Other sensors that may be configured in the electronic device 1200, such as gyroscopes, barometers, hygrometers, thermometers, and infrared sensors, will not be described in detail here.

[0101] Audio circuitry 160, speaker 161, and microphone 162 provide an audio interface between the user and electronic device 1200. Audio circuitry 160 converts received audio data into electrical signals, which are then transmitted to speaker 161, where they are converted into sound signals for output. Conversely, microphone 162 converts collected sound signals into electrical signals, which are received by audio circuitry 160, converted back into audio data, and then processed by processor 180 before being transmitted via RF circuitry 110 to, for example, another terminal, or output to memory 120 for further processing. Audio circuitry 160 may also include an earphone jack to facilitate communication between external headphones and electronic device 1200.

[0102] Electronic device 1200, through transmission module 170 (e.g., Wi-Fi module), enables users to send and receive emails, browse web pages, and access streaming media, providing users with wireless broadband internet access. Although Figure 3 The transmission module 170 is shown, but it is understood that it is not an essential component of the electronic device 1200 and can be omitted as needed without changing the nature of the invention.

[0103] The processor 180 is the control center of the electronic device 1200. It connects various parts of the electronic device 1200 via various interfaces and lines. By running or executing software programs and / or modules stored in the memory 120, and by calling data stored in the memory 120, it performs various functions and processes data of the electronic device 1200, thereby enabling overall monitoring of the human body. Optionally, the processor 180 may include one or more processing cores; in some embodiments, the processor 180 may integrate an application processor and a modem processor, wherein the application processor mainly handles the operating system, user interface, and applications, and the modem processor mainly handles wireless communication. It is understood that the modem processor may also not be integrated into the processor 180.

[0104] The electronic device 1200 also includes a power supply 190 (such as a battery) that supplies power to various components. In some embodiments, the power supply may be logically connected to the processor 180 through a power management system, thereby enabling functions such as charging, discharging, and power consumption management through the power management system. The power supply 190 may also include one or more DC or AC power supplies, recharging systems, power fault detection circuits, power converters or inverters, power status indicators, and other arbitrary components.

[0105] Although not shown, the electronic device 1200 may also include a camera (such as a front-facing camera and a rear-facing camera), a Bluetooth module, etc., which will not be described in detail here. Specifically, in this embodiment, the display unit 140 of the electronic device 1200 is a touch screen display, and the electronic device 1200 also includes a memory 120 and one or more programs, one or more of which are stored in the memory 120 and configured to be executed by one or more processors 180. One or more programs contain instructions for performing the following operations:

[0106] When a user initiates a program compilation command, the compiled file corresponding to the program compilation command is obtained;

[0107] Scan the compiled files to generate the compilation dependency tree corresponding to the compiled files;

[0108] Generate the first checksum corresponding to each node in the compilation dependency tree, wherein the first checksum corresponding to different nodes is different;

[0109] Determine whether there exists a target check code in the compilation dependency tree of other distributed devices that is the same as the first check code corresponding to at least any node to be compiled;

[0110] If it exists, then determine whether the target node corresponding to the target verification code has been compiled in the corresponding target distributed device;

[0111] If so, the target output file of the target node is obtained from the target distributed device as the output file of the node to be compiled, and the node to be compiled is not compiled.

[0112] Compile the other nodes that have not yet generated output files to generate complete output files corresponding to the compiled files.

[0113] In some embodiments, the processor 180 is configured to generate the parent checksum corresponding to the first level node in the compilation dependency tree, and after the parent checksum is generated, generate the child checksum corresponding to the node in each level of the compilation dependency tree in sequence according to the dependency relationship corresponding to the node in each level of the compilation dependency tree, thereby obtaining the first checksum corresponding to each node in the compilation dependency tree.

[0114] In some embodiments, the processor 180 is used to obtain the second check code corresponding to each node in the compilation dependency tree in each of the distributed devices;

[0115] Compare each of the second check codes with the first check codes corresponding to each node to be compiled;

[0116] If there exists a second check code that is the same as the first check code corresponding to at least any of the nodes to be compiled, then it is determined that there exists a target check code in the compilation dependency tree of the other distributed devices that is the same as the first check code corresponding to at least any of the nodes to be compiled.

[0117] If there is no second check code that is the same as the first check code corresponding to at least any of the nodes to be compiled, then it is determined that there is no target check code in the compilation dependency tree of the other distributed devices that is the same as the first check code corresponding to at least any of the nodes to be compiled.

[0118] In some embodiments, the processor 180 is configured to send all of the first check codes to each of the distributed devices;

[0119] If a device receives a message from at least one of the distributed devices indicating that there exists a checksum in its compilation dependency tree that is identical to the first checksum corresponding to at least any of the nodes to be compiled, then it is determined that there exists a target checksum in the compilation dependency tree of the distributed device that is identical to the first checksum corresponding to at least any of the nodes to be compiled.

[0120] If all the distributed devices send a message indicating that there is no checksum in the compilation dependency tree of this device that is the same as the first checksum corresponding to at least any of the nodes to be compiled, then it is determined that there is no target checksum in the compilation dependency tree of the distributed device that is the same as the first checksum corresponding to at least any of the nodes to be compiled.

[0121] In some embodiments, the processor 180 is configured to determine, if present, whether the target output file exists in the corresponding target distributed device for the target node corresponding to the target check code;

[0122] If the target output file exists, it is determined that the target node corresponding to the target checksum has been compiled in the corresponding target distributed device;

[0123] If the target output file does not exist, it is determined that the target node corresponding to the target check code has not been compiled in the corresponding target distributed device.

[0124] In some embodiments, the processor 180 is used to obtain the start compilation node and the end compilation node selected by the user;

[0125] Based on the starting compilation node, the ending compilation node, and the dependencies of each node in the compilation dependency tree, the node to be compiled is determined.

[0126] In some embodiments, the processor 180 is configured to, if not, compile the node to be compiled to generate an output file for the node to be compiled.

[0127] As can be seen from the above, this application embodiment provides an electronic device 1200, which performs the following steps: when a user starts a program compilation command, the electronic device 1200 obtains the compilation file corresponding to the program compilation command;

[0128] Scan the compiled files to generate the compilation dependency tree corresponding to the compiled files;

[0129] The process involves generating a first checksum corresponding to each node in the compilation dependency tree, wherein different nodes have different first checksums. It then determines whether there exists a target checksum in the compilation dependency tree of other distributed devices that is identical to the first checksum corresponding to at least any node to be compiled. If so, it determines whether the target node corresponding to the target checksum has been compiled in the corresponding target distributed device. If so, it obtains the target output file of the target node from the target distributed device as the output file of the node to be compiled, without compiling the node to be compiled. The process continues with compiling other nodes that have not yet generated output files to generate a complete output file corresponding to the compiled file. Through these steps, the embodiments of this application can improve the compilation efficiency of the device for compiled files.

[0130] This application also provides a storage medium storing a computer program. When the computer program is run on a computer, the computer executes the rapid compilation method described in any of the above embodiments.

[0131] It should be noted that, for the rapid compilation method described in this application, those skilled in the art will understand that implementing all or part of the rapid compilation method described in the embodiments of this application can be accomplished by a computer program controlling related hardware. The computer program can be stored in a computer-readable storage medium, such as in the memory of an electronic device, and executed by at least one processor within the electronic device. During execution, it can include the processes described in the embodiments of the rapid compilation method. The storage medium can be a magnetic disk, optical disk, read-only memory (ROM), random access memory (RAM), etc.

[0132] The rapid compilation method, apparatus, storage medium, and electronic device provided in the embodiments of this application have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the embodiments above are only for the purpose of helping to understand the methods and core ideas of this application; at the same time, those skilled in the art will recognize that, based on the ideas of this application, there will be changes in the specific implementation methods and application scope. Therefore, the content of this specification should not be construed as a limitation of this application.

Claims

1. A rapid compilation method, characterized in that, include: When a user initiates a program compilation command, the compiled file corresponding to the program compilation command is obtained; Scan the compiled files to generate the compilation dependency tree corresponding to the compiled files; Generate the parent checksum corresponding to the first level node in the compilation dependency tree, and after the parent checksum is generated, generate the child checksum corresponding to the node in each level of the compilation dependency tree in sequence according to the dependency relationship of the node in each level of the compilation dependency tree, so as to obtain the first checksum corresponding to each node in the compilation dependency tree, wherein the first checksum corresponding to different nodes is different. Retrieve the start and end compilation nodes selected by the user; Based on the starting compilation node, the ending compilation node, and the dependencies of each node in the compilation dependency tree, the node to be compiled is determined; Determine whether there is a target check code in the compilation dependency tree of other distributed devices that is the same as the first check code corresponding to at least any node to be compiled, wherein the distributed devices communicate directly through a distributed soft bus using P2P technology. If it exists, then determine whether the target node corresponding to the target verification code has been compiled in the corresponding target distributed device; If so, the target output file of the target node is obtained from the target distributed device as the output file of the node to be compiled, and the node to be compiled is not compiled. Compile the other nodes that have not yet generated output files to generate complete output files corresponding to the compiled files.

2. The rapid compilation method as described in claim 1, characterized in that, The step of determining whether there exists a target checksum in the compilation dependency tree of other distributed devices that is identical to the first checksum corresponding to at least any node to be compiled includes: Obtain the second checksum corresponding to each node in the compilation dependency tree of each of the distributed devices; Compare each of the second check codes with the first check codes corresponding to each node to be compiled; If there exists a second check code that is the same as the first check code corresponding to at least any of the nodes to be compiled, then it is determined that there exists a target check code in the compilation dependency tree of the other distributed devices that is the same as the first check code corresponding to at least any of the nodes to be compiled. If there is no second check code that is the same as the first check code corresponding to at least any of the nodes to be compiled, then it is determined that there is no target check code in the compilation dependency tree of the other distributed devices that is the same as the first check code corresponding to at least any of the nodes to be compiled.

3. The rapid compilation method as described in claim 1, characterized in that, The step of determining whether there is a target checksum in the compilation dependency tree of other distributed devices that is identical to the first checksum corresponding to at least any node to be compiled, further includes: Send all the first verification codes to each of the distributed devices; If a device receives a message from at least one of the distributed devices indicating that there exists a checksum in its compilation dependency tree that is identical to the first checksum corresponding to at least any of the nodes to be compiled, then it is determined that there exists a target checksum in the compilation dependency tree of the distributed device that is identical to the first checksum corresponding to at least any of the nodes to be compiled. If all the distributed devices send a message indicating that there is no checksum in the compilation dependency tree of this device that is the same as the first checksum corresponding to at least any of the nodes to be compiled, then it is determined that there is no target checksum in the compilation dependency tree of the distributed device that is the same as the first checksum corresponding to at least any of the nodes to be compiled.

4. The rapid compilation method as described in claim 1, characterized in that, If such a condition exists, then determining whether the target node corresponding to the target verification code has been compiled in the corresponding target distributed device includes: If it exists, then determine whether the target output file exists in the corresponding target distributed device of the target node corresponding to the target verification code; If the target output file exists, it is determined that the target node corresponding to the target checksum has been compiled in the corresponding target distributed device; If the target output file does not exist, it is determined that the target node corresponding to the target check code has not been compiled in the corresponding target distributed device.

5. The rapid compilation method as described in claim 1, characterized in that, If it exists, then after determining whether the target node corresponding to the target check code has been compiled in the corresponding target distributed device, the method further includes: If not, then the node to be compiled is compiled to generate the output file of the node to be compiled.

6. A rapid compilation apparatus, characterized in that, The device includes a processor and a memory, the memory storing a computer program, and the processor executing the rapid compilation method according to any one of claims 1 to 5 by calling the computer program stored in the memory.

7. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when run on a computer, causes the computer to perform the rapid compilation method according to any one of claims 1 to 5.

8. An electronic device, characterized in that, The electronic device includes the rapid compilation apparatus of claim 6.

Citation Information

Patent Citations

  • Compiling method and device

    CN114356342A

  • Incremental compiling method and device based on source code detection

    CN115113876A