[go: up one dir, main page]
More Web Proxy on the site http://driver.im/

CN114647407A - Method, device and storage medium for realizing complex branch logic call - Google Patents

Method, device and storage medium for realizing complex branch logic call Download PDF

Info

Publication number
CN114647407A
CN114647407A CN202210325392.3A CN202210325392A CN114647407A CN 114647407 A CN114647407 A CN 114647407A CN 202210325392 A CN202210325392 A CN 202210325392A CN 114647407 A CN114647407 A CN 114647407A
Authority
CN
China
Prior art keywords
class
values
map container
keys
creating
Prior art date
Legal status (The legal status 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 status listed.)
Pending
Application number
CN202210325392.3A
Other languages
Chinese (zh)
Inventor
周波
陈蓓珍
林敏�
蔡浴泓
况涛
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhejiang Huifu Network Technology Co ltd
Original Assignee
Zhejiang Huifu Network Technology Co ltd
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 Zhejiang Huifu Network Technology Co ltd filed Critical Zhejiang Huifu Network Technology Co ltd
Priority to CN202210325392.3A priority Critical patent/CN114647407A/en
Publication of CN114647407A publication Critical patent/CN114647407A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/31Programming languages or programming paradigms
    • G06F8/315Object-oriented languages
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/31Programming languages or programming paradigms
    • G06F8/311Functional or applicative languages; Rewrite languages
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/36Software reuse
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/448Execution paradigms, e.g. implementations of programming paradigms
    • G06F9/4488Object-oriented
    • G06F9/449Object-oriented method invocation or resolution

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • Design And Manufacture Of Integrated Circuits (AREA)

Abstract

The invention provides a method, a device and a storage medium for realizing complex branch logic calling, wherein the method for realizing the complex branch logic calling comprises the following steps: creating a class, creating a Map container in the class, wherein the Map container comprises a plurality of keys; creating a core class by which values are initialized into the Map container, the keys being mapped to the values to form key-value pairs; and calling the corresponding value in the key value pair from the Map container through the core class according to different keys. Therefore, the problems of poor readability and maintainability of codes and high development cost in the prior art are solved, and the problems that each part of logic is encapsulated into different classes, the strategy implementation classes are more and more due to a plurality of branch judgments, the assigned and compared business logic cannot be overlooked, and the development time is multiplied are solved.

Description

一种实现复杂分支逻辑调用的方法、装置及存储介质A method, device and storage medium for realizing complex branch logic call

技术领域technical field

本发明涉及软件开发技术领域,具体涉及一种实现复杂分支逻辑调用的方法、装置及存储介质。The invention relates to the technical field of software development, in particular to a method, a device and a storage medium for implementing complex branch logic calls.

背景技术Background technique

在现有的软件开发过程中,很多产品在技术设计实现上除了考虑通用化设计以外,还会留好口子防止差异化定制化需求,技术设计都会把可扩展性留好。比如某消费贷产品放款之前需要了解用户的公积金数据来综合评估信用分,那么这款消费贷产品是全国性质的产品,公积金产品又是每个省甚至市级别都不一样,在现有技术中,一些技术人员是在类似场景技术设计上大部分都是在接口上写满了if/else语句或者swtich(case),所有的代码分支都在一个接口里面,如此就造成代码长度太长,可维护性极差,影响了可读性,一个缺陷就会导致所有公积金接口不可用;还有些技术人员是通过策略模式把每部分的逻辑都封装到不同的类里面,代码可维护性好了不少,但是缺点也很明显,如果分支判断很多,那么策略实现类就会越来越多,没法实现俯视分派和对比的业务逻辑,开发上也是很麻烦,开发时间成倍增加。因此,现今需要一种实现复杂分支逻辑调用的方法,解决现有技术中代码的可读性、可维护性差,开发成本高的问题。In the existing software development process, in addition to considering generalized design in the technical design and implementation of many products, there will be good openings to prevent differentiated customization requirements, and the technical design will keep scalability. For example, a consumer loan product needs to know the user's provident fund data to comprehensively evaluate the credit score before lending. Then this consumer loan product is a national product, and the provident fund product is different for each province or even city level. In the existing technology , some technicians in the technical design of similar scenarios mostly write if/else statements or swtich (case) on the interface, all code branches are in one interface, so the code length is too long, but The maintainability is extremely poor, which affects the readability. One defect will make all provident fund interfaces unavailable; some technicians encapsulate each part of the logic into different classes through the strategy mode, so the code maintainability is good. Fewer, but the shortcomings are also obvious. If there are many branch judgments, there will be more and more policy implementation classes, and the business logic of overlooking the assignment and comparison cannot be realized. The development is also very troublesome, and the development time increases exponentially. Therefore, there is a need for a method for implementing complex branch logic calls, which solves the problems of poor code readability and maintainability and high development cost in the prior art.

