WO2023123022A1 - Method and apparatus for acquiring molecular properties, and storage medium - Google Patents

Method and apparatus for acquiring molecular properties, and storage medium Download PDF

Info

Publication number
WO2023123022A1
WO2023123022A1 PCT/CN2021/142380 CN2021142380W WO2023123022A1 WO 2023123022 A1 WO2023123022 A1 WO 2023123022A1 CN 2021142380 W CN2021142380 W CN 2021142380W WO 2023123022 A1 WO2023123022 A1 WO 2023123022A1
Authority
WO
WIPO (PCT)
Prior art keywords
service request
function
calculation
target molecule
molecule
Prior art date
Application number
PCT/CN2021/142380
Other languages
French (fr)
Chinese (zh)
Inventor
蒋瑞
Original Assignee
深圳晶泰科技有限公司
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 深圳晶泰科技有限公司 filed Critical 深圳晶泰科技有限公司
Priority to PCT/CN2021/142380 priority Critical patent/WO2023123022A1/en
Publication of WO2023123022A1 publication Critical patent/WO2023123022A1/en

Links

Images

Classifications

    • GPHYSICS
    • G16INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR SPECIFIC APPLICATION FIELDS
    • G16CCOMPUTATIONAL CHEMISTRY; CHEMOINFORMATICS; COMPUTATIONAL MATERIALS SCIENCE
    • G16C20/00Chemoinformatics, i.e. ICT specially adapted for the handling of physicochemical or structural data of chemical particles, elements, compounds or mixtures
    • G16C20/30Prediction of properties of chemical compounds, compositions or mixtures

