Thinking graph-based complex algorithm implementation method, computer storage medium and equipment

文档序号:134952 发布日期:2021-10-22 浏览:24次 中文

阅读说明:本技术 基于思维图的复杂算法实现方法、计算机存储介质及设备 (Thinking graph-based complex algorithm implementation method, computer storage medium and equipment ) 是由 朱平 史进 于 2021-06-23 设计创作,主要内容包括:本发明提出一种基于思维图的复杂算法实现方法、计算机存储介质及设备,该方法包括:根据待设计程序需要实现的业务功能以及与业务功能相关的操作数据解析待设计程序的业务逻辑,得到多个逻辑模块;基于思维图对各逻辑模块进行功能及数据接口描述,得到对应的思维图;对各思维图进行功能抽象,将具有共性功能的思维图抽象到基础类,将具有特有属性功能的思维图作为继承基础类的应用类思维图,实现待设计程序的逻辑框架构建。本发明能够自顶向下对复杂算法的宏观逻辑进行较好的把握,可以将晦涩的程序代码表示为直观的思维逻辑图,有利于调试问题的快速定位和程序维护,而且对于类似逻辑模块代码可复用,有效提高复杂算法的程序编码效率。(The invention provides a thinking-graph-based complex algorithm implementation method, a computer storage medium and equipment, wherein the method comprises the following steps: analyzing the service logic of the program to be designed according to the service function to be realized by the program to be designed and the operation data related to the service function to obtain a plurality of logic modules; describing functions and data interfaces of each logic module based on the thinking diagram to obtain a corresponding thinking diagram; and performing function abstraction on each mind map, abstracting the mind maps with common functions to a basic class, and using the mind maps with specific attribute functions as an application class mind map for inheriting the basic class to realize the construction of a logic framework of the program to be designed. The invention can better grasp the macroscopic logic of the complex algorithm from top to bottom, can express obscure program codes as an intuitive thinking logic diagram, is beneficial to the rapid positioning and the program maintenance of debugging problems, can multiplex codes of similar logic modules and effectively improves the program coding efficiency of the complex algorithm.)

1. A thinking graph-based complex algorithm implementation method is characterized by comprising the following steps:

analyzing the service logic of the program to be designed according to the service function to be realized by the program to be designed and the operation data related to the service function to obtain a plurality of logic modules;

performing function and data interface description on each logic module from a logic point of view based on a thinking diagram with a preset logic structure to obtain a thinking diagram corresponding to each logic module;

the method comprises the steps of performing function abstraction on each mind map, abstracting the mind maps with common functions to a basic class, and using the mind maps with specific attribute functions as an application class mind map of an inheritance basic class so as to realize the construction of a logic framework of a program to be designed;

and designing logic function codes based on the obtained logic framework.

2. The method of claim 1, wherein the preset logic structure comprises the following components: functional description, private data, example information, public data, data interfaces, and execution direction.

3. The method of claim 2, wherein after logically describing the functions and data interfaces of the logical modules based on the mind map having the preset logical structure, the method further comprises:

dividing the current thinking graph into a plurality of continuously executed thinking graphs according to the logic flow of the logic module corresponding to each thinking graph, wherein the thinking graphs have the same preset logic structure, the public data of each thinking graph is the external global data of the plurality of corresponding thinking graphs, and the sum of the private data, the example information and the data interface of the plurality of thinking graphs forms the private data, the example information and the data interface of the corresponding thinking graph.

4. The method of claim 2, wherein after logically describing the functions and data interfaces of the logical modules based on the mind map having the preset logical structure, the method further comprises:

and creating parallel thinking graphs for the thinking graphs according to the logic functions of the logic modules corresponding to the thinking graphs, wherein the parallel thinking graphs are used for describing the key logic functions of the corresponding logic modules.

5. The method of claim 1, wherein after logically describing the functions and data interfaces of the logical modules based on a mind map having a preset logical structure, the method further comprises:

and describing the corresponding thinking diagram by adopting multiple data configuration files according to the inheritance relationship and the polymorphism of each logic module.