发明内容SUMMARY OF THE INVENTION

因此,本发明要解决的技术问题在于克服现有技术中代码的可读性、可维护性差,开发成本高的问题。Therefore, the technical problem to be solved by the present invention is to overcome the problems of poor code readability and maintainability and high development cost in the prior art.

为了解决上述技术问题,本发明提供一种实现复杂分支逻辑调用的方法,包括步骤:创建类,在所述类中创建Map容器,所述Map容器中包含若干键;In order to solve the above-mentioned technical problems, the present invention provides a method for realizing complex branch logic call, comprising the steps of: creating a class, and creating a Map container in the class, where the Map container contains several keys;

创建核心类,通过所述核心类将若干值初始化到所述Map容器中,所述键映射到所述值形成键值对;Create a core class, initialize several values into the Map container through the core class, and map the keys to the values to form key-value pairs;

根据不同的所述键,通过所述核心类从所述Map容器中调用所述键值对中相应的所述值。According to the different keys, the corresponding value in the key-value pair is called from the Map container through the core class.

可选地,不同的所述值之间相互隔离。Optionally, different said values are isolated from each other.

可选地,每个所述键分别映射到一个所述值。Optionally, each of the keys is mapped to one of the values, respectively.

可选地,所述值使用函数创建。Optionally, the value is created using a function.

可选地,通过所述核心类将若干值初始化到所述Map容器中的方法包括:使用lambda表达式实现将所述若干值初始化到所述Map容器中。Optionally, the method for initializing several values into the Map container by using the core class includes: using a lambda expression to implement initializing the several values into the Map container.

可选地,通过所述核心类将若干值初始化到所述Map容器中的方法还包括:将http接口注入所述核心类,调用所述核心类的核心方法完成所述使用lambda表达式实现将所述若干值初始化到所述Map容器中。Optionally, the method of initializing several values into the Map container by using the core class further includes: injecting an http interface into the core class, and calling the core method of the core class to complete the implementation of using a lambda expression. The several values are initialized into the Map container.

可选地,所述核心类创建在所述类中。Optionally, the core class is created in the class.

为了解决上述技术问题,本发明还提供一种实现复杂分支逻辑调用的装置,包括:存储器;以及In order to solve the above technical problems, the present invention also provides an apparatus for implementing complex branch logic calls, including: a memory; and

与所述存储器连接的处理器,所述处理器被配置成:a processor coupled to the memory, the processor configured to:

创建类,在所述类中创建Map容器,所述Map容器中包含若干键;Create a class, create a Map container in the class, and the Map container contains several keys;

创建核心类,通过所述核心类将若干值初始化到所述Map容器中,所述键映射到所述值形成键值对;Create a core class, initialize several values into the Map container through the core class, and map the keys to the values to form key-value pairs;

根据不同的所述键,通过所述核心类从所述Map容器中调用所述键值对中相应的所述值。According to the different keys, the corresponding value in the key-value pair is called from the Map container through the core class.

可选地,所述处理器还被配置成:不同的所述值之间相互隔离。Optionally, the processor is further configured to isolate the different values from each other.

为了解决上述技术问题,本发明还提供一种计算机存储介质,其上存储有计算机程序,其中所述计算机程序被机器执行时实现如上所述的方法的步骤。In order to solve the above technical problem, the present invention also provides a computer storage medium on which a computer program is stored, wherein the computer program implements the steps of the above method when executed by a machine.

本发明技术方案,具有如下优点:The technical scheme of the present invention has the following advantages:

1.本发明提供的一种实现复杂分支逻辑调用的方法,包括步骤:创建类,在所述类中创建Map容器,所述Map容器中包含若干键;创建核心类,通过所述核心类将若干值初始化到所述Map容器中,所述键映射到所述值形成键值对;根据不同的所述键,通过所述核心类从所述Map容器中调用所述键值对中相应的所述值。1. A method for implementing complex branch logic calls provided by the present invention includes the steps of: creating a class, creating a Map container in the class, and the Map container contains several keys; Several values are initialized into the Map container, and the keys are mapped to the values to form key-value pairs; according to the different keys, the corresponding keys in the key-value pairs are called from the Map container through the core class. the value.