Definitions

  • the present application relates to the field of computer-aided pharmacy, in particular to a method, device and storage medium for obtaining molecular properties.
  • the methods for predicting molecular properties mainly include using commercial software or accessing public or private traditional network services that provide property calculations.
  • commercial software licenses are expensive, and general users are usually unable to intervene in development work.
  • Packaged software packages often cannot meet user customization needs, and traditional network services need to be deployed on actual servers, which will bring resources Waste and poor scalability flaws.
  • the present application provides a method, device and storage medium for obtaining molecular properties.
  • the technical solution can reduce various costs of obtaining molecular properties and enhance the scalability of the system.
  • the first aspect of the present application provides a method for obtaining molecular properties, including:
  • an entry function to receive a service request from a client, and trigger a calculation function according to the service request; wherein the service request includes at least one target molecule to be calculated;
  • calculation function to perform a preset operation to perform property calculation on the at least one target molecule to obtain a calculation result, the calculation result including the property of each target molecule;
  • the calculation result is returned to the client by using an exit function.
  • the second aspect of the present application provides a device for obtaining molecular properties, including:
  • a receiving module configured to use an entry function to receive a service request from a client, and trigger a calculation function according to the service request; wherein the service request includes at least one target molecule to be calculated;
  • An execution module configured to use the calculation function to perform a preset operation to perform property calculation on the at least one target molecule to obtain a calculation result, the calculation result including the property of each target molecule;
  • the return module returns the calculation result to the client by using an exit function.
  • the third aspect of the present application provides an electronic device, including:
  • a memory on which executable codes are stored, which, when executed by the processor, cause the processor to perform the method as described above.
  • a fourth aspect of the present application provides a storage medium, on which executable code is stored, and when the executable code is executed by a processor of an electronic device, the processor is made to execute the above-mentioned method.
  • the entry function and the calculation function are functions deployed without a server, the calculation result of the properties of the target molecule is finally obtained by triggering the entry function and the calculation function.
  • calculation functions can usually be deployed in mirror images, which means that the release process of corresponding software can be simplified and the time for calculating target molecules can be shortened. The time spent in nature.
  • Figure 1 is a schematic diagram of the application scenario of the method for obtaining molecular properties shown in the embodiment of the present application;
  • Figure 2 is a schematic flow diagram of a method for obtaining molecular properties shown in an embodiment of the present application
  • FIG. 3 is a schematic structural diagram of a device for obtaining molecular properties shown in an embodiment of the present application
  • Fig. 4 is a schematic structural diagram of an electronic device shown in an embodiment of the present application.
  • first, second, third and so on may be used in this application to describe various information, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another.
  • first information may also be called second information, and similarly, second information may also be called first information.
  • second information may also be called first information.
  • a feature defined as “first” and “second” may explicitly or implicitly include one or more of these features.
  • “plurality” means two or more, unless otherwise specifically defined.
  • the embodiment of the present application provides a method for obtaining molecular properties, which can reduce various costs of obtaining molecular properties and enhance the scalability of the system.
  • FIG. 1 it is a schematic diagram of an application scenario of the method for obtaining molecular properties shown in the embodiment of the present application.
  • This application scenario is based on a serverless (Serverless) architecture, and its basic features are Function as a Service (FaaS) and event-driven. Functions such as function development, testing, and online deployment are realized on the Internet.
  • Event-driven means that the functions in the serverless architecture are executed by event-driven, and the event is released by the event source, which is essentially a business request for the completion of the corresponding business.
  • API Gateway one of the main functions of API Gateway (API Gateway) is to provide a central interface to clients using microservices. Central interface means that these interfaces have a unified address.
  • the client when the client needs to call any microservice in the backend, it only needs to send a service request to the central interface with a unified address.
  • the API gateway triggers the corresponding cloud function on the backend according to the service request. After the cloud function is executed, the API gateway returns the execution result of the cloud function to the client through the central interface.
  • FIG. 2 it is a schematic flowchart of a method for obtaining molecular properties shown in the embodiment of the present application.
  • the method mainly includes steps S201 to S203, and the details are as follows:
  • Step S201 Use an entry function to receive a service request from a client, and trigger a calculation function according to the service request, wherein the service request includes at least one target molecule to be calculated.
  • the service request of the client is a service request sent by the user to the API gateway through the client, and the service request indicates the service requested by the user to be completed.
  • the API gateway can provide the client with a central interface.
  • the API gateway can provide the client with an entry cloud function. Therefore, the service request sent by the client to the API gateway is essentially It is a service request sent to the portal cloud function, and the portal function receives this service request from the client.
  • the entry function can be a serverless function deployed in a lightweight manner. Therefore, in addition to having all the attributes of a serverless function, it also means that the entry function has minimal impact on resources such as third-party libraries and components. rely.
  • the service request sent by the user through the client should contain at least one target molecule, and the ID of the service request and the nature of the molecule to be calculated are optional, that is, the user can fill in the ID of the service request and/or the molecule to be calculated when operating.
  • the sent service request also includes the ID and/or molecule of the service request to be calculated; the user may not fill in the ID and/or molecule of the service request when operating The property to be calculated.
  • the service request sent only contains the ID of at least one target molecule, and does not contain the ID of the service request and/or the property to be calculated of the molecule. In this case, the ID of the service request and the property to be calculated of the molecule can be generated by the entry function.
  • the calculation function is a serverless function (Serverless Function) deployed with a container image or code archive, which means that the specific algorithm of the calculation function is not affected by the deployment environment or has a high tolerance to the deployment environment.
  • Serverless functions mean that billing by volume, On-demand scalability to save idle time costs and ensure availability during busy periods.
  • the specific function of the calculation function will be based on different requirements or algorithms, the actual code executed and the resources such as the third-party library and components depended on are different, and the sequential triggering of the entry function and the calculation function means that the entry
  • the triggering of functions and calculation functions has a strict order, that is, the entry function is triggered first, and then the calculation function is triggered.
  • the service request from the client, the trigger calculation function may be: use the entry function to generate and save the corresponding relationship for the service request; issue the request calculation event through the entry function, and trigger the calculation function, wherein the request calculation event carries There is an ID of the service request, and the corresponding relationship includes the ID of the service request, the mapping between at least one target molecule and the property to be calculated of the molecule.
  • the ID of the service request, the mapping of at least one target molecule and the properties of the molecule to be calculated means that the ID of a service request can correspond to multiple target molecules. ID) to obtain properties of multiple target molecules.
  • the service request from the client may contain at least one target molecule, the ID of the service request and the property to be calculated of the molecule, or, only include at least one target molecule without the ID of the service request and the property to be calculated of the molecule, or, Contains at least one target molecule and the ID of the service request but does not include the property to be calculated of the molecule, or contains at least one target molecule and the property to be calculated of the molecule but does not contain the ID of the service request; the following cases are explained:
  • the above-mentioned use of the entry function to generate and save the corresponding relationship for the service request may be: use the entry function to analyze Service request, obtain the ID of the service request, at least one target molecule and the property to be calculated of the molecule, and establish a corresponding relationship with the ID of the service request as the index and at least one target molecule and the property to be calculated of the molecule as the index value, and then save it in the storage system ;
  • use the entry function to analyze the service request specifically by passing the service request ID, at least one target molecule and the property of the molecule to be calculated to the entry function, so as to trigger the entry function to analyze the service request from the client.
  • the above-mentioned use of the entry function to generate and save the corresponding relationship for the service request may be: Utilize the entry function to analyze the service request, obtain at least one target molecule, generate the ID of the service request and the molecular properties to be calculated for at least one target molecule, and establish the ID of the service request generated by the entry function as an index, with at least one target Molecules and the molecules generated by the entry function are stored in the storage system after the calculated property is the corresponding relationship of the index value; here, the entry function is used to parse the service request, specifically by passing at least one target molecule to the entry function to trigger the entry function Parse service requests from clients.
  • the above-mentioned use of the entry function to generate and save the corresponding relationship for the service request may be: use
  • the entry function parses the service request, obtains the ID of the service request and at least one target molecule, generates the molecular properties to be calculated for at least one target molecule, and establishes a molecule indexed by the service request ID, at least one target molecule and the entry function To be calculated and stored in the storage system after the corresponding relationship of the index value; here, use the entry function to analyze the service request, specifically by passing at least one target molecule and the ID of the service request to the entry function, so as to trigger the entry function to resolve the request from Client's service request.
  • the above-mentioned use of the entry function to generate and save the corresponding relationship for the service request may be: use
  • the entry function parses the service request, obtains at least one target molecule and the property to be calculated of the molecule, generates the ID of the service request, and establishes the ID of the service request generated by the entry function as an index, and at least one target molecule and the property to be calculated of the molecule as an index value
  • the corresponding relationship is saved in the storage system; here, the entry function is used to analyze the service request, specifically, by passing at least one target molecule and the property of the molecule to be calculated to the entry function, so as to trigger the entry function to analyze the service request from the client.
  • the storage system in the foregoing embodiments may be a structured database, an unstructured database, or a storage unit based on object storage. Since the ID of the service request is used as the index when stored in these storage systems, at least one target molecule and the property to be calculated of the molecule are used as the index value to establish a corresponding relationship. Therefore, when the calculation result needs to be read later, the ID of the service request is used to perform Just index.
  • the trigger calculation function is to use the entry function to generate and save the corresponding relationship for the service request; the request calculation event is issued through the entry function to trigger the calculation function, wherein the request calculation event carries the ID of the service request, corresponding to The relationship includes an ID of the service request, a mapping of at least one target molecule and a property of the molecule to be calculated.
  • Step S202 Using a calculation function to perform a preset operation to perform property calculation on at least one target molecule to obtain a calculation result, wherein the calculation result includes the property of each target molecule.
  • the calculation function is used to perform preset operations to calculate the properties of at least one target molecule
  • the calculation result may be: use the calculation function to obtain at least one target molecule and the molecule to be treated according to the ID of the service request from the corresponding relationship. calculating the property, and performing a preset operation corresponding to the property of the molecule to be calculated to calculate the property of at least one target molecule to obtain a calculation result.
  • the ID of the service request may be passed to the calculation function, and the calculation function may be triggered to read at least one target molecule and the property to be calculated of the molecule from the storage system with the ID of the service request as an index, and use the target molecule and the property to be calculated of the molecule as Input parameters, run the code in the calculation function corresponding to the property of the molecule to be calculated to perform property calculation on at least one target molecule, so as to obtain the calculation result of the property of the target molecule.
  • the entry function is triggered, the storage system establishes a corresponding relationship with the ID of the service request as the index and at least one target molecule and the attribute to be calculated of the molecule as the index value and saves it in the storage system.
  • the calculation function when the calculation function is passed After entering the ID of the service request, the calculation function can be triggered to read the target molecule and the property to be calculated from the storage system with the ID of the service request as an index, and use the target molecule and the property to be calculated of the molecule as input parameters to run the calculation function and the molecule
  • the code corresponding to the property to be calculated performs property calculation on at least one target molecule to obtain the calculation result of the property of the target molecule.
  • the calculation function is used to perform preset operations to perform property calculation on at least one target molecule, and after obtaining the calculation result, it also includes saving the calculation result in the corresponding relationship to update the corresponding relationship.
  • Calculation results can be saved to storage systems such as structured databases, unstructured databases, or storage units based on object storage mentioned in the foregoing embodiments.
  • the ID of the service request can be used as an index, and at least one target molecule and molecule to be calculated The property establishes a corresponding relationship for the index value, which is convenient for subsequent indexing when the calculation result needs to be read.
  • Step S203 using the exit function to return the calculation result to the client.
  • the exit functions of the embodiments of the present application are also serverless functions deployed in a lightweight manner, that is, Code Archive. Therefore, in addition to having serverless functions In addition to all attributes, it also means that the export function has minimal dependence on resources such as third-party libraries and components.
  • using the exit function to return the calculation result to the client may be: using the exit function to receive a query request from the client, wherein the query request includes the ID of the service request; using the exit function and according to the ID of the service request, read Get the calculation result corresponding to the ID of the service request and return the calculation result to the client.
  • the ID of the service request received through the query request is still the entry cloud function provided by the client by calling the API gateway, it is passed in by the entry cloud function. Therefore, when the service request carries the ID of the service request, It is directly passed in by the portal cloud function. When the service request does not contain the ID of the service request, the service request can be parsed by the portal cloud function to generate the ID of the service request and then passed in. Then, using the ID of the service request as an index, the calculation result is read from a storage system such as a structured database, an unstructured database, or a storage unit based on object storage, and the calculation result is returned to the client.
  • a storage system such as a structured database, an unstructured database, or a storage unit based on object storage
  • the method of the above embodiment further includes publishing the Completion of the calculation event triggers the exit function, wherein the completion of the calculation event carries the ID of the service request.
  • a calculation completion event is issued, which contains the ID of the service request.
  • the exit function subscribes to the topic of "completion of calculation events", and its trigger fetches the corresponding calculation event that has been completed, and passes the ID of the service request to the exit function, and the exit function is triggered.
  • the address of the callback interface is filled in when the user sends a service request through the client. Since the address of the callback interface is optional for the user when sending the service request, that is, the user may not fill in the address of the callback interface when sending the service request.
  • returning the saved calculation result to the client can be achieved by the method of the foregoing embodiment, that is, receiving a query request from the client (including the service request) ID), according to the ID of the service request, read the saved calculation result and return the calculation result to the client.
  • the method of the above embodiment also includes issuing a calculation completion event through the calculation function, triggering export function.
  • using the exit function to return the calculation result to the client may be: using the exit function to read the calculation result corresponding to the ID of the service request, and calling the callback interface according to the address of the callback interface to return to the client Calculation results.
  • the ID of the service request as an index
  • a storage system such as a structured database, an unstructured database, or a storage unit based on object storage
  • the present application also provides a device for obtaining molecular properties, electronic equipment, and corresponding embodiments.
  • FIG. 3 it is a schematic structural diagram of a device for obtaining molecular properties shown in an embodiment of the present application. For ease of description, only the parts related to the embodiment of the present application are shown.
  • the apparatus illustrated in FIG. 3 may include a receiving module 301, an executing module 302, and a returning module 303, which are described as follows:
  • the receiving module 301 is configured to use an entry function to receive a service request from a client, and trigger a calculation function according to the service request, wherein the service request includes at least one target molecule to be calculated;
  • Executing module 302 configured to use a calculation function to perform a preset operation to perform property calculation on at least one target molecule to obtain a calculation result, wherein the calculation result includes the property of each target molecule;
  • the return module 303 is used to return the calculation result to the client by using the exit function.
  • the receiving module 301 illustrated in FIG. 3 may include a generating unit and a triggering unit
  • the executing module 302 may include a first computing unit, wherein:
  • the generation unit is used to generate and save the corresponding relationship for the service request by using the entry function, and the corresponding relationship includes the ID of the service request, the mapping between at least one target molecule and the properties of the molecule to be calculated;
  • a trigger unit configured to issue a request calculation event through an entry function, and trigger a calculation function, wherein the request calculation event carries the ID of the service request;
  • the first calculation unit is used to obtain at least one target molecule and the property to be calculated of the molecule from the corresponding relationship according to the ID of the service request by using a calculation function, and perform a preset operation corresponding to the property to be calculated of the molecule to perform properties on the at least one target molecule Calculate and get the calculation result.
  • the above-mentioned service request may also include the ID of the service request and the property of the molecule to be calculated
  • the generation unit may include a first establishment unit, which is used to analyze the service request by using the entry function, and obtain the ID of the service request, at least one target molecule and the molecule
  • the property to be calculated is established and stored in the storage system after establishing a corresponding relationship with the ID of the service request as an index and at least one target molecule and the property to be calculated of the molecule as an index value.
  • the above-mentioned generation unit may include a second establishment unit, which is used to analyze the service request by using the entry function, obtain at least one target molecule, generate the ID of the service request and the molecular property to be calculated for the at least one target molecule, and establish the entry
  • the ID of the service request generated by the function is used as an index
  • the corresponding relationship between at least one target molecule and the property to be calculated of the molecule generated by the entry function is used as an index value, and then stored in the storage system.
  • the above-mentioned service request may further include an ID of the service request
  • the generation unit may include a third establishment unit, configured to use an entry function to parse the service request, obtain the ID of the service request and at least one target molecule, and generate an ID for at least one target molecule The property to be calculated of the molecule of , and establishes the corresponding relationship with the ID of the service request as the index, at least one target molecule and the property to be calculated of the molecule generated by the entry function as the index value, and then saves it in the storage system.
  • the above-mentioned service request may also include properties of molecules to be calculated
  • the generation unit may include a fourth establishment unit, configured to use an entry function to analyze the service request, obtain at least one target molecule and properties to be calculated of molecules, and generate an ID of the service request, And establish a corresponding relationship with the ID of the service request generated by the entry function as the index, and at least one target molecule and the attribute to be calculated of the molecule as the index value, and then save it in the storage system.
  • the device illustrated in FIG. 3 may also include a saving module, which is used for the execution module 302 to use the calculation function to perform preset operations to perform property calculations on at least one target molecule, and after obtaining the calculation results, save the calculation results in the corresponding relationship, to update the correspondence.
  • a saving module which is used for the execution module 302 to use the calculation function to perform preset operations to perform property calculations on at least one target molecule, and after obtaining the calculation results, save the calculation results in the corresponding relationship, to update the correspondence.
  • the returning module 303 may include a query request receiving unit and a reading unit, wherein:
  • the query request receiving unit is used to receive the query request from the client by using the exit function, and the query request includes the ID of the service request;
  • the reading unit is configured to use the exit function and according to the ID of the service request, read the calculation result corresponding to the ID of the service request and return the calculation result to the client.
  • the above-mentioned service request may also include the address of the callback interface
  • the device illustrated in FIG. 3 may also include a trigger module
  • the return module 303 may include a calling unit, wherein:
  • the trigger module is used for returning module 303 to use the exit function to return the calculation result to the client before issuing the calculation completion event through the calculation function, triggering the exit function, and the completion calculation event carrying the ID of the service request;
  • the calling unit is used to use the exit function to read the calculation result corresponding to the ID of the service request, and call the callback interface according to the address of the callback interface to return the calculation result to the client.
  • the above computing functions are deployed through container images or code archives, and entry functions or exit functions are deployed in a lightweight manner or code archives.
  • the electronic device 400 includes a memory 410 and a processor 420 .
  • the processor 420 can be a central processing unit (Central Processing Unit, CPU), and can also be other general-purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), on-site Field-Programmable Gate Array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
  • a general-purpose processor may be a microprocessor, or the processor may be any conventional processor, or the like.
  • the memory 410 may include various types of storage units, such as system memory, read only memory (ROM), and persistent storage. Wherein, the ROM can store static data or instructions required by the processor 420 or other modules of the computer.
  • the persistent storage device may be a readable and writable storage device. Persistent storage may be a non-volatile storage device that does not lose stored instructions and data even if the computer is powered off.
  • the permanent storage device adopts a mass storage device (such as a magnetic or optical disk, flash memory) as the permanent storage device.
  • the permanent storage device may be a removable storage device (such as a floppy disk, an optical drive).
  • the system memory can be a readable and writable storage device or a volatile readable and writable storage device, such as dynamic random access memory.
  • System memory can store some or all of the instructions and data that the processor needs at runtime.
  • memory 410 may include any combination of computer-readable storage media, including various types of semiconductor memory chips (DRAM, SRAM, SDRAM, flash memory, programmable read-only memory), and magnetic and/or optical disks may also be used.
  • memory 410 may include a readable and/or writable removable storage device, such as a compact disc (CD), a read-only digital versatile disc (e.g., DVD-ROM, dual-layer DVD-ROM), Read-Only Blu-ray Disc, Super Density Disc, Flash memory card (such as SD card, min SD card, Micro-SD card, etc.), magnetic floppy disk, etc.
  • a readable and/or writable removable storage device such as a compact disc (CD), a read-only digital versatile disc (e.g., DVD-ROM, dual-layer DVD-ROM), Read-Only Blu-ray Disc, Super Density Disc, Flash memory card (such as SD card, min SD card, Micro-SD card, etc.), magnetic floppy disk, etc.
  • Computer-readable storage media do not contain carrier waves and transient electronic signals transmitted by wireless or wire.
  • Executable codes are stored in the memory 410 , and when the executable codes are processed by the processor 420 , the processor 420 can be made to execute part or all of the methods mentioned above.
  • the method according to the present application can also be implemented as a computer program or computer program product, the computer program or computer program product including computer program code instructions for executing some or all of the steps in the above method of the present application.
  • the present application may also be implemented as a storage medium, including a non-transitory machine-readable storage medium, a computer-readable storage medium, or a machine-readable storage medium, on which executable code (or computer program, or computer instruction) is stored. code), when the executable code (or computer program, or computer instruction code) is executed by the processor of the electronic device (or electronic device, server, etc.), causing the processor to perform part or part of each step of the above-mentioned method according to the present application all.

Landscapes

  • Chemical & Material Sciences (AREA)
  • Crystallography & Structural Chemistry (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Engineering & Computer Science (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Computing Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)
  • Complex Calculations (AREA)
  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)

Abstract

The present application relates to a method and apparatus for acquiring molecular properties, and a storage medium. The method comprises: receiving a service request from a client by using an entry function, and triggering a calculation function according to the service request, wherein the service request comprises at least one target molecule to be subjected to calculation; performing property calculation on the at least one target molecule by using the calculation function and by executing a preset operation, so as to obtain a calculation result, wherein the calculation result includes the properties of each target molecule; and returning the calculation result to the client by using an exit function. The technical solution of the present application can reduce the costs of acquiring molecular properties, and enhance the expansibility of a system.

Description