6. The method of claim 5, wherein said employing multiple data profiles to describe a corresponding mind map comprises:

describing the explicit inheritance relationship of the thinking graph by adopting a dynamic common sense attribute configuration file;

describing the implicit inheritance relationship of the mind map by adopting a static common sense attribute configuration file;

and describing the polymorphism of the thinking diagram by adopting a polymorphic recognition configuration file.

7. The method of any one of claims 1-6, further comprising:

and constructing a storage index for each mind map, and storing the mind map based on the storage index, wherein the storage index of the mind map is divided into a transverse dimension and a longitudinal dimension, the transverse dimension represents an execution flow, and the longitudinal dimension represents a function containing relationship.

8. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 7.

9. A computer arrangement comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the steps of the method according to any of claims 1-7 are implemented when the computer program is executed by the processor.

Technical Field

The invention relates to the technical field of computers, in particular to a thinking-graph-based complex algorithm implementation method, a computer storage medium and a device.

Background

The complex algorithm is a machine solving process with large input variety, intensive knowledge, unknown range, ambiguous internal processing flow, complex algorithm logic, huge scale and long research and development period. When dealing with such problems, the conventional programming method is to continuously update and patch codes iteratively, programmers are easy to get lost in the gradually complicated codes and lose control over the whole logic, and the algorithm design and maintenance cost rises exponentially along with the work progress.

The existing solution is model driven architecture MDA, software requirement specification and flow chart technology, and attempts to improve the design and maintenance problems of complex algorithms through program data separation, modification of requirement specification and flow chart logic, and automatic program design. The prior art has the problems that an MDA architecture can be used for reference, but different complex algorithm logic designs and maintenance architectures are different, and specific problem specific analysis is needed; the specification of the requirement is focused on the identification of the requirement of the user, and the internal logic flow of the algorithm is inconvenient to modify and determine; the flow chart is biased to the bottom of program design, although the realization of automatic program design is convenient, the high-level logic semantics is lacked, the updating backup mechanism is not modified, the logic modification complexity is still very high, the design and maintenance cost is very high, the description of the uncertain program logic is still inconvenient, the use is very inconvenient, and the practical application complexity is too high.

Disclosure of Invention

In view of the above, the present invention has been developed to provide a method, computer storage medium, and apparatus for implementing a complex mind map-based algorithm that overcome, or at least partially address, the above-described problems.

The invention provides a thinking diagram-based complex algorithm implementation method, which comprises the following steps:

analyzing the service logic of the program to be designed according to the service function to be realized by the program to be designed and the operation data related to the service function to obtain a plurality of logic modules;

performing function and data interface description on each logic module from a logic point of view based on a thinking diagram with a preset logic structure to obtain a thinking diagram corresponding to each logic module;

the method comprises the steps of performing function abstraction on each mind map, abstracting the mind maps with common functions into a basic class, and using the mind maps with specific attribute functions as an application class mind map of an inheritance basic class so as to realize the construction of a logic framework of a program to be designed;

and designing logic function codes based on the obtained logic framework.

Optionally, the preset logic structure includes the following components: functional description, private data, example information, public data, data interfaces, and execution direction.

Optionally, after logically describing the functions and data interfaces of each logic module based on the mind map with the preset logic structure, the method further comprises:

dividing the current thinking graph into a plurality of continuously executed thinking graphs according to the logic flow of the logic module corresponding to each thinking graph, wherein the thinking graphs have the same preset logic structure, the public data of each thinking graph is the external global data of the plurality of corresponding thinking graphs, and the sum of the private data, the example information and the data interface of the plurality of thinking graphs forms the private data, the example information and the data interface of the corresponding thinking graph.

Optionally, after logically describing the functions and data interfaces of each logic module based on the mind map with the preset logic structure, the method further comprises:

and creating parallel thinking graphs for the thinking graphs according to the logic functions of the logic modules corresponding to the thinking graphs, wherein the parallel thinking graphs are used for describing the key logic functions of the corresponding logic modules.