通过在一个类中创建多个方法类(值)去实现不同的需求,提高了代码可读性、可维护性和复用率,降低了开发成本,使开发敏捷迅速,并且避免了把每部分的逻辑都封装到不同的类里面,由于分支判断很多,造成策略实现类会越来越多,没法俯视分派和对比的业务逻辑,开发时间成倍增加的问题。By creating multiple method classes (values) in one class to achieve different requirements, the code readability, maintainability and reuse rate are improved, development costs are reduced, development is agile and rapid, and each part is avoided. The logic of the system is encapsulated into different classes. Since there are many branch judgments, there will be more and more policy implementation classes. It is impossible to overlook the business logic of assignment and comparison, and the development time will increase exponentially.

2.进一步,不同的所述值之间相互隔离。如此可以避免由于代码过长影响了可读性,造成可维护性差,因此提高了代码可读性、可维护性和复用率,降低了开发成本,使开发敏捷迅速。2. Further, different said values are isolated from each other. In this way, it can be avoided that the readability of the code is too long and the maintainability is poor, so the readability, maintainability and reuse rate of the code are improved, the development cost is reduced, and the development is agile and rapid.

3.进一步,所述值使用函数创建。使用函数更加方便,函数式编程的代码有更高的信噪比,函数式编程的代码不仅简洁优雅,不易出错,而且效率更高,易于优化改进和并行化,从而降低了开发成本,使开发敏捷迅速。3. Further, the value is created using a function. It is more convenient to use functions, and the code of functional programming has a higher signal-to-noise ratio. The code of functional programming is not only concise and elegant, less error-prone, but also more efficient, easy to optimize, improve and parallelize, thereby reducing development costs and making development easier. Quick and agile.

4.进一步,通过所述核心类将若干值初始化到所述Map容器中的方法包括:使用lambda表达式实现将所述若干值初始化到所述Map容器中。通过一行代码lambda表达式来实现初始化,提高了代码可读性、可维护性和复用率,降低了开发成本,使开发敏捷迅速。4. Further, the method for initializing several values into the Map container by using the core class includes: implementing the initialization of the several values into the Map container by using a lambda expression. The initialization is realized through a line of code lambda expression, which improves the code readability, maintainability and reuse rate, reduces the development cost, and makes the development agile and rapid.

附图说明Description of drawings

为了更清楚地说明本发明具体实施方式或现有技术中的技术方案,下面将对具体实施方式或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图是本发明的一些实施方式,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to illustrate the specific embodiments of the present invention or the technical solutions in the prior art more clearly, the following briefly introduces the accompanying drawings that need to be used in the description of the specific embodiments or the prior art. Obviously, the accompanying drawings in the following description The drawings are some embodiments of the present invention. For those of ordinary skill in the art, other drawings can also be obtained based on these drawings without creative efforts.

图1为本发明的一实施方式中提供的一种实现复杂分支逻辑调用的方法的流程图;1 is a flowchart of a method for implementing complex branch logic calls provided in an embodiment of the present invention;

图2为本发明的一实施方式中提供的一种实现复杂分支逻辑调用的方法的实现过程示意图;2 is a schematic diagram of an implementation process of a method for implementing complex branch logic calls provided in an embodiment of the present invention;

图3为本发明的一实施方式中提供的一种实现复杂分支逻辑调用的装置的模块框图。FIG. 3 is a block diagram of a module of an apparatus for implementing complex branch logic calls according to an embodiment of the present invention.

具体实施方式Detailed ways

下面将结合附图对本发明的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are a part of the embodiments of the present invention, but not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.

此外,下面所描述的本发明不同实施方式中所涉及的技术特征只要彼此之间未构成冲突就可以相互结合。In addition, the technical features involved in the different embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.

本发明一实施例提供一种实现复杂分支逻辑调用的方法,参考图1,图1为本发明的一实施方式中提供的一种实现复杂分支逻辑调用的方法的流程图,应当理解的是,该方法还可以包括未示出的附加框和/或可以省略所示出的框,本发明的范围在此方面不受限制。包括如下步骤:An embodiment of the present invention provides a method for implementing complex branch logic invocation. Referring to FIG. 1, FIG. 1 is a flowchart of a method for implementing complex branch logic invocation provided in an embodiment of the present invention. It should be understood that, The method may also include additional blocks not shown and/or blocks shown may be omitted, and the scope of the present invention is not limited in this regard. It includes the following steps:

在步骤101处,创建类,在所述类中创建Map容器,所述Map容器中包含若干键。At step 101, a class is created in which a Map container is created containing several keys.