获取分子性质的方法、装置及存储介质Method, device and storage medium for obtaining molecular properties 技术领域technical field
本申请涉及计算机辅助制药领域,尤其涉及一种获取分子性质的方法、装置及存储介质。The present application relates to the field of computer-aided pharmacy, in particular to a method, device and storage medium for obtaining molecular properties.
背景技术Background technique
在进行计算机辅助药物设计的过程中,常常需要对备选药物分子进行物理、化学或ADMET性质的计算或预测,并据此进行分析和筛选。相关技术中,进行分子性质预测的方法主要包括使用商业软件或访问公开或私有的提供性质计算的传统网络服务。然而,商业软件授权费用昂贵,且一般用户通常不能介入开发工作,成套的软件包经常无法满足用户的定制化需求,而使用传统网络服务,需要将服务部署在实际的服务器,这将带来资源浪费和可扩展性较差的缺陷。In the process of computer-aided drug design, it is often necessary to calculate or predict the physical, chemical or ADMET properties of candidate drug molecules, and analyze and screen accordingly. In related technologies, the methods for predicting molecular properties mainly include using commercial software or accessing public or private traditional network services that provide property calculations. However, commercial software licenses are expensive, and general users are usually unable to intervene in development work. Packaged software packages often cannot meet user customization needs, and traditional network services need to be deployed on actual servers, which will bring resources Waste and poor scalability flaws.
发明内容Contents of the invention
为解决或部分解决相关技术中存在的问题,本申请提供一种获取分子性质的方法、装置及存储介质,该技术方案能够降低获取分子性质的各项成本,并使得系统的扩展性增强。In order to solve or partially solve the problems in the related technologies, the present application provides a method, device and storage medium for obtaining molecular properties. The technical solution can reduce various costs of obtaining molecular properties and enhance the scalability of the system.
本申请第一方面提供一种获取分子性质的方法,包括:The first aspect of the present application provides a method for obtaining molecular properties, including:
利用入口函数接收来自客户端的服务请求,并根据所述服务请求,触发计算函数;其中,所述服务请求包括待计算的至少一个目标分子;Using an entry function to receive a service request from a client, and trigger a calculation function according to the service request; wherein the service request includes at least one target molecule to be calculated;
利用所述计算函数执行预设操作对所述至少一个目标分子进行性质计算,得到计算结果,所述计算结果包含每个所述目标分子的性质;Using the calculation function to perform a preset operation to perform property calculation on the at least one target molecule to obtain a calculation result, the calculation result including the property of each target molecule;
利用出口函数向所述客户端返回所述计算结果。The calculation result is returned to the client by using an exit function.
本申请第二方面提供一种获取分子性质的装置,包括:The second aspect of the present application provides a device for obtaining molecular properties, including:
接收模块,用于利用入口函数接收来自客户端的服务请求,并根据所述服务请求,触发计算函数;其中,所述服务请求包括待计算的至少一个目标分子;A receiving module, configured to use an entry function to receive a service request from a client, and trigger a calculation function according to the service request; wherein the service request includes at least one target molecule to be calculated;
执行模块,用于利用所述计算函数执行预设操作对所述至少一个目标分子进行性质计算,得到计算结果,所述计算结果包含每个所述目标分子的性质;An execution module, configured to use the calculation function to perform a preset operation to perform property calculation on the at least one target molecule to obtain a calculation result, the calculation result including the property of each target molecule;
返回模块,利用出口函数向所述客户端返回所述计算结果。The return module returns the calculation result to the client by using an exit function.
本申请第三方面提供一种电子设备,包括:The third aspect of the present application provides an electronic device, including:
处理器;以及processor; and
存储器,其上存储有可执行代码,当所述可执行代码被所述处理器执行时,使所述处理器执行如上所述的方法。A memory, on which executable codes are stored, which, when executed by the processor, cause the processor to perform the method as described above.
本申请第四方面提供一种存储介质,其上存储有可执行代码,当所述可执行代码被电子设备的处理器执行时,使所述处理器执行如上所述的方法。A fourth aspect of the present application provides a storage medium, on which executable code is stored, and when the executable code is executed by a processor of an electronic device, the processor is made to execute the above-mentioned method.
从上述本申请提供的技术方案可知,由于入口函数和计算函数是以无服务器部署的函数,因此,通过对入口函数和计算函数的触发最终获得目标分子的性质的计算结果,对用户而言,不仅可以有效地实现按量计费、按需伸缩能力,节省闲时成本并确保繁忙期的可用性,而且计算函数通常可以镜像部署,这意味着可以简化相应软件的发布流程以及缩短计算目标分子的性质所花费的时间。From the above-mentioned technical solution provided by this application, since the entry function and the calculation function are functions deployed without a server, the calculation result of the properties of the target molecule is finally obtained by triggering the entry function and the calculation function. For the user, Not only can it effectively realize pay-as-you-go, on-demand scalability, save idle time costs, and ensure availability during busy periods, but calculation functions can usually be deployed in mirror images, which means that the release process of corresponding software can be simplified and the time for calculating target molecules can be shortened. The time spent in nature.
应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性的,并不能限制本申请。It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the application.
附图说明Description of drawings
通过结合附图对本申请示例性实施方式进行更详细的描述,本申请的上述以及其它目的、特征和优势将变得更加明显,其中,在本申请示例性实施方式中,相同的参考标号通常代表相同部件。The above and other objects, features and advantages of the present application will become more apparent by describing the exemplary embodiments of the present application in more detail with reference to the accompanying drawings, wherein, in the exemplary embodiments of the present application, the same reference numerals generally represent same parts.
图1是本申请实施例示出的获取分子性质的方法的应用场景示意图;Figure 1 is a schematic diagram of the application scenario of the method for obtaining molecular properties shown in the embodiment of the present application;
图2是本申请实施例示出的获取分子性质的方法的流程示意图;Figure 2 is a schematic flow diagram of a method for obtaining molecular properties shown in an embodiment of the present application;
图3是本申请实施例示出的获取分子性质的装置的结构示意图;FIG. 3 is a schematic structural diagram of a device for obtaining molecular properties shown in an embodiment of the present application;
图4是本申请实施例示出的电子设备的结构示意图。Fig. 4 is a schematic structural diagram of an electronic device shown in an embodiment of the present application.
具体实施方式Detailed ways
下面将参照附图更详细地描述本申请的实施方式。虽然附图中显示了本申请的实施方式,然而应该理解,可以以各种形式实现本申请而不应被这里阐述的实施方式所限制。相反,提供这些实施方式是为了使本申请更加透彻和完整,并且能够将本申请的范围完整地传达给本领域的技术人员。Embodiments of the present application will be described in more detail below with reference to the accompanying drawings. Although embodiments of the present application are shown in the drawings, it should be understood that the present application may be embodied in various forms and should not be limited by the embodiments set forth herein. Rather, these embodiments are provided so that this application will be thorough and complete, and will fully convey the scope of this application to those skilled in the art.
在本申请使用的术语是仅仅出于描述特定实施例的目的,而非旨在限制本申请。在本申请和所附权利要求书中所使用的单数形式的“一种”、“所述”和“该”也旨在包括多数形式,除非上下文清楚地表示其他含义。还应当理解,本文中使用的术语“和/或”是指并包含一个或多个相关联的列出项目的任何或所有可能组合。The terminology used in this application is for the purpose of describing particular embodiments only, and is not intended to limit the application. As used in this application and the appended claims, the singular forms "a", "the", and "the" are intended to include the plural forms as well, unless the context clearly dictates otherwise. It should also be understood that the term "and/or" as used herein refers to and includes any and all possible combinations of one or more of the associated listed items.
应当理解,尽管在本申请可能采用术语“第一”、“第二”、“第三”等来描述各种信息,但这些信息不应限于这些术语。这些术语仅用来将同一类型的信息彼此区分开。例如,在不脱离本申请范围的情况下,第一信息也可以被称为第二信息,类似地,第二信息也可以被称为第一信息。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括一个或者更多个该特征。在本申请的描述中,“多个”的含义是两个或两个以上,除非另有明确具体的限定。It should be understood that although the terms "first", "second", "third" and so on may be used in this application to describe various information, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, without departing from the scope of the present application, first information may also be called second information, and similarly, second information may also be called first information. Thus, a feature defined as "first" and "second" may explicitly or implicitly include one or more of these features. In the description of the present application, "plurality" means two or more, unless otherwise specifically defined.
在进行计算机辅助药物设计的过程中,常常需要对备选药物分子进行物理、化学或ADMET性质的计算或预测。相关技术中主要包括使用商业软件或访问公开或私有的提供性质计算的传统网络服务。然而,商业软件授权费用昂贵,且一般用户通常不能介入开发工作,成套的软件包经常无法满足用户的定制化需求。而使用传统网络服务,需要将服务部署在实际的服务器上。由于分子性质计算服务的访问频率取决于用户设计、生成待评估分子的工作进度,具有很高的不确定性,将服务部署在实际的服务器上,常常会造成闲时资源浪费、忙时可用性受限。此外,服务器需要兼容运行环境复杂的不同算法,部署难度大,且可扩展性和可维护性差。In the process of computer-aided drug design, it is often necessary to calculate or predict the physical, chemical or ADMET properties of candidate drug molecules. Related technologies mainly include using commercial software or accessing public or private traditional network services that provide nature computing. However, commercial software licenses are expensive, and general users are usually unable to participate in development work, and complete software packages often cannot meet user customization needs. With traditional web services, services need to be deployed on actual servers. Since the access frequency of the molecular property calculation service depends on the progress of the user's design and generation of molecules to be evaluated, it has high uncertainty. Deploying the service on an actual server often results in waste of resources during idle hours and limited availability during busy hours. limit. In addition, the server needs to be compatible with different algorithms with complex operating environments, which is difficult to deploy, and has poor scalability and maintainability.
针对上述问题,本申请实施例提供一种获取分子性质的方法,能够降低获取分子性质的各项成本,并使得系统的扩展性增强。In view of the above problems, the embodiment of the present application provides a method for obtaining molecular properties, which can reduce various costs of obtaining molecular properties and enhance the scalability of the system.
以下结合附图详细描述本申请实施例的技术方案。The technical solutions of the embodiments of the present application are described in detail below with reference to the accompanying drawings.
参见图1,是本申请实施例示出的获取分子性质的方法的应用场景示意图。该应用场景基于无服务器(Serverless)架构,基本特征是函数即服 务(Function as a Service,FaaS)和事件驱动,具体是指将函数抽象为一种服务提供给开发者,以使开发者能够在互联网上实现函数的开发、测试以及在线部署等功能。事件驱动是指Serverless架构中的函数由事件驱动执行,事件由事件源发布,其实质是一种业务请求,用于请求完成相应的业务。在Serverless架构中,API网关(API Gateway)的主要功能之一是向使用微服务的客户端提供中央接口。中央接口意味着这些接口具有统一的地址。换言之,当客户端需要调用后端任意一个微服务时,只需要向具有统一地址的中央接口发送服务请求。API网关根据服务请求,触发后端相应的云函数。该云函数执行完毕,API网关通过中央接口向客户端返回云函数执行的结果。Referring to FIG. 1 , it is a schematic diagram of an application scenario of the method for obtaining molecular properties shown in the embodiment of the present application. This application scenario is based on a serverless (Serverless) architecture, and its basic features are Function as a Service (FaaS) and event-driven. Functions such as function development, testing, and online deployment are realized on the Internet. Event-driven means that the functions in the serverless architecture are executed by event-driven, and the event is released by the event source, which is essentially a business request for the completion of the corresponding business. In a serverless architecture, one of the main functions of API Gateway (API Gateway) is to provide a central interface to clients using microservices. Central interface means that these interfaces have a unified address. In other words, when the client needs to call any microservice in the backend, it only needs to send a service request to the central interface with a unified address. The API gateway triggers the corresponding cloud function on the backend according to the service request. After the cloud function is executed, the API gateway returns the execution result of the cloud function to the client through the central interface.
参见图2,是本申请实施例示出的获取分子性质的方法的流程示意图,该方法主要包括步骤S201至步骤S203,详细说明如下:Referring to FIG. 2 , it is a schematic flowchart of a method for obtaining molecular properties shown in the embodiment of the present application. The method mainly includes steps S201 to S203, and the details are as follows:
步骤S201:利用入口函数接收来自客户端的服务请求,并根据服务请求,触发计算函数,其中,服务请求包括待计算的至少一个目标分子。Step S201: Use an entry function to receive a service request from a client, and trigger a calculation function according to the service request, wherein the service request includes at least one target molecule to be calculated.
在本申请实施例中,客户端的服务请求是用户通过客户端向API网关发送的服务请求,该服务请求表明用户请求完成的业务。如前所述,API网关可以向客户端提供中央接口,具体地,在本申请实施例中,API网关可以向客户端提供一个入口云函数,因此,客户端向API网关发送的服务请求本质上是向入口云函数发送的服务请求,入口函数接收来自客户端的这一服务请求。需说明的是,入口函数可以是以轻量级方式部署的无服务器函数,因此,其除了具有无服务器函数的所有属性之外,还意味着入口函数对第三方库、组件等资源最小程度的依赖。In this embodiment of the application, the service request of the client is a service request sent by the user to the API gateway through the client, and the service request indicates the service requested by the user to be completed. As mentioned above, the API gateway can provide the client with a central interface. Specifically, in the embodiment of this application, the API gateway can provide the client with an entry cloud function. Therefore, the service request sent by the client to the API gateway is essentially It is a service request sent to the portal cloud function, and the portal function receives this service request from the client. It should be noted that the entry function can be a serverless function deployed in a lightweight manner. Therefore, in addition to having all the attributes of a serverless function, it also means that the entry function has minimal impact on resources such as third-party libraries and components. rely.
此外,用户通过客户端发送的服务请求应当包含至少一个目标分子,而服务请求的ID和分子待计算性质则是可选项,即用户在操作时,既可以填写服务请求的ID和/或分子待计算性质,此时,发送的服务请求除了包含至少一个目标分子之外,还包含服务请求的ID和/或分子待计算性质;用户在操作时,亦可以不填写服务请求的ID和/或分子待计算性质,此时,发送的服务请求就只是包含至少一个目标分子的ID,不包含服务请求的ID和/或分子待计算性质,在这种情况下,服务请求的ID和分子待计算性质都可以由入口函数生成。In addition, the service request sent by the user through the client should contain at least one target molecule, and the ID of the service request and the nature of the molecule to be calculated are optional, that is, the user can fill in the ID of the service request and/or the molecule to be calculated when operating. Calculation properties, at this time, in addition to at least one target molecule, the sent service request also includes the ID and/or molecule of the service request to be calculated; the user may not fill in the ID and/or molecule of the service request when operating The property to be calculated. At this time, the service request sent only contains the ID of at least one target molecule, and does not contain the ID of the service request and/or the property to be calculated of the molecule. In this case, the ID of the service request and the property to be calculated of the molecule can be generated by the entry function.
在本申请实施例中,计算函数是以容器镜像或代码存档部署的无服务器函数(Serverless Function),意味着计算函数的具体算法不受部署环境的影响或者对部署环境的宽容度较高,当需要增加新的服务时,只需要算法研究人员将实现好的科学算法打包为计算函数并相应增加新的事件主题和触发器即可,而无服务器函数意味着可以有效地实现按量计费、按需伸缩能力,节省闲时成本并确保繁忙期的可用性。需要说明的是,计算函数的具体功能会根据不同的需求或算法,其实际执行的代码以及依赖的第三方库、组件等资源是不同的,而入口函数和计算函数的依次触发,意味着入口函数和计算函数的触发具有严格的顺序,即先触发入口函数,再触发计算函数。In the embodiment of this application, the calculation function is a serverless function (Serverless Function) deployed with a container image or code archive, which means that the specific algorithm of the calculation function is not affected by the deployment environment or has a high tolerance to the deployment environment. When new services need to be added, algorithm researchers only need to package well-implemented scientific algorithms into calculation functions and add new event topics and triggers accordingly. Serverless functions mean that billing by volume, On-demand scalability to save idle time costs and ensure availability during busy periods. It should be noted that the specific function of the calculation function will be based on different requirements or algorithms, the actual code executed and the resources such as the third-party library and components depended on are different, and the sequential triggering of the entry function and the calculation function means that the entry The triggering of functions and calculation functions has a strict order, that is, the entry function is triggered first, and then the calculation function is triggered.
作为本申请一个实施例,来自客户端的服务请求,触发计算函数可以是:利用入口函数生成针对服务请求的对应关系并保存;通过入口函数发布请求计算事件,触发计算函数,其中,请求计算事件携带有服务请求的ID,对应关系包括服务请求的ID、至少一个目标分子与分子待计算性质的映射。此处,服务请求的ID、至少一个目标分子与分子待计算性质的映射,意味着一个服务请求的ID可以对应多个目标分子,换言之,可以通过发送一个或一次服务请求(对应一个服务请求的ID)来获取多个目标分子的性质。As an embodiment of the present application, the service request from the client, the trigger calculation function may be: use the entry function to generate and save the corresponding relationship for the service request; issue the request calculation event through the entry function, and trigger the calculation function, wherein the request calculation event carries There is an ID of the service request, and the corresponding relationship includes the ID of the service request, the mapping between at least one target molecule and the property to be calculated of the molecule. Here, the ID of the service request, the mapping of at least one target molecule and the properties of the molecule to be calculated means that the ID of a service request can correspond to multiple target molecules. ID) to obtain properties of multiple target molecules.
如前所述,来自客户端的服务请求可以包含至少一个目标分子、服务请求的ID和分子待计算性质,或者,仅仅包含至少一个目标分子而不包含服务请求的ID和分子待计算性质,或者,包含至少一个目标分子和服务请求的ID而不包含分子待计算性质,或者,包含至少一个目标分子和分子待计算性质而不包含服务请求的ID;以下分情况进行说明:As mentioned above, the service request from the client may contain at least one target molecule, the ID of the service request and the property to be calculated of the molecule, or, only include at least one target molecule without the ID of the service request and the property to be calculated of the molecule, or, Contains at least one target molecule and the ID of the service request but does not include the property to be calculated of the molecule, or contains at least one target molecule and the property to be calculated of the molecule but does not contain the ID of the service request; the following cases are explained:
当来自客户端的服务请求包含至少一个目标分子、服务请求的ID和分子待计算性质时,作为本申请一个实施例,上述利用入口函数生成针对服务请求的对应关系并保存可以是:利用入口函数解析服务请求,获得服务请求的ID、至少一个目标分子和分子待计算性质,并建立以服务请求的ID为索引、以至少一个目标分子和分子待计算属性为索引值的对应关系后保存于存储系统;此处,利用入口函数解析服务请求,具体是通过向入口函数传入服务请求的ID、至少一个目标分子和分子待计算性质,以此触发 入口函数解析来自客户端的服务请求。When the service request from the client includes at least one target molecule, the ID of the service request, and the properties of the molecule to be calculated, as an embodiment of the present application, the above-mentioned use of the entry function to generate and save the corresponding relationship for the service request may be: use the entry function to analyze Service request, obtain the ID of the service request, at least one target molecule and the property to be calculated of the molecule, and establish a corresponding relationship with the ID of the service request as the index and at least one target molecule and the property to be calculated of the molecule as the index value, and then save it in the storage system ; Here, use the entry function to analyze the service request, specifically by passing the service request ID, at least one target molecule and the property of the molecule to be calculated to the entry function, so as to trigger the entry function to analyze the service request from the client.
当来自客户端的服务请求仅仅包含至少一个目标分子而不包含服务请求的ID和分子待计算性质时,作为本申请另一实施例,上述利用入口函数生成针对服务请求的对应关系并保存可以是:利用所述入口函数解析服务请求,获得至少一个目标分子,生成服务请求的ID以及针对至少一个目标分子的分子待计算性质,并建立以入口函数生成的服务请求的ID为索引、以至少一个目标分子和入口函数生成的分子待计算性质为索引值的对应关系后保存于存储系统;此处,利用入口函数解析服务请求,具体是通过向入口函数传入至少一个目标分子,以此触发入口函数解析来自客户端的服务请求。When the service request from the client only contains at least one target molecule but does not contain the ID of the service request and the properties of the molecule to be calculated, as another embodiment of the present application, the above-mentioned use of the entry function to generate and save the corresponding relationship for the service request may be: Utilize the entry function to analyze the service request, obtain at least one target molecule, generate the ID of the service request and the molecular properties to be calculated for at least one target molecule, and establish the ID of the service request generated by the entry function as an index, with at least one target Molecules and the molecules generated by the entry function are stored in the storage system after the calculated property is the corresponding relationship of the index value; here, the entry function is used to parse the service request, specifically by passing at least one target molecule to the entry function to trigger the entry function Parse service requests from clients.
当来自客户端的服务请求包含至少一个目标分子和服务请求的ID而不包含分子待计算性质时,作为本申请另一实施例,上述利用入口函数生成针对服务请求的对应关系并保存可以是:利用入口函数解析服务请求,获得服务请求的ID和至少一个目标分子,生成针对至少一个目标分子的分子待计算性质,并建立以服务请求的ID为索引、以至少一个目标分子和入口函数生成的分子待计算性质为索引值的对应关系后保存于存储系统;此处,利用入口函数解析服务请求,具体是通过向入口函数传入至少一个目标分子和服务请求的ID,以此触发入口函数解析来自客户端的服务请求。When the service request from the client includes at least one target molecule and the ID of the service request but does not include the property of the molecule to be calculated, as another embodiment of the present application, the above-mentioned use of the entry function to generate and save the corresponding relationship for the service request may be: use The entry function parses the service request, obtains the ID of the service request and at least one target molecule, generates the molecular properties to be calculated for at least one target molecule, and establishes a molecule indexed by the service request ID, at least one target molecule and the entry function To be calculated and stored in the storage system after the corresponding relationship of the index value; here, use the entry function to analyze the service request, specifically by passing at least one target molecule and the ID of the service request to the entry function, so as to trigger the entry function to resolve the request from Client's service request.
当来自客户端的服务请求包含至少一个目标分子和分子待计算性质而不包含服务请求的ID时,作为本申请另一实施例,上述利用入口函数生成针对服务请求的对应关系并保存可以是:利用入口函数解析服务请求,获得至少一个目标分子和分子待计算性质,生成服务请求的ID,并建立以入口函数生成的服务请求的ID为索引、以至少一个目标分子和分子待计算属性为索引值的对应关系后保存于存储系统;此处,利用入口函数解析服务请求,具体是通过向入口函数传入至少一个目标分子和分子待计算性质,以此触发入口函数解析来自客户端的服务请求。When the service request from the client contains at least one target molecule and the property to be calculated of the molecule but does not contain the ID of the service request, as another embodiment of the present application, the above-mentioned use of the entry function to generate and save the corresponding relationship for the service request may be: use The entry function parses the service request, obtains at least one target molecule and the property to be calculated of the molecule, generates the ID of the service request, and establishes the ID of the service request generated by the entry function as an index, and at least one target molecule and the property to be calculated of the molecule as an index value The corresponding relationship is saved in the storage system; here, the entry function is used to analyze the service request, specifically, by passing at least one target molecule and the property of the molecule to be calculated to the entry function, so as to trigger the entry function to analyze the service request from the client.
上述实施例的存储系统可以是结构化数据库、非结构化数据库或基于对象存储的存储单元等。由于在保存在这些存储系统时是以服务请求的ID为索引、以至少一个目标分子和分子待计算性质为索引值建立的对应关系, 因此,后续需要读取计算结果时以服务请求的ID进行索引即可。The storage system in the foregoing embodiments may be a structured database, an unstructured database, or a storage unit based on object storage. Since the ID of the service request is used as the index when stored in these storage systems, at least one target molecule and the property to be calculated of the molecule are used as the index value to establish a corresponding relationship. Therefore, when the calculation result needs to be read later, the ID of the service request is used to perform Just index.
相应于来自客户端的服务请求,触发计算函数为利用入口函数生成针对服务请求的对应关系并保存;通过入口函数发布请求计算事件,触发计算函数,其中,请求计算事件携带有服务请求的ID,对应关系包括服务请求的ID、至少一个目标分子与分子待计算性质的映射。Corresponding to the service request from the client, the trigger calculation function is to use the entry function to generate and save the corresponding relationship for the service request; the request calculation event is issued through the entry function to trigger the calculation function, wherein the request calculation event carries the ID of the service request, corresponding to The relationship includes an ID of the service request, a mapping of at least one target molecule and a property of the molecule to be calculated.
步骤S202:利用计算函数执行预设操作对至少一个目标分子进行性质计算,得到计算结果,其中,计算结果包含每个目标分子的性质。Step S202: Using a calculation function to perform a preset operation to perform property calculation on at least one target molecule to obtain a calculation result, wherein the calculation result includes the property of each target molecule.
在本申请一个实施例中,利用计算函数执行预设操作对至少一个目标分子进行性质计算,得到计算结果可以是:利用计算函数根据服务请求的ID从对应关系中获得至少一个目标分子和分子待计算性质,并执行与分子待计算性质相对应的预设操作对至少一个目标分子进行性质计算,得到计算结果。In one embodiment of the present application, the calculation function is used to perform preset operations to calculate the properties of at least one target molecule, and the calculation result may be: use the calculation function to obtain at least one target molecule and the molecule to be treated according to the ID of the service request from the corresponding relationship. calculating the property, and performing a preset operation corresponding to the property of the molecule to be calculated to calculate the property of at least one target molecule to obtain a calculation result.
具体地,可以是向计算函数传入服务请求的ID,触发计算函数以服务请求的ID为索引从存储系统读取至少一个目标分子和分子待计算性质,并以目标分子和分子待计算性质为入参,运行计算函数中与分子待计算性质相对应的代码对至少一个目标分子进行性质计算,以得到目标分子的性质这一计算结果。由于入口函数被触发时,在存储系统建立了以服务请求的ID为索引、以至少一个目标分子的和分子待计算属性为索引值的对应关系后保存于存储系统,因此,当向计算函数传入服务请求的ID后,可以触发计算函数以服务请求的ID为索引从存储系统读取目标分子和分子待计算性质,并以目标分子和分子待计算性质为入参,运行计算函数中与分子待计算性质相对应的代码对至少一个目标分子进行性质计算以得到目标分子的性质这一计算结果。Specifically, the ID of the service request may be passed to the calculation function, and the calculation function may be triggered to read at least one target molecule and the property to be calculated of the molecule from the storage system with the ID of the service request as an index, and use the target molecule and the property to be calculated of the molecule as Input parameters, run the code in the calculation function corresponding to the property of the molecule to be calculated to perform property calculation on at least one target molecule, so as to obtain the calculation result of the property of the target molecule. When the entry function is triggered, the storage system establishes a corresponding relationship with the ID of the service request as the index and at least one target molecule and the attribute to be calculated of the molecule as the index value and saves it in the storage system. Therefore, when the calculation function is passed After entering the ID of the service request, the calculation function can be triggered to read the target molecule and the property to be calculated from the storage system with the ID of the service request as an index, and use the target molecule and the property to be calculated of the molecule as input parameters to run the calculation function and the molecule The code corresponding to the property to be calculated performs property calculation on at least one target molecule to obtain the calculation result of the property of the target molecule.
上述实施例中,利用计算函数执行预设操作对至少一个目标分子进行性质计算,得到计算结果之后还包括将计算结果保存在对应关系中,以更新对应关系。计算结果可以保存到前述实施例提及的结构化数据库、非结构化数据库或基于对象存储的存储单元等存储系统,保存时,可以服务请求的ID为索引、以至少一个目标分子和分子待计算性质为索引值建立对应关系,方便后续需要读取计算结果时进行索引。In the above embodiment, the calculation function is used to perform preset operations to perform property calculation on at least one target molecule, and after obtaining the calculation result, it also includes saving the calculation result in the corresponding relationship to update the corresponding relationship. Calculation results can be saved to storage systems such as structured databases, unstructured databases, or storage units based on object storage mentioned in the foregoing embodiments. When saving, the ID of the service request can be used as an index, and at least one target molecule and molecule to be calculated The property establishes a corresponding relationship for the index value, which is convenient for subsequent indexing when the calculation result needs to be read.
步骤S203:利用出口函数向客户端返回计算结果。Step S203: using the exit function to return the calculation result to the client.
首先说明的是,与前述实施例的入口函数类似,本申请实施例的出口函数也是以轻量级方式亦即代码存档(Code Archive)部署的无服务器函数,因此,其除了具有无服务器函数的所有属性之外,还意味着出口函数对第三方库、组件等资源最小程度的依赖。作为本申请一个实施例,利用出口函数向客户端返回计算结果可以是:利用出口函数接收来自客户端的查询请求,其中,查询请求包含服务请求的ID;利用出口函数并根据服务请求的ID,读取与服务请求的ID相对应的计算结果后向客户端返回该计算结果。需要说明的是,由于通过查询请求所接收的服务请求的ID,仍然是客户端通过调用API网关提供的入口云函数,由入口云函数传入,因此,当服务请求携带服务请求的ID时,直接由入口云函数传入,当服务请求并不包含服务请求的ID时,可以由入口云函数解析该服务请求、生成服务请求的ID这一参数后传入。然后,以服务请求的ID为索引,从结构化数据库、非结构化数据库或基于对象存储的存储单元等存储系统读取计算结果后向客户端返回该计算结果。Firstly, it is explained that, similar to the entry functions of the foregoing embodiments, the exit functions of the embodiments of the present application are also serverless functions deployed in a lightweight manner, that is, Code Archive. Therefore, in addition to having serverless functions In addition to all attributes, it also means that the export function has minimal dependence on resources such as third-party libraries and components. As an embodiment of this application, using the exit function to return the calculation result to the client may be: using the exit function to receive a query request from the client, wherein the query request includes the ID of the service request; using the exit function and according to the ID of the service request, read Get the calculation result corresponding to the ID of the service request and return the calculation result to the client. It should be noted that since the ID of the service request received through the query request is still the entry cloud function provided by the client by calling the API gateway, it is passed in by the entry cloud function. Therefore, when the service request carries the ID of the service request, It is directly passed in by the portal cloud function. When the service request does not contain the ID of the service request, the service request can be parsed by the portal cloud function to generate the ID of the service request and then passed in. Then, using the ID of the service request as an index, the calculation result is read from a storage system such as a structured database, an unstructured database, or a storage unit based on object storage, and the calculation result is returned to the client.
本申请一实施例中,当来自客户端的服务请求包含回调接口的地址,在利用出口函数向客户端返回与服务请求的ID相对应的计算结果之前,上述实施例的方法还包括通过计算函数发布完成计算事件,触发出口函数,其中,完成计算事件携带有服务请求的ID。In one embodiment of the present application, when the service request from the client includes the address of the callback interface, before using the exit function to return the calculation result corresponding to the ID of the service request to the client, the method of the above embodiment further includes publishing the Completion of the calculation event triggers the exit function, wherein the completion of the calculation event carries the ID of the service request.
具体地,计算函数完成目标分子的性质的计算后,发布完成计算事件,其中包含服务请求的ID。出口函数通过订阅“完成计算事件”这一主题,其触发器取出已完成相应计算事件,向出口函数传入服务请求的ID,出口函数得以触发。需要说明的是,上述实施例中,回调接口的地址是由用户通过客户端发送服务请求时填写进去。由于回调接口的地址对用户而言,是发送服务请求时的可选项,即,用户在发送服务请求时可能并没有填写回调接口的地址。当用户在通过客户端发送服务请求时未填写回调接口的地址时,向客户端返回保存的计算结果可以通过前述实施例的方式来实现,即,接收来自客户端的查询请求(其中包含服务请求的ID),根据服务请求的ID,读取保存的计算结果后向客户端返回该计算结果。Specifically, after the calculation function completes the calculation of the property of the target molecule, a calculation completion event is issued, which contains the ID of the service request. The exit function subscribes to the topic of "completion of calculation events", and its trigger fetches the corresponding calculation event that has been completed, and passes the ID of the service request to the exit function, and the exit function is triggered. It should be noted that, in the above embodiment, the address of the callback interface is filled in when the user sends a service request through the client. Since the address of the callback interface is optional for the user when sending the service request, that is, the user may not fill in the address of the callback interface when sending the service request. When the user does not fill in the address of the callback interface when sending a service request through the client, returning the saved calculation result to the client can be achieved by the method of the foregoing embodiment, that is, receiving a query request from the client (including the service request) ID), according to the ID of the service request, read the saved calculation result and return the calculation result to the client.
相应于当来自客户端的服务请求包含回调接口的地址,在利用出口函数向客户端返回与服务请求的ID相对应的计算结果之前,上述实施例的 方法还包括通过计算函数发布完成计算事件,触发出口函数。作为本申请另一实施例,利用出口函数向客户端返回计算结果可以是:利用出口函数读取与服务请求的ID相对应的计算结果,并根据回调接口的地址调用回调接口以向客户端返回计算结果。具体地,是以服务请求的ID为索引,从结构化数据库、非结构化数据库或基于对象存储的存储单元等存储系统读取至少一个目标分子的性质的计算结果并检查该计算结果的完整性,最后,根据回调接口的地址调用回调接口,向客户端返回该计算结果。Corresponding to when the service request from the client includes the address of the callback interface, before using the exit function to return the calculation result corresponding to the ID of the service request to the client, the method of the above embodiment also includes issuing a calculation completion event through the calculation function, triggering export function. As another embodiment of the present application, using the exit function to return the calculation result to the client may be: using the exit function to read the calculation result corresponding to the ID of the service request, and calling the callback interface according to the address of the callback interface to return to the client Calculation results. Specifically, using the ID of the service request as an index, read the calculation result of the property of at least one target molecule from a storage system such as a structured database, an unstructured database, or a storage unit based on object storage, and check the integrity of the calculation result , and finally, call the callback interface according to the address of the callback interface, and return the calculation result to the client.
从上述图2示例的技术方案可知,由于入口函数和计算函数是以无服务器部署的函数,因此,通过对入口函数和计算函数的触发最终获得目标分子的性质的计算结果,对用户而言,不仅可以有效地实现按量计费、按需伸缩能力,节省闲时成本并确保繁忙期的可用性,而且计算函数通常可以镜像部署,这意味着可以简化相应软件的发布流程以及缩短计算目标分子的性质所花费的时间。It can be seen from the technical solution illustrated in Figure 2 above that since the entry function and the calculation function are functions deployed without a server, the calculation result of the property of the target molecule is finally obtained by triggering the entry function and the calculation function. For the user, Not only can it effectively realize pay-as-you-go, on-demand scalability, save idle time costs, and ensure availability during busy periods, but calculation functions can usually be deployed in mirror images, which means that the release process of corresponding software can be simplified and the time for calculating target molecules can be shortened. The time spent in nature.
与前述应用功能实现方法实施例相对应,本申请还提供了一种获取分子性质的装置、电子设备及相应的实施例。Corresponding to the aforementioned embodiments of the method for realizing application functions, the present application also provides a device for obtaining molecular properties, electronic equipment, and corresponding embodiments.
参见图3是本申请实施例示出的获取分子性质的装置的结构示意图。为了便于说明,仅仅示出与本申请实施例相关的部分。图3示例的装置可以包括接收模块301、执行模块302和返回模块303,说明如下:Referring to FIG. 3 , it is a schematic structural diagram of a device for obtaining molecular properties shown in an embodiment of the present application. For ease of description, only the parts related to the embodiment of the present application are shown. The apparatus illustrated in FIG. 3 may include a receiving module 301, an executing module 302, and a returning module 303, which are described as follows:
接收模块301,用于利用入口函数接收来自客户端的服务请求,并根据所述服务请求,触发计算函数,其中,服务请求包括待计算的至少一个目标分子;The receiving module 301 is configured to use an entry function to receive a service request from a client, and trigger a calculation function according to the service request, wherein the service request includes at least one target molecule to be calculated;
执行模块302,用于利用计算函数执行预设操作对至少一个目标分子进行性质计算,得到计算结果,其中,计算结果包含每个目标分子的性质;Executing module 302, configured to use a calculation function to perform a preset operation to perform property calculation on at least one target molecule to obtain a calculation result, wherein the calculation result includes the property of each target molecule;
返回模块303,用于利用出口函数向客户端返回计算结果。The return module 303 is used to return the calculation result to the client by using the exit function.
关于上述实施例中的装置,其中各个模块执行操作的具体方式已经在有关该方法的实施例中进行了详细描述,此处将不再做详细阐述说明。Regarding the apparatus in the above embodiments, the specific manner in which each module executes operations has been described in detail in the embodiments related to the method, and will not be described in detail here.
从图3示例的装置可知,由于入口函数和计算函数是以无服务器部署的函数,因此,通过对入口函数和计算函数的触发最终获得目标分子的性质的计算结果,对用户而言,不仅可以有效地实现按量计费、按需伸缩能力,节省闲时成本并确保繁忙期的可用性,而且计算函数通常可以镜像部 署,这意味着可以简化相应软件的发布流程以及缩短计算目标分子的性质所花费的时间。It can be seen from the device shown in Figure 3 that since the entry function and the calculation function are functions deployed without a server, the calculation result of the properties of the target molecule can be finally obtained by triggering the entry function and the calculation function. For the user, not only can Effectively realize pay-as-you-go, on-demand scalability, save idle time costs and ensure availability during busy periods, and calculation functions can usually be deployed in mirror images, which means that the release process of corresponding software can be simplified and the time required for calculating the properties of target molecules can be shortened. time spent.
可选地,图3示例的接收模块301可包括生成单元和触发单元,执行模块302可以包括第一计算单元,其中:Optionally, the receiving module 301 illustrated in FIG. 3 may include a generating unit and a triggering unit, and the executing module 302 may include a first computing unit, wherein:
生成单元,用于利用入口函数生成针对服务请求的对应关系并保存,对应关系包括服务请求的ID、至少一个目标分子与分子待计算性质的映射;The generation unit is used to generate and save the corresponding relationship for the service request by using the entry function, and the corresponding relationship includes the ID of the service request, the mapping between at least one target molecule and the properties of the molecule to be calculated;
触发单元,用于通过入口函数发布请求计算事件,触发计算函数,其中,请求计算事件携带有服务请求的ID;A trigger unit, configured to issue a request calculation event through an entry function, and trigger a calculation function, wherein the request calculation event carries the ID of the service request;
第一计算单元,用于利用计算函数根据服务请求的ID从对应关系中获得至少一个目标分子和分子待计算性质,并执行与分子待计算性质相对应的预设操作对至少一个目标分子进行性质计算,得到计算结果。The first calculation unit is used to obtain at least one target molecule and the property to be calculated of the molecule from the corresponding relationship according to the ID of the service request by using a calculation function, and perform a preset operation corresponding to the property to be calculated of the molecule to perform properties on the at least one target molecule Calculate and get the calculation result.
可选地,上述服务请求还可以包括服务请求的ID和分子待计算性质,生成单元可以包括第一建立单元,用于利用入口函数解析服务请求,获得服务请求的ID、至少一个目标分子和分子待计算性质,并建立以服务请求的ID为索引、以至少一个目标分子和分子待计算属性为索引值的对应关系后保存于存储系统。Optionally, the above-mentioned service request may also include the ID of the service request and the property of the molecule to be calculated, and the generation unit may include a first establishment unit, which is used to analyze the service request by using the entry function, and obtain the ID of the service request, at least one target molecule and the molecule The property to be calculated is established and stored in the storage system after establishing a corresponding relationship with the ID of the service request as an index and at least one target molecule and the property to be calculated of the molecule as an index value.
可选地,上述生成单元可以包括第二建立单元,用于利用入口函数解析服务请求,获得至少一个目标分子,生成服务请求的ID以及针对至少一个目标分子的分子待计算性质,并建立以入口函数生成的服务请求的ID为索引、以至少一个目标分子和入口函数生成的分子待计算性质为索引值的对应关系后保存于存储系统。Optionally, the above-mentioned generation unit may include a second establishment unit, which is used to analyze the service request by using the entry function, obtain at least one target molecule, generate the ID of the service request and the molecular property to be calculated for the at least one target molecule, and establish the entry The ID of the service request generated by the function is used as an index, and the corresponding relationship between at least one target molecule and the property to be calculated of the molecule generated by the entry function is used as an index value, and then stored in the storage system.
可选地,上述服务请求可以还包括服务请求的ID,生成单元可以包括第三建立单元,用于利用入口函数解析服务请求,获得服务请求的ID和至少一个目标分子,生成针对至少一个目标分子的分子待计算性质,并建立以服务请求的ID为索引、以至少一个目标分子和入口函数生成的分子待计算性质为索引值的对应关系后保存于存储系统。Optionally, the above-mentioned service request may further include an ID of the service request, and the generation unit may include a third establishment unit, configured to use an entry function to parse the service request, obtain the ID of the service request and at least one target molecule, and generate an ID for at least one target molecule The property to be calculated of the molecule of , and establishes the corresponding relationship with the ID of the service request as the index, at least one target molecule and the property to be calculated of the molecule generated by the entry function as the index value, and then saves it in the storage system.
可选地,上述服务请求还可以包括分子待计算性质,生成单元可以包括第四建立单元,用于利用入口函数解析服务请求,获得至少一个目标分子和分子待计算性质,生成服务请求的ID,并建立以入口函数生成的服务请求的ID为索引、以至少一个目标分子和分子待计算属性为索引值的对 应关系后保存于存储系统。Optionally, the above-mentioned service request may also include properties of molecules to be calculated, and the generation unit may include a fourth establishment unit, configured to use an entry function to analyze the service request, obtain at least one target molecule and properties to be calculated of molecules, and generate an ID of the service request, And establish a corresponding relationship with the ID of the service request generated by the entry function as the index, and at least one target molecule and the attribute to be calculated of the molecule as the index value, and then save it in the storage system.
可选地,图3示例的装置还可以包括保存模块,用于执行模块302利用计算函数执行预设操作对至少一个目标分子进行性质计算,得到计算结果之后,将计算结果保存在对应关系中,以更新对应关系。Optionally, the device illustrated in FIG. 3 may also include a saving module, which is used for the execution module 302 to use the calculation function to perform preset operations to perform property calculations on at least one target molecule, and after obtaining the calculation results, save the calculation results in the corresponding relationship, to update the correspondence.
可选地,返回模块303可以包括查询请求接收单元和读取单元,其中:Optionally, the returning module 303 may include a query request receiving unit and a reading unit, wherein:
查询请求接收单元,用于利用出口函数接收来自客户端的查询请求,查询请求包含服务请求的ID;The query request receiving unit is used to receive the query request from the client by using the exit function, and the query request includes the ID of the service request;
读取单元,用于利用出口函数并根据服务请求的ID,读取与服务请求的ID相对应的计算结果后向客户端返回计算结果。The reading unit is configured to use the exit function and according to the ID of the service request, read the calculation result corresponding to the ID of the service request and return the calculation result to the client.
可选地,上述服务请求还可以包括回调接口的地址,图3示例的装置还可以包括触发模块,返回模块303可以包括调用单元,其中:Optionally, the above-mentioned service request may also include the address of the callback interface, the device illustrated in FIG. 3 may also include a trigger module, and the return module 303 may include a calling unit, wherein:
触发模块,用于返回模块303利用出口函数向客户端返回计算结果之前,通过计算函数发布完成计算事件,触发出口函数,完成计算事件携带有服务请求的ID;The trigger module is used for returning module 303 to use the exit function to return the calculation result to the client before issuing the calculation completion event through the calculation function, triggering the exit function, and the completion calculation event carrying the ID of the service request;
调用单元,用于利用出口函数读取与服务请求的ID相对应的计算结果,并根据回调接口的地址调用回调接口以向客户端返回计算结果。The calling unit is used to use the exit function to read the calculation result corresponding to the ID of the service request, and call the callback interface according to the address of the callback interface to return the calculation result to the client.
可选地,上述计算函数通过容器镜像或代码存档部署,入口函数或出口函数以轻量级方式或代码存档部署。Optionally, the above computing functions are deployed through container images or code archives, and entry functions or exit functions are deployed in a lightweight manner or code archives.
参见图4,是本申请实施例示出的电子设备的结构示意图。该电子设备400包括存储器410和处理器420。Referring to FIG. 4 , it is a schematic structural diagram of an electronic device shown in an embodiment of the present application. The electronic device 400 includes a memory 410 and a processor 420 .
处理器420可以是中央处理单元(Central Processing Unit,CPU),还可以是其他通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。The processor 420 can be a central processing unit (Central Processing Unit, CPU), and can also be other general-purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), on-site Field-Programmable Gate Array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor, or the processor may be any conventional processor, or the like.
存储器410可以包括各种类型的存储单元,例如系统内存、只读存储器(ROM),和永久存储装置。其中,ROM可以存储处理器420或者计算机的其他模块需要的静态数据或者指令。永久存储装置可以是可读写的存储装置。永久存储装置可以是即使计算机断电后也不会失去存储的指令 和数据的非易失性存储设备。在一些实施方式中,永久性存储装置采用大容量存储装置(例如磁或光盘、闪存)作为永久存储装置。另外一些实施方式中,永久性存储装置可以是可移除的存储设备(例如软盘、光驱)。系统内存可以是可读写存储设备或者易失性可读写存储设备,例如动态随机访问内存。系统内存可以存储一些或者所有处理器在运行时需要的指令和数据。此外,存储器410可以包括任意计算机可读存储媒介的组合,包括各种类型的半导体存储芯片(DRAM,SRAM,SDRAM,闪存,可编程只读存储器),磁盘和/或光盘也可以采用。在一些实施方式中,存储器410可以包括可读和/或写的可移除的存储设备,例如激光唱片(CD)、只读数字多功能光盘(例如DVD-ROM,双层DVD-ROM)、只读蓝光光盘、超密度光盘、闪存卡(例如SD卡、min SD卡、Micro-SD卡等等)、磁性软盘等等。计算机可读存储媒介不包含载波和通过无线或有线传输的瞬间电子信号。The memory 410 may include various types of storage units, such as system memory, read only memory (ROM), and persistent storage. Wherein, the ROM can store static data or instructions required by the processor 420 or other modules of the computer. The persistent storage device may be a readable and writable storage device. Persistent storage may be a non-volatile storage device that does not lose stored instructions and data even if the computer is powered off. In some embodiments, the permanent storage device adopts a mass storage device (such as a magnetic or optical disk, flash memory) as the permanent storage device. In some other implementations, the permanent storage device may be a removable storage device (such as a floppy disk, an optical drive). The system memory can be a readable and writable storage device or a volatile readable and writable storage device, such as dynamic random access memory. System memory can store some or all of the instructions and data that the processor needs at runtime. In addition, memory 410 may include any combination of computer-readable storage media, including various types of semiconductor memory chips (DRAM, SRAM, SDRAM, flash memory, programmable read-only memory), and magnetic and/or optical disks may also be used. In some embodiments, memory 410 may include a readable and/or writable removable storage device, such as a compact disc (CD), a read-only digital versatile disc (e.g., DVD-ROM, dual-layer DVD-ROM), Read-Only Blu-ray Disc, Super Density Disc, Flash memory card (such as SD card, min SD card, Micro-SD card, etc.), magnetic floppy disk, etc. Computer-readable storage media do not contain carrier waves and transient electronic signals transmitted by wireless or wire.
存储器410上存储有可执行代码,当可执行代码被处理器420处理时,可以使处理器420执行上文述及的方法中的部分或全部。Executable codes are stored in the memory 410 , and when the executable codes are processed by the processor 420 , the processor 420 can be made to execute part or all of the methods mentioned above.
此外,根据本申请的方法还可以实现为一种计算机程序或计算机程序产品,该计算机程序或计算机程序产品包括用于执行本申请的上述方法中部分或全部步骤的计算机程序代码指令。In addition, the method according to the present application can also be implemented as a computer program or computer program product, the computer program or computer program product including computer program code instructions for executing some or all of the steps in the above method of the present application.
或者,本申请还可以实施为一种存储介质,包括非暂时性机器可读存储介质、计算机可读存储介质或机器可读存储介质,其上存储有可执行代码(或计算机程序、或计算机指令代码),当可执行代码(或计算机程序、或计算机指令代码)被电子设备(或电子设备、服务器等)的处理器执行时,使处理器执行根据本申请的上述方法的各个步骤的部分或全部。Alternatively, the present application may also be implemented as a storage medium, including a non-transitory machine-readable storage medium, a computer-readable storage medium, or a machine-readable storage medium, on which executable code (or computer program, or computer instruction) is stored. code), when the executable code (or computer program, or computer instruction code) is executed by the processor of the electronic device (or electronic device, server, etc.), causing the processor to perform part or part of each step of the above-mentioned method according to the present application all.
以上已经描述了本申请的各实施例,上述说明是示例性的,并非穷尽性的,并且也不限于所披露的各实施例。在不偏离所说明的各实施例的范围和精神的情况下,对于本技术领域的普通技术人员来说许多修改和变更都是显而易见的。本文中所用术语的选择,旨在最好地解释各实施例的原理、实际应用或对市场中的技术的改进,或者使本技术领域的其它普通技术人员能理解本文披露的各实施例。Having described various embodiments of the present application above, the foregoing description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and alterations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is chosen to best explain the principle of each embodiment, practical application or improvement of technology in the market, or to enable other ordinary skilled in the art to understand each embodiment disclosed herein.

