WO2019085474A1 - Calculation engine implementing method, electronic device, and storage medium - Google Patents

Calculation engine implementing method, electronic device, and storage medium Download PDF

Info

Publication number
WO2019085474A1
WO2019085474A1 PCT/CN2018/089884 CN2018089884W WO2019085474A1 WO 2019085474 A1 WO2019085474 A1 WO 2019085474A1 CN 2018089884 W CN2018089884 W CN 2018089884W WO 2019085474 A1 WO2019085474 A1 WO 2019085474A1
Authority
WO
WIPO (PCT)
Prior art keywords
operator
library
take
target
redis
Prior art date
Application number
PCT/CN2018/089884
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 平安科技(深圳)有限公司
Publication of WO2019085474A1 publication Critical patent/WO2019085474A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/31Programming languages or programming paradigms
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/34Addressing or accessing the instruction operand or the result ; Formation of operand address; Addressing modes

Definitions

  • the present application relates to the field of computer technologies, and in particular, to a computing engine implementation method, an electronic device, and a storage medium.
  • the existing calculation engine can be used to implement various functions, such as keyword search function of massive data, knowledge encyclopedia function, information prediction function, and the like.
  • the calculation function of a single calculation engine is relatively simple.
  • the present application provides a computing engine implementation method, the method comprising: determining a step of: determining each operator that constitutes a target algorithm chain; and generating a step: determining each operator according to the determined The operator combination rule of the target algorithm chain generates a corresponding algorithm number; and the storing step: storing the algorithm number in the database.
  • the present application further provides an electronic device including a memory and a processor, wherein the memory includes a calculation engine implementation program, and the calculation engine implementation program implements the following steps when executed by the processor:
  • Determining step determining each operator that constitutes the target algorithm chain; generating step: generating a corresponding algorithm number according to each operator determined and the operator combination rule of the set target algorithm chain; storing step: The algorithm number is stored in the database.
  • the present application further provides a computer readable storage medium including a calculation engine implementation program, which implements the calculation as described above when the program is executed by the processor Any step of the engine implementation method.
  • the calculation engine implementation method, the electronic device and the computer readable storage medium proposed by the present application use the algorithm chain and the operator as the implementation framework when developing and maintaining the calculation engine, and the algorithm chain corresponding to each calculation function is flexibly implemented in the form of an operator.
  • the operators are connected in a loosely coupled manner, and only the information transfer format and content between the operators are specified, without interfering with the specific implementation methods of the respective operators.
  • Using this method to implement the calculation function in the new calculation engine can make the development process of the calculation engine more flexible. It only needs to configure the algorithm chain according to the existing operator, or develop a new operator when necessary.
  • the new features of the Compute Engine are widely versatile and scalable, without the need for additional system code and database development.
  • FIG. 1 is a schematic diagram of an operating environment of a preferred embodiment of a computing engine.
  • FIG. 2 is a schematic diagram of an operating environment of a preferred embodiment of an electronic device provided by the present application.
  • FIG. 3 is a block diagram of a program of the calculation engine implementation program of FIG. 2.
  • FIG. 4 is a flow chart of a preferred embodiment of a computing engine implementation method of the present application.
  • embodiments of the present application can be implemented as a method, apparatus, device, system, or computer program product. Accordingly, the application can be embodied in a complete hardware, complete software (including firmware, resident software, microcode, etc.), or a combination of hardware and software.
  • a computing engine implementation method an electronic device, and a storage medium are provided.
  • FIG. 1 it is a schematic diagram of an operating environment of the preferred embodiment of the computing engine.
  • the computing engine is installed in the server 100 to provide users with various computing functions, such as disease prediction, similar case query, related word query, and the like.
  • the various computing functions described in the calculation engine are each implemented by a corresponding algorithm chain.
  • the user sends a usage request of a certain computing function to the server 100 through the client 200.
  • the calculation engine acquires a corresponding algorithm chain and executes a program corresponding to the algorithm chain, thereby implementing the computing function.
  • the calculation result is obtained from the database 300, and the calculation result is returned to the client 200.
  • the database 300 can include, for example, a local memory cache, a Redis database, or a PostgreSQL (PG) database.
  • the server 100 can also be in communication with the electronic device 1, and the electronic device 1 can also access the database 300.
  • the developer of the calculation engine can develop the calculation engine through the electronic device 1 and set the developed calculation engine to be executed in the server 100.
  • FIG. 2 is a structural block diagram of a preferred embodiment of an electronic device of the present application.
  • the electronic device 1 may be a terminal device having a storage and computing function, such as a portable computer or a desktop computer.
  • the electronic device 1 includes a memory 11, a processor 12, a network interface 13, and a communication bus 14.
  • the network interface 13 can optionally include a standard wired interface and a wireless interface (such as a WI-FI interface).
  • the communication bus 14 is used to implement connection communication between the above components.
  • the memory 11 includes at least one type of readable storage medium.
  • the at least one type of readable storage medium may be a non-volatile storage medium such as a flash memory, a hard disk, a multimedia card, a card type memory, or the like.
  • the readable storage medium may be an internal storage unit of the electronic device 1, such as a hard disk of the electronic device 1.
  • the readable storage medium may also be an external memory 11 of the electronic device 1, such as a plug-in hard disk equipped on the electronic device 1, a smart memory card (SMC). , Secure Digital (SD) card, Flash Card, etc.
  • SMC smart memory card
  • SD Secure Digital
  • the readable storage medium of the memory 11 is generally used to store the calculation engine implementation program 10 and the program configuration file, the database 300, and the like installed in the electronic device 1.
  • the memory 11 can also be used to temporarily store data that has been output or is about to be output.
  • the processor 12 may be a central processing unit (CPU), a microprocessor or other data processing chip for running program code or processing data stored in the memory 11, such as executing a computational engine Program 10 and so on.
  • CPU central processing unit
  • microprocessor or other data processing chip for running program code or processing data stored in the memory 11, such as executing a computational engine Program 10 and so on.
  • FIG. 2 shows only the electronic device 1 having the components 11-14 and the computing engine implementation program 10, but it should be understood that not all illustrated components may be implemented, and more or fewer components may be implemented instead.
  • the electronic device 1 may further include a user interface
  • the user interface may include an input unit such as a keyboard, a voice input device such as a microphone, a device with a voice recognition function, a voice output device such as an audio, a headphone, and the like.
  • the user interface may also include a standard wired interface and a wireless interface.
  • the electronic device 1 may further include a display, which may also be referred to as a display screen or a display unit.
  • a display may also be referred to as a display screen or a display unit.
  • it may be an LED display, a liquid crystal display, a touch liquid crystal display, and an Organic Light-Emitting Diode (OLED) display.
  • the display is used to display information processed in the electronic device 1 and a user interface for displaying visualizations.
  • the electronic device 1 further comprises a touch sensor.
  • the area provided by the touch sensor for the user to perform a touch operation is referred to as a touch area.
  • the touch sensor described herein may be a resistive touch sensor, a capacitive touch sensor, or the like.
  • the touch sensor includes not only a contact type touch sensor but also a proximity type touch sensor or the like.
  • the touch sensor may be a single sensor or a plurality of sensors arranged, for example, in an array. The user can start the calculation engine implementation program 10 by touching the touch area.
  • the area of the display of the electronic device 1 may be the same as or different from the area of the touch sensor.
  • a display is stacked with the touch sensor to form a touch display. The device detects a user-triggered touch operation based on a touch screen display.
  • the electronic device 1 may further include a radio frequency (RF) circuit, a sensor, an audio circuit, and the like, and details are not described herein.
  • RF radio frequency
  • the computing engine implementation program 10 is directed to a developer of the computing engine. Specifically, the calculation engine implementation program 10 may be embedded in the calculation engine, or may be a set of applications independent of the calculation engine, and process the calculation engine through a preset interface.
  • the computation engine implementation program 10 can be implemented using the JAVA language and can be managed using the Spring MVC framework. If the developer needs to develop a new computing function for the computing engine, the computing engine implementation program 10 is invoked to implement.
  • the memory 11 including the readable storage medium may include an operating system, a calculation engine implementation program 10, a program configuration file, a database, and the like.
  • the processor 12 executes the calculation engine implementation program 10 stored in the memory 11, the following steps are implemented:
  • Determining steps determining each operator that constitutes the target algorithm chain
  • a generating step generating a corresponding algorithm number according to each operator determined and an operator combination rule of the set target algorithm chain;
  • Storage step store the algorithm number in the database.
  • the determining step further includes: determining, by the program configuration file, whether each operator that constitutes the target algorithm chain is included, and if the determination result is yes, performing the generating step.
  • the step of configuring is further included, and if the determining result of the determining step is no, the configuring step is performed.
  • the configuring step of: receiving a target operator input according to a predetermined format, and configuring the received target operator in a program configuration file, and then performing the generating step.
  • FIG. 3 for a description of the program module diagram of the calculation engine implementation program 10 and FIG. 4 for a flowchart of the preferred embodiment of the calculation engine implementation method.
  • a program module diagram of the program 10 of the calculation engine of FIG. 2 is shown.
  • the calculation engine implementation program 10 is divided into a plurality of modules that are stored in the memory 11 and executed by the processor 12 to complete the application.
  • a module as referred to in this application refers to a series of computer program instructions that are capable of performing a particular function.
  • the calculation engine implementation program 10 can be divided into: a determination module 110, a generation module 140, and a storage module 150.
  • the calculation engine implementation program 10 may further include a determination module 120 and a configuration module 130.
  • the determining module 110 is configured to determine each operator that constitutes the target algorithm chain.
  • various computing functions in the computing engine are implemented by various algorithm chains (also called workflows), and each algorithm chain is composed of a plurality of operators (also called plug-ins). , each of which corresponds to a specific computing requirement.
  • the calculation requirement corresponding to the definition operator CommonHead is to obtain input data from the page and store it in the system general data structure MyTupleList
  • the calculation requirement corresponding to the definition operator Hanlp is keyword extraction.
  • an algorithm chain that implements the word segmentation function has the computational requirements of “getting input data from the page and storing it into the system general data structure MyTupleList” and the computational requirements of “keyword extraction”
  • the algorithm chain implementing the word segmentation function can be used by the CommonHead.
  • the operator is composed of the Hanlp operator.
  • the operator combination rules for each algorithm chain can be indicated by the corresponding algorithm number.
  • Operator 1 is abbreviated as: operator 1 #### ⁇ ## ⁇ ;
  • business number #advertisement number# strategy number” and “10001#024#8024” are the algorithm numbers.
  • the determining module 110 when receiving the development request of the target algorithm chain input by the developer, parses one or more computing requirements corresponding to the target algorithm chain, and determines an operator corresponding to each computing requirement, thereby determining a component target algorithm. Each operator of the chain.
  • the determining module 120 is configured to determine whether each operator that constitutes the target algorithm chain is included in the program configuration file, and if the determination result is no, the configuration module 130 is triggered, and if the determination result is yes, The triggering the generating module 140 is triggered.
  • the developer can develop a number of general-purpose operators in advance for some of the more common computing requirements, and pre-configure the generic-type operators in the program configuration file.
  • two general-purpose operators are listed:
  • the first 1 represents the data table number of the pull data is 1, and -1 means that the data does not need to be pulled from the PG database; the second 1 represents the algorithm number, and -1 represents the no need for the algorithm number; the last one Represents weights.
  • 6 represents the data table number of the data extracted from the PG library or the Redis library; 1 represents the algorithm number, and the algorithm number has the same meaning as the algorithm number when the data is stored in the database; the first 2 in 2_2 represents the access method, The second 2 represents the fetch type.
  • a three-layer data storage manner is provided, which is a local memory cache, a Redis data storage, and a PG data storage.
  • the storage capacity of the three increases in turn, and the corresponding storage speed decreases in turn.
  • the method for obtaining the database may be set to one of the following five types:
  • RedisOnly only from the Redis library to take the number, this mode is suitable for the data volume is small and the access speed requirements are high, the premise is that the data already exists in the Redis library;
  • RedisPGSync first take the number from the Redis library, if not taken, then go to the PG library to fetch, then write back to the Redis library after synchronization;
  • RedisPGAsync first take the number from Redis, if not taken, then go to the PG library to fetch, asynchronously write back to the Redis library;
  • this embodiment also provides a setting of the fetch type, focusing on the type of data entering the PG library, as follows:
  • the first 2 of the “2_2” represents the Retrilisting mode
  • the second 2 represents the fetching number.
  • the type is an ordered list.
  • the configuration module 130 is configured to receive a target operator input according to a predetermined format, and configure the received target operator in a program configuration file, and then trigger the generating module 140.
  • the target operator is an operator that is not included in the program configuration file that constitutes the target algorithm chain.
  • the operator included in the program configuration file may be the general-purpose operator, that is, an operator that is more likely to be used in various common requirements.
  • the target operator is an algorithm chain for certain computing functions, and an operator corresponding to a special requirement is required.
  • Such operators can be collectively referred to as functional operators.
  • the functional operator is, for example, a word-cutting (keyword extraction) operator that implements word segmentation and similar case function requirements.
  • the generating module 140 is configured to generate a corresponding algorithm number according to each determined operator and an operator combination rule of the set target algorithm chain.
  • the storage module 150 is configured to store the algorithm number in a database.
  • the algorithm number corresponding to the calculation function is obtained from the database, and the corresponding operator is called from the program configuration file to form an algorithm chain according to the algorithm number, and the program corresponding to the algorithm chain is executed. Thereby implementing the computing function.
  • FIG. 4 it is a flowchart of a preferred embodiment of a computing engine implementation method of the present application. The following steps are implemented when the processor 12 of the electronic device 1 executes the calculation engine implementation program 10 stored in the memory 11 to implement the calculation engine implementation method:
  • step S10 the determination module 110 determines each operator that constitutes the target algorithm chain.
  • step S20 the determining module 120 determines whether each operator that constitutes the target algorithm chain is included in the program configuration file. If the determination result is negative, step S30 is performed. If the determination result is yes, step S40 is performed.
  • step S30 the configuration module 130 receives the target operator input according to the predetermined format, and configures the received target operator in the program configuration file, and then performs step S40.
  • the target operator is an operator that is not included in the program configuration file that constitutes the target algorithm chain.
  • step S40 the generating module 140 generates a corresponding algorithm number according to each operator determined and the operator combination rule of the set target algorithm chain.
  • the storage module 150 stores the algorithm number in the database.
  • the database includes a local memory cache, a Redis library, or a Postgre SQL library.
  • the method of obtaining the database includes one of the following:
  • the calculation engine implementation method described in this embodiment uses an algorithm chain and an operator as an implementation framework when developing and maintaining a calculation engine.
  • the algorithm chain corresponding to each calculation function is flexibly implemented in the form of an operator, and the operators are loosely coupled. Mode connection, only the information transfer format and content between operators are specified, without interfering with the specific implementation methods of each operator.
  • Using this method to implement the calculation function in the new calculation engine can make the development process of the calculation engine more flexible. It only needs to configure the algorithm chain according to the existing operator, or develop a new operator when necessary.
  • the new features of the Compute Engine are widely versatile and scalable, without the need for additional system code and database development.
  • the embodiment of the present application further provides a computer readable storage medium, which may be a hard disk, a multimedia card, an SD card, a flash memory card, an SMC, a read only memory (ROM), and an erasable programmable Any combination or combination of any one or more of read only memory (EPROM), portable compact disk read only memory (CD-ROM), USB memory, and the like.
  • the computer readable storage medium includes a program configuration file, a database, a calculation engine implementation program 10, and the like. When the calculation engine implementation program 10 is executed by the processor 12, the following operations are implemented:
  • Determining steps determining each operator that constitutes the target algorithm chain
  • a generating step generating a corresponding algorithm number according to each operator determined and an operator combination rule of the set target algorithm chain;
  • Storage step store the algorithm number in the database.
  • the determining step further includes: determining, by the program configuration file, whether each operator that constitutes the target algorithm chain is included, and if the determination result is yes, performing the generating step.
  • the step of configuring is further included, and if the determining result of the determining step is no, the configuring step is performed.
  • the configuring step of: receiving a target operator input according to a predetermined format, and configuring the received target operator in a program configuration file, and then performing the generating step.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