具体地,在一些实施例中,基于java jdk8来实现本发明的方法,使用java新建一个类,在所述类中创建Map容器,Map是一种把键对象和值对象进行关联的容器,Map容器提供了一种映射关系,其中的元素是以键值对的形式存储的,能够实现根据key(键)快速查找value(值),Map容器中的键值对以Entry类型的对象实例形式存在,键(key)不可重复,value值可以重复,一个value值可以和很多键形成对应关系,每个键最多只能映射到一个value值。Map容器的键是不可以重复的。当Map容器有相同key的时候,key是不可以重复的。后面的key对应的值value会覆盖前面key对应的值value。在一些实施例中,参考图2,以调用各省公积金数据为例,key作为区分各省的Type:areaType。Specifically, in some embodiments, the method of the present invention is implemented based on java jdk8, a new class is created using java, and a Map container is created in the class. Map is a container that associates key objects and value objects. Map The container provides a mapping relationship, in which the elements are stored in the form of key-value pairs, which can quickly find the value (value) according to the key (key). The key-value pair in the Map container exists in the form of an object instance of the Entry type. , the key (key) cannot be repeated, the value value can be repeated, a value value can form a corresponding relationship with many keys, and each key can only be mapped to at most one value value. The keys of the Map container cannot be repeated. When the Map container has the same key, the key cannot be repeated. The value corresponding to the following key will overwrite the value corresponding to the previous key. In some embodiments, referring to FIG. 2 , taking the example of calling the provident fund data of each province, the key is used as the Type for distinguishing each province: areaType.

在步骤102处,创建核心类,通过所述核心类将若干值初始化到所述Map容器中,所述键映射到所述值形成键值对。At step 102, a core class is created through which several values are initialized into the Map container, and the keys are mapped to the values to form key-value pairs.

具体地,所述核心类可以创建在前述类中,也可以在所述类之外创建。在一些实施例中,所述值之间相互隔离,分不同的方法隔离来实现。如此可以避免由于代码过长影响了可读性,造成可维护性差,因此提高了代码可读性、可维护性和复用率,降低了开发成本,使开发敏捷迅速。Specifically, the core class can be created in the aforementioned class, or can be created outside the class. In some embodiments, the values are isolated from each other and implemented in different ways. In this way, it can be avoided that the readability of the code is too long and the maintainability is poor, so the readability, maintainability and reuse rate of the code are improved, the development cost is reduced, and the development is agile and rapid.

在一些实施例中,参考图2,以调用各省公积金数据为例,所述值为浙江的逻辑处理、江苏的逻辑处理、安徽的逻辑处理、江西的逻辑处理、上海的逻辑处理等,通过所述核心类将所述值初始化到所述Map容器中。In some embodiments, referring to FIG. 2 , taking the call of the provident fund data of each province as an example, the value is the logical processing of Zhejiang, the logical processing of Jiangsu, the logical processing of Anhui, the logical processing of Jiangxi, the logical processing of Shanghai, and the like. The core class initializes the value into the Map container.

在一些实施例中,所述值使用函数创建。使用函数更加方便,函数式编程的代码有更高的信噪比,函数式编程的代码不仅简洁优雅,不易出错,而且效率更高,易于优化改进和并行化,从而降低了开发成本,使开发敏捷迅速。In some embodiments, the value is created using a function. It is more convenient to use functions, and the code of functional programming has a higher signal-to-noise ratio. The code of functional programming is not only concise and elegant, less error-prone, but also more efficient, easy to optimize, improve and parallelize, thereby reducing development costs and making development easier. Quick and agile.

在一些实施例中,通过所述核心类将若干值初始化到所述Map容器中的方法包括:使用lambda表达式实现将所述若干值初始化到所述Map容器中。有了lambda表达式之后,可以在Java里充分发挥函数式编程的威力,使用函数式风格,得到表达性更佳,更简洁,赋值操作更少,错误更少的代码,从而提高了代码可读性、可维护性和复用率,降低了开发成本,使开发敏捷迅速。In some embodiments, the method of initializing a number of values into the Map container by the core class includes using a lambda expression to implement the initialization of the number of values into the Map container. With lambda expressions, you can fully utilize the power of functional programming in Java. Using functional style, you can get better expressiveness, more concise code, fewer assignment operations, and fewer errors, thus improving code readability. It reduces development costs and makes development agile and rapid.

在一些实施例中,通过所述核心类将若干值初始化到所述Map容器中的方法还包括:将http接口注入所述核心类,调用所述核心类的核心方法完成所述使用lambda表达式实现将所述若干值初始化到所述Map容器中。In some embodiments, the method of initializing several values into the Map container through the core class further includes: injecting an http interface into the core class, and calling a core method of the core class to complete the using lambda expression The implementation initializes the several values into the Map container.