Optionally, after logically describing the functions and data interfaces of each logic module based on the mind map with the preset logic structure, the method further comprises:

and describing the corresponding thinking diagram by adopting multiple data configuration files according to the inheritance relationship and the polymorphism of each logic module.

Optionally, the describing the corresponding mind map by using multiple data configuration files includes:

describing the explicit inheritance relationship of the thinking graph by adopting a dynamic common sense attribute configuration file;

describing the implicit inheritance relationship of the mind map by adopting a static common sense attribute configuration file;

and describing the polymorphism of the thinking diagram by adopting a polymorphic recognition configuration file.

Optionally, the method further comprises:

and constructing a storage index for each mind map, and storing the mind map based on the storage index, wherein the storage index of the mind map is divided into a transverse dimension and a longitudinal dimension, the transverse dimension represents an execution flow, and the longitudinal dimension represents a function containing relationship.

The present invention provides a computer-readable storage medium having stored thereon a computer program which, when being executed by a processor, carries out the steps of the method as set forth above.

The invention provides a computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the steps of the method as described above when executing the computer program.

The thinking-graph-based complex algorithm implementation method, the computer storage medium and the equipment can better grasp the macroscopic logic of the complex algorithm from top to bottom, obscure program codes can be represented as an intuitive thinking logic graph by using the thinking graph, the debugging problem can be quickly positioned and the program can be maintained, codes of similar logic modules can be reused, and the thinking-graph-based complex algorithm implementation method can effectively improve the program coding efficiency of the complex algorithm.

Drawings

FIG. 1 is a flow chart of a complex algorithm implementation method based on a mind map of the present invention;

FIG. 2 is a schematic diagram of a thought graph according to an embodiment of the present invention;

FIG. 3 is a schematic structural diagram of a thought graph according to an embodiment of the present invention;

FIG. 4 is a schematic structural diagram of a parallel thought diagram according to an embodiment of the present invention;

FIG. 5 is a diagram illustrating a data element semantic recognition thinking graph according to an embodiment of the present invention;

FIG. 6 is a schematic structural diagram of a data element name semantic recognition thought subgraph and a data element variable calculation formula recognition thought subgraph in the embodiment of the present invention;

FIG. 7 is a schematic diagram of a logic description of a bottom implementation of the Sub-TGraph-11 according to the embodiment of the present invention;

FIG. 8 is a schematic diagram of a logic description of a bottom implementation of the thought Sub-TGraph-12 in the embodiment of the present invention.

Detailed Description

In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.

Fig. 1 is a schematic flow chart of a method for implementing a complex algorithm based on a mind map according to an embodiment of the present invention. The method for realizing the complex algorithm based on the mind map provided by the embodiment of the invention specifically comprises the following steps:

s11, analyzing the service logic of the program to be designed according to the service function to be realized by the program to be designed and the operation data related to the service function to obtain a plurality of logic modules.

And S12, describing functions and data interfaces of each logic module from a logic point of view based on the mind map with the preset logic structure to obtain the mind map corresponding to each logic module.

And S13, performing function abstraction on each mind map, abstracting the mind maps with common functions to a basic class, and using the mind maps with specific attribute functions as an application class mind map for inheriting the basic class so as to realize the construction of a logic framework of the program to be designed.

And S14, designing logic function codes based on the obtained logic framework.

Wherein the preset logic structure comprises the following components: functional description, private data, example information, public data, data interfaces, and execution direction. Specifically, the method comprises the following steps:

functional description FD: textual description of the basic function of the mind map. For example, the functional description FD of "data meta-variable semantic recognition mind map" is: "semantic triples such as quantifier attributes (properties), recent nouns (features), and membership attributes (constraints) that identify data elements".

Public data CD: the thought graph and its parallel thought graphs, or data common to all thought graphs of the thought graph. Common data is maintained by parallel thought graphs in the logical context of the thought graph or by all thought graphs in common (read/write). For example, data element variable semantics represents a triple, all thought subgraphs for a "data element semantics recognizing thought graph" are common data, and all thought subgraphs read and write this triple.

