CN115136127A - Distributed compiling and caching method and system - Google Patents

Distributed compiling and caching method and system Download PDF

Info

Publication number
CN115136127A
CN115136127A CN202080096796.9A CN202080096796A CN115136127A CN 115136127 A CN115136127 A CN 115136127A CN 202080096796 A CN202080096796 A CN 202080096796A CN 115136127 A CN115136127 A CN 115136127A
Authority
CN
China
Prior art keywords
compiling
distributed
caching
client
cache
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202080096796.9A
Other languages
Chinese (zh)
Inventor
郭子亮
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Shenzhen Huantai Technology Co Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp Ltd
Shenzhen Huantai Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Oppo Mobile Telecommunications Corp Ltd, Shenzhen Huantai Technology Co Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Publication of CN115136127A publication Critical patent/CN115136127A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The application discloses a distributed compiling and caching method, which is applied to a distributed compiling and caching system, and comprises the following steps: the distributed compiling cache system sends compiling information through the terminal, and commands hijack is carried out on the compiling information through the terminal to obtain a compiling intermediate file; the distributed compiling cache system receives the compiling intermediate file through the compiling client; the distributed compiling and caching system calculates the hash value of the compiling intermediate file through the compiling client and sends the hash value to the compiling and caching service module through the compiling client; and the distributed compiling and caching system determines a distributed compiling and caching strategy according to the hash value through the compiling and caching service module. According to the method, the parallel compiling capacity is expanded, the compiling speed is accelerated, and disk resources brought by multiple caches are reduced through a distributed compiling and caching method.

Description