在步骤103处,根据不同的所述键,通过所述核心类从所述Map容器中调用所述键值对中对应的所述值。At step 103, according to the different keys, the value corresponding to the key-value pair is called from the Map container through the core class.

具体地,参考图2,以调用各省公积金数据为例,当调用浙江的公积金数据时,根据浙江的aeraType,通过所述核心类从Map容器中调用浙江的逻辑处理,从而获取到浙江的公积金数据。Specifically, referring to FIG. 2 , taking the example of calling the provident fund data of each province, when calling the provident fund data of Zhejiang, according to the aeraType of Zhejiang, the logic processing of Zhejiang is called from the Map container through the core class, so as to obtain the provident fund data of Zhejiang .

图3为本发明的一实施方式中提供的一种实现复杂分支逻辑调用的装置的模块框图。该装置包括:FIG. 3 is a block diagram of a module of an apparatus for implementing complex branch logic calls according to an embodiment of the present invention. The device includes:

存储器201;以及与所述存储器201连接的处理器202,所述处理器202被配置成:创建类,在所述类中创建Map容器,所述Map容器中包含若干键;创建核心类,通过所述核心类将若干值初始化到所述Map容器中,所述键映射到所述值形成键值对;根据不同的所述键,通过所述核心类从所述Map容器中调用所述键值对中相应的所述值。a memory 201; and a processor 202 connected to the memory 201, the processor 202 is configured to: create a class, and create a Map container in the class, and the Map container contains several keys; create a core class, through The core class initializes several values into the Map container, and the keys are mapped to the values to form key-value pairs; according to the different keys, the core class calls the keys from the Map container The corresponding stated value in the value pair.

在一些实施例中,处理器202还被配置成:不同的所述值之间相互隔离。In some embodiments, the processor 202 is further configured to isolate different said values from each other.

在一些实施例中,处理器202还被配置成:每个所述键分别映射到一个所述值。In some embodiments, the processor 202 is further configured to map each of the keys to one of the values.

在一些实施例中,处理器202还被配置成:所述值使用函数创建。In some embodiments, the processor 202 is further configured to: the value is created using a function.

在一些实施例中,处理器202还被配置成:通过所述核心类将若干值初始化到所述Map容器中的方法包括:使用lambda表达式实现将所述若干值初始化到所述Map容器中。In some embodiments, the processor 202 is further configured to: the method of initializing a number of values into the Map container by the core class comprises: using a lambda expression to implement the initialization of the number of values into the Map container .

在一些实施例中,处理器202还被配置成:通过所述核心类将若干值初始化到所述Map容器中的方法还包括:将http接口注入所述核心类,调用所述核心类的核心方法完成所述使用lambda表达式实现将所述若干值初始化到所述Map容器中。In some embodiments, the processor 202 is further configured to: the method of initializing several values into the Map container through the core class further comprises: injecting an http interface into the core class, calling the core of the core class The method completes the initialization of the number of values into the Map container using the lambda expression implementation.

在一些实施例中,处理器202还被配置成:所述核心类创建在所述类中。In some embodiments, the processor 202 is further configured such that the core class is created in the class.

具体实现方法参考前述方法实施例,此处不再赘述。For a specific implementation method, refer to the foregoing method embodiments, and details are not repeated here.

根据本发明的各种实施方式,通过在一个类中创建多个方法类(值)去实现不同的需求,提高了代码可读性、可维护性和复用率,降低了开发成本,使开发敏捷迅速,并且避免了把每部分的逻辑都封装到不同的类里面,由于分支判断很多,造成策略实现类会越来越多,没法俯视分派和对比的业务逻辑,开发时间成倍增加的问题。According to various embodiments of the present invention, by creating multiple method classes (values) in one class to achieve different requirements, code readability, maintainability and reuse rate are improved, development costs are reduced, and development Agile and fast, and avoids encapsulating the logic of each part into different classes. Because there are many branch judgments, there will be more and more policy implementation classes. It is impossible to overlook the business logic of assignment and comparison, and the development time increases exponentially. question.

本发明可以是方法、装置、系统和/或计算机程序产品。计算机程序产品可以包括计算机可读存储介质,其上载有用于执行本发明的各个方面的计算机可读程序指令。The present invention may be a method, apparatus, system and/or computer program product. The computer program product may include a computer-readable storage medium having computer-readable program instructions loaded thereon for carrying out various aspects of the present invention.

