WO2019080412A1 - Data service method, electronic device and storage medium - Google Patents

Data service method, electronic device and storage medium

Info

Publication number
WO2019080412A1
WO2019080412A1 PCT/CN2018/076165 CN2018076165W WO2019080412A1 WO 2019080412 A1 WO2019080412 A1 WO 2019080412A1 CN 2018076165 W CN2018076165 W CN 2018076165W WO 2019080412 A1 WO2019080412 A1 WO 2019080412A1
Authority
WO
WIPO (PCT)
Prior art keywords
data service
data
operator
primary key
algorithm chain
Prior art date
Application number
PCT/CN2018/076165
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 WO2019080412A1 publication Critical patent/WO2019080412A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/951Indexing; Web crawling techniques

Definitions

  • the current data service engine usually provides a single data service function.
  • the scalability is poor, and the reliability, timeliness, and serviceability of the data service are insufficient.
  • the present application provides a data method, the method comprising: obtaining a step of: obtaining a data service request; and configuring a step of: parsing the data service request, configuring an algorithm chain according to the parsing result; and performing the step of: executing the configured algorithm Chain, obtaining target data from raw data in the database; output step: outputting the target data.
  • the configuring step includes: parsing the data service request, determining respective computing requirements corresponding to the data service request; determining an operator and operator combination rule corresponding to each computing requirement; and obtaining the determined An operator; the algorithm chain is configured according to the obtained operator and the operator combination rule.
  • the algorithm chain is composed of operators corresponding to respective computing requirements.
  • the storage format of the original data in the database includes: a simple type: the primary key has only one related content and a weight; the unordered list: the primary key has a plurality of related content, and the related content is unordered ; There is an ordered list: the primary key has a number of related content, the multiple related content is previously ordered.
  • the present application further provides an electronic device including a memory and a processor, wherein the memory includes a data service program, and when the data service program is executed by the processor, the following steps are performed: the obtaining step: Obtaining a data service request; configuring step: parsing the data service request, configuring an algorithm chain according to the parsing result; performing steps: executing the configured algorithm chain, acquiring target data from original data in the database; and outputting step: outputting the target data.
  • the algorithm chain is composed of operators corresponding to respective computing requirements.
  • the storage format of the original data in the database includes: a simple type: the primary key has only one related content and a weight; the unordered list: the primary key has a plurality of related content, and the related content is unordered ; There is an ordered list: the primary key has a number of related content, the multiple related content is previously ordered.
  • the present application further provides a computer readable storage medium including a data service program, when the data service program is executed by a processor, implementing the data service method as described above Any step.
  • FIG. 2 is a schematic diagram of interaction between an electronic device and a client according to a preferred embodiment of the present application
  • FIG. 3 is a program block diagram of the data service program of Figure 1;
  • Figure 4 is a schematic diagram of an operator in an algorithm chain
  • FIG. 5 is a schematic diagram of an input interface of a user in an example
  • FIG. 6 is a schematic diagram showing a display interface of target data in an example
  • FIG. 7 is a flowchart of a preferred embodiment of a data service method according to 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 data service method an electronic device, and a storage medium are proposed.
  • FIG. 1 is a schematic diagram of an operating environment 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 server, a portable computer, or a desktop computer.
  • the readable storage medium of the memory 11 is generally used to store a data service program 10 and a program configuration file installed in the electronic device 1, a database in which original data is stored, and the like.
  • the memory 11 can also be used to temporarily store data that has been output or is about to be output.
  • the processor 12 in some embodiments, may be a Central Processing Unit (CPU), microprocessor or other data processing chip for running program code or processing data stored in the memory 11, such as executing a data service 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 data service program. 10 and so on.
  • FIG. 1 shows only the electronic device 1 having the components 11-14 and the data service 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 data service 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
  • FIG. 2 it is a schematic diagram of interaction between the electronic device and the client in the preferred embodiment of the present application.
  • the data service program 10 runs in the electronic device 1.
  • the preferred embodiment of the electronic device 1 is a server.
  • the electronic device 1 is connected to the client 2 via a network.
  • the client 2 can run in various types of terminal devices, such as smart phones, portable computers, and the like.
  • the data service method can provide various data services for the user, for example, querying similar cases from a large number of cases, querying related words by keywords, querying a disease encyclopedia, and the like.
  • the memory 11 including the readable storage medium may include an operating system, a data service program 10, a program configuration file, and a database.
  • the processor 12 executes the data service program 10 stored in the memory 11, the following steps are implemented:
  • Acquisition step obtaining a data service request
  • Configuration step parsing the data service request, and configuring an algorithm chain according to the parsing result
  • FIG. 3 for a description of the program module diagram of the data service program 10 and FIG. 7 for a flowchart of the preferred embodiment of the data service method.
  • FIG. 3 it is a program module diagram of the data service program 10 in FIG.
  • the data service 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 present 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 data service program 10 can be divided into: an acquisition module 110, a configuration module 120, an execution module 130, and an output module 140.
  • the configuration module 120 is configured to parse the data service request, and configure an algorithm chain according to the parsing result.
  • the algorithm chain adopts a serial mode, that is, the algorithm chain is composed of operators corresponding to respective computing requirements.
  • the program corresponding to the algorithm chain is executed, the operator corresponding to each calculation requirement is sequentially executed in the stated order, and after the execution of the operator corresponding to the previous calculation requirement is completed, the intermediate data is output to the operator corresponding to the next calculation requirement.
  • the next operator corresponding to the calculation demand is then calculated and outputted, and so on, and the final calculation operator corresponding to the operator is executed after the execution of the output data.
  • This process is similar to the pipeline processing process.
  • the algorithm chain is split into several operators corresponding to the calculation requirements in a pipeline manner.
  • the operator processing data corresponding to each calculation requirement passes the result to the operator corresponding to the next calculation requirement. This modular processing of the pipeline can improve the operational efficiency of data services.
  • each computing requirement in the algorithm chain may correspond to one or more identical operators, and the one or more identical operators are in the algorithm chain.
  • the execution is performed in parallel and the execution results are output in a preset priority order.
  • a container represents a step of calculation, that is, a computational requirement.
  • the operator contained in a container that is, the specific operator, performs a specific computational requirement.
  • a container can contain several identical operators. These several identical operators are executed in parallel, and the main thread is set for each operator. The access to the execution results of each operator is prioritized. When the current main thread of the operator times out but still does not return the execution result, then discard the
  • the execution module 130 acquires target data from the original data of the database by executing a program corresponding to the configured algorithm chain.
  • the algorithm chain for implementing the function of finding similar cases is:
  • the output module 140 is configured to output the target data.
  • the target data may be formatted, that is, unified normalization processing.
  • the target data may be output in the form of a triplet of MyTupleList (Key, Weight, Info).
  • the original data stored in the database is a plurality of related word records, each record consisting of a word and its 10 most relevant words and relevance information, as shown below.
  • the word "intra-domain" and its 10 related words and relevance data For the word "intra-domain" and its 10 related words and relevance data:
  • Intra-domain #1 intra-area, 1.0, distribution area, 0.28298, brain area, 0.2413, area, 0.2016, arm, 0.15518, area, 0.12988, inter-area, 0.12308, aspect, 0.09344, CDF, 0.08009, clearance, 0.06984.
  • the original data is stored in the PostgreSQL (PG) database in the format of the ordered list, the original data is in the form of the following after the storage:
  • PG PostgreSQL
  • the obtaining module 110 acquires a data service request, which is generated according to input information of the user, and the input interface of the user is as shown in FIG. 5, for example.
  • the configuration module 120 parses the data service request, determines that the data service request is a related word of the query term “intra-domain”, and outputs the related words and the relevance degree of the word according to the ascending order (or descending order) of the association degree.
  • the configuration module 120 determines that the computing requirement is (1), obtains a query key (inside the domain) from the user interface, and the corresponding operator is “CommonHead”; (2) according to the query key, the slave database The corresponding data is pulled in Redis or PostgreSQL (PG), and the corresponding operator is "Retrieval”.
  • the configuration module 120 configures the algorithm chain according to the operators "CommonHead” and “Retrieval” according to the operator combination rules corresponding to the respective calculation requirements:
  • Retr RetrievalV2#6#1#2_2.
  • the "10001#022#base” and the "10001#022#8002" are algorithm numbers, and the algorithm numbers are the operator combination rules corresponding to the respective calculation requirements.
  • the execution module 130 executes the configured algorithm chain, that is, each operator in the algorithm chain is sequentially executed in sequence, and the target data is obtained by processing the word “intra-domain” of the database and its 10 related words and association degree data, and Format the output target data.
  • the presentation interface of the target data is as shown in FIG.
  • FIG. 7 a flow chart of a preferred embodiment of the data service method of the present application is shown. The following steps are implemented when the processor 12 of the electronic device 1 executes the data service program 10 stored in the memory 11 to implement the data service method:
  • the obtaining module 110 acquires a data service request.
  • the configuration module 120 parses the data service request, and configures an algorithm chain according to the analysis result. Specifically, the configuration module 120 is configured to parse the data service request, determine each computing requirement corresponding to the data service request, determine an operator and an operator combination rule corresponding to each computing requirement, and obtain the determined one from the program configuration file. An operator; the algorithm chain is configured according to the obtained operator and the operator combination rule.
  • the execution module 130 executes the configured algorithm chain to obtain target data from the original data in the database.
  • the algorithm chain may be serially composed of operators corresponding to respective computing requirements.
  • each computing requirement corresponds to one or more identical operators, the one or more identical operators are executed in parallel in the algorithm chain, and the execution results are output in a preset priority order.
  • the storage format of the original data in the database may include, for example, a simple type: the primary key has only one related content and weight; the unordered list: the primary key has a plurality of related contents, and the plurality of related contents are unordered; ordered List: The primary key has a number of related content, which is previously ordered.
  • the output module 140 outputs the target data.
  • the output module 140 may format and output the target data.
  • the data service method proposed in this embodiment can respond to the online data service request in a pipeline manner by an operator in the algorithm chain after receiving the data service request, and input and output data format of the operator in the algorithm chain. Encapsulation process to make the data format uniform, so that the operators are loosely coupled, and the data between the operators is closely combined, so the data service provided has good scalability, reliability, timeliness and Serviceability.
  • 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 storing the original data, a data service program 10, and the like. When the data service program 10 is executed by the processor 12, the following operations are implemented:
  • Acquisition step obtaining a data service request
  • Configuration step parsing the data service request, and configuring an algorithm chain according to the parsing result
  • Output step output the target data.
  • the configuration steps include:
  • the algorithm chain is configured according to the obtained operator and the operator combination rule.