Distributed compiling and caching method and system Technical Field
The present application relates to the field of electronic technologies, and in particular, to a distributed compiling and caching method and system.
Background
At present, it is a time-consuming process for a compiler to compile a source file, and particularly, after C + + language compilation optimization is poor and a user imports a large amount of unnecessary header files, the compilation time of a single source file may reach 5 minutes or more. In the development process, the situation of modifying the code once and compiling for half an hour may be encountered, the development efficiency is seriously influenced, and meanwhile, the repeated compiling also brings the waste of machine resources.
Disclosure of Invention
The embodiment of the application provides a distributed compiling and caching method and system, which expand the parallel compiling capability, accelerate the compiling speed and reduce the disk resources brought by multiple caches through the distributed compiling and caching method.
In a first aspect, an embodiment of the present application provides a distributed compiling and caching method and system, which are applied to a distributed compiling and caching system, where the distributed compiling and caching system includes a compiling and caching service module, a compiling client, and a terminal, where the compiling and caching service module includes a scheduling server and a file system of the scheduling server, and the method includes: the distributed compiling and caching system sends compiling information through the terminal, and commands hijack the compiling information through the terminal to obtain a compiling intermediate file; the distributed compiling cache system receives the compiling intermediate file through the compiling client, and the compiling intermediate file is sent to the compiling client by the terminal; the distributed compiling cache system calculates a hash value of the compiling intermediate file through the compiling client, and sends the hash value to the compiling cache service module through the compiling client; and the distributed compiling and caching system determines a distributed compiling and caching strategy according to the hash value through the compiling and caching service module.
In a second aspect, an embodiment of the present application provides a distributed compiling and caching system, where the distributed compiling and caching system includes a compiling and caching service module, a compiling client, and a terminal, where the compiling and caching service module includes a scheduling server and a file system of the scheduling server, where,
the terminal is used for sending compiling information and carrying out command hijack on the compiling information to obtain a compiling intermediate file; the compiling client is used for receiving the compiling intermediate file, and the compiling intermediate file is sent to the compiling client by the terminal; the compiling client is also used for calculating a hash value of the compiling intermediate file and sending the hash value to the compiling cache service module; and the compiling and caching service module is used for determining a distributed compiling and caching strategy according to the hash value.
It can be seen that, in the embodiment of the present application, firstly, the distributed compiling and caching system sends compiling information through the terminal, and performs command hijacking on the compiling information through the terminal to obtain a compiling intermediate file, secondly, the distributed compiling and caching system receives the compiling intermediate file through the compiling client, where the compiling intermediate file is sent to the compiling client by the terminal, then, the distributed compiling and caching system calculates a hash value of the compiling intermediate file through the compiling client, and sends the hash value to the compiling and caching service module through the compiling client, and finally, the distributed compiling and caching system determines a distributed compiling and caching policy according to the hash value through the compiling and caching service module. Therefore, the compiling time of a single terminal can be accelerated to the time for extracting and compiling the intermediate file from the cache through the distributed compiling cache method on the basis of the distributed compiling, namely, the compiling speed is accelerated through parallel compiling, and when compiling the cache, the source file can be globally shared after being compiled once, so that more compiling resources are released, and further, the waste of disk resources caused by multiple caches is reduced through unified cache.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the embodiments or the prior art descriptions will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative efforts.
Fig. 1 is a schematic diagram of a framework of a distributed compiling cache system according to an embodiment of the present application;
fig. 2A is a schematic flowchart of a distributed compiling and caching method according to an embodiment of the present application;
fig. 2B is a timing diagram of a distributed compiling and caching method according to an embodiment of the present application;
fig. 2C is a timing diagram illustrating another distributed compile cache method according to an embodiment of the present application;
fig. 3 is a schematic flowchart of another distributed compiling and caching method according to an embodiment of the present application;
fig. 4 is a flowchart illustrating another distributed compiling and caching method according to an embodiment of the present application.
Detailed Description
In order to make the technical solutions better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only partial embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The following are detailed below.
The terms "first," "second," "third," and "fourth," etc. in the description and claims of this application and in the accompanying drawings are used for distinguishing between different objects and not for describing a particular order. Furthermore, the terms "include" and "have," as well as any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those steps or elements but may alternatively include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the application. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It is explicitly and implicitly understood by one skilled in the art that the embodiments described herein can be combined with other embodiments.
Hereinafter, some terms in the present application are explained to facilitate understanding by those skilled in the art.
The following describes embodiments of the present application in detail.
As shown in fig. 1, fig. 1 is a schematic diagram of a distributed compiling cache system framework according to an embodiment of the present application. The distributed compiling and caching system comprises a compiling and caching service module, a compiling client and a terminal, wherein the compiling and caching service module comprises a scheduling server and a file system of the scheduling server, wherein,
the terminal is used for sending compiling information and carrying out command hijack on the compiling information to obtain a compiling intermediate file; the compiling client is used for receiving the compiling intermediate file, and the compiling intermediate file is sent to the compiling client by the terminal; the compiling client is also used for calculating a hash value of the compiling intermediate file and sending the hash value to the compiling cache service module; and the compiling and caching service module is used for determining a distributed compiling and caching strategy according to the hash value.
It can be seen that, in the embodiment of the present application, firstly, the distributed compiling and caching system sends compiling information through the terminal, and performs command hijacking on the compiling information through the terminal to obtain a compiling intermediate file, secondly, the distributed compiling and caching system receives the compiling intermediate file through the compiling client, where the compiling intermediate file is sent to the compiling client by the terminal, then, the distributed compiling and caching system calculates a hash value of the compiling intermediate file through the compiling client, and sends the hash value to the compiling and caching service module through the compiling client, and finally, the distributed compiling and caching system determines a distributed compiling and caching policy according to the hash value through the compiling and caching service module. Therefore, the compiling time of a single terminal can be accelerated to the time for extracting the compiled intermediate file from the cache by the distributed compiling and caching method on the basis of distributed compiling, namely, the compiling speed is accelerated by parallel compiling, and when compiling and caching are carried out, the source file can be globally shared after being compiled once, so that more compiling resources are released, and further, the waste of disk resources caused by multiple caches is reduced by unified caching.
In one possible example, in the aspect that the distributed compiling and caching system determines the distributed compiling and caching strategy according to the hash value through the compiling and caching service module, the compiling and caching service module is used for judging whether the hash value specifies a cache; if so, the distributed compiling cache system acquires a first compiling intermediate file corresponding to the hash value from a file system of the scheduling server through the compiling client; and the file system of the scheduling server is used for sending the first compiled intermediate file to the terminal.
In one possible example, in the aspect that the distributed compilation cache system determines the distributed compilation cache policy according to the hash value through the compilation cache service module, the compilation cache service module is configured to determine whether the hash value specifies a cache; if not, the distributed compiling cache system executes a compiling command through the compiling client to generate a second compiling intermediate file; the compiling client is used for sending the second compiling intermediate file to the file system of the dispatching server; the file system of the scheduling server is used for receiving the second compiled intermediate file and updating a preset database on the file system of the scheduling server; the file system of the scheduling server is further configured to send the second compiled intermediate file to the terminal.
In one possible example, in terms of the distributed compilation cache system determining whether the hash value specifies a cache through the compilation cache service module, the compilation client is configured to send the hash value to a file system of the scheduling server; the file system of the scheduling server is used for inquiring a preset database and determining whether a target hash value consistent with the hash value exists in the preset database; if yes, determining a nomination cache; or if not, determining that the cache is not appointed.
In one possible example, before the distributed compilation caching system receives the compiled intermediate file through the compilation client, the terminal is configured to communicate with the scheduling server to determine whether the scheduling server supports concurrent compilation; and if so, capturing at least one compiling client in the scheduling server.
In one possible example, the method includes grabbing at least one compiling client aspect in the scheduling server, the scheduling server being configured to query a plurality of compiling clients; and screening at least one compiling client capable of supporting parallel compiling as a target compiling client.
In one possible example, in the aspect that the distributed compilation caching system calculates the hash value of the compiled intermediate file through the compilation client, the compilation client is configured to calculate the hash value through the compilation environment information and the source file in the compiled intermediate file.
In one possible example, in terms of command hijacking of the compiled information by the terminal, the terminal is configured to perform command hijacking for soft connection or command override execution.
In one possible example, the cache server module is in communication with a compilation client; the cache server module is communicated with the terminal; the compiling client module communicates with the terminal.
In a possible example, before the distributed compiling and caching system sends compiling information through the terminal and performs command hijack on the compiling information through the terminal to obtain a compiling intermediate file, the terminal is used for obtaining the compiling information through preloading.
The distributed compiling and caching system consists of three main logics, namely a compiling and caching service module, a compiling client and a terminal.
The compiling cache service module mainly stores global compiling intermediate files and manages all available compiling client machine resources.
The compiling client mainly completes the actual compiling command work and pulls and updates the compiling cache.
The terminal, also called as a user client, is mainly used for actually initiating a compiling command terminal and communicating with a compiling service and a compiler after hijacking the compiling command.
The terminals and compiling clients may include various desktop computers, notebook computers, to mini-notebook and tablet computers, ultrabooks, etc. having wireless communication functions.
Referring to fig. 2A, fig. 2A is a schematic flowchart of a distributed compiling and caching method, which is applied to a distributed compiling and caching system, where the distributed compiling and caching system includes a compiling and caching service module, a compiling client, and a terminal, where the compiling and caching service module includes a scheduling server and a file system of the scheduling server, and as shown in the figure, the distributed compiling and caching method includes:
s201, the distributed compiling and caching system sends compiling information through the terminal, and commands hijack the compiling information through the terminal to obtain a compiling intermediate file.
Optionally, the performing, by the terminal, command hijacking on the compiled information includes: and the distributed compiling and caching system carries out command hijack through the soft connection of the terminal or the execution of command coverage.
Wherein the command hijacking can be performed through gcc or clang.
In an implementation manner of performing command hijacking on the compiling information, a user can directly use a make command and directly interface the parallel compiling capability of the make, the make supports local parallel compiling, compiling of unmodified files can be skipped by calculating whether a source file is modified, and the speed of overall compiling is accelerated by a parallel compiling manner.
Wherein, calculating the intermediate target file can be realized by the basic logic of the ccache.
Optionally, the cache server module communicates with the compiling client; the cache server module is communicated with the terminal; the compiling client module communicates with the terminal.
Optionally, before the distributed compiling and caching system sends compiling information through the terminal, and performs command hijacking on the compiling information through the terminal to obtain a compiled intermediate file, the method further includes: and the distributed compiling and caching system acquires compiling information through preloading by the terminal.
The preloading is a compiling code preset by the terminal.
Therefore, in the example, the required files are further extracted through command hijack of the compiling information, and the mis-compiling performance of the subsequent actual compiling is avoided.
S202, the distributed compiling and caching system receives the compiling intermediate file through the compiling client, and the compiling intermediate file is sent to the compiling client by the terminal.
In one possible example, before the distributed compilation cache system receives the compiled intermediate file through the compilation client, the method includes: the distributed compiling and caching system communicates with the scheduling server through the terminal to determine whether the scheduling server supports parallel compiling or not; and if so, capturing at least one compiling client in the scheduling server.
Optionally, the fetching at least one compiling client in the scheduling server includes: the distributed compiling cache system queries a plurality of compiling clients through the scheduling server; and the distributed compiling and caching system screens out at least one compiling client capable of supporting parallel compiling as a target compiling client through the scheduling server.
As can be seen, in this example, at least one compiling client receives the compiling command and pushes or pulls the compiling intermediate file to the cache service request, so as to expand the parallel compiling capability, and further, through parallel compiling, the user can enjoy a compiling environment exceeding the local resource, thereby speeding up the compiling.
S203, the distributed compiling and caching system calculates the hash value of the compiled intermediate file through the compiling client, and sends the hash value to the compiling and caching service module through the compiling client.
Optionally, the calculating, by the distributed compiling cache system through the compiling client, a hash value of the compiled intermediate file includes: and the distributed compiling cache system calculates a hash value through the compiling client by compiling environment information and a source file in the compiling intermediate file.
The compiling environment information may include different information such as an environment variable and a header file, which is not limited herein.
Wherein the source file is set by a developer.
S204, the distributed compiling and caching system determines a distributed compiling and caching strategy according to the hash value through the compiling and caching service module.
In one possible example, the determining, by the compilation cache service module, a distributed compilation cache policy according to the hash value by the distributed compilation cache system includes: the distributed compiling and caching system judges whether the hash value specifies a cache or not through the compiling and caching service module; if so, the distributed compiling cache system acquires a first compiling intermediate file corresponding to the hash value from a file system of the scheduling server through the compiling client; and the distributed compiling and caching system sends the first compiling intermediate file to the terminal through a file system of the scheduling server.
As shown in fig. 2B, fig. 2B is a timing diagram of a distributed compiling and caching method.
In one possible example, the determining, by the compilation cache service module, a distributed compilation cache policy according to the hash value by the distributed compilation cache system includes:
the distributed compiling cache system judges whether the hash value specifies a cache or not through the compiling cache service module; if not, the distributed compiling cache system executes a compiling command through the compiling client to generate a second compiling intermediate file; the distributed compiling cache system sends the second compiling intermediate file to a file system of the scheduling server through the compiling client; the distributed compiling and caching system receives the second compiling intermediate file through the file system of the scheduling server and updates a preset database on the file system of the scheduling server; and the distributed compiling and caching system sends the second compiling intermediate file to the terminal through a file system of the scheduling server.
As shown in fig. 2C, fig. 2C is a timing diagram of another distributed compiling and caching method.
As can be seen, in this example, all compiled intermediate files are stored uniformly by the compiling and caching service module, once a source file is compiled, any user can share the intermediate file, so that more compiling resources are further released, and waste of disk resources caused by multiple caches is reduced.
Optionally, the determining, by the distributed compiling and caching system, whether the hash value specifies a cache by using the compiling and caching service module includes: the distributed compiling cache system sends the hash value to a file system of the scheduling server through the compiling client; the distributed compiling and caching system inquires a preset database through a file system of the scheduling server and determines whether a target hash value consistent with the hash value exists in the preset database or not; if yes, determining a nomination cache; or if not, determining that the cache is not appointed.
The predetermined database may be obtained from a developer through data provision or big data, and is not limited herein.
It can be seen that, in the embodiment of the present application, firstly, the distributed compiling and caching system sends compiling information through the terminal, and performs command hijacking on the compiling information through the terminal to obtain a compiling intermediate file, secondly, the distributed compiling and caching system receives the compiling intermediate file through the compiling client, where the compiling intermediate file is sent to the compiling client by the terminal, then, the distributed compiling and caching system calculates a hash value of the compiling intermediate file through the compiling client, and sends the hash value to the compiling and caching service module through the compiling client, and finally, the distributed compiling and caching system determines a distributed compiling and caching policy according to the hash value through the compiling and caching service module. Therefore, the compiling time of a single terminal can be accelerated to the time for extracting the compiled intermediate file from the cache by the distributed compiling and caching method on the basis of distributed compiling, namely, the compiling speed is accelerated by parallel compiling, and when compiling and caching are carried out, the source file can be globally shared after being compiled once, so that more compiling resources are released, and further, the waste of disk resources caused by multiple caches is reduced by unified caching.
Consistent with the embodiment shown in fig. 2A, please refer to fig. 3, where fig. 3 is a schematic flowchart of a distributed compiling and caching method provided in an embodiment of the present application, and is applied to a distributed compiling and caching system, where the distributed compiling and caching system includes a compiling and caching service module, a compiling client, and a terminal, the compiling and caching service module includes a scheduling server and a file system of the scheduling server, and as shown in the figure, the distributed compiling and caching method includes:
s301, the distributed compiling and caching system sends compiling information through the terminal, and commands hijack the compiling information through the terminal to obtain a compiling intermediate file.
S302, the distributed compiling and caching system communicates with the scheduling server through the terminal to determine whether the scheduling server supports parallel compiling.
S303, if yes, capturing at least one compiling client in the scheduling server.
S304, the distributed compiling and caching system receives the compiling intermediate file through the compiling client, and the compiling intermediate file is sent to the compiling client by the terminal.
S305, the distributed compiling and caching system calculates the hash value of the compiling intermediate file through the compiling client, and sends the hash value to the compiling and caching service module through the compiling client.
S306, the distributed compiling and caching system judges whether the hash value specifies the cache or not through the compiling and caching service module.
And S307, if so, the distributed compiling and caching system acquires the first compiling intermediate file corresponding to the hash value from the file system of the scheduling server through the compiling client.
S308, the distributed compiling and caching system sends the first compiling intermediate file to the terminal through the file system of the scheduling server.
It can be seen that, in the embodiment of the present application, firstly, the distributed compiling and caching system sends compiling information through the terminal, and performs command hijacking on the compiling information through the terminal to obtain a compiling intermediate file, secondly, the distributed compiling and caching system receives the compiling intermediate file through the compiling client, where the compiling intermediate file is sent to the compiling client by the terminal, then, the distributed compiling and caching system calculates a hash value of the compiling intermediate file through the compiling client, and sends the hash value to the compiling and caching service module through the compiling client, and finally, the distributed compiling and caching system determines a distributed compiling and caching policy according to the hash value through the compiling and caching service module. Therefore, the compiling time of a single terminal can be accelerated to the time for extracting the compiled intermediate file from the cache by the distributed compiling and caching method on the basis of distributed compiling, namely, the compiling speed is accelerated by parallel compiling, and when compiling and caching are carried out, the source file can be globally shared after being compiled once, so that more compiling resources are released, and further, the waste of disk resources caused by multiple caches is reduced by unified caching.
In addition, the compiling client receives the compiling command and pushes or pulls the compiling intermediate file to the cache service request, the parallel compiling capability is expanded, and further, through parallel compiling, a user can enjoy a compiling environment exceeding local resources, and the compiling speed is accelerated.
Consistent with the embodiment shown in fig. 2A, please refer to fig. 4, where fig. 4 is a schematic flowchart of a distributed compiling and caching method provided in an embodiment of the present application, and is applied to a distributed compiling and caching system, where the distributed compiling and caching system includes a compiling and caching service module, a compiling client, and a terminal, the compiling and caching service module includes a scheduling server and a file system of the scheduling server, and as shown in the figure, the distributed compiling and caching method includes:
s401, the distributed compiling and caching system sends compiling information through the terminal, and commands hijack the compiling information through the terminal to obtain a compiling intermediate file.
S402, the distributed compiling and caching system communicates with the scheduling server through the terminal to determine whether the scheduling server supports parallel compiling.
S403, if yes, capturing at least one compiling client in the scheduling server.
S404, the distributed compiling and caching system receives the compiling intermediate file through the compiling client, and the compiling intermediate file is sent to the compiling client by the terminal.
S405, the distributed compiling and caching system calculates the hash value of the compiling intermediate file through the compiling client, and sends the hash value to the compiling and caching service module through the compiling client.
S406, the distributed compiling and caching system judges whether the hash value specifies a cache or not through the compiling and caching service module.
And S407, if not, the distributed compiling and caching system executes the compiling command through the compiling client to generate a second compiling intermediate file.
S408, the distributed compiling and caching system sends the second compiling intermediate file to the file system of the scheduling server through the compiling client.
And S409, the distributed compiling and caching system receives the second compiled intermediate file through the file system of the scheduling server and updates a preset database on the file system of the scheduling server.
S410, the distributed compiling and caching system sends the second compiling intermediate file to the terminal through the file system of the scheduling server.
It can be seen that, in the embodiment of the present application, firstly, the distributed compiling and caching system sends compiling information through the terminal, and performs command hijacking on the compiling information through the terminal to obtain a compiling intermediate file, secondly, the distributed compiling and caching system receives the compiling intermediate file through the compiling client, where the compiling intermediate file is sent to the compiling client by the terminal, then, the distributed compiling and caching system calculates a hash value of the compiling intermediate file through the compiling client, and sends the hash value to the compiling and caching service module through the compiling client, and finally, the distributed compiling and caching system determines a distributed compiling and caching policy according to the hash value through the compiling and caching service module. Therefore, the compiling time of a single terminal can be accelerated to the time for extracting and compiling the intermediate file from the cache by the distributed compiling and caching method on the basis of distributed compiling, namely, the compiling speed is accelerated by parallel compiling, and when compiling and caching are carried out, the source file can be globally shared after being compiled once, so that more compiling resources are released, and further, the waste of magnetic disk resources caused by multiple caches is reduced by unified caching.
In addition, the compiling client receives the compiling command and pushes or pulls the compiling intermediate file to the cache service request, the parallel compiling capability is expanded, and further, through parallel compiling, a user can enjoy a compiling environment exceeding local resources, and the compiling speed is accelerated.
The above description has introduced the solution of the embodiment of the present application mainly from the perspective of the method-side implementation process. It is understood that, in order to implement the above functions, the distributed compiling cache system includes a hardware structure and/or a software module for performing the respective functions. Those of skill in the art will readily appreciate that the steps described in connection with the embodiments provided herein may be implemented as hardware or a combination of hardware and computer software. Whether a function is performed as hardware or computer software drives hardware depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
In the embodiment of the present application, the functional units of the distributed compiling and caching system may be divided according to the above method example, for example, each functional unit may be divided corresponding to each function, or two or more functions may be integrated in one processing unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit. It should be noted that the division of the unit in the embodiment of the present application is schematic, and is only a logic function division, and there may be another division manner in actual implementation.
It should be noted that, for simplicity of description, the above-mentioned method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present application is not limited by the order of acts described, as some steps may occur in other orders or concurrently depending on the application. Further, those skilled in the art should also appreciate that the embodiments described in the specification are preferred embodiments and that the acts and modules referred to are not necessarily required in this application.
In the foregoing embodiments, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus may be implemented in other manners. For example, the above-described system embodiments are merely illustrative, and for example, the division of the above-described units is merely a logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, systems or units, and may be in an electrical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit may be implemented in the form of hardware, or may also be implemented in the form of a software functional unit.
The integrated unit may be stored in a computer readable memory if it is implemented in the form of a software functional unit and sold or used as a stand-alone product. Based on such understanding, the technical solutions of the present application, which are essential or part of the technical solutions contributing to the prior art, or all or part of the technical solutions, may be embodied in the form of a software product, which is stored in a memory and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the above methods of the embodiments of the present application. And the aforementioned memory comprises: a U-disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic or optical disk, and other various media capable of storing program codes.
Those skilled in the art will appreciate that all or part of the steps in the methods of the above embodiments may be implemented by associated hardware instructed by a program, which may be stored in a computer-readable memory, which may include: flash Memory disks, Read-Only memories (ROMs), Random Access Memories (RAMs), magnetic or optical disks, and the like.
The foregoing embodiments have been described in detail, and specific examples are used herein to explain the principles and implementations of the present application, but the above description of the embodiments is only used to help understand the methods and their core ideas of the present application; meanwhile, for a person skilled in the art, according to the idea of the present application, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present application.