A calculation engine implementing method. The method comprises the following steps: determining step: determining every operator of which a target algorithm chain is composed (S10); determining step: determining whether every operator of which the target algorithm chain is composed is contained in a program configuration file (S20), if not, performing a configuring step, and if yes, performing a generating step; configuring step: receiving a target operator input according to a preset format, and configuring the target operator into the program configuration file (S30); generating step: generating a corresponding algorithm number according to an operator composition rule of the set target algorithm chain (S40); and storing step: storing the algorithm number into a database (S50). In addition to the method, also provided are an electronic device and a computer readable storage medium. According to the method, a newly-added function of the calculation engine can be implemented.

Description

计算引擎实现方法、电子装置及存储介质Calculation engine implementation method, electronic device and storage medium
本申请要求于2017年10月31日提交中国专利局,申请号为201711047210.6、发明名称为“计算引擎实现方法、电子装置及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。The present application claims priority to Chinese Patent Application No. 201711047210.6, entitled "Computation Engine Implementation Method, Electronic Device and Storage Medium", which is filed on October 31, 2017, the entire contents of which are incorporated by reference. In this application.
技术领域Technical field
本申请涉及计算机技术领域,尤其涉及一种计算引擎实现方法、电子装置及存储介质。The present application relates to the field of computer technologies, and in particular, to a computing engine implementation method, an electronic device, and a storage medium.
背景技术Background technique
随着信息技术的发展,越来越多的计算引擎应运而生,以满足用户日益广泛且多变的需求。现有的计算引擎可以用于实现多种功能,例如海量数据的关键词搜索功能、知识百科功能、信息预测功能等。通常单一种计算引擎的计算功能相对而言也是比较单一的。With the development of information technology, more and more computing engines have emerged to meet the ever-widening and ever-changing needs of users. The existing calculation engine can be used to implement various functions, such as keyword search function of massive data, knowledge encyclopedia function, information prediction function, and the like. Usually the calculation function of a single calculation engine is relatively simple.
然而,业界现有的计算引擎开发过程中,对计算引擎的普适性和扩展性的考虑不足,在计算引擎支持的计算功能不能满足需求,需开发新的计算功能的情况下,需要进行大量的代码开发和重构工作,极大地耗费代码开发成本,并且降低了研发人员的工作效率。However, in the development process of the existing computing engine in the industry, the consideration of the universality and scalability of the computing engine is insufficient. When the computing function supported by the computing engine cannot meet the demand, and a new computing function needs to be developed, a large amount of The code development and refactoring work greatly consumes the cost of code development and reduces the productivity of the developer.
发明内容Summary of the invention
鉴于以上原因,有必要提供一种计算引擎实现方法、电子装置及存储介质,可以使计算引擎的开发过程更灵活,具有广泛的普适性和良好的可扩展性,且不需要额外的***代码及数据库开发。In view of the above reasons, it is necessary to provide a computing engine implementation method, an electronic device and a storage medium, which can make the development process of the calculation engine more flexible, has wide universality and good scalability, and does not require additional system code. And database development.
为实现上述目的,本申请提供一种计算引擎实现方法,该方法包括:确定步骤:确定组成目标算法链的每个算子;生成步骤:依据所确定的每个算子,以及所设定的目标算法链的算子组合规则,生成相应的算法号;存储步骤:将所述算法号存入数据库。To achieve the above objective, the present application provides a computing engine implementation method, the method comprising: determining a step of: determining each operator that constitutes a target algorithm chain; and generating a step: determining each operator according to the determined The operator combination rule of the target algorithm chain generates a corresponding algorithm number; and the storing step: storing the algorithm number in the database.
为实现上述目的,本申请还提供一种电子装置,该电子装置包括存储器和处理器,所述存储器中包括计算引擎实现程序,该计算引擎实现程序被所 述处理器执行时实现如下步骤:To achieve the above object, the present application further provides an electronic device including a memory and a processor, wherein the memory includes a calculation engine implementation program, and the calculation engine implementation program implements the following steps when executed by the processor:
确定步骤:确定组成目标算法链的每个算子;生成步骤:依据所确定的每个算子,以及所设定的目标算法链的算子组合规则,生成相应的算法号;存储步骤:将所述算法号存入数据库。Determining step: determining each operator that constitutes the target algorithm chain; generating step: generating a corresponding algorithm number according to each operator determined and the operator combination rule of the set target algorithm chain; storing step: The algorithm number is stored in the database.
此外,为实现上述目的,本申请还提供一种计算机可读存储介质,所述计算机可读存储介质中包括计算引擎实现程序,该计算引擎实现程序被处理器执行时,实现如上所述的计算引擎实现方法的任意步骤。In addition, in order to achieve the above object, the present application further provides a computer readable storage medium including a calculation engine implementation program, which implements the calculation as described above when the program is executed by the processor Any step of the engine implementation method.
本申请提出的计算引擎实现方法、电子装置及计算机可读存储介质,在开发和维护计算引擎时以算法链和算子作为实现框架,各个计算功能对应的算法链以算子的形式灵活实现,算子之间以松耦合方式连接,仅对算子间的信息传递格式和内容作规定,而不干涉各个算子的具体实现方法。利用本方法实现新增计算引擎中的计算功能,可以使计算引擎的开发过程更灵活,只需要根据已有的算子配置好算法链,或者在必要的时候开发新的算子,即可实现计算引擎的新功能,具有广泛的普适性和良好的可扩展性,且不需要额外的***代码及数据库开发。The calculation engine implementation method, the electronic device and the computer readable storage medium proposed by the present application use the algorithm chain and the operator as the implementation framework when developing and maintaining the calculation engine, and the algorithm chain corresponding to each calculation function is flexibly implemented in the form of an operator. The operators are connected in a loosely coupled manner, and only the information transfer format and content between the operators are specified, without interfering with the specific implementation methods of the respective operators. Using this method to implement the calculation function in the new calculation engine can make the development process of the calculation engine more flexible. It only needs to configure the algorithm chain according to the existing operator, or develop a new operator when necessary. The new features of the Compute Engine are widely versatile and scalable, without the need for additional system code and database development.
附图说明DRAWINGS
图1为计算引擎较佳实施例的运行环境示意图。FIG. 1 is a schematic diagram of an operating environment of a preferred embodiment of a computing engine.
图2为本申请提供的电子装置较佳实施例的运行环境示意图。2 is a schematic diagram of an operating environment of a preferred embodiment of an electronic device provided by the present application.
图3为图2中计算引擎实现程序的程序模块图。3 is a block diagram of a program of the calculation engine implementation program of FIG. 2.
图4为本申请计算引擎实现方法较佳实施例的流程图。4 is a flow chart of a preferred embodiment of a computing engine implementation method of the present application.
本申请目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。The implementation, functional features and advantages of the present application will be further described with reference to the accompanying drawings.
具体实施方式Detailed ways
下面将参考若干具体实施例来描述本申请的原理和精神。应当理解,此处所描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。The principles and spirit of the present application are described below with reference to a number of specific embodiments. It is understood that the specific embodiments described herein are merely illustrative of the application and are not intended to be limiting.
本领域的技术人员知道,本申请的实施方式可以实现为一种方法、装置、设备、***或计算机程序产品。因此,本申请可以具体实现为完全的硬件、 完全的软件(包括固件、驻留软件、微代码等),或者硬件和软件结合的形式。Those skilled in the art will appreciate that embodiments of the present application can be implemented as a method, apparatus, device, system, or computer program product. Accordingly, the application can be embodied in a complete hardware, complete software (including firmware, resident software, microcode, etc.), or a combination of hardware and software.
根据本申请的实施例,提出了一种计算引擎实现方法、电子装置及存储介质。According to an embodiment of the present application, a computing engine implementation method, an electronic device, and a storage medium are provided.
参阅图1所示,为所述计算引擎较佳实施例的运行环境示意图。Referring to FIG. 1 , it is a schematic diagram of an operating environment of the preferred embodiment of the computing engine.
在本实施例中,所述计算引擎架设于服务器100中,为用户提供各种计算功能的服务,例如疾病预测、相似病例查询、关联词查询等。计算引擎中所述的各种计算功能分别由相应的算法链来实现。用户通过客户端200向服务器100发送某一计算功能的使用请求,计算引擎在接收到所述使用请求后,获取对应的算法链,并执行所述算法链对应的程序,从而实现所述计算功能,从数据库300中获取计算结果,并将计算结果返回至客户端200。所述数据库300例如可以包括本地内存缓存、Redis数据库,或PostgreSQL(PG)数据库。此外,服务器100还可与电子装置1通讯连接,所述电子装置1也可以访问数据库300。所述计算引擎的开发人员可以通过电子装置1对计算引擎进行开发,并将所开发的计算引擎架设在服务器100中执行。In this embodiment, the computing engine is installed in the server 100 to provide users with various computing functions, such as disease prediction, similar case query, related word query, and the like. The various computing functions described in the calculation engine are each implemented by a corresponding algorithm chain. The user sends a usage request of a certain computing function to the server 100 through the client 200. After receiving the usage request, the calculation engine acquires a corresponding algorithm chain and executes a program corresponding to the algorithm chain, thereby implementing the computing function. The calculation result is obtained from the database 300, and the calculation result is returned to the client 200. The database 300 can include, for example, a local memory cache, a Redis database, or a PostgreSQL (PG) database. In addition, the server 100 can also be in communication with the electronic device 1, and the electronic device 1 can also access the database 300. The developer of the calculation engine can develop the calculation engine through the electronic device 1 and set the developed calculation engine to be executed in the server 100.
参照图2所示,为本申请电子装置较佳实施例的结构框图。2 is a structural block diagram of a preferred embodiment of an electronic device of the present application.
该电子装置1可以是便携式计算机、桌上型计算机等具有存储和运算功能的终端设备。The electronic device 1 may be a terminal device having a storage and computing function, such as a portable computer or a desktop computer.
该电子装置1包括存储器11、处理器12、网络接口13及通信总线14。所述网络接口13可选地可以包括标准的有线接口和无线接口(如WI-FI接口)。通信总线14用于实现上述组件之间的连接通信。The electronic device 1 includes a memory 11, a processor 12, a network interface 13, and a communication bus 14. The network interface 13 can optionally include a standard wired interface and a wireless interface (such as a WI-FI interface). The communication bus 14 is used to implement connection communication between the above components.
存储器11包括至少一种类型的可读存储介质。所述至少一种类型的可读存储介质可为如闪存、硬盘、多媒体卡、卡型存储器等的非易失性存储介质。在一些实施例中,所述可读存储介质可以是所述电子装置1的内部存储单元,例如该电子装置1的硬盘。在另一些实施例中,所述可读存储介质也可以是所述电子装置1的外部存储器11,例如所述电子装置1上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。The memory 11 includes at least one type of readable storage medium. The at least one type of readable storage medium may be a non-volatile storage medium such as a flash memory, a hard disk, a multimedia card, a card type memory, or the like. In some embodiments, the readable storage medium may be an internal storage unit of the electronic device 1, such as a hard disk of the electronic device 1. In other embodiments, the readable storage medium may also be an external memory 11 of the electronic device 1, such as a plug-in hard disk equipped on the electronic device 1, a smart memory card (SMC). , Secure Digital (SD) card, Flash Card, etc.
在本实施例中,所述存储器11的可读存储介质通常用于存储安装于所述电子装置1的计算引擎实现程序10及程序配置文件、数据库300等。所述存 储器11还可以用于暂时地存储已经输出或者将要输出的数据。In the present embodiment, the readable storage medium of the memory 11 is generally used to store the calculation engine implementation program 10 and the program configuration file, the database 300, and the like installed in the electronic device 1. The memory 11 can also be used to temporarily store data that has been output or is about to be output.
处理器12在一些实施例中可以是一中央处理器(Central Processing Unit,CPU),微处理器或其他数据处理芯片,用于运行存储器11中存储的程序代码或处理数据,例如执行计算引擎实现程序10等。The processor 12, in some embodiments, may be a central processing unit (CPU), a microprocessor or other data processing chip for running program code or processing data stored in the memory 11, such as executing a computational engine Program 10 and so on.
图2仅示出了具有组件11-14以及计算引擎实现程序10的电子装置1,但是应理解的是,并不要求实施所有示出的组件,可以替代的实施更多或者更少的组件。2 shows only the electronic device 1 having the components 11-14 and the computing engine implementation program 10, but it should be understood that not all illustrated components may be implemented, and more or fewer components may be implemented instead.
可选地,该电子装置1还可以包括用户接口,用户接口可以包括输入单元比如键盘(Keyboard)、语音输入装置比如麦克风(microphone)等具有语音识别功能的设备、语音输出装置比如音响、耳机等。可选地,用户接口还可以包括标准的有线接口、无线接口。Optionally, the electronic device 1 may further include a user interface, and the user interface may include an input unit such as a keyboard, a voice input device such as a microphone, a device with a voice recognition function, a voice output device such as an audio, a headphone, and the like. . Optionally, the user interface may also include a standard wired interface and a wireless interface.
可选地,该电子装置1还可以包括显示器,显示器也可以称为显示屏或显示单元。在一些实施例中可以是LED显示器、液晶显示器、触控式液晶显示器以及有机发光二极管(Organic Light-Emitting Diode,OLED)显示器等。显示器用于显示在电子装置1中处理的信息以及用于显示可视化的用户界面。Optionally, the electronic device 1 may further include a display, which may also be referred to as a display screen or a display unit. In some embodiments, it may be an LED display, a liquid crystal display, a touch liquid crystal display, and an Organic Light-Emitting Diode (OLED) display. The display is used to display information processed in the electronic device 1 and a user interface for displaying visualizations.
可选地,该电子装置1还包括触摸传感器。所述触摸传感器所提供的供用户进行触摸操作的区域称为触控区域。此外,这里所述的触摸传感器可以为电阻式触摸传感器、电容式触摸传感器等。而且,所述触摸传感器不仅包括接触式的触摸传感器,也可包括接近式的触摸传感器等。此外,所述触摸传感器可以为单个传感器,也可以为例如阵列布置的多个传感器。用户可以通过触摸所述触控区域启动计算引擎实现程序10。Optionally, the electronic device 1 further comprises a touch sensor. The area provided by the touch sensor for the user to perform a touch operation is referred to as a touch area. Further, the touch sensor described herein may be a resistive touch sensor, a capacitive touch sensor, or the like. Moreover, the touch sensor includes not only a contact type touch sensor but also a proximity type touch sensor or the like. Furthermore, the touch sensor may be a single sensor or a plurality of sensors arranged, for example, in an array. The user can start the calculation engine implementation program 10 by touching the touch area.
此外,该电子装置1的显示器的面积可以与所述触摸传感器的面积相同,也可以不同。可选地,将显示器与所述触摸传感器层叠设置,以形成触摸显示屏。该装置基于触摸显示屏侦测用户触发的触控操作。In addition, the area of the display of the electronic device 1 may be the same as or different from the area of the touch sensor. Optionally, a display is stacked with the touch sensor to form a touch display. The device detects a user-triggered touch operation based on a touch screen display.
该电子装置1还可以包括射频(Radio Frequency,RF)电路、传感器和音频电路等等,在此不再赘述。The electronic device 1 may further include a radio frequency (RF) circuit, a sensor, an audio circuit, and the like, and details are not described herein.
所述计算引擎实现程序10面向的是所述计算引擎的开发人员。具体而言,所述计算引擎实现程序10可以嵌入在所述计算引擎中,也可以是一套独立于计算引擎的应用程序,并通过预设的接口对计算引擎进行处理。该计算引擎 实现程序10可以使用JAVA语言实现,且可以采用Spring MVC框架来管理代码。若开发人员需要为所述计算引擎开发新的计算功能,则调用所述计算引擎实现程序10来实现。The computing engine implementation program 10 is directed to a developer of the computing engine. Specifically, the calculation engine implementation program 10 may be embedded in the calculation engine, or may be a set of applications independent of the calculation engine, and process the calculation engine through a preset interface. The computation engine implementation program 10 can be implemented using the JAVA language and can be managed using the Spring MVC framework. If the developer needs to develop a new computing function for the computing engine, the computing engine implementation program 10 is invoked to implement.
在图2所示的电子装置1较佳实施例的运行环境示意图中,包含可读存储介质的存储器11中可以包括操作***、计算引擎实现程序10、程序配置文件、数据库等。处理器12执行存储器11中存储的计算引擎实现程序10时实现如下步骤:In the operating environment diagram of the preferred embodiment of the electronic device 1 shown in FIG. 2, the memory 11 including the readable storage medium may include an operating system, a calculation engine implementation program 10, a program configuration file, a database, and the like. When the processor 12 executes the calculation engine implementation program 10 stored in the memory 11, the following steps are implemented:
确定步骤:确定组成目标算法链的每个算子;Determining steps: determining each operator that constitutes the target algorithm chain;
生成步骤:依据所确定的每个算子,以及所设定的目标算法链的算子组合规则,生成相应的算法号;a generating step: generating a corresponding algorithm number according to each operator determined and an operator combination rule of the set target algorithm chain;
存储步骤:将所述算法号存入数据库。Storage step: store the algorithm number in the database.
可选地,在所述生成步骤前还包括判断步骤:判断程序配置文件中是否包含所述组成目标算法链的每个算子,若判断结果为是,则执行所述生成步骤。Optionally, before the generating step, the determining step further includes: determining, by the program configuration file, whether each operator that constitutes the target algorithm chain is included, and if the determination result is yes, performing the generating step.
可选地,在所述判断步骤后还包括配置步骤,若所述判断步骤的判断结果为否,则执行所述配置步骤。Optionally, after the determining step, the step of configuring is further included, and if the determining result of the determining step is no, the configuring step is performed.
所述配置步骤:接收按照预定格式输入的目标算子,并将所接收的目标算子配置在程序配置文件中,然后执行所述生成步骤。The configuring step of: receiving a target operator input according to a predetermined format, and configuring the received target operator in a program configuration file, and then performing the generating step.
具体原理请参照下述图3关于计算引擎实现程序10的程序模块图及图4关于计算引擎实现方法较佳实施例的流程图的介绍。For specific principles, please refer to the following FIG. 3 for a description of the program module diagram of the calculation engine implementation program 10 and FIG. 4 for a flowchart of the preferred embodiment of the calculation engine implementation method.
参照图3所示,为图2中计算引擎实现程序10的程序模块图。在本实施例中,计算引擎实现程序10被分割为多个模块,该多个模块被存储于存储器11中,并由处理器12执行,以完成本申请。本申请所称的模块是指能够完成特定功能的一系列计算机程序指令段。Referring to FIG. 3, a program module diagram of the program 10 of the calculation engine of FIG. 2 is shown. In the present embodiment, the calculation engine implementation program 10 is divided into a plurality of modules that are stored in the memory 11 and executed by the processor 12 to complete the application. A module as referred to in this application refers to a series of computer program instructions that are capable of performing a particular function.
所述计算引擎实现程序10可以被分割为:确定模块110、生成模块140和存储模块150。可选的,所述计算引擎实现程序10还可以包括判断模块120和配置模块130。The calculation engine implementation program 10 can be divided into: a determination module 110, a generation module 140, and a storage module 150. Optionally, the calculation engine implementation program 10 may further include a determination module 120 and a configuration module 130.
确定模块110,用于确定组成目标算法链的每个算子。The determining module 110 is configured to determine each operator that constitutes the target algorithm chain.
在本实施例中,所述计算引擎中的各种计算功能通过各条算法链(也称工作流)来实现,而每一条算法链则由若干个算子(也称为插件)组合而成,其中每个算子分别对应一个特定的计算需求。例如定义算子CommonHead对应的计算需求为从页面获取输入数据并存入***通用数据结构MyTupleList,而定义算子Hanlp对应的计算需求为关键词抽取。假设一条实现分词功能的算法链有“从页面获取输入数据并存入***通用数据结构MyTupleList”的计算需求和“关键词抽取”的计算需求,则该实现分词功能的算法链即可由所述CommonHead算子和Hanlp算子组成。针对每一种算法链的算子组合规则,可以由相应的算法号来指示。In this embodiment, various computing functions in the computing engine are implemented by various algorithm chains (also called workflows), and each algorithm chain is composed of a plurality of operators (also called plug-ins). , each of which corresponds to a specific computing requirement. For example, the calculation requirement corresponding to the definition operator CommonHead is to obtain input data from the page and store it in the system general data structure MyTupleList, and the calculation requirement corresponding to the definition operator Hanlp is keyword extraction. Assuming that an algorithm chain that implements the word segmentation function has the computational requirements of “getting input data from the page and storing it into the system general data structure MyTupleList” and the computational requirements of “keyword extraction”, the algorithm chain implementing the word segmentation function can be used by the CommonHead. The operator is composed of the Hanlp operator. The operator combination rules for each algorithm chain can be indicated by the corresponding algorithm number.
一条算法链的形式可以如下所示:The form of an algorithm chain can be as follows:
业务号#广告位号#策略号;Business number #广告位号#Strategy number;
算子1简称:算子1名#表号#版本号#权重; Operator 1 is abbreviated as: operator 1 ####版本##重重;
算子2简称:算子2名#表号#版本号#权重。Operator 2 abbreviation: operator 2 # #号##版本# weight.
举例:实现分词功能的算法链如下所示:Example: The algorithm chain that implements the word segmentation function is as follows:
10001#024#8024;10001#024#8024;
Com:CommonHeadV2#-1#-1#1。Com: CommonHeadV2#-1#-1#1.
其中,上述“业务号#广告位号#策略号”和“10001#024#8024”即为所述算法号。The above “business number #advertisement number# strategy number” and “10001#024#8024” are the algorithm numbers.
当开发人员为计算引擎新增计算功能时,需要开发新的算法链,所述新的算法链在本实施例中即被称为目标算法链。此外,开发人员还需要设定所述目标算法链的算子组合规则。确定模块110在接收到开发人员输入的目标算法链的开发请求时,解析出所述目标算法链对应的一个或多个计算需求,并确定每个计算需求对应的算子,从而确定组成目标算法链的每个算子。When developers add computing functions to the computing engine, it is necessary to develop a new algorithm chain, which in this embodiment is called the target algorithm chain. In addition, the developer also needs to set the operator combination rules of the target algorithm chain. The determining module 110, when receiving the development request of the target algorithm chain input by the developer, parses one or more computing requirements corresponding to the target algorithm chain, and determines an operator corresponding to each computing requirement, thereby determining a component target algorithm. Each operator of the chain.
可选地,判断模块120,用于判断程序配置文件中是否包含所述组成目标算法链的每个算子,若判断结果为否,则触发所述配置模块130,若判断结果为是,则所述触发所述生成模块140。Optionally, the determining module 120 is configured to determine whether each operator that constitutes the target algorithm chain is included in the program configuration file, and if the determination result is no, the configuration module 130 is triggered, and if the determination result is yes, The triggering the generating module 140 is triggered.
具体而言,开发人员可预先针对一些比较普遍的计算需求开发若干通用型算子,并将所述通用型算子预先配置在程序配置文件中。在本实施例中,列举两种通用型算子:Specifically, the developer can develop a number of general-purpose operators in advance for some of the more common computing requirements, and pre-configure the generic-type operators in the program configuration file. In this embodiment, two general-purpose operators are listed:
1、算子名称:CommonHead1, operator name: CommonHead
算子简称:ComOperator abbreviation: Com
功能:从页面获取输入数据并存入***通用数据结构MyTupleListFunction: Get input data from the page and store it in the system common data structure MyTupleList
格式举例:Com:CommonHead#-1#-1#1;Format example: Com:CommonHead#-1#-1#1;
其中第一个1代表拉取数据的数据表号为1,而-1代表不需要从PG数据库中拉取数据;第二个1代表算法号,而-1代表不需要算法号;最后一个1代表权重。The first 1 represents the data table number of the pull data is 1, and -1 means that the data does not need to be pulled from the PG database; the second 1 represents the algorithm number, and -1 represents the no need for the algorithm number; the last one Represents weights.
2、算子名称:Retrieval2, operator name: Retrieval
算子简称:RetrOperator abbreviation: Retr
功能:从PG库或Redis库拉取数据并存入***通用数据结构MyTupleListFunction: Pull data from PG library or Redis library and store it in system common data structure MyTupleList
格式举例:Retr:Retrieval#6#1#2_2;Format example: Retr:Retrieval#6#1#2_2;
其中6代表从PG库或Redis库中拉取数据的数据表号;1代表算法号,该算法号与该数据存入数据库时的算法号意义一致;2_2中第一个2代表取数方式,第二个2代表取数类型。6 represents the data table number of the data extracted from the PG library or the Redis library; 1 represents the algorithm number, and the algorithm number has the same meaning as the algorithm number when the data is stored in the database; the first 2 in 2_2 represents the access method, The second 2 represents the fetch type.
具体地,在本实施例中提供一种三层数据存储方式,分别为本地内存缓存、Redis数据存储、PG数据存储。三者的存储容量依次增加,而相应的存储速度依次递减。针对所述三层数据存储方式,对数据库的所述取数方式可以设定为以下五种之一:Specifically, in this embodiment, a three-layer data storage manner is provided, which is a local memory cache, a Redis data storage, and a PG data storage. The storage capacity of the three increases in turn, and the corresponding storage speed decreases in turn. For the three-layer data storage mode, the method for obtaining the database may be set to one of the following five types:
1、优先从本地内存缓存中取数,若取成功,则返回该数据,若不成功,再按以下四种方式进行取数;1. Take the number from the local memory cache first. If it succeeds, return the data. If it is unsuccessful, perform the following methods in the following four ways;
2、RedisOnly:仅从Redis库取数,本模式适用于数据量较小而对取数速度要求较高的取数需求,前提是数据已存在Redis库;2, RedisOnly: only from the Redis library to take the number, this mode is suitable for the data volume is small and the access speed requirements are high, the premise is that the data already exists in the Redis library;
3、RedisPGSync:先从Redis库取数,如果没有取到,再去PG库取,取到后同步写回Redis库;3, RedisPGSync: first take the number from the Redis library, if not taken, then go to the PG library to fetch, then write back to the Redis library after synchronization;
4、RedisPGAsync:先从Redis取数,如果没有取到,再去PG库取,取到后异步写回Redis库;4, RedisPGAsync: first take the number from Redis, if not taken, then go to the PG library to fetch, asynchronously write back to the Redis library;
5、PGOnly:仅从PG库取数,本模式适用于数据量大而对取数速度要求相对不高的取数需求。5, PGOnly: only take the number from the PG library, this mode is suitable for the data volume is large and the acquisition speed requirements are relatively low.
此外,本实施例还提供一种取数类型的设定,关注的是数据进入PG库的类型,如下:In addition, this embodiment also provides a setting of the fetch type, focusing on the type of data entering the PG library, as follows:
11 简单类型Simple type
22 有序列表Ordered list
33 无序列表Unordered list
由此,上述算子Retrieval的格式举例中,对应到以上设定的取数方式和取数类型,所述“2_2”中第一个2代表取数方式为RedisOnly,第二个2代表取数类型为有序列表。Therefore, in the example of the format of the operator Retrieval, corresponding to the fetch mode and the fetch type set above, the first 2 of the “2_2” represents the Retrilisting mode, and the second 2 represents the fetching number. The type is an ordered list.
可选地,配置模块130,用于接收按照预定格式输入的目标算子,并将所接收的目标算子配置在程序配置文件中,然后触发所述生成模块140。所述目标算子为不包含在程序配置文件中的组成所述目标算法链的算子。Optionally, the configuration module 130 is configured to receive a target operator input according to a predetermined format, and configure the received target operator in a program configuration file, and then trigger the generating module 140. The target operator is an operator that is not included in the program configuration file that constitutes the target algorithm chain.
具体而言,程序配置文件中包含的算子可以为所述的通用型算子,即各种普通需求都有较大可能用到的算子。而所述目标算子则为针对某些计算功能的算法链,所需要的对应特殊需求的算子。当发现要配置目标算法链,仅使用程序配置文件中已有的通用型算子不够时,开发人员需要针对新的计算需求开发新的算子,这种算子可以被统称为功能性算子。所述功能性算子例如:实现分词及相似病例功能需求的切词(关键词抽取)算子Hanlp:KeywordExtraction#-1#-1#1;为实现相似病例功能需求的相似度和排序计算的Sc:BM25New#-1#-1#1和Sort:Heapsort#-1#-1#1算子。功能性算子被配置在程序配置文件中后,可供后续配置算法链时灵活取用。Specifically, the operator included in the program configuration file may be the general-purpose operator, that is, an operator that is more likely to be used in various common requirements. The target operator is an algorithm chain for certain computing functions, and an operator corresponding to a special requirement is required. When it is found that the target algorithm chain is to be configured, and only the general-purpose operators existing in the program configuration file are not enough, the developer needs to develop new operators for the new computing requirements. Such operators can be collectively referred to as functional operators. . The functional operator is, for example, a word-cutting (keyword extraction) operator that implements word segmentation and similar case function requirements. Hanlp: KeywordExtraction#-1#-1#1; similarity and ranking calculation for achieving similar case function requirements Sc: BM25New#-1#-1#1 and Sort:Heapsort#-1#-1#1 operator. After the functional operator is configured in the program configuration file, it can be flexibly accessed when the algorithm chain is subsequently configured.
生成模块140,用于依据所确定的每个算子,以及所设定的目标算法链的算子组合规则,生成相应的算法号。The generating module 140 is configured to generate a corresponding algorithm number according to each determined operator and an operator combination rule of the set target algorithm chain.
存储模块150,用于将所述算法号存入数据库。当计算引擎需要执行某一计算功能时,从数据库中获取该计算功能对应的算法号,并根据该算法号从程序配置文件中调用对应的算子组成算法链,执行所述算法链对应的程序,从而实现所述计算功能。The storage module 150 is configured to store the algorithm number in a database. When the calculation engine needs to perform a certain calculation function, the algorithm number corresponding to the calculation function is obtained from the database, and the corresponding operator is called from the program configuration file to form an algorithm chain according to the algorithm number, and the program corresponding to the algorithm chain is executed. Thereby implementing the computing function.
参照图4所示,为本申请计算引擎实现方法较佳实施例的流程图。电子装置1的处理器12执行存储器11中存储的计算引擎实现程序10时实现所述计算引擎实现方法的如下步骤:Referring to FIG. 4, it is a flowchart of a preferred embodiment of a computing engine implementation method of the present application. The following steps are implemented when the processor 12 of the electronic device 1 executes the calculation engine implementation program 10 stored in the memory 11 to implement the calculation engine implementation method:
步骤S10,确定模块110确定组成目标算法链的每个算子。In step S10, the determination module 110 determines each operator that constitutes the target algorithm chain.
步骤S20,判断模块120判断程序配置文件中是否包含所述组成目标算法链的每个算子,若判断结果为否,则执行步骤S30,若判断结果为是,则执行 步骤S40。In step S20, the determining module 120 determines whether each operator that constitutes the target algorithm chain is included in the program configuration file. If the determination result is negative, step S30 is performed. If the determination result is yes, step S40 is performed.
步骤S30,配置模块130接收按照预定格式输入的目标算子,并将所接收的目标算子配置在程序配置文件中,然后执行步骤S40。所述目标算子为不包含在程序配置文件中的组成所述目标算法链的算子。In step S30, the configuration module 130 receives the target operator input according to the predetermined format, and configures the received target operator in the program configuration file, and then performs step S40. The target operator is an operator that is not included in the program configuration file that constitutes the target algorithm chain.
步骤S40,生成模块140依据所确定的每个算子,以及所设定的目标算法链的算子组合规则,生成相应的算法号。In step S40, the generating module 140 generates a corresponding algorithm number according to each operator determined and the operator combination rule of the set target algorithm chain.
步骤S50,存储模块150将所述算法号存入数据库。所述数据库包括本地内存缓存、Redis库或Postgre SQL库。所述数据库的取数方式包括以下之一:In step S50, the storage module 150 stores the algorithm number in the database. The database includes a local memory cache, a Redis library, or a Postgre SQL library. The method of obtaining the database includes one of the following:
从本地内存缓存中取数;Take the number from the local memory cache;
仅从Redis库中取数;Take only the number from the Redis library;
先从Redis库中取数,若不成功,则从Postgre SQL库中取数,取到后同步写回Redis库;First take the number from the Redis library, if it is not successful, take the number from the Postgre SQL library, and then write back to the Redis library after synchronization;
先从Redis库中取数,若不成功,则从Postgre SQL库中取数,取到后异步写回Redis库;First take the number from the Redis library, if not successful, take the number from the Postgre SQL library, and then asynchronously write back to the Redis library;
仅从Postgre SQL库中取数。Take only the number from the Postgre SQL library.
本实施例所述的计算引擎实现方法,在开发和维护计算引擎时以算法链和算子作为实现框架,各个计算功能对应的算法链以算子的形式灵活实现,算子之间以松耦合方式连接,仅对算子间的信息传递格式和内容作规定,而不干涉各个算子的具体实现方法。利用本方法实现新增计算引擎中的计算功能,可以使计算引擎的开发过程更灵活,只需要根据已有的算子配置好算法链,或者在必要的时候开发新的算子,即可实现计算引擎的新功能,具有广泛的普适性和良好的可扩展性,且不需要额外的***代码及数据库开发。The calculation engine implementation method described in this embodiment uses an algorithm chain and an operator as an implementation framework when developing and maintaining a calculation engine. The algorithm chain corresponding to each calculation function is flexibly implemented in the form of an operator, and the operators are loosely coupled. Mode connection, only the information transfer format and content between operators are specified, without interfering with the specific implementation methods of each operator. Using this method to implement the calculation function in the new calculation engine can make the development process of the calculation engine more flexible. It only needs to configure the algorithm chain according to the existing operator, or develop a new operator when necessary. The new features of the Compute Engine are widely versatile and scalable, without the need for additional system code and database development.
此外,本申请实施例还提出一种计算机可读存储介质,所述计算机可读存储介质可以是硬盘、多媒体卡、SD卡、闪存卡、SMC、只读存储器(ROM)、可擦除可编程只读存储器(EPROM)、便携式紧致盘只读存储器(CD-ROM)、USB存储器等等中的任意一种或者几种的任意组合。所述计算机可读存储介质中包括程序配置文件、数据库、计算引擎实现程序10等,所述计算引擎实现程序10被所述处理器12执行时实现如下操作:In addition, the embodiment of the present application further provides a computer readable storage medium, which may be a hard disk, a multimedia card, an SD card, a flash memory card, an SMC, a read only memory (ROM), and an erasable programmable Any combination or combination of any one or more of read only memory (EPROM), portable compact disk read only memory (CD-ROM), USB memory, and the like. The computer readable storage medium includes a program configuration file, a database, a calculation engine implementation program 10, and the like. When the calculation engine implementation program 10 is executed by the processor 12, the following operations are implemented:
确定步骤:确定组成目标算法链的每个算子;Determining steps: determining each operator that constitutes the target algorithm chain;
生成步骤:依据所确定的每个算子,以及所设定的目标算法链的算子组合规则,生成相应的算法号;a generating step: generating a corresponding algorithm number according to each operator determined and an operator combination rule of the set target algorithm chain;
存储步骤:将所述算法号存入数据库。Storage step: store the algorithm number in the database.
可选地,在所述生成步骤前还包括判断步骤:判断程序配置文件中是否包含所述组成目标算法链的每个算子,若判断结果为是,则执行所述生成步骤。Optionally, before the generating step, the determining step further includes: determining, by the program configuration file, whether each operator that constitutes the target algorithm chain is included, and if the determination result is yes, performing the generating step.
可选地,在所述判断步骤后还包括配置步骤,若所述判断步骤的判断结果为否,则执行所述配置步骤。Optionally, after the determining step, the step of configuring is further included, and if the determining result of the determining step is no, the configuring step is performed.
所述配置步骤:接收按照预定格式输入的目标算子,并将所接收的目标算子配置在程序配置文件中,然后执行所述生成步骤。The configuring step of: receiving a target operator input according to a predetermined format, and configuring the received target operator in a program configuration file, and then performing the generating step.
本申请之计算机可读存储介质的具体实施方式与上述计算引擎实现方法以及电子装置1的具体实施方式大致相同,在此不再赘述。The specific implementation of the computer readable storage medium of the present application is substantially the same as the implementation method of the above calculation engine and the specific implementation of the electronic device 1, and details are not described herein again.
需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、装置、物品或者方法不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、装置、物品或者方法所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、装置、物品或者方法中还存在另外的相同要素。It is to be understood that the term "comprises", "comprising", or any other variants thereof, is intended to encompass a non-exclusive inclusion, such that a process, apparatus, article, or method that comprises a series of elements includes those elements. It also includes other elements not explicitly listed, or elements that are inherent to such a process, device, item, or method. An element that is defined by the phrase "comprising a ..." does not exclude the presence of additional equivalent elements in the process, the device, the item, or the method that comprises the element.
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在如上所述的一个存储介质中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,或者网络设备等)执行本申请各个实施例所述的方法。Through the description of the above embodiments, those skilled in the art can clearly understand that the foregoing embodiment method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be through hardware, but in many cases, the former is better. Implementation. Based on such understanding, portions of the technical solution of the present application that contribute substantially or to the prior art may be embodied in the form of a software product stored in a storage medium as described above, including a number of instructions. To enable a terminal device (which may be a mobile phone, a computer, a server, or a network device, etc.) to perform the methods described in the various embodiments of the present application.
以上仅为本申请的优选实施例,并非因此限制本申请的专利范围,凡是利用本申请说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本申请的专利保护范围内。The above is only a preferred embodiment of the present application, and is not intended to limit the scope of the patent application, and the equivalent structure or equivalent process transformations made by the specification and the drawings of the present application, or directly or indirectly applied to other related technical fields. The same is included in the scope of patent protection of this application.

