WO2021184304A1 - 分布式编译缓存方法及系统 - Google Patents

分布式编译缓存方法及系统 Download PDF

Info

Publication number
WO2021184304A1
WO2021184304A1 PCT/CN2020/080232 CN2020080232W WO2021184304A1 WO 2021184304 A1 WO2021184304 A1 WO 2021184304A1 CN 2020080232 W CN2020080232 W CN 2020080232W WO 2021184304 A1 WO2021184304 A1 WO 2021184304A1
Authority
WO
WIPO (PCT)
Prior art keywords
compilation
caching
distributed
client
terminal
Prior art date
Application number
PCT/CN2020/080232
Other languages
English (en)
French (fr)
Inventor
郭子亮
Original Assignee
深圳市欢太科技有限公司
Oppo广东移动通信有限公司
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 深圳市欢太科技有限公司, Oppo广东移动通信有限公司 filed Critical 深圳市欢太科技有限公司
Priority to PCT/CN2020/080232 priority Critical patent/WO2021184304A1/zh
Priority to CN202080096796.9A priority patent/CN115136127A/zh
Publication of WO2021184304A1 publication Critical patent/WO2021184304A1/zh

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

Definitions

  • This application relates to the field of electronic technology, and in particular to a distributed compilation and caching method and system.
  • the embodiments of the present application provide a distributed compilation and caching method and system, which expand parallel compilation capabilities, accelerate compilation speed, and reduce disk resources caused by multiple caches through the distributed compilation and caching method.
  • the embodiments of the present application provide a distributed compilation cache method and system, which are applied to a distributed compilation cache system.
  • the distributed compilation cache system includes a compilation cache service module, a compilation client, and a terminal.
  • the compilation cache The service module includes a dispatch server and a file system of the dispatch server, and the method includes: the distributed compilation cache system sends compilation information through the terminal, and command hijacks the compilation information through the terminal to obtain a compiled intermediate file
  • the distributed compilation and caching system receives the compilation intermediate file through the compilation client, and the compilation intermediate file is sent by the terminal to the compilation client; the distributed compilation cache system passes the compilation
  • the client calculates the hash value of the compiled intermediate file, and sends the hash value to the compilation and cache service module through the compilation client; the distributed compilation and cache system uses the compilation and cache service module according to The hash value determines a distributed compilation and caching strategy.
  • an embodiment of the present application provides a distributed compilation and caching system, characterized in that the distributed compilation and caching system includes a compilation and caching service module, a compilation client, and a terminal, and the compilation and caching service module includes a scheduling server and The file system of the dispatch server, where,
  • the terminal is used to send compilation information, and is used to command hijack the compilation information to obtain a compilation intermediate file;
  • the compilation client is used to receive the compilation intermediate file, and the compilation intermediate file is sent by the terminal To the compiling client; the compiling client is also used to calculate the hash value of the compiled intermediate file, and send the hash value to the compilation cache service module; the compilation cache service module is used for A distributed compilation and caching strategy is determined according to the hash value.
  • the distributed compilation and caching system sends compilation information through the terminal, and command hijacks the compilation information through the terminal to obtain a compilation intermediate file
  • the distribution The distributed compilation and caching system receives the compilation intermediate file through the compilation client, and the compilation intermediate file is sent by the terminal to the compilation client.
  • the distributed compilation and caching system passes the compilation client Calculate the hash value of the compiled intermediate file, and send the hash value to the compilation and cache service module through the compilation client.
  • the distributed compilation and cache system uses the compilation and cache service module according to The hash value determines a distributed compilation and caching strategy.
  • the distributed compilation and caching method can accelerate the compilation time of a single terminal to the time to extract the compilation intermediate file from the cache, that is, speed up the compilation through parallel compilation, and when compiling and caching,
  • the source file can be globally shared after compiling once, thereby releasing more compilation resources, and further reducing the waste of disk resources caused by multiple caching through unified caching.
  • FIG. 1 is a schematic diagram of the framework of a distributed compilation and caching system provided by an embodiment of the present application
  • 2A is a schematic flowchart of a distributed compilation and caching method provided by an embodiment of the present application
  • 2B is a schematic diagram of a time sequence of a distributed compilation and caching method provided by an embodiment of the present application
  • 2C is a schematic diagram of a timing sequence of another distributed compilation and caching method provided by an embodiment of the present application.
  • FIG. 3 is a schematic flowchart of another distributed compilation and caching method provided by an embodiment of the present application.
  • FIG. 4 is a schematic flowchart of another distributed compilation and caching method provided by an embodiment of the present application.
  • FIG. 1 is a schematic diagram of the framework of a distributed compilation cache system provided by an embodiment of the present application.
  • the distributed compilation and cache system includes a compilation and cache service module, a compilation client, and a terminal, and the compilation and cache service module includes a dispatch server and a file system of the dispatch server, wherein:
  • the terminal is used to send compilation information, and is used to command hijack the compilation information to obtain a compilation intermediate file;
  • the compilation client is used to receive the compilation intermediate file, and the compilation intermediate file is sent by the terminal To the compiling client; the compiling client is also used to calculate the hash value of the compiled intermediate file, and send the hash value to the compilation cache service module; the compilation cache service module is used for A distributed compilation and caching strategy is determined according to the hash value.
  • the distributed compilation and caching system sends compilation information through the terminal, and command hijacks the compilation information through the terminal to obtain a compilation intermediate file
  • the distribution The distributed compilation and caching system receives the compilation intermediate file through the compilation client, and the compilation intermediate file is sent by the terminal to the compilation client.
  • the distributed compilation and caching system passes the compilation client Calculate the hash value of the compiled intermediate file, and send the hash value to the compilation and cache service module through the compilation client.
  • the distributed compilation and cache system uses the compilation and cache service module according to The hash value determines a distributed compilation and caching strategy.
  • the distributed compilation and caching method can accelerate the compilation time of a single terminal to the time to extract the compilation intermediate file from the cache, that is, speed up the compilation through parallel compilation, and when compiling and caching,
  • the source file can be globally shared after compiling once, thereby releasing more compilation resources, and further reducing the waste of disk resources caused by multiple caching through unified caching.
  • the distributed compilation and caching system determines the distributed compilation and caching strategy according to the hash value through the compilation and caching service module
  • the compilation and caching service module is used to determine the hash value Whether the cache is destined; if so, the distributed compilation and caching system obtains the first compilation intermediate file corresponding to the hash value from the file system of the dispatch server through the compilation client; the file system of the dispatch server For sending the first compiled intermediate file to the terminal.
  • the compilation and caching service module is used to determine the hash value Whether the cache is destined; if not, the distributed compilation and caching system executes the compilation command through the compilation client to generate a second compilation intermediate file; the compilation client is used to send the second compilation intermediate file to the The file system of the dispatch server; the file system of the dispatch server is used to receive the second compiled intermediate file and update the preset database on the file system of the dispatch server; the file system of the dispatch server is also used to The second compiled intermediate file is sent to the terminal.
  • the compilation client is configured to send the hash value to the The file system of the dispatch server; the file system of the dispatch server is used to query a preset database to determine whether there is a target hash value consistent with the hash value in the preset database; if it exists, determine the designated cache; Or, if it does not exist, it is determined that the cache is not designated.
  • the terminal before the distributed compilation and caching system receives the compilation intermediate file through the compilation client, the terminal is used to communicate with the dispatch server to determine whether the dispatch server supports parallel Compile; if supported, grab at least one compiling client from the scheduling server.
  • the dispatch server in terms of capturing at least one compilation client from the dispatch server, is used to query multiple compilation clients; and is also used to filter out at least one compilation client that can support parallel compilation Compile the client for the target.
  • the compilation client is configured to use the compilation environment in the compilation intermediate file
  • the hash value is calculated from the information and the source file.
  • the terminal in terms of command hijacking the compiled information through the terminal, the terminal is used for soft connection or executing command override for command hijacking.
  • the cache server module communicates with the compiling client; the cache server module communicates with the terminal; and the compiling client module communicates with the terminal.
  • the terminal before the distributed compilation and caching system sends compilation information through the terminal, and hijacks the compilation information through the terminal to obtain the compiled intermediate file, the terminal is used to pass the pre- Load, get compilation information.
  • the above-mentioned distributed compilation and caching system consists of three main logics, the compilation and caching service module, the compilation client and the terminal.
  • the compilation cache service module mainly stores global compilation intermediate files and manages all available compilation client resources.
  • the compilation client mainly completes the actual compilation command work, and pulls and updates the compilation cache.
  • the terminal also known as (user client) is mainly used to actually initiate the compilation command, and at the same time hijack the compilation command to communicate with the compilation service and the compiler.
  • Terminals and compiling clients can include various desktop computers, notebook computers, small notebook computers and tablet computers, ultrabooks, and so on with wireless communication capabilities.
  • FIG. 2A is a schematic flowchart of a distributed compilation cache method provided by an embodiment of the present application, which is applied to a distributed compilation cache system.
  • the distributed compilation cache system includes a compilation cache service module, a compilation client, and In the terminal, the compilation and caching service module includes a dispatch server and a file system of the dispatch server.
  • the distributed compilation and caching method includes:
  • S201 The distributed compilation and caching system sends compilation information through the terminal, and hijacks the compilation information through the terminal to obtain a compilation intermediate file.
  • the command hijacking the compilation information through the terminal includes: the distributed compilation and caching system performs command hijacking through the soft connection of the terminal or the execution command override.
  • command hijacking can be performed through gcc or clang.
  • the user can directly use the make command and directly connect to the parallel compilation capability of make.
  • Make supports local parallel compilation. You can skip by calculating whether the source file has been modified. Through the compilation of unmodified files, the speed of the overall compilation is accelerated by means of parallel compilation.
  • the calculation of the intermediate target file can be realized through the basic logic of ccache.
  • the cache server module communicates with the compiling client; the cache server module communicates with the terminal; the compiling client module communicates with the terminal.
  • the method further includes: the distributed The compilation cache system obtains compilation information through preloading through the terminal.
  • the preloading is a compiled code preset by the terminal itself.
  • the required files are further extracted through command hijacking of the compilation information, which avoids the miscompilation of subsequent actual compilation.
  • S202 The distributed compilation and caching system receives the compilation intermediate file through the compilation client, where the compilation intermediate file is sent by the terminal to the compilation client.
  • the method before the distributed compilation and caching system receives the compilation intermediate file through the compilation client, the method includes: the distributed compilation and caching system sends the dispatch server to the dispatch server through the terminal Communicate to determine whether the scheduling server supports parallel compilation; if so, grab at least one compiling client from the scheduling server.
  • the capturing at least one compilation client from the dispatch server includes: the distributed compilation and caching system queries multiple compilation clients through the dispatch server; the distributed compilation and caching system passes all The scheduling server screens out at least one compiling client that can support parallel compilation as the target compiling client.
  • At least one compilation client receives compilation commands and requests to push or pull compilation intermediate files from the cache service to expand parallel compilation capabilities. Further, through parallel compilation, users can enjoy a compilation environment that exceeds local resources. Speed up the compilation speed.
  • S203 The distributed compilation and caching system calculates the hash value of the compilation intermediate file through the compilation client, and sends the hash value to the compilation and cache service module through the compilation client.
  • the distributed compilation and caching system calculates the hash value of the compilation intermediate file through the compilation client includes: the distributed compilation and caching system passes the compilation intermediate file through the compilation client Compile environment information and source files to calculate the hash value.
  • the compilation environment information may include different information such as environment variables and header files, which is not uniquely limited here.
  • the source file is set by the developer.
  • the distributed compilation and caching system determines a distributed compilation and caching strategy according to the hash value through the compilation and caching service module.
  • the distributed compilation and caching system determines the distributed compilation and caching strategy according to the hash value through the compilation and caching service module, including: the distributed compilation and caching system uses the compilation and caching service module to determine the distributed compilation and caching strategy. Determine whether the hash value is destined for caching; if so, the distributed compilation and caching system obtains the first compilation intermediate file corresponding to the hash value from the file system of the scheduling server through the compilation client; The distributed compilation and caching system sends the first compilation intermediate file to the terminal through the file system of the dispatch server.
  • FIG. 2B is a timing diagram of a distributed compilation and caching method.
  • the distributed compilation and caching system determines the distributed compilation and caching strategy according to the hash value through the compilation and caching service module, including:
  • the distributed compilation and caching system judges whether the hash value is destined for caching through the compilation and caching service module; if not, the distributed compilation and caching system executes the compilation command through the compilation client to generate a second compilation intermediate
  • the distributed compilation and caching system sends the second compilation intermediate file to the file system of the dispatch server through the compilation client; the distributed compilation and caching system receives it through the file system of the dispatch server
  • the second compiled intermediate file is updated and a preset database on the file system of the dispatch server is updated; the distributed compilation cache system sends the second compiled intermediate file to the terminal through the file system of the dispatch server.
  • FIG. 2C is a timing diagram of another distributed compilation and caching method.
  • the distributed compilation and cache system judging whether the hash value is destined for caching through the compilation and cache service module includes: the distributed compilation and cache system sends the hash value through the compilation client To the file system of the dispatch server; the distributed compilation and cache system queries a preset database through the file system of the dispatch server to determine whether there is a target hash value consistent with the hash value in the preset database ; If it exists, the cache is determined to be designated; or, if it does not exist, it is determined that the cache is not designated.
  • the preset database can be obtained from data provided by the developer pass or obtained from big data, which is not the only limitation here.
  • the distributed compilation and caching system sends compilation information through the terminal, and command hijacks the compilation information through the terminal to obtain a compilation intermediate file
  • the distribution The distributed compilation and caching system receives the compilation intermediate file through the compilation client, and the compilation intermediate file is sent by the terminal to the compilation client.
  • the distributed compilation and caching system passes the compilation client Calculate the hash value of the compiled intermediate file, and send the hash value to the compilation and cache service module through the compilation client.
  • the distributed compilation and cache system uses the compilation and cache service module according to The hash value determines a distributed compilation and caching strategy.
  • the distributed compilation and caching method can accelerate the compilation time of a single terminal to the time to extract the compilation intermediate file from the cache, that is, speed up the compilation through parallel compilation, and when compiling and caching,
  • the source file can be globally shared after compiling once, thereby releasing more compilation resources, and further reducing the waste of disk resources caused by multiple caching through unified caching.
  • FIG. 3 is a schematic flowchart of a distributed compilation and caching method provided by an embodiment of the present application, which is applied to a distributed compilation and caching system.
  • the cache system includes a compilation and cache service module, a compilation client, and a terminal.
  • the compilation and cache service module includes a dispatch server and a file system of the dispatch server.
  • the distributed compilation and cache method includes:
  • S301 The distributed compilation and caching system sends compilation information through the terminal, and hijacks the compilation information through the terminal to obtain a compilation intermediate file.
  • the distributed compilation and caching system communicates with the dispatch server through the terminal, and determines whether the dispatch server supports parallel compilation.
  • S304 The distributed compilation and caching system receives the compilation intermediate file through the compilation client, and the compilation intermediate file is sent by the terminal to the compilation client.
  • S305 The distributed compilation and caching system calculates the hash value of the compilation intermediate file through the compilation client, and sends the hash value to the compilation and cache service module through the compilation client.
  • S306 The distributed compilation and caching system judges whether the hash value is designated for caching through the compilation and caching service module.
  • S308 The distributed compilation and caching system sends the first compilation intermediate file to the terminal through the file system of the scheduling server.
  • the distributed compilation and caching system sends compilation information through the terminal, and command hijacks the compilation information through the terminal to obtain a compilation intermediate file
  • the distribution The distributed compilation and caching system receives the compilation intermediate file through the compilation client, and the compilation intermediate file is sent by the terminal to the compilation client.
  • the distributed compilation and caching system passes the compilation client Calculate the hash value of the compiled intermediate file, and send the hash value to the compilation and cache service module through the compilation client.
  • the distributed compilation and cache system uses the compilation and cache service module according to The hash value determines a distributed compilation and caching strategy.
  • the distributed compilation and caching method can accelerate the compilation time of a single terminal to the time to extract the compilation intermediate file from the cache, that is, speed up the compilation through parallel compilation, and when compiling and caching,
  • the source file can be globally shared after compiling once, thereby releasing more compilation resources, and further reducing the waste of disk resources caused by multiple caching through unified caching.
  • At least one compiling client receives compilation commands and requests to push or pull compilation intermediate files from the cache service to expand parallel compilation capabilities. Further, through parallel compilation, users can enjoy a compilation environment that exceeds local resources and speed up compilation.
  • FIG. 4 is a schematic flowchart of a distributed compilation and caching method provided by an embodiment of the present application, which is applied to a distributed compilation and caching system.
  • the cache system includes a compilation and cache service module, a compilation client, and a terminal.
  • the compilation and cache service module includes a dispatch server and a file system of the dispatch server.
  • the distributed compilation and cache method includes:
  • S401 The distributed compilation and caching system sends compilation information through the terminal, and hijacks the compilation information through the terminal to obtain a compilation intermediate file.
  • S402 The distributed compilation and caching system communicates to the dispatch server through the terminal to determine whether the dispatch server supports parallel compilation.
  • S404 The distributed compilation and caching system receives the compilation intermediate file through the compilation client, where the compilation intermediate file is sent by the terminal to the compilation client.
  • S405 The distributed compilation and caching system calculates the hash value of the compilation intermediate file through the compilation client, and sends the hash value to the compilation and cache service module through the compilation client.
  • S406 The distributed compilation and caching system judges whether the hash value is designated for caching through the compilation and caching service module.
  • S408 The distributed compilation and caching system sends the second compilation intermediate file to the file system of the dispatch server through the compilation client.
  • the distributed compilation and caching system receives the second compilation intermediate file through the file system of the dispatch server and updates a preset database on the file system of the dispatch server.
  • S410 The distributed compilation and caching system sends the second compilation intermediate file to the terminal through the file system of the scheduling server.
  • the distributed compilation and caching system sends compilation information through the terminal, and command hijacks the compilation information through the terminal to obtain a compilation intermediate file
  • the distribution The distributed compilation and caching system receives the compilation intermediate file through the compilation client, and the compilation intermediate file is sent by the terminal to the compilation client.
  • the distributed compilation and caching system passes the compilation client Calculate the hash value of the compiled intermediate file, and send the hash value to the compilation and cache service module through the compilation client.
  • the distributed compilation and cache system uses the compilation and cache service module according to The hash value determines a distributed compilation and caching strategy.
  • the distributed compilation and caching method can accelerate the compilation time of a single terminal to the time to extract the compilation intermediate file from the cache, that is, speed up the compilation through parallel compilation, and when compiling and caching,
  • the source file can be shared globally after one time compilation, thereby freeing more compilation resources, and further reducing the waste of disk resources caused by multiple caching through unified caching.
  • At least one compiling client receives compilation commands and requests to push or pull compilation intermediate files from the cache service to expand parallel compilation capabilities. Further, through parallel compilation, users can enjoy a compilation environment that exceeds local resources and speed up compilation.
  • the distributed compilation cache system includes hardware structures and/or software modules corresponding to each function.
  • the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a certain function is executed by hardware or computer software-driven hardware depends on the specific application and design constraint conditions of the technical solution. Professionals and technicians can use different methods for each specific application to implement the described functions, but such implementation should not be considered beyond the scope of this application.
  • the embodiment of the present application may divide the distributed compilation and cache system into functional units according to the foregoing method examples.
  • each functional unit may be divided corresponding to each function, or two or more functions may be integrated into one processing unit.
  • the above-mentioned integrated unit can be implemented in the form of hardware or software functional unit. It should be noted that the division of units in the embodiments of the present application is illustrative, and is only a logical function division, and there may be other division methods in actual implementation.
  • the disclosed device may be implemented in other ways.
  • the system embodiment described above is only illustrative, for example, the division of the above-mentioned units is only a logical function division, and there may be other divisions in actual implementation, for example, multiple units or components can be combined or integrated. To another system, or some features can be ignored, or not implemented.
  • the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, systems or units, and may be in electrical or other forms.
  • the units described above as separate components may or may not be physically separate, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the objectives of the solutions of the embodiments.
  • the functional units in the various embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit.
  • the above-mentioned integrated unit can be implemented in the form of hardware or software functional unit.
  • the above integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer readable memory.
  • the technical solution of the present application essentially or the part that contributes to the existing technology or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a memory.
  • a number of instructions are included to enable 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 foregoing methods of the various embodiments of the present application.
  • the aforementioned memory includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and other media that can store program codes.
  • the program can be stored in a computer-readable memory, and the memory can include: a flash disk , Read-only memory (English: Read-Only Memory, abbreviation: ROM), random access device (English: Random Access Memory, abbreviation: RAM), magnetic disk or optical disc, etc.

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 Transfer Between Computers (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

本申请公开了一种分布式编译缓存方法,应用于分布式编译缓存系统,所所述方法包括:所述分布式编译缓存系统通过所述终端发送编译信息,并通过所述终端对所述编译信息进行命令劫持,得到编译中间文件;所述分布式编译缓存系统通过所述编译客户机接收所述编译中间文件;所述分布式编译缓存系统通过所述编译客户机计算所述编译中间文件的哈希值,并通过所述编译客户机将所述哈希值发送给所述编译缓存服务模块;所述分布式编译缓存系统通过所述编译缓存服务模块根据所述哈希值确定分布式编译缓存策略。本申请实施通过分布式编译缓存方法拓展并行编译能力、加快编译速度,减少多地缓存所带来的磁盘资源。

Description

分布式编译缓存方法及系统 技术领域
本申请涉及电子技术领域,尤其涉及一种分布式编译缓存方法及系统。
背景技术
目前,编译器编译源文件是一个比较耗时的过程,特别是C++语言编译优化不佳以及用户大量导入不必要的头文件之后,单个源文件的编译用时可能达到5分钟甚至更久。在开发过程中可能会遇到修改一次代码编译半小时的情况,严重影响开发效率,同时反复编译也会带来机器资源的浪费。
发明内容
本申请实施例提供一种分布式编译缓存方法及系统,通过分布式编译缓存方法拓展并行编译能力、加快编译速度,减少多地缓存所带来的磁盘资源。
第一方面,本申请实施例提供一种分布式编译缓存方法及系统,应用于分布式编译缓存系统,所述分布式编译缓存系统包括编译缓存服务模块、编译客户机、终端,所述编译缓存服务模块包括调度服务器和调度服务器的文件系统,所述方法包括:所述分布式编译缓存系统通过所述终端发送编译信息,并通过所述终端对所述编译信息进行命令劫持,得到编译中间文件;所述分布式编译缓存系统通过所述编译客户机接收所述编译中间文件,所述编译中间文件是由所述终端发送给所述编译客户机;所述分布式编译缓存系统通过所述编译客户机计算所述编译中间文件的哈希值,并通过所述编译客户机将所述哈希值发送给所述编译缓存服务模块;所述分布式编译缓存系统通过所述编译缓存服务模块根据所述哈希值确定分布式编译缓存策略。
第二方面,本申请实施例提供一种分布式编译缓存系统,其特征在于,所述分布式编译缓存系统包括编译缓存服务模块、编译客户机、终端,所述编译 缓存服务模块包括调度服务器和调度服务器的文件系统,其中,
所述终端用于发送编译信息,并用于对所述编译信息进行命令劫持,得到编译中间文件;所述编译客户机用于接收所述编译中间文件,所述编译中间文件是由所述终端发送给所述编译客户机;所述编译客户机还用于计算所述编译中间文件的哈希值,并将所述哈希值发送给所述编译缓存服务模块;所述编译缓存服务模块用于根据所述哈希值确定分布式编译缓存策略。
可以看出,本申请实施例中,首先所述分布式编译缓存系统通过所述终端发送编译信息,并通过所述终端对所述编译信息进行命令劫持,得到编译中间文件,其次,所述分布式编译缓存系统通过所述编译客户机接收所述编译中间文件,所述编译中间文件是由所述终端发送给所述编译客户机,然后,所述分布式编译缓存系统通过所述编译客户机计算所述编译中间文件的哈希值,并通过所述编译客户机将所述哈希值发送给所述编译缓存服务模块,最后,所述分布式编译缓存系统通过所述编译缓存服务模块根据所述哈希值确定分布式编译缓存策略。可见,通过分布式编译缓存方法可在分布式编译的基础上,可以将单个终端的编译时间加速为从缓存中提取编译中间文件的时间,即通过并行编译加快编译速度,并且在编译缓存时,源文件编译一次完就可以全局共享,进而释放更多的编译资源,进一步的通过统一缓存,减少多地缓存所带来的磁盘资源浪费。
附图说明
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1是本申请实施例提供的一种分布式编译缓存系统的框架示意图;
图2A是本申请实施例提供的一种分布式编译缓存方法的流程示意图;
图2B是本申请实施例提供的一种分布式编译缓存方法的时序示意图;
图2C是本申请实施例提供的另一种分布式编译缓存方法的时序示意图;
图3是本申请实施例提供的另一种分布式编译缓存方法的流程示意图;
图4是本申请实施例提供的另一种分布式编译缓存方法的流程示意图。
具体实施方式
为了使本技术领域的人员更好地理解本申请方案,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分的实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都应当属于本申请保护的范围。
以下分别进行详细说明。
本申请的说明书和权利要求书及所述附图中的术语“第一”、“第二”、“第三”和“第四”等是用于区别不同对象,而不是用于描述特定顺序。此外,术语“包括”和“具有”以及它们任何变形,意图在于覆盖不排他的包含。例如包含了一系列步骤或单元的过程、方法、系统、产品或设备没有限定于已列出的步骤或单元,而是可选地还包括没有列出的步骤或单元,或可选地还包括对于这些过程、方法、产品或设备固有的其它步骤或单元。
在本文中提及“实施例”意味着,结合实施例描述的特定特征、结构或特性可以包含在本申请的至少一个实施例中。在说明书中的各个位置出现该短语并不一定均是指相同的实施例,也不是与其它实施例互斥的独立的或备选的实施例。本领域技术人员显式地和隐式地理解的是,本文所描述的实施例可以与其它实施例相结合。
以下,对本申请中的部分用语进行解释说明,以便于本领域技术人员理解。
下面对本申请实施例进行详细介绍。
如图1所示,图1是本申请实施例提供的一种分布式编译缓存系统框架示意图。所述分布式编译缓存系统包括编译缓存服务模块、编译客户机、终端,所述编译缓存服务模块包括调度服务器和调度服务器的文件系统,其中,
所述终端用于发送编译信息,并用于对所述编译信息进行命令劫持,得到编译中间文件;所述编译客户机用于接收所述编译中间文件,所述编译中间文件是由所述终端发送给所述编译客户机;所述编译客户机还用于计算所述编译中间文件的哈希值,并将所述哈希值发送给所述编译缓存服务模块;所述编译缓存服务模块用于根据所述哈希值确定分布式编译缓存策略。
可以看出,本申请实施例中,首先所述分布式编译缓存系统通过所述终端发送编译信息,并通过所述终端对所述编译信息进行命令劫持,得到编译中间文件,其次,所述分布式编译缓存系统通过所述编译客户机接收所述编译中间文件,所述编译中间文件是由所述终端发送给所述编译客户机,然后,所述分布式编译缓存系统通过所述编译客户机计算所述编译中间文件的哈希值,并通过所述编译客户机将所述哈希值发送给所述编译缓存服务模块,最后,所述分布式编译缓存系统通过所述编译缓存服务模块根据所述哈希值确定分布式编译缓存策略。可见,通过分布式编译缓存方法可在分布式编译的基础上,可以将单个终端的编译时间加速为从缓存中提取编译中间文件的时间,即通过并行编译加快编译速度,并且在编译缓存时,源文件编译一次完就可以全局共享,进而释放更多的编译资源,进一步的通过统一缓存,减少多地缓存所带来的磁盘资源浪费。
在一个可能的示例中,在所述分布式编译缓存系统通过所述编译缓存服务模块根据所述哈希值确定分布式编译缓存策略方面,所述编译缓存服务模块用于判断所述哈希值是否命定缓存;若是,则所述分布式编译缓存系统通过所述编译客户机从所述调度服务器的文件系统中获取所述哈希值对应的第一编译中间文件;所述调度服务器的文件系统用于将所述第一编译中间文件发送至所述终端。
在一个可能的示例中,在所述分布式编译缓存系统通过所述编译缓存服务模块根据所述哈希值确定分布式编译缓存策略方面,所述编译缓存服务模块用于判断所述哈希值是否命定缓存;若否,则所述分布式编译缓存系统通过所述编译客户机执行编译命令,生成第二编译中间文件;所述编译客户机用于将所述第二编译中间文件发送到所述调度服务器的文件系统上;所述调度服务器的 文件系统用于接收所述第二编译中间文件并更新在调度服务器的文件系统上的预设数据库;所述调度服务器的文件系统还用于将所述第二编译中间文件发送至所述终端。
在一个可能的示例中,在所述分布式编译缓存系统通过所述编译缓存服务模块判断所述哈希值是否命定缓存方面,所述编译客户机用于将所述哈希值发送至所述调度服务器的文件系统;所述调度服务器的文件系统用于查询预设数据库,确定所述预设数据库中是否存在与所述哈希值一致的目标哈希值;若存在,则确定命定缓存;或者,若不存在,则确定未命定缓存。
在一个可能的示例中,在所述分布式编译缓存系统通过所述编译客户机接收所述编译中间文件之前,所述终端用于向所述调度服务器进行通信,确定所述调度服务器是否支持并行编译;若支持,则在所述调度服务器中抓取至少一个编译客户机。
在一个可能的示例中,在所述调度服务器中抓取至少一个编译客户机方面,所述调度服务器用于查询多个编译客户机;还用于筛选出可支持并行编译的至少一个编译客户机为目标编译客户机。
在一个可能的示例中,在所述分布式编译缓存系统通过所述编译客户机计算所述编译中间文件的哈希值方面,所述编译客户机用于通过所述编译中间文件中的编译环境信息和源文件计算得到哈希值。
在一个可能的示例中,在所述通过所述终端对所述编译信息进行命令劫持方面,所述终端用于软连接或执行命令覆盖进行命令劫持。
在一个可能的示例中,所述缓存服务器模块与编译客户机进行相互通信;所述缓存服务器模块与所述终端进行通信;所述编译客户机模块与所述终端进行通信。
在一个可能的示例中,在所述分布式编译缓存系统通过所述终端发送编译信息,并通过所述终端对所述编译信息进行命令劫持,得到编译中间文件之前,所述终端用于通过预加载,获取编译信息。
上述分布式编译缓存系统由三个主要逻辑组成,编译缓存服务模块、编译客户机和终端。
其中,编译缓存服务模块主要存储全局的编译中间文件并管理所有的可用编译客户机资源。
编译客户机主要完成实际的编译命令工作,以及拉取和更新编译缓存。
终端,又名(用户客户机)主要用于实际发起编译命令端,同时劫持编译命令后与编译服务和编译机通信。
终端和编译客户机可以包括各种具有无线通信功能的台式机、笔记本电脑到小型笔记本电脑和平板电脑以及超级本等等。
请参阅图2A,图2A是本申请实施例提供了一种分布式编译缓存方法的流程示意图,应用于分布式编译缓存系统,所述分布式编译缓存系统包括编译缓存服务模块、编译客户机、终端,所述编译缓存服务模块包括调度服务器和调度服务器的文件系统,如图所示,本分布式编译缓存方法包括:
S201,所述分布式编译缓存系统通过所述终端发送编译信息,并通过所述终端对所述编译信息进行命令劫持,得到编译中间文件。
可选的,所述通过所述终端对所述编译信息进行命令劫持,包括:所述分布式编译缓存系统通过所述终端的软连接或执行命令覆盖进行命令劫持。
其中,所述命令劫持可通过gcc或者clang进行。
其中,在对所述编译信息进行命令劫持的一种实现方式中,用户可以直接使用make命令,并直接对接了make的并行编译能力,make支持本地并行编译,通过计算源文件是否有修改可以跳过未修改文件的编译,通过并行编译的方式加快整体编译的速度。
其中,计算中间目标文件可以通过ccache的基本逻辑实现。
可选的,所述缓存服务器模块与编译客户机进行相互通信;所述缓存服务器模块与所述终端进行通信;所述编译客户机模块与所述终端进行通信。
可选的,在所述分布式编译缓存系统通过所述终端发送编译信息,并通过所述终端对所述编译信息进行命令劫持,得到编译中间文件之前,所述方法还包括:所述分布式编译缓存系统通过所述终端通过预加载,获取编译信息。
其中,所述预加载为终端自身预设的编译编码。
可见,本示例中,通过对编译信息的命令劫持,进一步的提取到需要的文件,避免了后续实际编译的误编性。
S202,所述分布式编译缓存系统通过所述编译客户机接收所述编译中间文件,所述编译中间文件是由所述终端发送给所述编译客户机。
在一个可能的示例中,在所述分布式编译缓存系统通过所述编译客户机接收所述编译中间文件之前,所述方法包括:所述分布式编译缓存系统通过所述终端向所述调度服务器进行通信,确定所述调度服务器是否支持并行编译;若支持,则在所述调度服务器中抓取至少一个编译客户机。
可选的,所述在所述调度服务器中抓取至少一个编译客户机,包括:所述分布式编译缓存系统通过所述调度服务器查询多个编译客户机;所述分布式编译缓存系统通过所述调度服务器筛选出可支持并行编译的至少一个编译客户机为目标编译客户机。
可见,本示例中,通过至少一个编译客户机接收编译命令以及向缓存服务请求推送或者拉取编译中间文件,扩展并行编译能力,进一步的通过并行编译,可使用户享有超过本地资源的编译环境,加快编译速度。
S203,所述分布式编译缓存系统通过所述编译客户机计算所述编译中间文件的哈希值,并通过所述编译客户机将所述哈希值发送给所述编译缓存服务模块。
可选的,所述分布式编译缓存系统通过所述编译客户机计算所述编译中间文件的哈希值,包括:所述分布式编译缓存系统通过所述编译客户机通过所述编译中间文件中的编译环境信息和源文件计算得到哈希值。
其中,所述编译环境信息可以包括环境变量和头文件等不同的信息,此处不做唯一限定。
其中,所述源文件为开发者设定。
S204,所述分布式编译缓存系统通过所述编译缓存服务模块根据所述哈希值确定分布式编译缓存策略。
在一个可能的示例中,所述分布式编译缓存系统通过所述编译缓存服务模块根据所述哈希值确定分布式编译缓存策略,包括:所述分布式编译缓存系统 通过所述编译缓存服务模块判断所述哈希值是否命定缓存;若是,则所述分布式编译缓存系统通过所述编译客户机从所述调度服务器的文件系统中获取所述哈希值对应的第一编译中间文件;所述分布式编译缓存系统通过所述调度服务器的文件系统将所述第一编译中间文件发送至所述终端。
其中,如图2B所示,图2B为一种分布式编译缓存方法的时序示意图。
在一个可能的示例中,所述分布式编译缓存系统通过所述编译缓存服务模块根据所述哈希值确定分布式编译缓存策略,包括:
所述分布式编译缓存系统通过所述编译缓存服务模块判断所述哈希值是否命定缓存;若否,则所述分布式编译缓存系统通过所述编译客户机执行编译命令,生成第二编译中间文件;所述分布式编译缓存系统通过所述编译客户机将所述第二编译中间文件发送到所述调度服务器的文件系统上;所述分布式编译缓存系统通过所述调度服务器的文件系统接收所述第二编译中间文件并更新在调度服务器的文件系统上的预设数据库;所述分布式编译缓存系统通过所述调度服务器的文件系统将所述第二编译中间文件发送至所述终端。
其中,如图2C所示,图2C为另一种分布式编译缓存方法的时序示意图。
可见,本示例中,通过编译缓存服务模块将所有的编译中间文件统一存储,一旦源文件被编译,则任何用户都可以共享该中间文件,进一步的释放更多的编译资源,减少多地缓存所带来的磁盘资源浪费。
可选的,所述分布式编译缓存系统通过所述编译缓存服务模块判断所述哈希值是否命定缓存,包括:所述分布式编译缓存系统通过所述编译客户机将所述哈希值发送至所述调度服务器的文件系统;所述分布式编译缓存系统通过所述调度服务器的文件系统查询预设数据库,确定所述预设数据库中是否存在与所述哈希值一致的目标哈希值;若存在,则确定命定缓存;或者,若不存在,则确定未命定缓存。
其中,所述预设数据库可根据开发者通提供数据或是从大数据得到,此处不作为唯一限定。
可以看出,本申请实施例中,首先所述分布式编译缓存系统通过所述终端发送编译信息,并通过所述终端对所述编译信息进行命令劫持,得到编译中间 文件,其次,所述分布式编译缓存系统通过所述编译客户机接收所述编译中间文件,所述编译中间文件是由所述终端发送给所述编译客户机,然后,所述分布式编译缓存系统通过所述编译客户机计算所述编译中间文件的哈希值,并通过所述编译客户机将所述哈希值发送给所述编译缓存服务模块,最后,所述分布式编译缓存系统通过所述编译缓存服务模块根据所述哈希值确定分布式编译缓存策略。可见,通过分布式编译缓存方法可在分布式编译的基础上,可以将单个终端的编译时间加速为从缓存中提取编译中间文件的时间,即通过并行编译加快编译速度,并且在编译缓存时,源文件编译一次完就可以全局共享,进而释放更多的编译资源,进一步的通过统一缓存,减少多地缓存所带来的磁盘资源浪费。
与上述图2A所示的实施例一致的,请参阅图3,图3是本申请实施例提供的一种分布式编译缓存方法的流程示意图,应用于分布式编译缓存系统,所述分布式编译缓存系统包括编译缓存服务模块、编译客户机、终端,所述编译缓存服务模块包括调度服务器和调度服务器的文件系统,如图所示,本分布式编译缓存方法包括:
S301,所述分布式编译缓存系统通过所述终端发送编译信息,并通过所述终端对所述编译信息进行命令劫持,得到编译中间文件。
S302,所述分布式编译缓存系统通过所述终端向所述调度服务器进行通信,确定所述调度服务器是否支持并行编译。
S303,若支持,则在所述调度服务器中抓取至少一个编译客户机。
S304,所述分布式编译缓存系统通过所述编译客户机接收所述编译中间文件,所述编译中间文件是由所述终端发送给所述编译客户机。
S305,所述分布式编译缓存系统通过所述编译客户机计算所述编译中间文件的哈希值,并通过所述编译客户机将所述哈希值发送给所述编译缓存服务模块。
S306,所述分布式编译缓存系统通过所述编译缓存服务模块判断所述哈希值是否命定缓存。
S307,若是,则所述分布式编译缓存系统通过所述编译客户机从所述调度服务器的文件系统中获取所述哈希值对应的第一编译中间文件。
S308,所述分布式编译缓存系统通过所述调度服务器的文件系统将所述第一编译中间文件发送至所述终端。
可以看出,本申请实施例中,首先所述分布式编译缓存系统通过所述终端发送编译信息,并通过所述终端对所述编译信息进行命令劫持,得到编译中间文件,其次,所述分布式编译缓存系统通过所述编译客户机接收所述编译中间文件,所述编译中间文件是由所述终端发送给所述编译客户机,然后,所述分布式编译缓存系统通过所述编译客户机计算所述编译中间文件的哈希值,并通过所述编译客户机将所述哈希值发送给所述编译缓存服务模块,最后,所述分布式编译缓存系统通过所述编译缓存服务模块根据所述哈希值确定分布式编译缓存策略。可见,通过分布式编译缓存方法可在分布式编译的基础上,可以将单个终端的编译时间加速为从缓存中提取编译中间文件的时间,即通过并行编译加快编译速度,并且在编译缓存时,源文件编译一次完就可以全局共享,进而释放更多的编译资源,进一步的通过统一缓存,减少多地缓存所带来的磁盘资源浪费。
此外,通过至少一个编译客户机接收编译命令以及向缓存服务请求推送或者拉取编译中间文件,扩展并行编译能力,进一步的通过并行编译,可使用户享有超过本地资源的编译环境,加快编译速度。
与上述图2A所示的实施例一致的,请参阅图4,图4是本申请实施例提供的一种分布式编译缓存方法的流程示意图,应用于分布式编译缓存系统,所述分布式编译缓存系统包括编译缓存服务模块、编译客户机、终端,所述编译缓存服务模块包括调度服务器和调度服务器的文件系统,如图所示,本分布式编译缓存方法包括:
S401,所述分布式编译缓存系统通过所述终端发送编译信息,并通过所述终端对所述编译信息进行命令劫持,得到编译中间文件。
S402,所述分布式编译缓存系统通过所述终端向所述调度服务器进行通 信,确定所述调度服务器是否支持并行编译。
S403,若支持,则在所述调度服务器中抓取至少一个编译客户机。
S404,所述分布式编译缓存系统通过所述编译客户机接收所述编译中间文件,所述编译中间文件是由所述终端发送给所述编译客户机。
S405,所述分布式编译缓存系统通过所述编译客户机计算所述编译中间文件的哈希值,并通过所述编译客户机将所述哈希值发送给所述编译缓存服务模块。
S406,所述分布式编译缓存系统通过所述编译缓存服务模块判断所述哈希值是否命定缓存。
S407,若否,则所述分布式编译缓存系统通过所述编译客户机执行编译命令,生成第二编译中间文件。
S408,所述分布式编译缓存系统通过所述编译客户机将所述第二编译中间文件发送到所述调度服务器的文件系统上。
S409,所述分布式编译缓存系统通过所述调度服务器的文件系统接收所述第二编译中间文件并更新在调度服务器的文件系统上的预设数据库。
S410,所述分布式编译缓存系统通过所述调度服务器的文件系统将所述第二编译中间文件发送至所述终端。
可以看出,本申请实施例中,首先所述分布式编译缓存系统通过所述终端发送编译信息,并通过所述终端对所述编译信息进行命令劫持,得到编译中间文件,其次,所述分布式编译缓存系统通过所述编译客户机接收所述编译中间文件,所述编译中间文件是由所述终端发送给所述编译客户机,然后,所述分布式编译缓存系统通过所述编译客户机计算所述编译中间文件的哈希值,并通过所述编译客户机将所述哈希值发送给所述编译缓存服务模块,最后,所述分布式编译缓存系统通过所述编译缓存服务模块根据所述哈希值确定分布式编译缓存策略。可见,通过分布式编译缓存方法可在分布式编译的基础上,可以将单个终端的编译时间加速为从缓存中提取编译中间文件的时间,即通过并行编译加快编译速度,并且在编译缓存时,源文件编译一次完就可以全局共享,进而释放更多的编译资源,进一步的通过统一缓存,减少多地缓存所带来的磁 盘资源浪费。
此外,通过至少一个编译客户机接收编译命令以及向缓存服务请求推送或者拉取编译中间文件,扩展并行编译能力,进一步的通过并行编译,可使用户享有超过本地资源的编译环境,加快编译速度。
上述主要从方法侧执行过程的角度对本申请实施例的方案进行了介绍。可以理解的是,分布式编译缓存系统为了实现上述功能,其包含了执行各个功能相应的硬件结构和/或软件模块。本领域技术人员应该很容易意识到,结合本文中所提供的实施例描述的步骤,本申请能够以硬件或硬件和计算机软件的结合形式来实现。某个功能究竟以硬件还是计算机软件驱动硬件的方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。
本申请实施例可以根据上述方法示例对分布式编译缓存系统进行功能单元的划分,例如,可以对应各个功能划分各个功能单元,也可以将两个或两个以上的功能集成在一个处理单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。需要说明的是,本申请实施例中对单元的划分是示意性的,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。
需要说明的是,对于前述的各方法实施例,为了简单描述,故将其都表述为一系列的动作组合,但是本领域技术人员应该知悉,本申请并不受所描述的动作顺序的限制,因为依据本申请,某些步骤可以采用其他顺序或者同时进行。其次,本领域技术人员也应该知悉,说明书中所描述的实施例均属于优选实施例,所涉及的动作和模块并不一定是本申请所必须的。
在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述的部分,可以参见其他实施例的相关描述。
在本申请所提供的几个实施例中,应该理解到,所揭露的装置,可通过其它的方式实现。例如,以上所描述的系统实施例仅仅是示意性的,例如上述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例 如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,系统或单元的间接耦合或通信连接,可以是电性或其它的形式。
上述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。
上述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储器中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储器中,包括若干指令用以使得一台计算机设备(可为个人计算机、服务器或者网络设备等)执行本申请各个实施例上述方法的全部或部分步骤。而前述的存储器包括:U盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、移动硬盘、磁碟或者光盘等各种可以存储程序代码的介质。
本领域普通技术人员可以理解上述实施例的各种方法中的全部或部分步骤是可以通过程序来指令相关的硬件来完成,该程序可以存储于一计算机可读存储器中,存储器可以包括:闪存盘、只读存储器(英文:Read-Only Memory,简称:ROM)、随机存取器(英文:Random Access Memory,简称:RAM)、磁盘或光盘等。
以上对本申请实施例进行了详细介绍,本文中应用了具体个例对本申请的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本申请的方 法及其核心思想;同时,对于本领域的一般技术人员,依据本申请的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本申请的限制。

Claims (20)

  1. 一种分布式编译缓存方法,其特征在于,应用于分布式编译缓存系统,所述分布式编译缓存系统包括编译缓存服务模块、编译客户机、终端,所述编译缓存服务模块包括调度服务器和调度服务器的文件系统,所述方法包括:
    所述分布式编译缓存系统通过所述终端发送编译信息,并通过所述终端对所述编译信息进行命令劫持,得到编译中间文件;
    所述分布式编译缓存系统通过所述编译客户机接收所述编译中间文件,所述编译中间文件是由所述终端发送给所述编译客户机;
    所述分布式编译缓存系统通过所述编译客户机计算所述编译中间文件的哈希值,并通过所述编译客户机将所述哈希值发送给所述编译缓存服务模块;
    所述分布式编译缓存系统通过所述编译缓存服务模块根据所述哈希值确定分布式编译缓存策略。
  2. 根据权利要求1所述的方法,其特征在于,所述分布式编译缓存系统通过所述编译缓存服务模块根据所述哈希值确定分布式编译缓存策略,包括:
    所述分布式编译缓存系统通过所述编译缓存服务模块判断所述哈希值是否命定缓存;
    若是,则所述分布式编译缓存系统通过所述编译客户机从所述调度服务器的文件系统中获取所述哈希值对应的第一编译中间文件;
    所述分布式编译缓存系统通过所述调度服务器的文件系统将所述第一编译中间文件发送至所述终端。
  3. 根据权利要求1所述的方法,其特征在于,所述分布式编译缓存系统通过所述编译缓存服务模块根据所述哈希值确定分布式编译缓存策略,包括:
    所述分布式编译缓存系统通过所述编译缓存服务模块判断所述哈希值是否命定缓存;
    若否,则所述分布式编译缓存系统通过所述编译客户机执行编译命令,生成第二编译中间文件;
    所述分布式编译缓存系统通过所述编译客户机将所述第二编译中间文件发送到所述调度服务器的文件系统上;
    所述分布式编译缓存系统通过所述调度服务器的文件系统接收所述第二编译中间文件并更新在调度服务器的文件系统上的预设数据库;
    所述分布式编译缓存系统通过所述调度服务器的文件系统将所述第二编译中间文件发送至所述终端。
  4. 根据权利要求2或3所述的方法,其特征在于,所述分布式编译缓存系统通过所述编译缓存服务模块判断所述哈希值是否命定缓存,包括:
    所述分布式编译缓存系统通过所述编译客户机将所述哈希值发送至所述调度服务器的文件系统;
    所述分布式编译缓存系统通过所述调度服务器的文件系统查询预设数据库,确定所述预设数据库中是否存在与所述哈希值一致的目标哈希值;
    若存在,则确定命定缓存;或者,
    若不存在,则确定未命定缓存。
  5. 根据权利要求1-3任一项所述的方法,其特征在于,在所述分布式编译缓存系统通过所述编译客户机接收所述编译中间文件之前,所述方法包括:
    所述分布式编译缓存系统通过所述终端向所述调度服务器进行通信,确定所述调度服务器是否支持并行编译;
    若支持,则在所述调度服务器中抓取至少一个编译客户机。
  6. 根据权利要求5所述的方法,其特征在于,所述在所述调度服务器中抓取至少一个编译客户机,包括:
    所述分布式编译缓存系统通过所述调度服务器查询多个编译客户机;
    所述分布式编译缓存系统通过所述调度服务器筛选出可支持并行编译的至少一个编译客户机为目标编译客户机。
  7. 根据权利要求1所述的方法,其特征在于,所述分布式编译缓存系统通过所述编译客户机计算所述编译中间文件的哈希值,包括:
    所述分布式编译缓存系统通过所述编译客户机通过所述编译中间文件中的编译环境信息和源文件计算得到哈希值。
  8. 根据权利要求1所述的方法,其特征在于,所述通过所述终端对所述编译信息进行命令劫持,包括:
    所述分布式编译缓存系统通过所述终端的软连接或执行命令覆盖进行命令劫持。
  9. 根据权利要求1-8任一项所述的方法,其特征在于,所述缓存服务器模块与编译客户机进行相互通信;所述缓存服务器模块与所述终端进行通信;所述编译客户机模块与所述终端进行通信。
  10. 根据权利要求1所述的方法,其特征在于,在所述分布式编译缓存系统通过所述终端发送编译信息,并通过所述终端对所述编译信息进行命令劫持,得到编译中间文件之前,所述方法还包括:
    所述分布式编译缓存系统通过所述终端通过预加载,获取编译信息。
  11. 一种分布式编译缓存系统,其特征在于,所述分布式编译缓存系统包括编译缓存服务模块、编译客户机、终端,所述编译缓存服务模块包括调度服务器和调度服务器的文件系统,其中,
    所述终端用于发送编译信息,并用于对所述编译信息进行命令劫持,得到编译中间文件;所述编译客户机用于接收所述编译中间文件,所述编译中间文件是由所述终端发送给所述编译客户机;所述编译客户机还用于计算所述编译中间文件的哈希值,并将所述哈希值发送给所述编译缓存服务模块;所述编译缓存服务模块用于根据所述哈希值确定分布式编译缓存策略。
  12. 根据权利要求11所述的系统,其特征在于,在所述分布式编译缓存系统通过所述编译缓存服务模块根据所述哈希值确定分布式编译缓存策略方面,所述编译缓存服务模块用于判断所述哈希值是否命定缓存;若是,则所述分布式编译缓存系统通过所述编译客户机从所述调度服务器的文件系统中获取所述哈希值对应的第一编译中间文件;所述调度服务器的文件系统用于将所述第一编译中间文件发送至所述终端。
  13. 根据权利要求11所述的系统,其特征在于,在所述分布式编译缓存系统通过所述编译缓存服务模块根据所述哈希值确定分布式编译缓存策略方面,所述编译缓存服务模块用于判断所述哈希值是否命定缓存;若否,则所述分布式编译缓存系统通过所述编译客户机执行编译命令,生成第二编译中间文件;所述编译客户机用于将所述第二编译中间文件发送到所述调度服务器的文件系统上;所述调度服务器的文件系统用于接收所述第二编译中间文件并更新在调度服务器的文件系统上的预设数据库;所述调度服务器的文件系统还用于将所述第二编译中间文件发送至所述终端。
  14. 根据权利要求12或13所述的系统,其特征在于,在所述分布式编译缓存系统通过所述编译缓存服务模块判断所述哈希值是否命定缓存方面,所述编译客户机用于将所述哈希值发送至所述调度服务器的文件系统;所述调度服务器的文件系统用于查询预设数据库,确定所述预设数据库中是否存在与所述哈希值一致的目标哈希值;若存在,则确定命定缓存;或者,若不存在,则确定未命定缓存。
  15. 根据权利要求11-13任一项所述的系统,其特征在于,在所述分布式编译缓存系统通过所述编译客户机接收所述编译中间文件之前,所述终端用于向所述调度服务器进行通信,确定所述调度服务器是否支持并行编译;若支持,则在所述调度服务器中抓取至少一个编译客户机。
  16. 根据权利要求15所述的系统,其特征在于,在所述调度服务器中抓取至少一个编译客户机方面,所述调度服务器用于查询多个编译客户机;还用于筛选出可支持并行编译的至少一个编译客户机为目标编译客户机。
  17. 根据权利要求11所述的系统,其特征在于,在所述分布式编译缓存系统通过所述编译客户机计算所述编译中间文件的哈希值方面,所述编译客户机用于通过所述编译中间文件中的编译环境信息和源文件计算得到哈希值。
  18. 根据权利要求11所述的系统,其特征在于,在所述通过所述终端对所述编译信息进行命令劫持方面,所述终端用于软连接或执行命令覆盖进行命令劫持。
  19. 根据权利要求11-18任一项所述的系统,其特征在于,所述缓存服务器模块与编译客户机进行相互通信;所述缓存服务器模块与所述终端进行通信;所述编译客户机模块与所述终端进行通信。
  20. 根据权利要求11所述的系统,其特征在于,在所述分布式编译缓存系统通过所述终端发送编译信息,并通过所述终端对所述编译信息进行命令劫持,得到编译中间文件之前,所述终端用于通过预加载,获取编译信息。
PCT/CN2020/080232 2020-03-19 2020-03-19 分布式编译缓存方法及系统 WO2021184304A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/CN2020/080232 WO2021184304A1 (zh) 2020-03-19 2020-03-19 分布式编译缓存方法及系统
CN202080096796.9A CN115136127A (zh) 2020-03-19 2020-03-19 分布式编译缓存方法及系统

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2020/080232 WO2021184304A1 (zh) 2020-03-19 2020-03-19 分布式编译缓存方法及系统

Publications (1)

Publication Number Publication Date
WO2021184304A1 true WO2021184304A1 (zh) 2021-09-23

Family

ID=77768386

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/080232 WO2021184304A1 (zh) 2020-03-19 2020-03-19 分布式编译缓存方法及系统

Country Status (2)

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

Citations (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
US20100313079A1 (en) * 2009-06-03 2010-12-09 Robert Beretta Methods and apparatuses for a compiler server
CN103544276A (zh) * 2013-10-22 2014-01-29 北京京东尚科信息技术有限公司 一种采用虚拟机显示脚本文件的方法及装置
CN105590051A (zh) * 2015-11-18 2016-05-18 中国银联股份有限公司 用于可信执行环境的可信应用生成及安装方法
CN109753306A (zh) * 2018-12-28 2019-05-14 北京东方国信科技股份有限公司 一种预编译函数缓存引擎的大数据处理方法

Patent Citations (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
US20100313079A1 (en) * 2009-06-03 2010-12-09 Robert Beretta Methods and apparatuses for a compiler server
CN103544276A (zh) * 2013-10-22 2014-01-29 北京京东尚科信息技术有限公司 一种采用虚拟机显示脚本文件的方法及装置
CN105590051A (zh) * 2015-11-18 2016-05-18 中国银联股份有限公司 用于可信执行环境的可信应用生成及安装方法
CN109753306A (zh) * 2018-12-28 2019-05-14 北京东方国信科技股份有限公司 一种预编译函数缓存引擎的大数据处理方法

Also Published As

Publication number Publication date
CN115136127A (zh) 2022-09-30

Similar Documents

Publication Publication Date Title
JP5758995B2 (ja) 仮想マシン間で分析の結果を共有するためのシステム、方法及びコンピュータ可読記憶媒体
US10223181B2 (en) Object-oriented remote procedure calls for browser applications
CN109886693B (zh) 区块链系统的共识实现方法、装置、设备和介质
KR20190058483A (ko) 트리거된 동작을 이용하는 gpu 원격 통신
US20180219962A1 (en) Synchronization of property values between a client and a server
WO2024104073A1 (zh) 一种元数据访问方法、装置和存储介质
CN116450355A (zh) 一种多集群模型训练方法、装置、设备及介质
AU2017395742B2 (en) Deferring invocation requests for remote objects
WO2021169264A1 (zh) 数据库接入层中间件的自动调度方法和装置
WO2021012795A1 (zh) 网络节点的调度方法、装置、电子设备和存储介质
WO2021184304A1 (zh) 分布式编译缓存方法及系统
JP2022520141A (ja) DAppで要求する高いトランザクション処理量をブロックチェーンで効率的に処理するための方法およびシステム
JP2009516296A (ja) 非同期ジャストインタイムコンパイル
CN110213398B (zh) 别名管理方法、装置、服务器及存储介质
WO2019109922A1 (zh) 资源处理方法及系统、存储介质、电子设备
CN103312808B (zh) 一种云操作系统总线及通信方法
WO2021232860A1 (zh) 通信方法、装置及系统
US20070006182A1 (en) Method and system for on-demand programming model transformation
WO2021078176A1 (zh) 存储过程的运行方法、装置、数据库系统及存储介质
CN110570859B (zh) 智能音箱控制方法、装置、系统及存储介质
CN112988738A (zh) 用于区块链的数据分片方法和装置
CN110661857A (zh) 一种数据同步方法和装置
CN113271229B (zh) 设备控制方法及装置、存储设备、安全设备、交换机、路由器及服务器
US11875151B1 (en) Inter-process serving of machine learning features from mapped memory for machine learning models
CN114553688B (zh) 云计算部署方法、装置、设备及计算机可读存储介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20925163

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 16.02.2023)

122 Ep: pct application non-entry in european phase

Ref document number: 20925163

Country of ref document: EP

Kind code of ref document: A1