计算机可读存储介质可以是可以保持和存储由指令执行设备使用的指令的有形设备。计算机可读存储介质例如可以是――但不限于――电存储设备、磁存储设备、光存储设备、电磁存储设备、半导体存储设备或者上述的任意合适的组合。计算机可读存储介质的更具体的例子(非穷举的列表)包括:便携式计算机盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、静态随机存取存储器(SRAM)、便携式压缩盘只读存储器(CD-ROM)、数字多功能盘(DVD)、记忆棒、软盘、机械编码设备、例如其上存储有指令的打孔卡或凹槽内凸起结构、以及上述的任意合适的组合。这里所使用的计算机可读存储介质不被解释为瞬时信号本身,诸如无线电波或者其他自由传播的电磁波、通过波导或其他传输媒介传播的电磁波(例如,通过光纤电缆的光脉冲)、或者通过电线传输的电信号。A computer-readable storage medium may be a tangible device that can hold and store instructions for use by the instruction execution device. The computer-readable storage medium may be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. More specific examples (non-exhaustive list) of computer readable storage media include: portable computer disks, hard disks, random access memory (RAM), read only memory (ROM), erasable programmable read only memory (EPROM) or flash memory), static random access memory (SRAM), portable compact disk read only memory (CD-ROM), digital versatile disk (DVD), memory sticks, floppy disks, mechanically coded devices, such as printers with instructions stored thereon Hole cards or raised structures in grooves, and any suitable combination of the above. Computer-readable storage media, as used herein, are not to be construed as transient signals per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through waveguides or other transmission media (eg, light pulses through fiber optic cables), or through electrical wires transmitted electrical signals.

这里所描述的计算机可读程序指令可以从计算机可读存储介质下载到各个计算/处理设备,或者通过网络、例如因特网、局域网、广域网和/或无线网下载到外部计算机或外部存储设备。网络可以包括铜传输电缆、光纤传输、无线传输、路由器、防火墙、交换机、网关计算机和/或边缘服务器。每个计算/处理设备中的网络适配卡或者网络接口从网络接收计算机可读程序指令,并转发该计算机可读程序指令,以供存储在各个计算/处理设备中的计算机可读存储介质中。The computer readable program instructions described herein may be downloaded to various computing/processing devices from a computer readable storage medium, or to an external computer or external storage device over a network such as the Internet, a local area network, a wide area network, and/or a wireless network. The network may include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers, and/or edge servers. A network adapter card or network interface in each computing/processing device receives computer-readable program instructions from a network and forwards the computer-readable program instructions for storage in a computer-readable storage medium in each computing/processing device .

用于执行本发明操作的计算机程序指令可以是汇编指令、指令集架构(ISA)指令、机器指令、机器相关指令、微代码、固件指令、状态设置数据、或者以一种或多种编程语言的任意组合编写的源代码或目标代码,所述编程语言包括面向对象的编程语言—诸如Smalltalk、C++等,以及常规的过程式编程语言—诸如“C”语言或类似的编程语言。计算机可读程序指令可以完全地在用户计算机上执行、部分地在用户计算机上执行、作为一个独立的软件包执行、部分在用户计算机上部分在远程计算机上执行、或者完全在远程计算机或服务器上执行。在涉及远程计算机的情形中,远程计算机可以通过任意种类的网络—包括局域网(LAN)或广域网(WAN)—连接到用户计算机,或者,可以连接到外部计算机(例如利用因特网服务提供商来通过因特网连接)。在一些实施例中,通过利用计算机可读程序指令的状态信息来个性化定制电子电路,例如可编程逻辑电路、现场可编程门阵列(FPGA)或可编程逻辑阵列(PLA),该电子电路可以执行计算机可读程序指令,从而实现本发明的各个方面。The computer program instructions for carrying out the operations of the present invention may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine dependent instructions, microcode, firmware instructions, state setting data, or instructions in one or more programming languages. Source or object code, written in any combination, including object-oriented programming languages, such as Smalltalk, C++, etc., and conventional procedural programming languages, such as the "C" language or similar programming languages. The computer readable program instructions may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer, or entirely on the remote computer or server implement. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (eg, using an Internet service provider through the Internet connect). In some embodiments, custom electronic circuits, such as programmable logic circuits, field programmable gate arrays (FPGAs), or programmable logic arrays (PLAs), can be personalized by utilizing state information of computer readable program instructions. Computer readable program instructions are executed to implement various aspects of the present invention.

这里参照根据本发明实施例的方法、装置(系统)和计算机程序产品的流程图和/或框图描述了本发明的各个方面。应当理解,流程图和/或框图的每个方框以及流程图和/或框图中各方框的组合,都可以由计算机可读程序指令实现。Aspects of the present invention are described herein with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer readable program instructions.