Claims (22)

  1. 一种获取分子性质的方法,其特征在于,所述方法包括:A method for obtaining molecular properties, characterized in that the method comprises:
    利用入口函数接收来自客户端的服务请求,并根据所述服务请求,触发计算函数;其中,所述服务请求包括待计算的至少一个目标分子;Using an entry function to receive a service request from a client, and trigger a calculation function according to the service request; wherein the service request includes at least one target molecule to be calculated;
    利用所述计算函数执行预设操作对所述至少一个目标分子进行性质计算,得到计算结果,所述计算结果包含每个所述目标分子的性质;Using the calculation function to perform a preset operation to perform property calculation on the at least one target molecule to obtain a calculation result, the calculation result including the property of each target molecule;
    利用出口函数向所述客户端返回所述计算结果。The calculation result is returned to the client by using an exit function.
  2. 根据权利要求1所述的获取分子性质的方法,其特征在于,所述根据所述服务请求,触发计算函数,包括:The method for obtaining molecular properties according to claim 1, wherein the triggering calculation function according to the service request includes:
    利用所述入口函数生成针对所述服务请求的对应关系并保存,所述对应关系包括所述服务请求的ID、所述至少一个目标分子与分子待计算性质的映射;Using the entry function to generate and save a corresponding relationship for the service request, the corresponding relationship includes the ID of the service request, the mapping between the at least one target molecule and the property to be calculated of the molecule;
    通过所述入口函数发布请求计算事件,触发所述计算函数,其中,所述请求计算事件携带有所述服务请求的ID;Publishing a request calculation event through the entry function to trigger the calculation function, wherein the request calculation event carries the ID of the service request;
    所述利用所述计算函数执行预设操作对所述至少一个目标分子进行性质计算,得到计算结果,包括:利用所述计算函数根据所述服务请求的ID从所述对应关系中获得所述至少一个目标分子和所述分子待计算性质,并执行与所述分子待计算性质相对应的预设操作对所述至少一个目标分子进行性质计算,得到计算结果。Using the calculation function to execute a preset operation to perform property calculation on the at least one target molecule to obtain a calculation result includes: using the calculation function to obtain the at least one target molecule from the corresponding relationship according to the ID of the service request. A target molecule and the property to be calculated of the molecule, and performing a preset operation corresponding to the property to be calculated of the molecule to calculate the property of the at least one target molecule to obtain a calculation result.
  3. 根据权利要求2所述的获取分子性质的方法,其特征在于,所述服务请求还包括所述服务请求的ID和所述分子待计算性质,所述利用所述入口函数生成针对所述服务请求的对应关系并保存,包括:The method for obtaining molecular properties according to claim 2, wherein the service request further includes the ID of the service request and the property to be calculated of the molecule, and the use of the entry function to generate Correspondence and save, including:
    利用所述入口函数解析所述服务请求,获得所述服务请求的ID、所述至少一个目标分子和所述分子待计算性质,并建立以所述服务请求的ID为索引、以所述至少一个目标分子和所述分子待计算属性为索引值的对应关系后保存于存储系统。Use the entry function to parse the service request, obtain the ID of the service request, the at least one target molecule, and the property to be calculated of the molecule, and establish an index based on the ID of the service request and the at least one The target molecule and said molecule are saved in the storage system after calculating the corresponding relationship whose attribute is the index value.
  4. 根据权利要求2所述的获取分子性质的方法,其特征在于,所述利用所述入口函数生成针对所述服务请求的对应关系并保存,包括:The method for obtaining molecular properties according to claim 2, wherein said using said entry function to generate and save a corresponding relationship for said service request includes:
    利用所述入口函数解析所述服务请求,获得所述至少一个目标分子,生成所述服务请求的ID以及针对所述至少一个目标分子的分子待计算性 质,并建立以所述入口函数生成的所述服务请求的ID为索引、以所述至少一个目标分子和所述入口函数生成的所述分子待计算性质为索引值的对应关系后保存于存储系统。Utilize the entry function to parse the service request, obtain the at least one target molecule, generate the ID of the service request and the property to be calculated for the molecule of the at least one target molecule, and establish all the information generated by the entry function The ID of the service request is used as an index, and the corresponding relationship between the at least one target molecule and the property to be calculated of the molecule generated by the entry function is used as an index value, and then stored in the storage system.
  5. 根据权利要求2所述的获取分子性质的方法,其特征在于,所述服务请求还包括所述服务请求的ID,所述利用所述入口函数生成针对所述服务请求的对应关系并保存,包括:The method for obtaining molecular properties according to claim 2, wherein the service request further includes the ID of the service request, and the use of the entry function to generate and save the corresponding relationship for the service request includes :
    利用所述入口函数解析所述服务请求,获得所述服务请求的ID和所述至少一个目标分子,生成针对所述至少一个目标分子的分子待计算性质,并建立以所述服务请求的ID为索引、以所述至少一个目标分子和所述入口函数生成的所述分子待计算性质为索引值的对应关系后保存于存储系统。Use the entry function to parse the service request, obtain the ID of the service request and the at least one target molecule, generate the property to be calculated for the molecule of the at least one target molecule, and establish the ID of the service request as The index and the property to be calculated of the molecule generated by the at least one target molecule and the entry function are stored in the storage system as the corresponding relationship of the index value.
  6. 根据权利要求2所述的获取分子性质的方法,其特征在于,所述服务请求还包括所述分子待计算性质,所述利用所述入口函数生成针对所述服务请求的对应关系并保存,包括:The method for obtaining molecular properties according to claim 2, wherein the service request further includes the property to be calculated of the molecule, and the use of the entry function to generate and save the corresponding relationship for the service request includes :
    利用所述入口函数解析所述服务请求,获得所述至少一个目标分子和所述分子待计算性质,生成所述服务请求的ID,并建立以所述入口函数生成的所述服务请求的ID为索引、以所述至少一个目标分子和所述分子待计算属性为索引值的对应关系后保存于存储系统。Utilize the entry function to parse the service request, obtain the at least one target molecule and the properties of the molecule to be calculated, generate the ID of the service request, and establish the ID of the service request generated by the entry function as The index and the corresponding relationship between the at least one target molecule and the property to be calculated of the molecule are stored in the storage system as index values.
  7. 根据权利要求2所述的获取分子性质的方法,其特征在于,所述利用所述计算函数执行预设操作对所述至少一个目标分子进行性质计算,得到计算结果之后,所述方法还包括:The method for obtaining molecular properties according to claim 2, wherein the calculation function is used to perform preset operations to calculate the properties of the at least one target molecule, and after obtaining the calculation results, the method further includes:
    将所述计算结果保存在所述对应关系中,以更新所述对应关系。saving the calculation result in the corresponding relationship to update the corresponding relationship.
  8. 根据权利要求1-7任一项所述的获取分子性质的方法,其特征在于,所述利用出口函数向所述客户端返回所述计算结果,包括:The method for obtaining molecular properties according to any one of claims 1-7, wherein the use of an export function to return the calculation result to the client includes:
    利用出口函数接收来自所述客户端的查询请求,所述查询请求包含所述服务请求的ID;using an exit function to receive a query request from the client, where the query request includes the ID of the service request;
    利用所述出口函数并根据所述服务请求的ID,读取与所述服务请求的ID相对应的计算结果后向所述客户端返回所述计算结果。Using the exit function and according to the ID of the service request, read the calculation result corresponding to the ID of the service request and return the calculation result to the client.
  9. 根据权利要求1-7任一项所述的获取分子性质的方法,其特征在于,所述服务请求还包括回调接口的地址,所述利用出口函数向所述客户 端返回所述计算结果之前,所述方法还包括:The method for obtaining molecular properties according to any one of claims 1-7, wherein the service request further includes the address of the callback interface, and before returning the calculation result to the client using the exit function, The method also includes:
    通过所述计算函数发布完成计算事件,触发出口函数,所述完成计算事件携带有所述服务请求的ID;Publishing a calculation completion event through the calculation function, triggering an exit function, the completion calculation event carrying the ID of the service request;
    所述利用出口函数向所述客户端返回所述计算结果,包括:The use of the exit function to return the calculation result to the client includes:
    利用所述出口函数读取与所述服务请求的ID相对应的计算结果,并根据所述回调接口的地址调用所述回调接口以向所述客户端返回所述计算结果。Using the exit function to read the calculation result corresponding to the ID of the service request, and calling the callback interface according to the address of the callback interface to return the calculation result to the client.
  10. 根据权利要求1-7任一项所述的获取分子性质的方法,其特征在于,所述计算函数通过容器镜像或代码存档部署;所述入口函数或出口函数以轻量级方式或代码存档部署。The method for obtaining molecular properties according to any one of claims 1-7, wherein the calculation function is deployed through a container image or a code archive; the entry function or exit function is deployed in a lightweight manner or a code archive .
  11. 一种获取分子性质的装置,其特征在于,所述装置包括:A device for obtaining molecular properties, characterized in that the device comprises:
    接收模块,用于利用入口函数接收来自客户端的服务请求,并根据所述服务请求,触发计算函数,所述服务请求包括待计算的至少一个目标分子;A receiving module, configured to use an entry function to receive a service request from a client, and trigger a calculation function according to the service request, the service request including at least one target molecule to be calculated;
    执行模块,用于利用所述计算函数执行预设操作对所述至少一个目标分子进行性质计算,得到计算结果,所述计算结果包含每个所述目标分子的性质;An execution module, configured to use the calculation function to perform a preset operation to perform property calculation on the at least one target molecule to obtain a calculation result, the calculation result including the property of each target molecule;
    返回模块,利用出口函数向所述客户端返回所述计算结果。The return module returns the calculation result to the client by using an exit function.
  12. 根据权利要求11所述的获取分子性质的装置,其特征在于,所述接收模块包括生成单元和触发单元,所述执行模块包括第一计算单元;The device for obtaining molecular properties according to claim 11, wherein the receiving module includes a generating unit and a triggering unit, and the executing module includes a first computing unit;
    所述生成单元,用于利用所述入口函数生成针对所述服务请求的对应关系并保存,所述对应关系包括所述服务请求的ID、所述至少一个目标分子与分子待计算性质的映射;The generating unit is configured to use the entry function to generate and save a corresponding relationship for the service request, the corresponding relationship includes the ID of the service request, the mapping between the at least one target molecule and the properties of the molecule to be calculated;
    所述触发单元,用于通过所述入口函数发布请求计算事件,触发计算函数,所述请求计算事件携带有所述服务请求的ID;The triggering unit is configured to issue a computing request event through the entry function to trigger a computing function, and the computing request event carries the ID of the service request;
    所述第一计算单元,用于利用所述计算函数根据所述服务请求的ID从对应关系中获得所述至少一个目标分子和所述分子待计算性质,并执行与所述分子待计算性质相对应的预设操作对所述至少一个目标分子进行性质计算,得到所述计算结果。The first calculation unit is configured to use the calculation function to obtain the at least one target molecule and the property to be calculated of the molecule from the corresponding relationship according to the ID of the service request, and perform the corresponding calculation with the property to be calculated of the molecule. The corresponding preset operation performs property calculation on the at least one target molecule to obtain the calculation result.
  13. 根据权利要求12所述的获取分子性质的装置,其特征在于,所 述服务请求还包括所述服务请求的ID和分子待计算性质,所述生成单元包括第一建立单元,用于利用所述入口函数解析服务请求,获得所述服务请求的ID、所述至少一个目标分子和所述分子待计算性质,并建立以所述服务请求的ID为索引、以所述至少一个目标分子和所述分子待计算属性为索引值的对应关系后保存于存储系统。The device for obtaining molecular properties according to claim 12, wherein the service request further includes the ID of the service request and the property to be calculated of the molecule, and the generating unit includes a first establishing unit for using the The entry function parses the service request, obtains the ID of the service request, the at least one target molecule, and the property to be calculated of the molecule, and establishes the ID of the service request as an index, the at least one target molecule and the The molecule is saved in the storage system after calculating the corresponding relationship between the attribute and the index value.
  14. 根据权利要求12所述的获取分子性质的装置,其特征在于,所述生成单元包括第二建立单元,用于利用所述入口函数解析所述服务请求,获得所述至少一个目标分子,生成所述服务请求的ID以及针对所述至少一个目标分子的分子待计算性质,并建立以所述入口函数生成的所述服务请求的ID为索引、以所述至少一个目标分子和所述入口函数生成的分子待计算性质为索引值的对应关系后保存于存储系统。The device for obtaining molecular properties according to claim 12, wherein the generating unit includes a second establishing unit, configured to use the entry function to analyze the service request, obtain the at least one target molecule, and generate the The ID of the service request and the molecular property to be calculated for the at least one target molecule, and establish the ID of the service request generated by the entry function as an index, and use the at least one target molecule and the entry function to generate The molecule of is saved in the storage system after calculating the corresponding relationship of the index value.
  15. 根据权利要求12所述的获取分子性质的装置,其特征在于,所述服务请求还包括服务请求的ID,生成单元可以包括第三建立单元,用于利用入口函数解析服务请求,获得服务请求的ID和至少一个目标分子,生成针对至少一个目标分子的分子待计算性质,并建立以服务请求的ID为索引、以至少一个目标分子和入口函数生成的分子待计算性质为索引值的对应关系后保存于存储系统。The device for obtaining molecular properties according to claim 12, wherein the service request further includes an ID of the service request, and the generation unit may include a third establishment unit, which is used to analyze the service request by using an entry function, and obtain the ID of the service request. ID and at least one target molecule, generate the molecular property to be calculated for at least one target molecule, and establish a corresponding relationship with the ID of the service request as the index and at least one target molecule and the molecular property to be calculated generated by the entry function as the index value stored in the storage system.
  16. 根据权利要求12所述的获取分子性质的装置,其特征在于,所述服务请求还包括分子待计算性质,所述生成单元包括第四建立单元,用于利用所述入口函数解析服务请求,获得所述至少一个目标分子和分子待计算性质,生成所述服务请求的ID,并建立以所述入口函数生成的所述服务请求的ID为索引、以所述至少一个目标分子和所述分子待计算属性为索引值的对应关系后保存于存储系统。The device for obtaining molecular properties according to claim 12, wherein the service request further includes the property to be calculated of the molecule, and the generation unit includes a fourth establishment unit, which is used to analyze the service request by using the entry function to obtain The at least one target molecule and the property to be calculated of the molecule generate the ID of the service request, and establish the ID of the service request generated by the entry function as an index, and use the at least one target molecule and the molecule to be calculated Calculate the correspondence between attributes and index values and save them in the storage system.
  17. 根据权利要求11所述的获取分子性质的装置,其特征在于,所述装置还包括保存模块,用于所述执行模块利用所述计算函数执行所述预设操作对所述至少一个目标分子进行性质计算,得到所述计算结果之后,将所述计算结果保存在对应关系中,以更新对应关系。The device for obtaining molecular properties according to claim 11, characterized in that the device further comprises a saving module, which is used for the execution module to use the calculation function to perform the preset operation on the at least one target molecule For property calculation, after the calculation result is obtained, the calculation result is stored in the corresponding relationship, so as to update the corresponding relationship.
  18. 根据权利要求11至17任意一项所述的获取分子性质的装置,其特征在于,所述返回模块包括:The device for obtaining molecular properties according to any one of claims 11 to 17, wherein the return module comprises:
    查询请求接收单元,用于利用所述出口函数接收来自客户端的查询请 求,查询请求包含服务请求的ID;Query request receiving unit, for utilizing described exit function to receive the query request from client, query request comprises the ID of service request;
    读取单元,用于利用所述出口函数并根据服务请求的ID,读取与所述服务请求的ID相对应的计算结果后向客户端返回计算结果。The reading unit is configured to use the exit function and according to the ID of the service request, read the calculation result corresponding to the ID of the service request and return the calculation result to the client.
  19. 根据权利要求11至17任意一项所述的获取分子性质的装置,其特征在于,所述服务请求还包括回调接口的地址,所述装置还包括触发模块,所述返回模块包括调用单元;The device for obtaining molecular properties according to any one of claims 11 to 17, wherein the service request also includes an address of a callback interface, the device also includes a trigger module, and the return module includes a calling unit;
    所述触发模块,用于所述返回模块利用所述出口函数向所述客户端返回所述计算结果之前,通过所述计算函数发布完成计算事件,触发所述出口函数,所述完成计算事件携带有服务请求的ID;The trigger module is used for the return module to use the exit function to return the calculation result to the client, issue a calculation completion event through the calculation function, trigger the exit function, and the completion calculation event carries has the ID of the service request;
    所述调用单元,用于利用所述出口函数读取与所述服务请求的ID相对应的计算结果,并根据回调接口的地址调用所述回调接口以向所述客户端返回所述计算结果。The calling unit is configured to use the exit function to read the calculation result corresponding to the ID of the service request, and call the callback interface according to the address of the callback interface to return the calculation result to the client.
  20. 根据权利要求11至17任意一项所述的获取分子性质的装置,其特征在于,所述计算函数通过容器镜像或代码存档部署,所述入口函数或出口函数以轻量级方式或代码存档部署。The device for obtaining molecular properties according to any one of claims 11 to 17, wherein the calculation function is deployed through a container image or a code archive, and the entry function or exit function is deployed in a lightweight manner or a code archive .
  21. 一种电子设备,其特征在于,包括:An electronic device, characterized in that it comprises:
    处理器;以及processor; and
    存储器,其上存储有可执行代码,当所述可执行代码被所述处理器执行时,使所述处理器执行如权利要求1至10中任一项所述的方法。A memory on which executable codes are stored, which, when executed by the processor, cause the processor to execute the method according to any one of claims 1 to 10.
  22. 一种存储介质,其上存储有可执行代码,当所述可执行代码被电子设备的处理器执行时,使所述处理器执行如权利要求1至10中任一项所述的方法。A storage medium, on which executable codes are stored, and when the executable codes are executed by a processor of an electronic device, the processor is made to execute the method according to any one of claims 1 to 10.