Claims (20)

  1. A distributed compiling and caching method is applied to a distributed compiling and caching system, the distributed compiling and caching system comprises a compiling and caching service module, a compiling client and a terminal, the compiling and caching service module comprises a scheduling server and a file system of the scheduling server, and the method comprises the following steps:
    the distributed compiling and caching system sends compiling information through the terminal, and commands hijack the compiling information through the terminal to obtain a compiling intermediate file;
    the distributed compiling cache system receives the compiling intermediate file through the compiling client, and the compiling intermediate file is sent to the compiling client by the terminal;
    the distributed compiling and caching system calculates the hash value of the compiling intermediate file through the compiling client and sends the hash value to the compiling and caching service module through the compiling client;
    and the distributed compiling and caching system determines a distributed compiling and caching strategy according to the hash value through the compiling and caching service module.
  2. The method of claim 1, wherein the determining, by the compilation cache service module, a distributed compilation cache policy from the hash value by the distributed compilation cache system comprises:
    the distributed compiling and caching system judges whether the hash value specifies a cache or not through the compiling and caching service module;
    if so, the distributed compiling cache system acquires a first compiling intermediate file corresponding to the hash value from a file system of the scheduling server through the compiling client;
    and the distributed compiling and caching system sends the first compiling intermediate file to the terminal through a file system of the scheduling server.
  3. The method of claim 1, wherein the determining, by the compilation cache service module, a distributed compilation cache policy from the hash value by the distributed compilation cache system comprises:
    the distributed compiling and caching system judges whether the hash value specifies a cache or not through the compiling and caching service module;
    if not, the distributed compiling cache system executes a compiling command through the compiling client to generate a second compiling intermediate file;
    the distributed compiling cache system sends the second compiling intermediate file to a file system of the scheduling server through the compiling client;
    the distributed compiling and caching system receives the second compiling intermediate file through the file system of the scheduling server and updates a preset database on the file system of the scheduling server;
    and the distributed compiling and caching system sends the second compiling intermediate file to the terminal through a file system of the scheduling server.
  4. The method of claim 2 or 3, wherein the determining, by the distributed compilation cache system and through the compilation cache service module, whether the hash value specifies a cache comprises:
    the distributed compiling cache system sends the hash value to a file system of the scheduling server through the compiling client;
    the distributed compiling and caching system inquires a preset database through a file system of the scheduling server and determines whether a target hash value consistent with the hash value exists in the preset database or not;
    if yes, determining a nomination cache; or,
    if not, the cache is determined to be undecided.
  5. The method of any of claims 1-3, wherein prior to the distributed compilation cache system receiving the compiled intermediate file via the compilation client, the method comprises:
    the distributed compiling and caching system communicates with the scheduling server through the terminal to determine whether the scheduling server supports parallel compiling or not;
    and if so, capturing at least one compiling client in the scheduling server.
  6. The method of claim 5, wherein crawling at least one compiling client in the scheduling server comprises:
    the distributed compiling cache system queries a plurality of compiling clients through the scheduling server;
    and the distributed compiling and caching system screens out at least one compiling client capable of supporting parallel compiling as a target compiling client through the scheduling server.
  7. The method of claim 1, wherein the distributed compilation cache system calculating, by the compilation client, a hash value of the compiled intermediate file comprises:
    and the distributed compiling cache system calculates a hash value through the compiling client by compiling environment information and a source file in the compiling intermediate file.
  8. The method of claim 1, wherein the command hijacking the compilation information by the terminal comprises:
    and the distributed compiling and caching system carries out command hijacking through the soft connection of the terminal or the execution of command coverage.
  9. The method of any of claims 1-8, wherein the cache server module is in communication with a compilation client; the cache server module is communicated with the terminal; the compiling client module communicates with the terminal.
  10. The method as claimed in claim 1, wherein before the distributed compiling and caching system sends compiling information through the terminal and performs command hijacking on the compiling information through the terminal to obtain a compiled intermediate file, the method further comprises:
    and the distributed compiling and caching system acquires compiling information through preloading by the terminal.
  11. A distributed compiling and caching system is characterized by comprising a compiling and caching service module, a compiling client and a terminal, wherein the compiling and caching service module comprises a scheduling server and a file system of the scheduling server, wherein,
    the terminal is used for sending compiling information and carrying out command hijack on the compiling information to obtain a compiling intermediate file; the compiling client is used for receiving the compiling intermediate file, and the compiling intermediate file is sent to the compiling client by the terminal; the compiling client is also used for calculating a hash value of the compiling intermediate file and sending the hash value to the compiling cache service module; and the compiling and caching service module is used for determining a distributed compiling and caching strategy according to the hash value.
  12. The system of claim 11, wherein, in the aspect that the distributed compilation caching system determines the distributed compilation caching policy according to the hash value through the compilation caching service module, the compilation caching service module is configured to determine whether the hash value specifies a cache; if so, the distributed compiling cache system acquires a first compiling intermediate file corresponding to the hash value from a file system of the scheduling server through the compiling client; and the file system of the scheduling server is used for sending the first compiled intermediate file to the terminal.
  13. The system of claim 11, wherein, in the aspect that the distributed compilation caching system determines the distributed compilation caching policy according to the hash value through the compilation caching service module, the compilation caching service module is configured to determine whether the hash value specifies a cache; if not, the distributed compiling cache system executes a compiling command through the compiling client to generate a second compiling intermediate file; the compiling client is used for sending the second compiling intermediate file to the file system of the dispatching server; the file system of the scheduling server is used for receiving the second compiled intermediate file and updating a preset database on the file system of the scheduling server; the file system of the scheduling server is further configured to send the second compiled intermediate file to the terminal.
  14. The system according to claim 12 or 13, wherein, in the aspect that the distributed compilation cache system determines whether the hash value specifies a cache through the compilation cache service module, the compilation client is configured to send the hash value to a file system of the scheduling server; the file system of the scheduling server is used for inquiring a preset database and determining whether a target hash value consistent with the hash value exists in the preset database; if yes, determining a nomination cache; or if not, determining that the cache is not appointed.
  15. The system according to any one of claims 11-13, wherein before the distributed compilation caching system receives the compiled intermediate file via the compilation client, the terminal is configured to communicate with the scheduling server to determine whether the scheduling server supports concurrent compilation; and if so, capturing at least one compiling client in the scheduling server.
  16. The system of claim 15, wherein the scheduling server is configured to query a plurality of compiling clients in connection with crawling at least one compiling client in the scheduling server; and the method is also used for screening out at least one compiling client capable of supporting concurrent compiling as a target compiling client.
  17. The system of claim 11, wherein the compilation client is configured to compute a hash value from the compilation environment information and the source file in the compiled intermediate file in the distributed compilation cache system in terms of computing the hash value from the compilation client.
  18. The system according to claim 11, wherein in said command hijacking said compiled information by said terminal, said terminal is configured to soft connect or execute command override command hijacking.
  19. The system of any of claims 11-18, wherein the cache server module is in communication with a compilation client; the cache server module is communicated with the terminal; the compiling client module communicates with the terminal.
  20. The system of claim 11, wherein before the distributed compilation cache system sends the compilation information through the terminal and performs command hijacking on the compilation information through the terminal to obtain the compilation intermediate file, the terminal is configured to obtain the compilation information through preloading.