Claims (20)

  1. 一种计算引擎实现方法,其特征在于,该方法包括:A computing engine implementation method, the method comprising:
    确定步骤:确定组成目标算法链的每个算子;Determining steps: determining each operator that constitutes the target algorithm chain;
    生成步骤:依据所确定的每个算子,以及所设定的目标算法链的算子组合规则,生成相应的算法号;a generating step: generating a corresponding algorithm number according to each operator determined and an operator combination rule of the set target algorithm chain;
    存储步骤:将所述算法号存入数据库。Storage step: store the algorithm number in the database.
  2. 如权利要求1所述的计算引擎实现方法,其特征在于,在所述生成步骤前还包括:The method for implementing a calculation engine according to claim 1, wherein before the generating step, the method further comprises:
    判断步骤:判断程序配置文件中是否包含所述组成目标算法链的每个算子,若判断结果为是,则所述执行生成步骤。The determining step is: determining whether the operator that constitutes the target algorithm chain is included in the program configuration file, and if the determination result is yes, the performing the generating step.
  3. 如权利要求2所述的计算引擎实现方法,其特征在于,该方法还包括:若所述判断步骤的结果为否,则执行配置步骤;The method for implementing a calculation engine according to claim 2, wherein the method further comprises: if the result of the determining step is negative, performing a configuration step;
    配置步骤:接收按照预定格式输入的目标算子,并将所接收的目标算子配置在程序配置文件中,然后执行所述生成步骤。The configuration step: receiving the target operator input according to the predetermined format, and configuring the received target operator in the program configuration file, and then performing the generating step.
  4. 如权利要求3所述的计算引擎实现方法,其特征在于,所述目标算子为不包含在程序配置文件中的组成所述目标算法链的算子。The computing engine implementation method according to claim 3, wherein the target operator is an operator that is not included in the program configuration file and constitutes the target algorithm chain.
  5. 如权利要求1所述的计算引擎实现方法,其特征在于,所述数据库包括本地内存缓存、Redis库或Postgre SQL库。The computing engine implementation method of claim 1, wherein the database comprises a local memory cache, a Redis library, or a Postgre SQL library.
  6. 如权利要求2或3或4所述的计算引擎实现方法,其特征在于,所述数据库包括本地内存缓存、Redis库或Postgre SQL库。The computing engine implementation method according to claim 2 or 3 or 4, wherein the database comprises a local memory cache, a Redis library or a Postgre SQL library.
  7. 如权利要求5所述的计算引擎实现方法,其特征在于,所述数据库的取数方式为以下方式之一:The method for implementing a calculation engine according to claim 5, wherein the method of fetching the database is one of the following methods:
    从本地内存缓存中取数;Take the number from the local memory cache;
    仅从Redis库中取数;Take only the number from the Redis library;
    先从Redis库中取数,若不成功,则从Postgre SQL库中取数,取到后同步写回Redis库;First take the number from the Redis library, if it is not successful, take the number from the Postgre SQL library, and then write back to the Redis library after synchronization;
    先从Redis库中取数,若不成功,则从Postgre SQL库中取数,取到后异步写回Redis库;First take the number from the Redis library, if not successful, take the number from the Postgre SQL library, and then asynchronously write back to the Redis library;
    仅从Postgre SQL库中取数。Take only the number from the Postgre SQL library.
  8. 一种电子装置,包括存储器和处理器,其特征在于,所述存储器中包括计算引擎实现程序,该计算引擎实现程序被所述处理器执行时实现如下步骤:An electronic device includes a memory and a processor, wherein the memory includes a calculation engine implementation program, and the calculation engine implementation program implements the following steps when executed by the processor:
    确定步骤:确定组成目标算法链的每个算子;Determining steps: determining each operator that constitutes the target algorithm chain;
    生成步骤:依据所确定的每个算子,以及所设定的目标算法链的算子组合规则,生成相应的算法号;a generating step: generating a corresponding algorithm number according to each operator determined and an operator combination rule of the set target algorithm chain;
    存储步骤:将所述算法号存入数据库。Storage step: store the algorithm number in the database.
  9. 如权利要求8所述的电子装置,其特征在于,在所述生成步骤前还包括:The electronic device according to claim 8, wherein before the generating step, the method further comprises:
    判断步骤:判断程序配置文件中是否包含所述组成目标算法链的每个算子,若判断结果为是,则所述执行生成步骤。The determining step is: determining whether the operator that constitutes the target algorithm chain is included in the program configuration file, and if the determination result is yes, the performing the generating step.
  10. 如权利要求9所述的电子装置,其特征在于,若所述判断步骤的结果为否,则执行配置步骤;The electronic device according to claim 9, wherein if the result of the determining step is negative, performing a configuration step;
    配置步骤:接收按照预定格式输入的目标算子,并将所接收的目标算子配置在程序配置文件中,然后执行所述生成步骤。The configuration step: receiving the target operator input according to the predetermined format, and configuring the received target operator in the program configuration file, and then performing the generating step.
  11. 如权利要求10所述的电子装置,其特征在于,所述目标算子为不包含在程序配置文件中的组成所述目标算法链的算子。The electronic device of claim 10, wherein the target operator is an operator that is not included in a program configuration file that constitutes the target algorithm chain.
  12. 如权利要求8所述的电子装置,其特征在于,所述数据库包括本地内存缓存、Redis库或Postgre SQL库。The electronic device of claim 8, wherein the database comprises a local memory cache, a Redis library, or a Postgre SQL library.
  13. 如权利要求9或10或11所述的电子装置,其特征在于,所述数据库包括本地内存缓存、Redis库或Postgre SQL库。The electronic device according to claim 9 or 10 or 11, wherein the database comprises a local memory cache, a Redis library or a Postgre SQL library.
  14. 如权利要求12所述的电子装置,其特征在于,所述数据库的取数方式为以下方式之一:The electronic device according to claim 12, wherein the method of taking the database is one of the following ways:
    从本地内存缓存中取数;Take the number from the local memory cache;
    仅从Redis库中取数;Take only the number from the Redis library;
    先从Redis库中取数,若不成功,则从Postgre SQL库中取数,取到后同步写回Redis库;First take the number from the Redis library, if it is not successful, take the number from the Postgre SQL library, and then write back to the Redis library after synchronization;
    先从Redis库中取数,若不成功,则从Postgre SQL库中取数,取到后异步写回Redis库;First take the number from the Redis library, if not successful, take the number from the Postgre SQL library, and then asynchronously write back to the Redis library;
    仅从Postgre SQL库中取数。Take only the number from the Postgre SQL library.
  15. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质中包括计算引擎实现程序,所述计算引擎实现程序被处理器执行时,实现如下步骤:A computer readable storage medium, comprising: a calculation engine implementation program, wherein when the calculation engine implementation program is executed by a processor, the following steps are implemented:
    确定步骤:确定组成目标算法链的每个算子;Determining steps: determining each operator that constitutes the target algorithm chain;
    生成步骤:依据所确定的每个算子,以及所设定的目标算法链的算子组合规则,生成相应的算法号;a generating step: generating a corresponding algorithm number according to each operator determined and an operator combination rule of the set target algorithm chain;
    存储步骤:将所述算法号存入数据库。Storage step: store the algorithm number in the database.
  16. 如权利要求15所述的计算机可读存储介质,其特征在于,在所述生成步骤前还包括:The computer readable storage medium of claim 15, further comprising: before the generating step:
    判断步骤:判断程序配置文件中是否包含所述组成目标算法链的每个算子,若判断结果为是,则所述执行生成步骤。The determining step is: determining whether the operator that constitutes the target algorithm chain is included in the program configuration file, and if the determination result is yes, the performing the generating step.
  17. 如权利要求16所述的计算机可读存储介质,其特征在于,若所述判断步骤的结果为否,则执行配置步骤;The computer readable storage medium of claim 16, wherein if the result of the determining step is negative, performing a configuration step;
    配置步骤:接收按照预定格式输入的目标算子,并将所接收的目标算子配置在程序配置文件中,然后执行所述生成步骤。The configuration step: receiving the target operator input according to the predetermined format, and configuring the received target operator in the program configuration file, and then performing the generating step.
  18. 如权利要求17所述的计算机可读存储介质,其特征在于,所述目标算子为不包含在程序配置文件中的组成所述目标算法链的算子。The computer readable storage medium of claim 17, wherein the target operator is an operator that is not included in a program configuration file that constitutes the target algorithm chain.
  19. 如权利要求15-18任一项所述的计算机可读存储介质,其特征在于,所述数据库包括本地内存缓存、Redis库或Postgre SQL库。The computer readable storage medium of any of claims 15-18, wherein the database comprises a local memory cache, a Redis library, or a Postgre SQL library.
  20. 如权利要求19所述的计算机可读存储介质,其特征在于,所述数据库的取数方式为以下方式之一:The computer readable storage medium according to claim 19, wherein the database is retrieved in one of the following manners:
    从本地内存缓存中取数;Take the number from the local memory cache;
    仅从Redis库中取数;Take only the number from the Redis library;
    先从Redis库中取数,若不成功,则从Postgre SQL库中取数,取到后同步写回Redis库;First take the number from the Redis library, if it is not successful, take the number from the Postgre SQL library, and then write back to the Redis library after synchronization;
    先从Redis库中取数,若不成功,则从Postgre SQL库中取数,取到后异步写回Redis库;First take the number from the Redis library, if not successful, take the number from the Postgre SQL library, and then asynchronously write back to the Redis library;
    仅从Postgre SQL库中取数。Take only the number from the Postgre SQL library.