Data interface DI: the mind map is passed on to the data for the next work link. For example, the data interface of the thought graph, which is transmitted to the common sense and display knowledge rule generation link, is the semantic triple of all data elements of the problem.

Private data PD: including data dynamically transferred by private data structures of the mind map operations, as well as data and its format in the static data configuration file of the mind map. For example, the private data profile contents of the "time quantifier recognition thinking graph" are: "second, minute, hour, microsecond, millisecond, day, week, month, year, …".

Example information EI: typical examples and processing specials of thought graph business processing functions are described. For example, in the "part-of-speech attribute specific case discriminative thinking diagram", the "and" in the context "4 soccer balls and 20 skipping ropes" are not nouns, and the "and" in the pattern "number + quantifier + noun + and + number + quantifier + noun" are all conjunctive attributes. The example information can generally describe three kinds of information, namely input information, processing basis information and output result information, and is described by concise and intuitive words.

Execution direction SD: and describing the next execution step of the mind map by using a one-way line segment, namely the subsequently executed mind map. Note that the independent parallel thought subgraph and the algorithm-ending thought subgraph have no direction of execution.

The complex algorithm implementation method based on the mind map can better grasp the macro logic of the complex algorithm from top to bottom, obscure program codes can be represented as an intuitive mind logic map by using the mind map, the rapid positioning and the program maintenance of debugging problems are facilitated, codes of similar logic modules can be reused, and the program coding efficiency of the complex algorithm can be effectively improved by adopting the complex algorithm implementation method based on the mind map.

The mind map is a relatively suitable high-level selection of the bias logic, and has three main functions: (1) describing a logic function flow and quickly positioning and debugging problems; (2) recording the change of program flow and function, and quickly verifying the program logic; (3) and backing up the logic modification record and saving the debugging intermediate result. The advantages of the logic description of the mind map are as follows: from top to bottom, the module is gradually thinned and extended, and the logic content of the whole algorithm is displayed. Specifically, three progressive research tasks can be divided: the definition of a formal thinking diagram forms a standardized logic expression model thereof, and forms a standard description document of a complex algorithm so as to facilitate subsequent machine identification and software implementation; designing a tool for describing the complex algorithm by the realization thinking diagram, and supporting the design and maintenance of the complex algorithm; and establishing a formally described thinking diagram and an automatic conversion mechanism of a software program, and developing the software of a complex algorithm by taking the thinking diagram design as a core.

The invention adopts the form of thinking diagram to describe the internal structure and logic flow of the complex algorithm, and becomes a practical tool for the design and maintenance of the complex large-scale algorithm. The mind map is composed of a series of serial or parallel logic modules, each of which may in turn be composed of multiple sub-modules, or may contain multiple parallel modules embedded. Each module contains six components of function description, private data, example information, public data, data interface and execution direction, and information needed for designing, understanding and maintaining algorithms, such as describing module functions and data interfaces from the program logic point of view.

Specifically, after describing the functions and data interfaces of each logic module from a logic point of view based on a mind map with a preset logic structure, the method further comprises the following steps:

dividing the current thinking graph into a plurality of continuously executed thinking graphs according to the logic flow of the logic module corresponding to each thinking graph, wherein the thinking graphs have the same preset logic structure, the public data of each thinking graph is the external global data of the plurality of corresponding thinking graphs, and the sum of the private data, the example information and the data interface of the plurality of thinking graphs forms the private data, the example information and the data interface of the corresponding thinking graph.

Specifically, after describing the functions and data interfaces of each logic module from a logic point of view based on a mind map with a preset logic structure, the method further comprises the following steps:

and creating parallel thinking graphs for the thinking graphs according to the logic functions of the logic modules corresponding to the thinking graphs, wherein the parallel thinking graphs are used for describing the key logic functions of the corresponding logic modules.