CN202080096796.9A 2020-03-19 2020-03-19 Distributed compiling and caching method and system Pending CN115136127A (en)

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2020/080232 WO2021184304A1 (en) 2020-03-19 2020-03-19 Distributed cache compilation method and system

Publications (1)

Publication Number Publication Date
CN115136127A true CN115136127A (en) 2022-09-30

Family

ID=77768386

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202080096796.9A Pending CN115136127A (en) 2020-03-19 2020-03-19 Distributed compiling and caching method and system

Country Status (2)

Country Link
CN (1) CN115136127A (en)
WO (1) WO2021184304A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115033243A (en) * 2022-06-01 2022-09-09 北京四维图新科技股份有限公司 Compiling method and system based on rapid compiling engine and map data cloud platform

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050039189A1 (en) * 2003-08-14 2005-02-17 Todd Anderson Methods and apparatus to preemptively compile an application
US8677329B2 (en) * 2009-06-03 2014-03-18 Apple Inc. Methods and apparatuses for a compiler server
CN103544276B (en) * 2013-10-22 2017-05-10 北京京东尚科信息技术有限公司 Method and device for displaying script files by virtual machine
CN105590051B (en) * 2015-11-18 2018-10-23 中国银联股份有限公司 Trusted application for credible performing environment generates and installation method
CN109753306A (en) * 2018-12-28 2019-05-14 北京东方国信科技股份有限公司 A kind of big data processing method of because precompiled function caching engine