PCT/CN2018/089884 2017-10-31 2018-06-05 Calculation engine implementing method, electronic device, and storage medium WO2019085474A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201711047210.6A CN107967135B (en) 2017-10-31 2017-10-31 Calculation engine implementation method, electronic device and storage medium
CN201711047210.6 2017-10-31

Publications (1)

Publication Number Publication Date
WO2019085474A1 true WO2019085474A1 (en) 2019-05-09

Family

ID=62000779

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/089884 WO2019085474A1 (en) 2017-10-31 2018-06-05 Calculation engine implementing method, electronic device, and storage medium

Country Status (2)

Country Link
CN (1) CN107967135B (en)
WO (1) WO2019085474A1 (en)

Families Citing this family (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107967135B (en) * 2017-10-31 2020-11-13 平安科技(深圳)有限公司 Calculation engine implementation method, electronic device and storage medium
CN109685201B (en) * 2018-12-14 2020-10-30 安徽寒武纪信息科技有限公司 Operation method, device and related product
CN109726822B (en) * 2018-12-14 2020-10-09 中科寒武纪科技股份有限公司 Operation method, device and related product
CN109711538B (en) * 2018-12-14 2021-01-15 安徽寒武纪信息科技有限公司 Operation method, device and related product
CN109740729B (en) * 2018-12-14 2020-12-22 安徽寒武纪信息科技有限公司 Operation method, device and related product
CN109740730B (en) * 2018-12-14 2020-10-23 安徽寒武纪信息科技有限公司 Operation method, device and related product
CN109657782B (en) * 2018-12-14 2020-10-27 安徽寒武纪信息科技有限公司 Operation method, device and related product
CN110020720B (en) * 2019-04-01 2021-05-11 中科寒武纪科技股份有限公司 Operator splicing method and device
CN113076155B (en) * 2020-01-03 2024-05-03 阿里巴巴集团控股有限公司 Data processing method, device, electronic equipment and computer storage medium
CN112035537B (en) * 2020-07-10 2023-10-20 北京远景视点科技有限公司 Method for rapidly counting behavior of mobile object monitored by multiple sensors
CN112270399B (en) * 2020-09-29 2022-03-11 北京百度网讯科技有限公司 Operator registration processing method and device based on deep learning and electronic equipment
CN114489850B (en) * 2022-01-20 2023-08-22 中广核工程有限公司 Calling method and device of design software, computer equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070279667A1 (en) * 2006-05-29 2007-12-06 Yasuhiro Hattori Image processing apparatus and information processing system
CN102624870A (en) * 2012-02-01 2012-08-01 北京航空航天大学 Intelligent optimization algorithm based cloud manufacturing computing resource reconfigurable collocation method
CN103235974A (en) * 2013-04-25 2013-08-07 中国科学院地理科学与资源研究所 Method for improving processing efficiency of massive spatial data
CN105760511A (en) * 2016-02-24 2016-07-13 南京信息职业技术学院 Big data self-adaption topology processing method based on storm
CN107967135A (en) * 2017-10-31 2018-04-27 平安科技(深圳)有限公司 Computing engines implementation method, electronic device and storage medium

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6721725B2 (en) * 2001-03-29 2004-04-13 Hewlett-Packard Development Company, L.P. Method of parallel trigger execution in an active database
US8490072B2 (en) * 2009-06-23 2013-07-16 International Business Machines Corporation Partitioning operator flow graphs
CN103838857B (en) * 2014-03-17 2017-02-15 中国科学院软件研究所 Automatic service combination system and method based on semantics
JP2015219575A (en) * 2014-05-14 2015-12-07 株式会社リコー Information processing system, information processor, information processing method, and program
CN105159925B (en) * 2015-08-04 2019-08-30 北京京东尚科信息技术有限公司 A kind of data-base cluster data distributing method and system
CN107729523A (en) * 2017-10-27 2018-02-23 平安科技(深圳)有限公司 Data service method, electronic installation and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070279667A1 (en) * 2006-05-29 2007-12-06 Yasuhiro Hattori Image processing apparatus and information processing system
CN102624870A (en) * 2012-02-01 2012-08-01 北京航空航天大学 Intelligent optimization algorithm based cloud manufacturing computing resource reconfigurable collocation method
CN103235974A (en) * 2013-04-25 2013-08-07 中国科学院地理科学与资源研究所 Method for improving processing efficiency of massive spatial data
CN105760511A (en) * 2016-02-24 2016-07-13 南京信息职业技术学院 Big data self-adaption topology processing method based on storm
CN107967135A (en) * 2017-10-31 2018-04-27 平安科技(深圳)有限公司 Computing engines implementation method, electronic device and storage medium

Also Published As

Publication number Publication date
CN107967135A (en) 2018-04-27
CN107967135B (en) 2020-11-13

Similar Documents

Publication Publication Date Title
WO2019085474A1 (en) Calculation engine implementing method, electronic device, and storage medium
WO2019153607A1 (en) Intelligent response method, electronic device and storage medium
US9104979B2 (en) Entity recognition using probabilities for out-of-collection data
CN109933571B (en) Database design document generation method, device and computer readable storage medium
CN111566638B (en) Adding descriptive metadata to an application programming interface for use by intelligent agents
WO2021217846A1 (en) Interface data processing method and apparatus, and computer device and storage medium
US10331441B2 (en) Source code mapping through context specific key word indexes and fingerprinting
CN108536745B (en) Shell-based data table extraction method, terminal, equipment and storage medium
JP2020074193A (en) Search method, device, facility, and non-volatile computer memory
CN106648569B (en) Target serialization realization method and device
AU2017216520A1 (en) Common data repository for improving transactional efficiencies of user interactions with a computing device
US9720946B2 (en) Efficient storage of related sparse data in a search index
CN109840120B (en) Decoupling micro-service release method, electronic device and computer readable storage medium
US20230205755A1 (en) Methods and systems for improved search for data loss prevention
US11036479B2 (en) Devices, systems, and methods of program identification, isolation, and profile attachment
US11507549B2 (en) Data normalization system
CN115543198A (en) Method and device for lake entering of unstructured data, electronic equipment and storage medium
WO2019080412A1 (en) Data service method, electronic device and storage medium
CN106502707B (en) Code generation method and device
CN112363814A (en) Task scheduling method and device, computer equipment and storage medium
US20180052696A1 (en) Providing teaching user interface activated by user action
US20140207729A1 (en) Rapid Provisioning of Information for Business Analytics
US9530094B2 (en) Jabba-type contextual tagger
JP6870454B2 (en) Analytical equipment, analytical programs and analytical methods
US20240020317A1 (en) Providing energy efficient dynamic redundancy elimination for stored data

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

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

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

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

122 Ep: pct application non-entry in european phase

Ref document number: 18872411

Country of ref document: EP

Kind code of ref document: A1