Abstract

A data service method, comprising: an acquisition step: acquiring a data service request (S10); a configuration step: parsing the data service request, configuring an algorithm chain according to a parsing result (S20); an execution step: executing the configured algorithm chain, acquiring target data from original data in a database (S30); and an output step: outputting the target data (S40). The data service method can enable the provided data service to have good scalability, reliability, timeliness, and operability and maintainability.

Description

数据服务方法、电子装置及存储介质Data service method, electronic device and storage medium
本申请要求于2017年10月27日提交中国专利局、申请号为201711025277.X、发明名称为“数据服务方法、电子装置及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在申请中。This application claims the priority of the Chinese Patent Application filed on October 27, 2017, the Chinese Patent Application No. 201711025277.X, entitled "Data Service Method, Electronic Device and Storage Medium", the entire contents of which are incorporated by reference. In the application.
技术领域Technical field
本申请涉及计算机技术领域,尤其涉及一种数据服务方法、电子装置及存储介质。The present application relates to the field of computer technologies, and in particular, to a data service method, an electronic device, and a storage medium.
背景技术Background technique
随着互联网技术的发展,人类拥有的信息量呈现爆炸式增长。为了让人们能够快速地在海量数据中获取所需要的数据,市场上出现了各种数据服务引擎,这些数据服务引擎能够根据人们的输入提供相应的数据服务。例如关键词检索、查询知识百科、查找关联词等。With the development of Internet technology, the amount of information owned by human beings has exploded. In order to enable people to quickly obtain the required data in massive data, various data service engines have appeared on the market, and these data service engines can provide corresponding data services according to people's input. For example, keyword search, query knowledge encyclopedia, find related words, and so on.
然而,目前的数据服务引擎通常提供的数据服务功能较为单一,在需要扩展多种数据服务功能时,可扩展性较差,而且提供数据服务的可靠性、时效性和可运维性不足。However, the current data service engine usually provides a single data service function. When it needs to expand multiple data service functions, the scalability is poor, and the reliability, timeliness, and serviceability of the data service are insufficient.
发明内容Summary of the invention
鉴于以上原因,有必要提供一种数据服务方法,可以使提供的数据服务具有良好的可扩展性、可靠性和可运维性,且处理效率可以得到提升。In view of the above reasons, it is necessary to provide a data service method, which can provide the data service with good scalability, reliability and serviceability, and the processing efficiency can be improved.
为实现上述目的,本申请提供一种数据方法,该方法包括:获取步骤:获取数据服务请求;配置步骤:解析所述数据服务请求,根据解析结果配置算法链;执行步骤:执行所配置的算法链,从数据库中的原始数据中获取目标数据;输出步骤:输出所述目标数据。To achieve the above objective, the present application provides a data method, the method comprising: obtaining a step of: obtaining a data service request; and configuring a step of: parsing the data service request, configuring an algorithm chain according to the parsing result; and performing the step of: executing the configured algorithm Chain, obtaining target data from raw data in the database; output step: outputting the target data.
优选地,所述配置步骤包括:解析所述数据服务请求,确定该数据服务请求对应的各个计算需求;确定各个计算需求对应的算子和算子组合规则;从程序配置文件中获取所确定的算子;根据所获取的算子和所述算子组合规则配置算法链。Preferably, the configuring step includes: parsing the data service request, determining respective computing requirements corresponding to the data service request; determining an operator and operator combination rule corresponding to each computing requirement; and obtaining the determined An operator; the algorithm chain is configured according to the obtained operator and the operator combination rule.
优选地,所述算法链由各个计算需求对应的算子串行构成。Preferably, the algorithm chain is composed of operators corresponding to respective computing requirements.
可选地,每个计算需求对应一个或多个相同算子,所述一个或多个相同算子在所述算法链中并行执行,并按照预设优先顺序输出执行结果。Optionally, each computing requirement corresponds to one or more identical operators, the one or more identical operators are executed in parallel in the algorithm chain, and the execution results are output in a preset priority order.
可选地,所述原始数据在数据库中的存储格式包括:简单类型:主键只有一项相关内容和权重;无序列表:主键有多项相关内容,该多项相关内容之间为无序的;有序列表:主键有多项相关内容,该多项相关内容之前为有序的。Optionally, the storage format of the original data in the database includes: a simple type: the primary key has only one related content and a weight; the unordered list: the primary key has a plurality of related content, and the related content is unordered ; There is an ordered list: the primary key has a number of related content, the multiple related content is previously ordered.
可选地,所述输出步骤包括:格式化输出所述目标数据。Optionally, the outputting step comprises: formatting and outputting the target data.
为实现上述目的,本申请还提供一种电子装置,该电子装置包括存储器和处理器,所述存储器中包括数据服务程序,该数据服务程序被所述处理器执行时实现如下步骤:获取步骤:获取数据服务请求;配置步骤:解析所述数据服务请求,根据解析结果配置算法链;执行步骤:执行所配置的算法链,从数据库中的原始数据中获取目标数据;输出步骤:输出所述目标数据。To achieve the above objective, the present application further provides an electronic device including a memory and a processor, wherein the memory includes a data service program, and when the data service program is executed by the processor, the following steps are performed: the obtaining step: Obtaining a data service request; configuring step: parsing the data service request, configuring an algorithm chain according to the parsing result; performing steps: executing the configured algorithm chain, acquiring target data from original data in the database; and outputting step: outputting the target data.
优选地,所述配置步骤包括:解析所述数据服务请求,确定该数据服务请求对应的各个计算需求;确定各个计算需求对应的算子和算子组合规则;从程序配置文件中获取所确定的算子;根据所获取的算子和所述算子组合规则配置算法链。Preferably, the configuring step includes: parsing the data service request, determining respective computing requirements corresponding to the data service request; determining an operator and operator combination rule corresponding to each computing requirement; and obtaining the determined An operator; the algorithm chain is configured according to the obtained operator and the operator combination rule.
优选地,所述算法链由各个计算需求对应的算子串行构成。Preferably, the algorithm chain is composed of operators corresponding to respective computing requirements.
可选地,每个计算需求对应一个或多个相同算子,所述一个或多个相同算子在所述算法链中并行执行,并按照预设优先顺序输出执行结果。Optionally, each computing requirement corresponds to one or more identical operators, the one or more identical operators are executed in parallel in the algorithm chain, and the execution results are output in a preset priority order.
可选地,所述原始数据在数据库中的存储格式包括:简单类型:主键只有一项相关内容和权重;无序列表:主键有多项相关内容,该多项相关内容之间为无序的;有序列表:主键有多项相关内容,该多项相关内容之前为有序的。Optionally, the storage format of the original data in the database includes: a simple type: the primary key has only one related content and a weight; the unordered list: the primary key has a plurality of related content, and the related content is unordered ; There is an ordered list: the primary key has a number of related content, the multiple related content is previously ordered.
可选地,所述输出步骤包括:格式化输出所述目标数据。Optionally, the outputting step comprises: formatting and outputting the target data.
此外,为实现上述目的,本申请还提供一种计算机可读存储介质,所述计算机可读存储介质中包括数据服务程序,该数据服务程序被处理器执行时,实现如上所述的数据服务方法的任意步骤。In addition, in order to achieve the above object, the present application further provides a computer readable storage medium including a data service program, when the data service program is executed by a processor, implementing the data service method as described above Any step.
本申请提出的数据服务方法、电子装置及计算机可读存储介质,在接收到数据服务请求后,可以通过算法链中的算子以流水线的方式对在线数据服务请求进行响应,且对算法链中的算子输入输出的数据格式进行封装处理,使数据格式保持统一,从而使算子之间具有松耦合性,而算子之间的数据又紧密结合,因此提供的数据服务具有良好的可扩展性、可靠性、时效性和可运维性。The data service method, the electronic device and the computer readable storage medium provided by the present application can respond to the online data service request in a pipeline manner by an operator in the algorithm chain after receiving the data service request, and in the algorithm chain The data format of the input and output of the operator is encapsulated, so that the data format is kept uniform, so that the operators are loosely coupled, and the data between the operators is closely combined, so the data service provided is well scalable. Sex, reliability, timeliness and serviceability.
附图说明DRAWINGS
图1为本申请电子装置较佳实施例的运行环境示意图;1 is a schematic diagram of an operating environment of a preferred embodiment of an electronic device of the present application;
图2为本申请电子装置与客户端较佳实施例的交互示意图;2 is a schematic diagram of interaction between an electronic device and a client according to a preferred embodiment of the present application;
图3为图1中数据服务程序的程序模块图;Figure 3 is a program block diagram of the data service program of Figure 1;
图4为算法链中的算子示意图;Figure 4 is a schematic diagram of an operator in an algorithm chain;
图5为一个示例中用户的输入界面示意图;FIG. 5 is a schematic diagram of an input interface of a user in an example; FIG.
图6为一个示例中目标数据的展示界面示意图;6 is a schematic diagram showing a display interface of target data in an example;
图7为本申请数据服务方法较佳实施例的流程图。FIG. 7 is a flowchart of a preferred embodiment of a data service method according to 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 data service method, an electronic device, and a storage medium are proposed.
参照图1所示,为本申请电子装置较佳实施例的运行环境示意图。1 is a schematic diagram of an operating environment 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 server, 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及程序配置文件、存储有原始数据的数据库等。所述存储器11还可以用于暂时地存储已经输出或者将要输出的数据。In the present embodiment, the readable storage medium of the memory 11 is generally used to store a data service program 10 and a program configuration file installed in the electronic device 1, a database in which original data is stored, and the like. 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), microprocessor or other data processing chip for running program code or processing data stored in the memory 11, such as executing a data service program. 10 and so on.
图1仅示出了具有组件11-14以及数据服务程序10的电子装置1,但是应理解的是,并不要求实施所有示出的组件,可以替代的实施更多或者更少的组件。1 shows only the electronic device 1 having the components 11-14 and the data service 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 data service 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.
参阅图2所示,为本申请电子装置与客户端较佳实施例的交互示意图。所述数据服务程序10运行于电子装置1中,在图2中所述电子装置1的较佳实施例为服务器。所述电子装置1通过网络与客户端2连接。所述客户端2可以运行于各类终端设备中,例如智能手机、便携式计算机等。用户通过客户端2登录至所述电子装置1后,通过所述数据服务方法,可以为用户提供各种数据服务,例如从海量病例中查询相似病例、以关键词查询关联词、查询疾病百科等。Referring to FIG. 2, it is a schematic diagram of interaction between the electronic device and the client in the preferred embodiment of the present application. The data service program 10 runs in the electronic device 1. In Fig. 2, the preferred embodiment of the electronic device 1 is a server. The electronic device 1 is connected to the client 2 via a network. The client 2 can run in various types of terminal devices, such as smart phones, portable computers, and the like. After the user logs in to the electronic device 1 through the client 2, the data service method can provide various data services for the user, for example, querying similar cases from a large number of cases, querying related words by keywords, querying a disease encyclopedia, and the like.
在图1所示的电子装置1较佳实施例的运行环境示意图中,包含可读存储介质的存储器11中可以包括操作系统、数据服务程序10、程序配置文件及数据库。处理器12执行存储器11中存储的数据服务程序10时实现如下步骤:In the operating environment diagram of the preferred embodiment of the electronic device 1 shown in FIG. 1, the memory 11 including the readable storage medium may include an operating system, a data service program 10, a program configuration file, and a database. When the processor 12 executes the data service program 10 stored in the memory 11, the following steps are implemented:
获取步骤:获取数据服务请求;Acquisition step: obtaining a data service request;
配置步骤:解析所述数据服务请求,根据解析结果配置算法链;Configuration step: parsing the data service request, and configuring an algorithm chain according to the parsing result;
执行步骤:执行所配置的算法链,从数据库中的原始数据中获取目标数据;Performing steps: executing the configured algorithm chain to obtain target data from the original data in the database;
输出步骤:输出所述目标数据。Output step: output the target data.
其中,所述配置步骤包括:The configuration steps include:
解析所述数据服务请求,确定该数据服务请求对应的各个计算需求;Parsing the data service request, and determining respective computing requirements corresponding to the data service request;
确定各个计算需求对应的算子和算子组合规则;Determining the operator and operator combination rules corresponding to each computing requirement;
从程序配置文件中获取所确定的算子;Obtain the determined operator from the program configuration file;
根据所获取的算子和所述算子组合规则配置算法链。The algorithm chain is configured according to the obtained operator and the operator combination rule.
具体原理请参照下述图3关于数据服务程序10的程序模块图及图7关于数据服务方法较佳实施例的流程图的介绍。For specific principles, please refer to the following FIG. 3 for a description of the program module diagram of the data service program 10 and FIG. 7 for a flowchart of the preferred embodiment of the data service method.
参照图3所示,为图1中数据服务程序10的程序模块图。在本实施例中,数据服务程序10被分割为多个模块,该多个模块被存储于存储器11中,并由处理器12执行,以完成本申请。本申请所称的模块是指能够完成特定功能的一系列计算机程序指令段。Referring to FIG. 3, it is a program module diagram of the data service program 10 in FIG. In the present embodiment, the data service 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 present 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、配置模块120、执行模块130及输出模块140。The data service program 10 can be divided into: an acquisition module 110, a configuration module 120, an execution module 130, and an output module 140.
获取模块110,用于获取数据服务请求。在本实施例中,可以从客户端的用户界面中获取用户输入的数据服务请求,例如输入关键词并请求查询该关键词的关联词。The obtaining module 110 is configured to obtain a data service request. In this embodiment, a data service request input by the user may be obtained from a user interface of the client, such as inputting a keyword and requesting to query a related word of the keyword.
配置模块120,用于解析所述数据服务请求,根据解析结果配置算法链。The configuration module 120 is configured to parse the data service request, and configure an algorithm chain according to the parsing result.
具体而言,电子装置1的程序配置文件中存储有若干个算子(也称为插件)。每个算子分别对应一个特定的计算需求。例如算子CommonHead对应的计算需求为从页面获取输入数据并存入系统通用数据结构MyTupleList,而算子Hanlp对应的计算需求为关键词抽取。所述算子由开发人员预先按照规则编写开发并存入程序配置文件中,供所述数据服务程序10在提供数据服务时调用,从而进行数据处理。Specifically, a plurality of operators (also referred to as plug-ins) are stored in the program configuration file of the electronic device 1. Each operator corresponds to a specific computing requirement. For example, the computational requirement corresponding to the operator CommonHead is to obtain input data from the page and store it in the system general data structure MyTupleList, and the computational requirement corresponding to the operator Hanlp is keyword extraction. The operator is written and developed by the developer in accordance with the rules and stored in the program configuration file for the data service program 10 to call when providing the data service, thereby performing data processing.
由此,所述配置模块120具体用于:Thus, the configuration module 120 is specifically configured to:
解析所述数据服务请求,确定该数据服务请求对应的各个计算需求;Parsing the data service request, and determining respective computing requirements corresponding to the data service request;
确定各个计算需求对应的算子和算子组合规则;Determining the operator and operator combination rules corresponding to each computing requirement;
从程序配置文件中获取所确定的算子;Obtain the determined operator from the program configuration file;
根据所获取的算子和所述算子组合规则配置算法链。The algorithm chain is configured according to the obtained operator and the operator combination rule.
执行模块130,用于执行所配置的算法链,从数据库中的原始数据中获取目标数据。The execution module 130 is configured to execute the configured algorithm chain to obtain target data from the original data in the database.
其中,所述算法链采用串行模式,即所述算法链由各个计算需求对应的算子串行构成。当执行所述算法链对应的程序时,即按照所述顺序依次执行各计算需求对应的算子,前一个计算需求对应的算子执行完毕后,输出中间数据给下一个计算需求对应的算子,下一个计算需求对应的算子再对此中间 数据进行计算后输出,依此类推,最终的计算需求对应的算子执行完毕后输出结果数据。这一过程类似于流水线处理过程,将算法链以流水线方式拆分为若干计算需求对应的算子,每个计算需求对应的算子处理数据将结果传递给下一个计算需求对应的算子,通过这种流水线模块化的处理方式,可以提高数据服务的运行效率。Wherein, the algorithm chain adopts a serial mode, that is, the algorithm chain is composed of operators corresponding to respective computing requirements. When the program corresponding to the algorithm chain is executed, the operator corresponding to each calculation requirement is sequentially executed in the stated order, and after the execution of the operator corresponding to the previous calculation requirement is completed, the intermediate data is output to the operator corresponding to the next calculation requirement. The next operator corresponding to the calculation demand is then calculated and outputted, and so on, and the final calculation operator corresponding to the operator is executed after the execution of the output data. This process is similar to the pipeline processing process. The algorithm chain is split into several operators corresponding to the calculation requirements in a pipeline manner. The operator processing data corresponding to each calculation requirement passes the result to the operator corresponding to the next calculation requirement. This modular processing of the pipeline can improve the operational efficiency of data services.
此外,为了提高所述算法链的可靠性,增加容错机制,所述算法链中的每个计算需求可以对应一个或多个相同算子,所述一个或多个相同算子在所述算法链中并行执行,并按照预设优先顺序输出执行结果。Moreover, in order to improve the reliability of the algorithm chain and increase the fault tolerance mechanism, each computing requirement in the algorithm chain may correspond to one or more identical operators, and the one or more identical operators are in the algorithm chain. The execution is performed in parallel and the execution results are output in a preset priority order.
[根据细则91更正 14.08.2018] 
例如,所述算法链的结构可以参看图4所示,其中容器(container)代表一个步骤的计算,即一个计算需求。而一个container里包含的算子(operator),即具体的算子,其执行一个具体的计算需求。为了提高算法链的可靠性,一个container里可以包含若干个相同的operator,这若干个相同的operator以并行方式执行,并对每个operator设置主线程计时。各个operator的执行结果的取用具有优先顺序。当当前operator的主线程计时超时却仍未返回执行结果,则放弃该
[Correct according to Rule 91 14.08.2018]
For example, the structure of the algorithm chain can be seen in FIG. 4, where a container represents a step of calculation, that is, a computational requirement. The operator contained in a container, that is, the specific operator, performs a specific computational requirement. In order to improve the reliability of the algorithm chain, a container can contain several identical operators. These several identical operators are executed in parallel, and the main thread is set for each operator. The access to the execution results of each operator is prioritized. When the current main thread of the operator times out but still does not return the execution result, then discard the
operator的执行结果,而等待返回下一个优先级的operator的执行结果。The result of the execution of the operator, while waiting to return the execution result of the operator of the next priority.
在本实施例中,所述数据库中预先存储有若干原始数据,例如某个词语及该词语的关联词和关联度数据,某种病症及其三种症状和相应的治疗措施数据等。所述原始数据在数据库中的存储格式可以为以下三种:In this embodiment, the database is pre-stored with a plurality of original data, such as a certain word and related words and relevance data of the word, a certain symptom and its three symptoms and corresponding treatment measures data. The storage format of the original data in the database may be the following three types:
1、简单类型1, simple type
简单类型适用于主键只有一项相关内容和权重的情况,其存储可抽象为id,name,doc(weight#info)。例如,原始数据为词语“感冒”,与“感冒”关联度最高的词语“发烧”,关联度“1”,该原始数据用简单类型可以以如下格式存储在数据库中:Simple types apply when the primary key has only one related content and weight, and its storage can be abstracted as id, name, doc(weight#info). For example, the original data is the word "cold", the word "fever" with the highest degree of association with "cold", the degree of association "1", the original data can be stored in the database in the following format with a simple type:
字段Field idId nameName docDoc create_dateCreate_date
类型Types of intInt textText textText dateDate
举例Example 11 感冒#1 Cold #1 1#发烧1# fever 2017-03-172017-03-17
2、无序列表2, no sequence list
无序列表适用于主键有多项相关内容,而这些相关内容间是无序的情况,可以将每项相关内容的权重都存为1来代表无序。其存储可抽象为id,name,doc(key1#weight#info1*key2#weight#info2*…keyn#weight#infon)。例如,原始 数据为病症“感冒”,以及“感冒”的三种症状“头疼”、“流涕”、“喉咙疼”,该原始数据用无序列表可以以如下格式存储在数据库中:The unordered list is applicable to the case where the primary key has a plurality of related contents, and the related contents are unordered, and the weight of each related content can be saved as 1 to represent the disorder. Its storage can be abstracted as id, name, doc(key1#weight#info1*key2#weight#info2*...keyn#weight#infon). For example, the raw data is the disease "cold", and the three symptoms of "cold" "headache", "rogue", "throat pain", the raw data can be stored in the database in the following format using an unordered list:
Figure PCTCN2018076165-appb-000001
Figure PCTCN2018076165-appb-000001
3、有序列表3, the ordered list
有序列表适用于主键有多项相关内容,这些相关内容间是有序的情况,可以用每项相关内容的权重来表示有序。其存储可抽象为id,name,doc(key1#weight1#info1*key2#weight2#info2*…keyn#weightn#infon)。例如,原始数据为词语“域内”,以该词语的10个关联词和关联度,该原始数据用有序列表可以以如下格式存储在数据库中:The ordered list is applicable to the primary key having a plurality of related contents, and the related contents are in an orderly manner, and the weight of each related content can be used to indicate the order. Its storage can be abstracted as id, name, doc(key1#weight1#info1*key2#weight2#info2*...keyn#weightn#infon). For example, the original data is the word "intra-domain", with 10 related words and relevance of the word, the original data can be stored in the database in the following format using an ordered list:
Figure PCTCN2018076165-appb-000002
Figure PCTCN2018076165-appb-000002
由上,执行模块130通过执行所配置的算法链对应的程序,从数据库的所述原始数据中获取目标数据。例如,针对实现查找相似病例功能的算法链为:From above, the execution module 130 acquires target data from the original data of the database by executing a program corresponding to the configured algorithm chain. For example, the algorithm chain for implementing the function of finding similar cases is:
算子Hanlp—>算子Retrieval—>算子Scoring—>算子HeapSort—>算子RetrievalDocOperator Hanlp—> operator Retrieval—> operator Scoring—> operator HeapSort—> operator RetrievalDoc
上述算子Hanlp、Retrieval、Scoring、HeapSort、RetrievalDoc的功能依次为:对中文切词、获取可能符合要求的文档ID、通过BM25算法对文档ID打分、对打分结果通过堆排序方式排序、通过文档ID取回文档正文。通过依次执行上述算子,即可以从数据库中的病例原始数据里获得用户请求的相似病例作为目标数据。The functions of the above operators Hanlp, Retrieval, Scoring, HeapSort, and RetrievalDoc are as follows: cutting the Chinese words, obtaining the document IDs that may meet the requirements, scoring the document IDs by the BM25 algorithm, sorting the scoring results by heap sorting, and passing the document ID. Retrieve the body of the document. By sequentially executing the above-mentioned operators, similar cases requested by the user can be obtained from the case raw data in the database as target data.
输出模块140,用于输出所述目标数据。为了适应各种不同来源、不同格式、不同字段数、不同类型的输入数据,可以对所述目标数据进行格式化,即统一规范化处理。例如,可以对所述目标数据按照MyTupleList(Key,Weight,Info)这一三元组形式输出。The output module 140 is configured to output the target data. In order to adapt to various sources, different formats, different number of fields, and different types of input data, the target data may be formatted, that is, unified normalization processing. For example, the target data may be output in the form of a triplet of MyTupleList (Key, Weight, Info).
[根据细则91更正 14.08.2018] 
在图4中,“输入结果(InputResult)”、“输出结果(OutputResult)”为用于在算子间传递中间结果的共用数据结构,可以采用封装方式对输出数据进行格式化,即统一规范化。例如,在本实施例中可以通过工具类PGToolT和RAOTool实现功能的选择和封装,而对各种格式数据的类作为IDaoBasic的接口来实现,对外输出均为MyTupleList(Key,Weight,Info)这一三元组形式。
[Correct according to Rule 91 14.08.2018]
In FIG. 4, "InputResult" and "OutputResult" are common data structures for transferring intermediate results between operators, and the output data can be formatted in a packaged manner, that is, unified normalization. For example, in this embodiment, the function selection and encapsulation can be implemented by the tools PGToolT and RAOTool, and the classes of various format data are implemented as an interface of IDaoBasic, and the external output is MyTupleList (Key, Weight, Info). The form of the triple.
下面举一个具体实施例,在本实施例中,数据库中存储的原始数据为若干条关联词记录,每条记录由一个词语及其10个关联度最高的词语和关联度信息组成,如下所示,为词语“域内”及其10个关联词和关联度数据:In the following embodiment, the original data stored in the database is a plurality of related word records, each record consisting of a word and its 10 most relevant words and relevance information, as shown below. For the word "intra-domain" and its 10 related words and relevance data:
域内#1,区域内,1.0,分布区,0.28298,脑区,0.2413,区内,0.2016,胳膊,0.15518,区域,0.12988,区域间,0.12308,纵横,0.09344,CDF,0.08009,廓清,0.06984。 Intra-domain #1, intra-area, 1.0, distribution area, 0.28298, brain area, 0.2413, area, 0.2016, arm, 0.15518, area, 0.12988, inter-area, 0.12308, aspect, 0.09344, CDF, 0.08009, clearance, 0.06984.
由于关联词的关联度不同,是存在顺序性的,因此若采用有序列表的格式将所述原始数据存入PostgreSQL(PG)数据库,则入库后该原始数据的形式如下:Since the relevance of the related words is different, there is a sequence. Therefore, if the original data is stored in the PostgreSQL (PG) database in the format of the ordered list, the original data is in the form of the following after the storage:
Figure PCTCN2018076165-appb-000003
Figure PCTCN2018076165-appb-000003
获取模块110获取数据服务请求,所述数据服务请求是根据用户的输入信息生成的,用户的输入界面例如图5所示。The obtaining module 110 acquires a data service request, which is generated according to input information of the user, and the input interface of the user is as shown in FIG. 5, for example.
配置模块120获取数据服务请求后,解析该数据服务请求,确定该数据服务请求为查询词语“域内”的关联词,并按照关联度升序(或降序)输出该词语的关联词和关联度。After obtaining the data service request, the configuration module 120 parses the data service request, determines that the data service request is a related word of the query term “intra-domain”, and outputs the related words and the relevance degree of the word according to the ascending order (or descending order) of the association degree.
根据所述数据服务请求,配置模块120确定计算需求为(1)、从用户界面中获取查询key(域内),其对应的算子为“CommonHead”;(2)、根据该查询key,从数据库Redis或PostgreSQL(PG)中拉取相应数据,其对应的算 子为“Retrieval”。根据所述算子“CommonHead”和“Retrieval”以所述各计算需求对应的算子组合规则,配置模块120配置算法链如下:According to the data service request, the configuration module 120 determines that the computing requirement is (1), obtains a query key (inside the domain) from the user interface, and the corresponding operator is “CommonHead”; (2) according to the query key, the slave database The corresponding data is pulled in Redis or PostgreSQL (PG), and the corresponding operator is "Retrieval". The configuration module 120 configures the algorithm chain according to the operators "CommonHead" and "Retrieval" according to the operator combination rules corresponding to the respective calculation requirements:
10001#022#base10001#022#base
10001#022#8002;10001#022#8002;
Com:CommonHeadV2#-1#-1#1;Com:CommonHeadV2#-1#-1#1;
Retr:RetrievalV2#6#1#2_2。Retr: RetrievalV2#6#1#2_2.
其中“10001#022#base”和“10001#022#8002”为算法号,所述算法号即指示所述各计算需求对应的算子组合规则。The "10001#022#base" and the "10001#022#8002" are algorithm numbers, and the algorithm numbers are the operator combination rules corresponding to the respective calculation requirements.
执行模块130执行所配置的算法链,即算法链中的各算子按照顺序依次执行,对数据库的所述词语“域内”及其10个关联词和关联度数据进行处理后,获取目标数据,并格式化输出目标数据。在一个实施例中,所述目标数据的展示界面例如图6所示。The execution module 130 executes the configured algorithm chain, that is, each operator in the algorithm chain is sequentially executed in sequence, and the target data is obtained by processing the word “intra-domain” of the database and its 10 related words and association degree data, and Format the output target data. In one embodiment, the presentation interface of the target data is as shown in FIG.
参阅图7所示,为本申请数据服务方法较佳实施例的流程图。电子装置1的处理器12执行存储器11中存储的数据服务程序10时实现数据服务方法的如下步骤:Referring to FIG. 7, a flow chart of a preferred embodiment of the data service method of the present application is shown. The following steps are implemented when the processor 12 of the electronic device 1 executes the data service program 10 stored in the memory 11 to implement the data service method:
S10,获取模块110获取数据服务请求。S10. The obtaining module 110 acquires a data service request.
S20,配置模块120解析所述数据服务请求,根据解析结果配置算法链。具体而言,配置模块120用于解析所述数据服务请求,确定该数据服务请求对应的各个计算需求;确定各个计算需求对应的算子和算子组合规则;从程序配置文件中获取所确定的算子;根据所获取的算子和所述算子组合规则配置算法链。S20. The configuration module 120 parses the data service request, and configures an algorithm chain according to the analysis result. Specifically, the configuration module 120 is configured to parse the data service request, determine each computing requirement corresponding to the data service request, determine an operator and an operator combination rule corresponding to each computing requirement, and obtain the determined one from the program configuration file. An operator; the algorithm chain is configured according to the obtained operator and the operator combination rule.
S30,执行模块130执行所配置的算法链,从数据库中的原始数据中获取目标数据。可选地,所述算法链可以由各个计算需求对应的算子串行构成。可选地,每个计算需求对应一个或多个相同算子,所述一个或多个相同算子在所述算法链中并行执行,并按照预设优先顺序输出执行结果。所述原始数据在数据库中的存储格式例如可以包括简单类型:主键只有一项相关内容和权重;无序列表:主键有多项相关内容,该多项相关内容之间为无序的;有序列表:主键有多项相关内容,该多项相关内容之前为有序的。S30. The execution module 130 executes the configured algorithm chain to obtain target data from the original data in the database. Optionally, the algorithm chain may be serially composed of operators corresponding to respective computing requirements. Optionally, each computing requirement corresponds to one or more identical operators, the one or more identical operators are executed in parallel in the algorithm chain, and the execution results are output in a preset priority order. The storage format of the original data in the database may include, for example, a simple type: the primary key has only one related content and weight; the unordered list: the primary key has a plurality of related contents, and the plurality of related contents are unordered; ordered List: The primary key has a number of related content, which is previously ordered.
S40,输出模块140输出所述目标数据。可选地,所述输出模块140可以 格式化输出所述目标数据。S40. The output module 140 outputs the target data. Optionally, the output module 140 may format and output the target data.
本实施例提出的数据服务方法,在接收到数据服务请求后,可以通过算法链中的算子以流水线的方式对在线数据服务请求进行响应,且对算法链中的算子输入输出的数据格式进行封装处理,使数据格式保持统一,从而使算子之间具有松耦合性,而算子之间的数据又紧密结合,因此提供的数据服务具有良好的可扩展性、可靠性、时效性和可运维性。The data service method proposed in this embodiment can respond to the online data service request in a pipeline manner by an operator in the algorithm chain after receiving the data service request, and input and output data format of the operator in the algorithm chain. Encapsulation process to make the data format uniform, so that the operators are loosely coupled, and the data between the operators is closely combined, so the data service provided has good scalability, reliability, timeliness and Serviceability.
此外,本申请实施例还提出一种计算机可读存储介质,所述计算机可读存储介质可以是硬盘、多媒体卡、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 storing the original data, a data service program 10, and the like. When the data service program 10 is executed by the processor 12, the following operations are implemented:
获取步骤:获取数据服务请求;Acquisition step: obtaining a data service request;
配置步骤:解析所述数据服务请求,根据解析结果配置算法链;Configuration step: parsing the data service request, and configuring an algorithm chain according to the parsing result;
执行步骤:执行所配置的算法链,从数据库中的原始数据中获取目标数据;Performing steps: executing the configured algorithm chain to obtain target data from the original data in the database;
输出步骤:输出所述目标数据。Output step: output the target data.
其中,所述配置步骤包括:The configuration steps include:
解析所述数据服务请求,确定该数据服务请求对应的各个计算需求;Parsing the data service request, and determining respective computing requirements corresponding to the data service request;
确定各个计算需求对应的算子和算子组合规则;Determining the operator and operator combination rules corresponding to each computing requirement;
从程序配置文件中获取所确定的算子;Obtain the determined operator from the program configuration file;
根据所获取的算子和所述算子组合规则配置算法链。The algorithm chain is configured according to the obtained operator and the operator combination rule.
本申请之计算机可读存储介质的具体实施方式与上述数据服务方法以及电子装置1的具体实施方式大致相同,在此不再赘述。The specific implementation of the computer readable storage medium of the present application is substantially the same as the above-described data service method and the specific embodiment 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 elements in the process, the device, the item, or the method of 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 data service method, applied to a computing device, characterized in that the method comprises:
    获取步骤:获取数据服务请求;Acquisition step: obtaining a data service request;
    配置步骤:解析所述数据服务请求,根据解析结果配置算法链;Configuration step: parsing the data service request, and configuring an algorithm chain according to the parsing result;
    执行步骤:执行所配置的算法链,从数据库中的原始数据中获取目标数据;Performing steps: executing the configured algorithm chain to obtain target data from the original data in the database;
    输出步骤:输出所述目标数据。Output step: output the target data.
  2. 如权利要求1所述的数据服务方法,其特征在于,所述配置步骤包括:The data service method according to claim 1, wherein said configuring step comprises:
    解析所述数据服务请求,确定该数据服务请求对应的各个计算需求;Parsing the data service request, and determining respective computing requirements corresponding to the data service request;
    确定各个计算需求对应的算子和算子组合规则;Determining the operator and operator combination rules corresponding to each computing requirement;
    从程序配置文件中获取所确定的算子;Obtain the determined operator from the program configuration file;
    根据所获取的算子和所述算子组合规则配置算法链。The algorithm chain is configured according to the obtained operator and the operator combination rule.
  3. 如权利要求2所述的数据服务方法,其特征在于,所述算法链由各个计算需求对应的算子串行构成。The data service method according to claim 2, wherein said algorithm chain is serially composed of operators corresponding to respective computational requirements.
  4. 如权利要求2所述的数据服务方法,其特征在于,每个计算需求对应一个或多个相同算子,所述一个或多个相同算子在所述算法链中并行执行,并按照预设优先顺序输出执行结果。The data service method according to claim 2, wherein each calculation requirement corresponds to one or more identical operators, and the one or more identical operators are executed in parallel in the algorithm chain, and are preset according to the preset The execution result is output in priority order.
  5. 如权利要求1所述的数据服务方法,其特征在于,所述原始数据在数据库中的存储格式包括:The data service method according to claim 1, wherein the storage format of the original data in the database comprises:
    简单类型:主键只有一项相关内容和权重;Simple type: The primary key has only one related content and weight;
    无序列表:主键有多项相关内容,该多项相关内容之间为无序的;Unordered list: The primary key has a plurality of related contents, and the related contents are unordered;
    有序列表:主键有多项相关内容,该多项相关内容之前为有序的。There is an ordered list: the primary key has a number of related content, and the related content is previously ordered.
  6. 如权利要求2所述的数据服务方法,其特征在于,所述原始数据在数据库中的存储格式包括:The data service method according to claim 2, wherein the storage format of the original data in the database comprises:
    简单类型:主键只有一项相关内容和权重;Simple type: The primary key has only one related content and weight;
    无序列表:主键有多项相关内容,该多项相关内容之间为无序的;Unordered list: The primary key has a plurality of related contents, and the related contents are unordered;
    有序列表:主键有多项相关内容,该多项相关内容之前为有序的。There is an ordered list: the primary key has a number of related content, and the related content is previously ordered.
  7. 如权利要求1-6任一项所述的数据服务方法,其特征在于,所述输出步骤包括:The data service method according to any one of claims 1 to 6, wherein the outputting step comprises:
    格式化输出所述目标数据。Formatting and outputting the target data.
  8. 一种电子装置,包括存储器和处理器,其特征在于,所述存储器中包括数据服务程序,该数据服务程序被所述处理器执行时实现如下步骤:An electronic device includes a memory and a processor, wherein the memory includes a data service program, and when the data service program is executed by the processor, the following steps are implemented:
    获取步骤:获取数据服务请求;Acquisition step: obtaining a data service request;
    配置步骤:解析所述数据服务请求,根据解析结果配置算法链;Configuration step: parsing the data service request, and configuring an algorithm chain according to the parsing result;
    执行步骤:执行所配置的算法链,从数据库中的原始数据中获取目标数据;Performing steps: executing the configured algorithm chain to obtain target data from the original data in the database;
    输出步骤:输出所述目标数据。Output step: output the target data.
  9. 如权利要求8所述的电子装置,其特征在于,所述配置步骤包括:The electronic device of claim 8, wherein the configuring step comprises:
    解析所述数据服务请求,确定该数据服务请求对应的各个计算需求;Parsing the data service request, and determining respective computing requirements corresponding to the data service request;
    确定各个计算需求对应的算子和算子组合规则;Determining the operator and operator combination rules corresponding to each computing requirement;
    从程序配置文件中获取所确定的算子;Obtain the determined operator from the program configuration file;
    根据所获取的算子和所述算子组合规则配置算法链。The algorithm chain is configured according to the obtained operator and the operator combination rule.
  10. 如权利要求9所述的电子装置,其特征在于,所述算法链由各个计算需求对应的算子串行构成。The electronic device according to claim 9, wherein said algorithm chain is serially composed of operators corresponding to respective computational requirements.
  11. 如权利要求9所述的电子装置,其特征在于,每个计算需求对应一个或多个相同算子,所述一个或多个相同算子在所述算法链中并行执行,并按照预设优先顺序输出执行结果。The electronic device according to claim 9, wherein each computing requirement corresponds to one or more identical operators, and the one or more identical operators are executed in parallel in the algorithm chain, and are preset according to a preset priority. The output is executed in sequence.
  12. 如权利要求8所述的电子装置,其特征在于,所述原始数据在数据库中的存储格式包括:The electronic device according to claim 8, wherein the storage format of the original data in the database comprises:
    简单类型:主键只有一项相关内容和权重;Simple type: The primary key has only one related content and weight;
    无序列表:主键有多项相关内容,该多项相关内容之间为无序的;Unordered list: The primary key has a plurality of related contents, and the related contents are unordered;
    有序列表:主键有多项相关内容,该多项相关内容之前为有序的。There is an ordered list: the primary key has a number of related content, and the related content is previously ordered.
  13. 如权利要求9所述的电子装置,其特征在于,所述原始数据在数据库中的存储格式包括:The electronic device according to claim 9, wherein the storage format of the original data in the database comprises:
    简单类型:主键只有一项相关内容和权重;Simple type: The primary key has only one related content and weight;
    无序列表:主键有多项相关内容,该多项相关内容之间为无序的;Unordered list: The primary key has a plurality of related contents, and the related contents are unordered;
    有序列表:主键有多项相关内容,该多项相关内容之前为有序的。There is an ordered list: the primary key has a number of related content, and the related content is previously ordered.
  14. 如权利要求8-13任一项所述的电子装置,其特征在于,所述输出步骤包括:The electronic device according to any one of claims 8 to 13, wherein the outputting step comprises:
    格式化输出所述目标数据。Formatting and outputting the target data.
  15. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质中包括数据服务程序,该数据服务程序被处理器执行时实现如下步骤:A computer readable storage medium, comprising: a data service program, wherein the data service program is executed by a processor to implement the following steps:
    获取步骤:获取数据服务请求;Acquisition step: obtaining a data service request;
    配置步骤:解析所述数据服务请求,根据解析结果配置算法链;Configuration step: parsing the data service request, and configuring an algorithm chain according to the parsing result;
    执行步骤:执行所配置的算法链,从数据库中的原始数据中获取目标数据;Performing steps: executing the configured algorithm chain to obtain target data from the original data in the database;
    输出步骤:输出所述目标数据。Output step: output the target data.
  16. 如权利要求15所述的计算机可读存储介质,其特征在于,所述配置步骤包括:The computer readable storage medium of claim 15 wherein said configuring step comprises:
    解析所述数据服务请求,确定该数据服务请求对应的各个计算需求;Parsing the data service request, and determining respective computing requirements corresponding to the data service request;
    确定各个计算需求对应的算子和算子组合规则;Determining the operator and operator combination rules corresponding to each computing requirement;
    从程序配置文件中获取所确定的算子;Obtain the determined operator from the program configuration file;
    根据所获取的算子和所述算子组合规则配置算法链。The algorithm chain is configured according to the obtained operator and the operator combination rule.
  17. 如权利要求16所述的计算机可读存储介质,其特征在于,每个计算需求对应一个或多个相同算子,所述一个或多个相同算子在所述算法链中并行执行,并按照预设优先顺序输出执行结果。The computer readable storage medium of claim 16 wherein each computing requirement corresponds to one or more identical operators, said one or more identical operators being executed in parallel in said algorithm chain and The execution result is output in a preset priority order.
  18. 如权利要求16所述的计算机可读存储介质,其特征在于,每个计算需求对应一个或多个相同算子,所述一个或多个相同算子在所述算法链中并行执行,并按照预设优先顺序输出执行结果。The computer readable storage medium of claim 16 wherein each computing requirement corresponds to one or more identical operators, said one or more identical operators being executed in parallel in said algorithm chain and The execution result is output in a preset priority order.
  19. 如权利要求15或16所述的计算机可读存储介质,其特征在于,所述原始数据在数据库中的存储格式包括:The computer readable storage medium according to claim 15 or 16, wherein the storage format of the original data in the database comprises:
    简单类型:主键只有一项相关内容和权重;Simple type: The primary key has only one related content and weight;
    无序列表:主键有多项相关内容,该多项相关内容之间为无序的;Unordered list: The primary key has a plurality of related contents, and the related contents are unordered;
    有序列表:主键有多项相关内容,该多项相关内容之前为有序的。There is an ordered list: the primary key has a number of related content, and the related content is previously ordered.
  20. 如权利要求19所述的计算机可读存储介质,其特征在于,所述输出步骤包括:The computer readable storage medium of claim 19, wherein the outputting comprises:
    格式化输出所述目标数据。Formatting and outputting the target data.
PCT/CN2018/076165 2017-10-27 2018-02-10 Data service method, electronic device and storage medium WO2019080412A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201711025277.XA CN107729523A (en) 2017-10-27 2017-10-27 Data service method, electronic installation and storage medium
CN201711025277.X 2017-10-27

Publications (1)

Publication Number Publication Date
WO2019080412A1 true WO2019080412A1 (en) 2019-05-02

Family

ID=61202778

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/076165 WO2019080412A1 (en) 2017-10-27 2018-02-10 Data service method, electronic device and storage medium

Country Status (2)

Country Link
CN (1) CN107729523A (en)
WO (1) WO2019080412A1 (en)

Families Citing this family (3)

* 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
CN109657782B (en) * 2018-12-14 2020-10-27 安徽寒武纪信息科技有限公司 Operation method, device and related product
CN109740730B (en) * 2018-12-14 2020-10-23 安徽寒武纪信息科技有限公司 Operation method, device and related product

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102270232A (en) * 2011-07-21 2011-12-07 华中科技大学 Semantic data query system with optimized storage
CN103186650A (en) * 2011-12-30 2013-07-03 中国移动通信集团四川有限公司 Searching method and device
CN104239021A (en) * 2013-06-21 2014-12-24 阿里巴巴集团控股有限公司 Search engine query string generation method and device and search engine system
CN105072139A (en) * 2015-06-26 2015-11-18 腾讯科技(深圳)有限公司 Recommendation method and recommendation device

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104267939B (en) * 2014-09-17 2017-08-29 华为技术有限公司 A kind of method of business processing, apparatus and system
CN105183470B (en) * 2015-09-06 2018-11-30 东南大学 A kind of natural language processing system service platform
CN105760511B (en) * 2016-02-24 2018-11-13 南京信息职业技术学院 A kind of big data adaptive topology processing method based on storm
CN106611037A (en) * 2016-09-12 2017-05-03 星环信息科技(上海)有限公司 Method and device for distributed diagram calculation

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102270232A (en) * 2011-07-21 2011-12-07 华中科技大学 Semantic data query system with optimized storage
CN103186650A (en) * 2011-12-30 2013-07-03 中国移动通信集团四川有限公司 Searching method and device
CN104239021A (en) * 2013-06-21 2014-12-24 阿里巴巴集团控股有限公司 Search engine query string generation method and device and search engine system
CN105072139A (en) * 2015-06-26 2015-11-18 腾讯科技(深圳)有限公司 Recommendation method and recommendation device

Also Published As

Publication number Publication date
CN107729523A (en) 2018-02-23

Similar Documents

Publication Publication Date Title
US11544623B2 (en) Consistent filtering of machine learning data
US11210307B2 (en) Consolidator platform to implement collaborative datasets via distributed computer networks
US11714602B2 (en) Methods and systems for identifying a level of similarity between a plurality of data representations
US20210049198A1 (en) Methods and Systems for Identifying a Level of Similarity Between a Filtering Criterion and a Data Item within a Set of Streamed Documents
WO2019085474A1 (en) Calculation engine implementing method, electronic device, and storage medium
US10346429B2 (en) Management of collaborative datasets via distributed computer networks
US8688702B1 (en) Techniques for using dynamic data sources with static search mechanisms
US11308031B2 (en) Resolving in-memory foreign keys in transmitted data packets from single-parent hierarchies
US20170364569A1 (en) Collaborative dataset consolidation via distributed computer networks
US10733370B2 (en) Method, apparatus, and computer program product for generating a preview of an electronic document
US11030242B1 (en) Indexing and querying semi-structured documents using a key-value store
EP3420469B1 (en) Content classes for object storage indexing systems
CN112136123A (en) Characterizing documents for similarity search
WO2019080412A1 (en) Data service method, electronic device and storage medium
US20180067986A1 (en) Database model with improved storage and search string generation techniques
AU2014309318B2 (en) System and method for implementing a 64 bit data searching and delivery portal
WO2021027149A1 (en) Portrait similarity-based information retrieval recommendation method and device and storage medium
CN109840120B (en) Decoupling micro-service release method, electronic device and computer readable storage medium
US9679066B2 (en) Search results based on an environment context
WO2019000697A1 (en) Information search method, system, server, and readable storage medium
US11947554B2 (en) Loading collaborative datasets into data stores for queries via distributed computer networks
CN110471901B (en) Data importing method and terminal equipment
US20140365542A1 (en) Data processing system and method
JP2010272082A (en) System, method and program for sharing information
CN114816421A (en) Code conversion method and device, electronic equipment and storage medium

Legal Events

Date Code Title Description
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 29/09/2020)

122 Ep: pct application non-entry in european phase

Ref document number: 18871073

Country of ref document: EP

Kind code of ref document: A1