PCT/CN2021/142380 2021-12-29 2021-12-29 Method and apparatus for acquiring molecular properties, and storage medium WO2023123022A1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/CN2021/142380 WO2023123022A1 (en) 2021-12-29 2021-12-29 Method and apparatus for acquiring molecular properties, and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2021/142380 WO2023123022A1 (en) 2021-12-29 2021-12-29 Method and apparatus for acquiring molecular properties, and storage medium

Publications (1)

Publication Number Publication Date
WO2023123022A1 true WO2023123022A1 (en) 2023-07-06

Family

ID=86996814

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/142380 WO2023123022A1 (en) 2021-12-29 2021-12-29 Method and apparatus for acquiring molecular properties, and storage medium

Country Status (1)

Country Link
WO (1) WO2023123022A1 (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030220910A1 (en) * 2002-05-22 2003-11-27 Robert Kincaid Biotechnology information naming system
CN113196238A (en) * 2018-11-05 2021-07-30 三星电子株式会社 Service-aware serverless cloud computing system
CN113611376A (en) * 2021-07-01 2021-11-05 苏州创腾软件有限公司 Method and device for constructing molecular structure, computer equipment and storage medium
CN113704004A (en) * 2021-08-30 2021-11-26 北京百度网讯科技有限公司 Notification service implementation method, device, equipment and storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030220910A1 (en) * 2002-05-22 2003-11-27 Robert Kincaid Biotechnology information naming system
CN113196238A (en) * 2018-11-05 2021-07-30 三星电子株式会社 Service-aware serverless cloud computing system
CN113611376A (en) * 2021-07-01 2021-11-05 苏州创腾软件有限公司 Method and device for constructing molecular structure, computer equipment and storage medium
CN113704004A (en) * 2021-08-30 2021-11-26 北京百度网讯科技有限公司 Notification service implementation method, device, equipment and storage medium

Similar Documents

Publication Publication Date Title
US10664331B2 (en) Generating an application programming interface
US9420034B2 (en) Providing services to multiple tenants of an application
US20230057335A1 (en) Deployment of self-contained decision logic
CN106354481B (en) Method and equipment for uniformly mapping HTTP (hyper text transport protocol) request
US9401835B2 (en) Data integration on retargetable engines in a networked environment
WO2022062304A1 (en) Method and device for deploying image recognition service on container cloud
JP2017514218A (en) Running third-party applications
US10891282B1 (en) Mutations with immediate feedback
WO2020063851A1 (en) Method and device for searching for hosting program
US11106641B2 (en) Supporting graph database backed object unmarshalling
US10891569B1 (en) Dynamic task discovery for workflow tasks
CN111698205B (en) Service calling method and related equipment
US11347808B1 (en) Dynamically-adaptive bloom-filter
US11159634B1 (en) Subscription fan out
US11362997B2 (en) Real-time policy rule evaluation with multistage processing
US11126610B1 (en) Conflict resolution in a data proxy
US11089133B1 (en) Synchronizing data with delayed subscriptions
US10776180B1 (en) Expression-based feature toggle in an application programming interface (API)
WO2020135212A1 (en) Method and device for searching for hosting program
CN113722114A (en) Data service processing method and device, computing equipment and storage medium
US11023527B2 (en) Using observable data object to unmarshal graph data
US9473561B2 (en) Data transmission for transaction processing in a networked environment
US11681709B2 (en) Joining remote tables by a federated server
WO2023123022A1 (en) Method and apparatus for acquiring molecular properties, and storage medium
US11093477B1 (en) Multiple source database system consolidation

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: 21969397

Country of ref document: EP

Kind code of ref document: A1