Also Published As

Publication number Publication date
WO2021184304A1 (en) 2021-09-23

Similar Documents

Publication Publication Date Title
US11621998B2 (en) Dynamic creation and execution of containerized applications in cloud computing
CN107766126B (en) Container mirror image construction method, system and device and storage medium
CN101370025A (en) Storing method, scheduling method and management system for geographic information data
CN111159897B (en) Target optimization method and device based on system modeling application
EP3320442A1 (en) Staged application rollout
WO2015073025A1 (en) Indicating a trait of a continuous delivery pipeline
CN111105006A (en) Deep learning network training system and method
CN113391826B (en) Solution method for software package dependence in customized mirror image
CN116450355A (en) Multi-cluster model training method, device, equipment and medium
CN111818194A (en) Domain name based access system and method
CN111460394A (en) Copyright file verification method and device and computer readable storage medium
CN111782730B (en) File uploading method and device and storage medium
CN112925792A (en) Data storage control method, device, computing equipment and medium
CN114614989A (en) Feasibility verification method and device of network service based on digital twin technology
CN112954040A (en) Method, system, device and storage medium for embedding application release server
CN115827253A (en) Chip resource calculation allocation method, device, equipment and storage medium
CN117724852B (en) Cloud computer computing resource allocation method and device
Hou et al. A case study of accelerating apache spark with FPGA
CN115136127A (en) Distributed compiling and caching method and system
CN113992662A (en) File transmission method, device and storage medium
CN104144170A (en) URL filtering method, device and system
CN103530369A (en) De-weight method and system
CN111610977B (en) Compiling method and related device
CN112308573A (en) Intelligent customer service method and device, storage medium and computer equipment
CN105610596B (en) Resource directory management method and network terminal

Legal Events

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