In the embodiment of the invention, a thought map TGraph: is formed by a function description FD, private data PD, example information EI, public data CD, data interface DI and its execution direction SD, i.e. TGraph (< FD, PD, EI, CD, DI, SD >. The mind map structure is shown in fig. 2.

Thought subgraph Sub-TGraph: and forming a series of serial or parallel independent logic modules for describing a complex algorithm thinking diagram TGraph, namely TGraph { Sub-TGraph }. The structure of the thought diagram is shown in fig. 3. The TGraph A is composed of three thought subgraphs A-1, A-2 and A-3, public data CD of the TGraph A is external global data of the three thought subgraphs, and the sum of private data PD of the three thought subgraphs, example information EI and data interface DI constitutes the private data of the TGraph A, the example information and the data interface.

Parallel thought diagram PSub-TGraph: the embedded thinking graph of the thinking graph is abstract of contents at the level of the nodes of the thinking graph. The parallel thought graph is shown in FIG. 4, wherein A-1 is the first parallel thought graph of the thought graph TGgraph A, describing the key logic functions in the thought graph.

Recursive thought diagram ESub-TGraph: there are 2 execution directions. One point represents recursive nesting by itself; and the other point is a thought subgraph for subsequent execution after the recursive nested execution is finished.

In practical applications, object-oriented programming (OOP) is used for programming. By using the OOP technology, the basic framework of the thinking graph can be designed into an original parent class, each subgraph is designed to inherit the subclass of the original parent class, and a specific function is reconstructed in a polymorphic mode. The concrete implementation process of abstraction of the thought graph basic class is as follows:

according to the logical model of the mind map, abstract extraction is carried out on the functions of all the components of the mind map, and common functions are abstracted into the basic classes. For example, the reading function of the external data configuration file can be integrated into the basic class; the identification and processing of the data configuration file format belong to the special attribute function of the high-level mind map and are completed by the application class mind map inheriting the basic class. The extraction of the basic classes is the work which needs to be carried out continuously, and relates to the continuous sharing optimization process of program logic. The invention merges basic frames of thinking diagrams into basic classes, firstly completes the design of a program macroscopic logic frame, then fills specific required logic function codes in the frame, and finally performs unified debugging operation, thereby changing the situation that the conventional program design is easy to lose the grasp of the macroscopic logic because the conventional program design is from bottom to top and is lost in the details of the codes. For example, the basic class _ basic described below describes the basic function functionality of external profile initialization and access, and all thought graphs inherit this basic class.

The specific implementation process of the thinking graph execution and inheritance framework is as follows:

the technical implementation of the mind map is responsible for the implementation process of the algorithm class framework, while the logic block implementation mainly implements the logic function of the filling framework. The condensing and summarizing algorithm class framework is mainly based on 2 dimensions, namely a thought graph structure dimension; the second is the common basic function dimension. The class structure design of the thinking diagram dimension is a main line, and the common basic function dimension is used for optimization and promotion. For example, the identification of the common sense knowledge implied by the text, the implementation of the class framework is as follows:

class 1:

class 2:

class 3:

the class 1, class 2 and class 3 determine the class executive program framework mainly according to the thought graph, and the class inheritance relationship of the class executive program framework determines the structure of the class mainly according to the public function distribution. Class 1 and class 2 inherit the common base class _ math, while class 3 inherits class 2. The execution invocation algorithm fragment of the above example is:

scene_frame_identification cScene(SCENE);

cScene.Dynamic_Semantic_Web_Generate();

math_commonsense cWeb0(COMMONSENSE);

cWeb0.Dynamic_Semantic_Web_Generate();

math_attibute_identfication cWeb(ATTRIB);

cWeb.Dynamic_Semantic_Web_Generate();

in the embodiment of the present invention, after describing the function and data interface of each logic module from a logic point of view based on the mind map having the preset logic structure, the method further includes: and describing the corresponding thinking diagram by adopting multiple data configuration files according to the inheritance relationship and the polymorphism of each logic module. Further, the description of the corresponding mind map by using the multiple data configuration files specifically includes: describing the explicit inheritance relationship of the thinking graph by adopting a dynamic common sense attribute configuration file; describing the implicit inheritance relationship of the mind map by adopting a static common sense attribute configuration file; and describing the polymorphism of the thinking diagram by adopting a polymorphic recognition configuration file.

Specifically, the phenomenon of inheritance and polymorphism generally exists in the objective world described by the thought graph, and the thought graph realizes the representation of the phenomenon through multiple data configuration files. For example, the cuboid water tank inherits the length, width, height and volume mathematical properties of the cuboid and the calculation method thereof; however, the "surface area" attribute and its calculation method requires polymorphic reconstruction because "water jars" typically have no lid and have one less top rectangular area than "cuboids". The explicit mathematical knowledge of the cuboid water tank can be described by establishing a dynamic common sense attribute configuration file, namely the water tank inherits the mathematical common sense attribute of the cuboid and the calculation method thereof, and the surface area attribute and the calculation method thereof are redefined through the common sense data configuration file of the water tank. From the above description, it can be judged that: the thinking diagram can realize the full description and realization of the objective world through the data configuration file, and can completely depict scenes and knowledge of the objective world.

Explicit inheritance relationships are described by a dynamic common sense property profile, whereas implicit inheritance relationships are described by a static common sense property profile. The polymorphism is realized by reconstructing a corresponding formula of mathematical common knowledge through a new calculation method described by the polymorphic identification configuration file. For example, the static common sense attribute profile defaults to a "carton" mathematical attribute of "cuboid"; the explicit expression of the 'cuboid water tank' means that the mathematical attribute of the 'water tank' is expressed as 'cuboid', and the 'surface area' attribute and the calculation formula are reconstructed by the polymorphic recognition configuration file. The polymorphic identification profile may be expressed in the following format:

1///polymorphic identifier ID

Number of 1///reconstruction equation

The water jar comprises a surface area, a periphery area, a bottom area, a reconstruction formula data element variable table

6///reconstruction equation ID

Total amount, part A, part B,// variable of mathematical formula table

1///number of items of dynamic common sense attributes

Cuboid///mathematical property concept

Water vat///practical concept

4///number of matching vocabulary items

...// cycle wildcard

The s cuboid///noun matching term "cuboid

s water jar | |///noun matches the vocabulary "water jar", "-", is wildly matched with any noun vocabulary

…///cycle wildcard

The algorithm for implementing inheritance and polymorphism is described as follows:

algorithm 1: polymorphic inheritance algorithm

Inputting: a mathematical attribute configuration file and a polymorphic inheritance configuration file;

and (3) outputting: problem mathematical calculation formula set

1.bool bSucc=false;

2.math_attibute_identfication cWeb(ATTRIB);

3.multi_state_identification cMultiState(MULTISTATE);

4.cMultiState.is_multistate_frame(cMultiState.struct_Scene,&(cMultiState.Num));

5.memset(&struct_Frame,0,sizeof(class_frame::MATHFRAME));

6.while(ReadAFrame(&struct_Frame))

7.{

8.if(cMultiState.is_multi_state(cMultiState.struct_Scene,cMultiState.Num,&struct_Frame))

9.{

10.bSucc=cMultiState.Dynamic_Semantic_Generate();

11.}

12.else

13.{

14.bSucc=cWeb.Dynamic_Semantic_Generate();

15.}

16.}

17.Return bSucc;

The following describes in detail an implementation of the mind map-based complex algorithm implementation method according to the present invention by using a specific example. In this embodiment, a data meta-semantic recognition algorithm is implemented as an example for explanation, and an example is used below to explain a mind map evolution process of the data meta-semantic recognition algorithm:

A. initial stage

The logical structure of the data element semantic recognition mind map is shown in fig. 5, wherein the description of the example information EI in the map is the first general functional description. As coding debugging progresses, input and output details that gradually evolve into a typical case are as follows:

inputting:

"a cuboid water jar, length 10 decimeter, width 8 decimeter, water depth 4.5 decimeter, put into a stone, at this moment the surface of water rises to 6 decimeters; what is the volume of the stone? ", a

And (3) outputting:

123, water, cuboid, volume, length, cuboid, distance, width, cuboid, distance, water, depth, cuboid, distance, cuboid length, cuboid width, cuboid height, cuboid, and the like

237: water, cuboid, area, length, distance, cuboid, distance, water, depth, cuboid, length, cuboid, and cuboid height

338, a bottom, a cuboid, an area, a length, a cuboid, a distance, a width, a cuboid, a distance, a cuboid bottom area, a cuboid length, a cuboid width

438, the top part is a cuboid, the area is the length, the distance is the cuboid, the width is the cuboid, the distance is the bottom area of the cuboid, the cuboid is long, and the cuboid is wide

522, water, cuboid, volume, bottom, cuboid area, 1, water, depth, cuboid, distance, cuboid volume, cross-sectional area, cuboid length

622, stone, water, volume, bottom, cuboid, area, 2, deep, cuboid volume, cross-sectional area, cuboid length

76, stone, water, cuboid, part A, total amount and part B

B. Intermediate process

The data element semantic recognition mind map of the above example can be initially logically divided into two mind maps that execute in succession: the data element name semantic recognition thought subgraph Sub-TGraph-11 and the data element variable calculation formula recognition thought subgraph Sub-TGraph-12. The logic structure of each sub-graph is shown in fig. 6:

details of EI for Sub-TGgraph-11 are as follows:

inputting:

"A", "an", "cuboid", "water jar", "long", "10", "decimeter", … …

And (3) outputting:

long-term storage of cuboid

Wide in the form of cuboid

……

Details of EI for Sub-TGgraph-12 are as follows:

inputting:

the water comprises 1, namely, a first water body, a second water body, a cuboid, a water cylinder and … …, wherein the water is deep, the cuboid is distant, the 2 is deep, and the … …

And (3) outputting:

123, water, a cuboid, a distance, a width, a cuboid, a distance, 1, water, a depth, a cuboid, a distance, a cuboid length, a cuboid width and a cuboid height.

In the embodiment of the present invention, the method further includes: and constructing a storage index for each mind map, and storing the mind map based on the storage index, wherein the storage index of the mind map is divided into a transverse dimension and a longitudinal dimension, the transverse dimension represents an execution flow, and the longitudinal dimension represents a function containing relationship.

Specifically, the storage index of the mind map is divided into two dimensions, the execution flow is represented horizontally, and the function containing relationship is represented vertically, so that design and maintenance personnel can search and look up conveniently.

In the embodiment of the invention, the thinking diagram sample information EI can be continuously thinned to form different versions of document form representations.

The thought graph intermediate process may be a multi-level refinement process. The degree of refinement of the mind map is based on the ability to clearly describe the key logic of the program. Generally, the detail processing which can be intuitively understood by the program source code is out of the responsibility, the thought graph is only responsible for the description of the high-level flow logic and the key processing logic, and generally, the knowledge can not be obtained by the local code analysis. The mind map is not an alternative tool to source code reading, but rather a tool that assists in code design and maintenance. The thinking diagram refinement level depends on the code complex program.

FIG. 7 is a logic description of an implementation at the bottom level of the foregoing thought Sub-diagram Sub-TGraph-11, wherein the detailed information of the logic block Sub-TGraph-11001 is as follows:

Sub-TGraph-11001 (ratio concept recognition)

FD: when all variables are proportional numbers or "fractions", the pattern "noun 1" + "takes up" + "noun 2" is recognized and variable names are generated: the term 1, the term 2, the ratio number, which contains the concept function of referring to the denominator of the identification ratio number.

CD: word segmentation vocabulary chain.

DI: the scale identifies the modified word-segmentation vocabulary chain.

PD: is free of

EI: "1/3 total cucumbers and 2/5 total tomatoes in a batch of vegetables transported in a shop, and the rest are potatoes and potatoes are a fraction of the batch of vegetables? The identification results comprise cucumber, total number, proportion number (1/3), tomato, total number, proportion number (2/5), potato, total number, proportion number (.

SD:Sub-TGraph-12

FIG. 8 is a logic description of one of the bottom implementations of the foregoing thought subgraph Sub-TGraph-12, wherein the detailed information of the logic block Sub-TGraph-12001 is exemplified as follows:

Sub-TGraph-12001 (proportional formula generation)

FD: and identifying a mode in the data matching file by matching proportion, determining the name of a data element variable, and outputting 2 to N proportional number addition formulas with the sum of 1 if the total value of all the variables is 1.

CD: word segmentation vocabulary chain.

DI: and determining the word segmentation vocabulary chain after the data element variable name is determined.

PD: pattern data profiles are identified (scale identification. txt).

EI: "1/5 for the first car room having completed the tent manufacturing plan, 1/4 for the second car room having completed the tent manufacturing plan, and a few parts left unfinished? "output formula: the method comprises the following steps of firstly, workshop:, proportion ++ second:, workshop:, tent:, proportion ++ remains, tent:, proportion ═ 1 ".

SD: END (END of function).

The thinking diagram technology is suitable for complex algorithm research and development, the internal logic function and the flow can not be determined at one time, and the problems need to be quickly positioned, the original logic function needs to be indexed, the original input/output format and interface needs to be inquired, and the internal logic and data format change information needs to be filed, wherein the problems need to be continuously modified and updated according to the situation. In the process of researching and developing the text data meta-semantic recognition algorithm, complex algorithm research and development is carried out based on the thought graph, the method is simple, convenient and easy to implement, practical to operate, convenient for logic function debugging, capable of improving research and development work efficiency, and meaningful for reference to research and development work of other complex algorithms.

Compared with the flow chart, the thinking chart mainly reflects the logic meaning of the complex algorithm rather than the detail trend of program execution, is oriented to the design and maintenance of the complex algorithm rather than the program writing, focuses on logic modules rather than execution statements, and has larger logic granularity than the flow chart. The realization of the complex algorithm is usually a gradual iterative coding debugging process, obscure program codes are represented as an intuitive thinking logic diagram by using the thinking diagram, the rapid positioning and the program maintenance of debugging problems are facilitated, and the code multiplexing function of similar logic modules is added in the later period, so that the program coding efficiency is effectively improved.

The complex algorithm implementation method based on the mind map can better grasp the macro logic of the complex algorithm from top to bottom, obscure program codes can be represented as an intuitive mind logic map by using the mind map, the rapid positioning and the program maintenance of debugging problems are facilitated, codes of similar logic modules can be reused, and the program coding efficiency of the complex algorithm can be effectively improved by adopting the complex algorithm implementation method based on the mind map.

Furthermore, an embodiment of the present invention also provides a computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, implements the steps of the method as described above.

All or part of the flow of the method of the embodiments may be implemented by a computer program, which may be stored in a computer readable storage medium and executed by a processor, to instruct related hardware to implement the steps of the embodiments of the methods. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc.

Furthermore, an embodiment of the present invention further provides a computer device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements the steps of the method when executing the computer program. Such as the steps shown in fig. 1: s11, analyzing the service logic of the program to be designed according to the service function to be realized by the program to be designed and the operation data related to the service function to obtain a plurality of logic modules; s12, describing functions and data interfaces of each logic module from a logic point of view based on the mind map with the preset logic structure to obtain the mind map corresponding to each logic module; s13, abstracting the functions of the mind maps, abstracting the mind maps with common functions to a basic class, and using the mind maps with specific attribute functions as an application class mind map for inheriting the basic class so as to realize the construction of a logic framework of a program to be designed; and S14, designing logic function codes based on the obtained logic framework.

Those skilled in the art will appreciate that while some embodiments herein include some features included in other embodiments, rather than others, combinations of features of different embodiments are meant to be within the scope of the invention and form different embodiments. For example, in the following claims, any of the claimed embodiments may be used in any combination.

Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

17页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种自定义标签的编码方法、装置、设备和介质

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!