这些计算机可读程序指令可以提供给通用计算机、专用计算机或其他可编程数据处理装置的处理单元,从而生产出一种机器,使得这些指令在通过计算机或其他可编程数据处理装置的处理单元执行时,产生了实现流程图和/或框图中的一个或多个方框中规定的功能/动作的装置。也可以把这些计算机可读程序指令存储在计算机可读存储介质中,这些指令使得计算机、可编程数据处理装置和/或其他设备以特定方式工作,从而,存储有指令的计算机可读介质则包括一个制造品,其包括实现流程图和/或框图中的一个或多个方框中规定的功能/动作的各个方面的指令。These computer readable program instructions may be provided to the processing unit of a general purpose computer, special purpose computer or other programmable data processing device to produce a machine that causes the instructions when executed by the processing unit of the computer or other programmable data processing device , resulting in means for implementing the functions/acts specified in one or more blocks of the flowchart and/or block diagrams. These computer readable program instructions can also be stored in a computer readable storage medium, these instructions cause a computer, programmable data processing apparatus and/or other equipment to operate in a specific manner, so that the computer readable medium on which the instructions are stored includes An article of manufacture comprising instructions for implementing various aspects of the functions/acts specified in one or more blocks of the flowchart and/or block diagrams.

也可以把计算机可读程序指令加载到计算机、其他可编程数据处理装置、或其他设备上,使得在计算机、其他可编程数据处理装置或其他设备上执行一系列操作步骤,以产生计算机实现的过程,从而使得在计算机、其他可编程数据处理装置、或其他设备上执行的指令实现流程图和/或框图中的一个或多个方框中规定的功能/动作。Computer-readable program instructions can also be loaded onto a computer, other programmable data processing apparatus, or other equipment to cause a series of operational steps to be performed on the computer, other programmable data processing apparatus, or other equipment to produce a computer-implemented process , thereby causing instructions executing on a computer, other programmable data processing apparatus, or other device to implement the functions/acts specified in one or more blocks of the flowcharts and/or block diagrams.

附图中的流程图和框图显示了根据本发明的多个实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段或指令的一部分,所述模块、程序段或指令的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个连续的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或动作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。The flowchart and block diagrams in the Figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of instructions, which comprises one or more functions for implementing the specified logical function(s) executable instructions. In some alternative implementations, the functions noted in the blocks may occur out of the order noted in the figures. For example, two blocks in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It is also noted that each block of the block diagrams and/or flowchart illustrations, and combinations of blocks in the block diagrams and/or flowchart illustrations, can be implemented in dedicated hardware-based systems that perform the specified functions or actions , or can be implemented in a combination of dedicated hardware and computer instructions.

注意,除非另有直接说明,否则本说明书(包含任何所附权利要求、摘要和附图)中所揭示的所有特征皆可由用于达到相同、等效或类似目的的可替代特征来替换。因此,除非另有明确说明,否则所公开的每一个特征仅是一组等效或类似特征的一个示例。在使用到的情况下,进一步地、较优地、更进一步地和更优地是在前述实施例基础上进行另一实施例阐述的简单起头,该进一步地、较优地、更进一步地或更优地后带的内容与前述实施例的结合作为另一实施例的完整构成。在同一实施例后带的若干个进一步地、较优地、更进一步地或更优地设置之间可任意组合的组成又一实施例。It is noted that all features disclosed in this specification (including any accompanying claims, abstract and drawings) may be replaced by alternative features serving the same, equivalent or similar purpose, unless directly stated otherwise. Thus, unless expressly stated otherwise, each feature disclosed is only one example of a group of equivalent or similar features. In the case of use, further, preferably, further and more preferably is a simple beginning of the description of another embodiment on the basis of the foregoing embodiment, which is further, preferably, further or More preferably, the content of the backband is combined with the foregoing embodiment as a complete composition of another embodiment. A further embodiment can be formed by arbitrarily combining several further, better, further or more optimal arrangements of the rear bands of the same embodiment.

本领域的技术人员应理解,上述描述及附图中所示的本发明的实施例只作为举例而并不限制本发明。本发明的目的已经完整并有效地实现。本发明的功能及结构原理已在实施例中展示和说明,在没有背离所述原理下,本发明的实施方式可以有任何变形或修改。It should be understood by those skilled in the art that the embodiments of the present invention shown in the above description and the accompanying drawings are only examples and do not limit the present invention. The objects of the present invention have been fully and effectively achieved. The functional and structural principles of the present invention have been shown and described in the embodiments, and the embodiments of the present invention may be modified or modified in any way without departing from the principles.

Claims (10)

1. A method for implementing a complex branch logic call, comprising the steps of:
creating a class, creating a Map container in the class, wherein the Map container comprises a plurality of keys;
creating a core class by which values are initialized into the Map container, the keys being mapped to the values to form key-value pairs;
and calling the corresponding value in the key value pair from the Map container through the core class according to different keys.
2. The method of claim 1, wherein different values are isolated from each other.
3. The method of claim 1, wherein each of said keys maps to a respective one of said values.
4. The method of claim 1, wherein the value is created using a function.
5. The method of claim 1, wherein initializing values into the Map container by the core class comprises: initializing the number of values into the Map container is accomplished using lambda expressions.
6. The method of claim 5, wherein initializing values into the Map container by the core class further comprises: and injecting an http interface into the core class, and calling a core method of the core class to complete the initialization of the values into the Map container by using the lambda expression.
7. The method of claim 1, wherein the core class is created in the class.
8. An apparatus for implementing complex branch logic calls, comprising:
a memory; and
a processor coupled to the memory, the processor configured to:
creating a class, creating a Map container in the class, wherein the Map container comprises a plurality of keys;
creating a core class by which values are initialized into the Map container, the keys being mapped to the values to form key-value pairs;
and calling the corresponding value in the key value pair from the Map container through the core class according to different keys.
9. The apparatus of claim 8, wherein the processor is further configured to: different said values are isolated from each other.
10. A computer storage medium having a computer program stored thereon, wherein the computer program, when executed by a machine, performs the steps of the method of any of claims 1-7.
CN202210325392.3A 2022-03-29 2022-03-29 Method, device and storage medium for realizing complex branch logic call Pending CN114647407A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210325392.3A CN114647407A (en) 2022-03-29 2022-03-29 Method, device and storage medium for realizing complex branch logic call

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210325392.3A CN114647407A (en) 2022-03-29 2022-03-29 Method, device and storage medium for realizing complex branch logic call

Publications (1)

Publication Number Publication Date
CN114647407A true CN114647407A (en) 2022-06-21

Family

ID=81994945

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210325392.3A Pending CN114647407A (en) 2022-03-29 2022-03-29 Method, device and storage medium for realizing complex branch logic call

Country Status (1)

Country Link
CN (1) CN114647407A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118312145A (en) * 2024-04-17 2024-07-09 广州市森扬电子科技有限公司 Positive and negative voltage control logic data structure method, device and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
JAVA技术栈: "还在用策略模式解决 if-else?Map + 函数式接口就搞定了。。。", pages 1 - 7, Retrieved from the Internet <URL:https://www.cnblogs.com/javastack/p/15870074.html> *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118312145A (en) * 2024-04-17 2024-07-09 广州市森扬电子科技有限公司 Positive and negative voltage control logic data structure method, device and storage medium
CN118312145B (en) * 2024-04-17 2024-09-24 广州市森扬电子科技有限公司 Positive and negative voltage control logic data structure method, device and storage medium

Similar Documents

Publication Publication Date Title
CN111198868B (en) Intelligent database-dividing real-time data migration method and device
US20200184380A1 (en) Creating optimized machine-learning models
US8972936B2 (en) Version labeling in a version control system
US20190012404A1 (en) Directed graph compression
US12217191B2 (en) Learning unpaired multimodal feature matching for semi-supervised learning
US11836538B2 (en) Heterogeneous graph generation for application microservices
CN108628738A (en) The generation method and device of application programming interface test case
US10902060B2 (en) Unbounded list processing
WO2025014545A1 (en) Computing technologies for large language models
KR20220016933A (en) Method and apparatus for ingesting data, device, storage medium and computer program stored in the medium
US9875088B2 (en) Optimized compiling of a template function
CN117350360A (en) Fine-tuning method, device, electronic device and storage medium for large model
CN114647407A (en) Method, device and storage medium for realizing complex branch logic call
US10592313B2 (en) Graph optimized message model parser
US10268798B2 (en) Condition analysis
US11163568B2 (en) Implementing write ports in register-file array cell
CN110555732A (en) Marketing strategy pushing method and device and marketing strategy operation platform
US11681865B2 (en) Annotating a log based on log documentation
US11281681B2 (en) Message parser runtime choices
US10027345B2 (en) Wall encoding and decoding
CN111752912B (en) Data processing method and device
US20210264313A1 (en) Machine-learned data management between devices
US20180204130A1 (en) Message choice model trainer
WO2023103793A1 (en) Debugging communication among units on processor simulator
CN114253480A (en) A data storage method, device, electronic device and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination