Acquisition method and device for multi-dimensional reusable implementation, equipment and storage medium
By using connectors for dimension sorting and splicing in the Spring framework, the 1-to-1 relationship problem between multi-dimensional information and specific implementation is solved, and the precise search and logical reuse of multi-dimensionality is realized, reducing the Repeat code and class files to improve development and operation and maintenance efficiency.
Patent Information
- Application Number
- CN202411023519.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-29
- Publication Date
- 2024-12-06
AI Technical Summary
In the prior art, multi-dimensional information adopts a 1-to-1 relationship with specific implementations, resulting in the need to develop a brand new implementation class for every additional dimension or dimension value, resulting in duplicate work, code bloat, complex management, high development costs and difficulty in maintenance. .
By providing a multi-dimensional reusable implementation acquisition method in the Spring framework, using connectors to sort and splice dimensions, find the corresponding implementation, and call recursively when not found until the implementation or the dimension array is empty.
It realizes multi-dimensional precise search and logical reuse, reduces duplicate code and class files, improves development efficiency and quality, and reduces development and operation and maintenance costs.
Smart Images

Figure CN119088379A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer science and technology, in particular to the field of class acquisition under the Spring framework, and more particularly to a multi-dimensional reusable acquisition method, device and storage medium. Background Art
[0002] At present, multi-dimensional information and specific implementations usually adopt a one-to-one relationship, and it is impossible to share an implementation class between different dimensional levels; this means that every time a new dimension or dimension value is added, a new implementation class corresponding to it needs to be developed. This not only leads to a lot of duplication of work, but also causes the code base to expand rapidly, making management extremely complicated. Not only that, because the relationship between multi-dimensionality and specific implementation is one-to-one, it is necessary to develop the Cartesian product implementation (L*M*N*...) of each value in all dimensions, which will generate a large number of files and repeated redundant code, greatly increasing the development cost. For operation and maintenance, maintaining so many files is also a daunting task. Once a dimension or value changes, a large amount of code may need to be modified, which also greatly increases the risk of errors.
[0003] Therefore, how to develop a method that can support the implementation of multiple dimensions and support the implementation of consistent reuse processing logic among multiple dimensions has always been a technical problem that needs to be solved urgently. Summary of the invention
[0004] To this end, the present application provides one or more technical solutions to solve the above-mentioned defects of the prior art, realize the special implementation of multiple dimensions, and support the implementation of the same logic of multiplexed processing between multiple dimensions. The present invention provides a method, device and storage medium for obtaining a multi-dimensional reusable implementation to solve at least one technical problem.
[0005] To achieve the above objectives, in a first aspect, the present invention provides a method for obtaining a multi-dimensional reusable implementation, which is applied to a scenario where an interface requires different implementations in different dimensions, comprising:
[0006] All implementations are sorted in a unified dimension according to the set rules, and different dimensions are connected by connectors to distinguish the implementations of different dimensions;
[0007] Receive a target parameter, which contains an array of all dimension information currently required to be searched;
[0008] Connect each dimension value in the dimension array through the connector to form a complete dimension information string;
[0009] According to the complete dimension information string, the corresponding implementation is searched; if the implementation is found, the implementation is directly returned; if the corresponding implementation cannot be found, the end dimension of the complete dimension information string is removed, and the search function is recursively called to continue searching for the implementation until the implementation is found and the implementation is directly returned, or until the dimension array is removed to empty, then a null value is returned.
[0010] Furthermore, the method is based on searching for a corresponding implementation in a Spring framework, and the method is instantiated and managed by the Spring framework.
[0011] Furthermore, if a dimension lacks a specific implementation and needs to reuse the implementation of other dimensions, perform the following operations:
[0012] In the process of connecting the different dimensions using connectors, there is no need to connect the specific values of the dimensions that lack specific implementation;
[0013] In the process of connecting the different dimensions using connectors, defaulting of the intermediate dimensions is not supported.
[0014] Furthermore, if the implementation is still not obtained after the logical processing, the first element in the dimension array is removed, and the search function is recursively called. The recursive process will continue until the implementation is found and the implementation is directly returned; or the dimension array is empty, in which case a null value is returned.
[0015] In a second aspect, the present invention also provides a multi-dimensional multiplexable acquisition device, the device comprising: a sorting unit, a receiving unit, a dimension splicing unit, and a retrieval unit;
[0016] The sorting unit is used to sort all implementations in a unified dimension according to set rules, and different dimensions are connected by connectors to distinguish implementations of different dimensions;
[0017] The receiving unit is used to receive a target parameter, wherein the parameter includes an array of all dimension information currently required to be searched and implemented;
[0018] The dimension concatenation unit is used to concatenate each dimension value in the dimension array through the connector to form a complete dimension information string;
[0019] The retrieval unit is used to search for the corresponding implementation according to the complete dimension information string; if the implementation is found, the implementation is directly returned; if the corresponding implementation cannot be found, the end dimension of the complete dimension information string is removed, and the search function is recursively called to continue searching for the implementation until the implementation is found and the implementation is directly returned, or until the dimension array is removed to empty, in which case a null value is returned.
[0020] Furthermore, the method is based on searching for a corresponding implementation in a Spring framework, and the method is instantiated and managed by the Spring framework.
[0021] Furthermore, if a dimension lacks a specific implementation and needs to reuse the implementation of other dimensions, perform the following operations:
[0022] In the process of connecting the different dimensions using connectors, there is no need to connect specific values of the dimensions that lack specific implementations.
[0023] In the process of connecting the different dimensions using connectors, defaulting of the intermediate dimensions is not supported.
[0024] Furthermore, if the implementation is still not obtained after the logical processing, the first element in the dimension array is removed, and the search function is recursively called. The recursive process will continue until the implementation is found and the implementation is directly returned; or the dimension array is empty, in which case a null value is returned.
[0025] In a third aspect, the present invention provides a computing device, comprising:
[0026] A memory for storing program instructions;
[0027] The processor is used to call the program instructions stored in the memory and execute the above-mentioned multi-dimensional reusable acquisition method according to the obtained program instructions.
[0028] In a fourth aspect, the present invention provides a computer-readable storage medium, including computer-readable instructions. When a computer reads and executes the computer-readable instructions, the above-mentioned multi-dimensional reusable acquisition method is implemented. The readable medium may be multiple, and the multiple readable media can operate independently of each other.
[0029] Compared with the prior art, this solution performs unified dimensional sorting through all implementations according to set rules, and different dimensions are connected by connectors to distinguish the implementations of different dimensions; receives the target parameter, which contains an array of all dimensional information of the implementation currently required to be found; splices each dimension value in the dimension array through the connector to form a complete dimension information string; searches for the corresponding implementation according to the complete dimension information string; if the implementation is found, the implementation is directly returned; if the corresponding implementation cannot be found, the terminal dimension of the complete dimension information string is removed, and the search function is recursively called to continue searching for the implementation until the implementation is found and the implementation is directly returned, or until the dimension array is removed to empty, at which time a null value is returned. It realizes multi-dimensional precise search implementation, reuse implementation of all sub-dimensions under the same root dimension, reuse implementation of different sub-dimensions under the same parent dimension, and reuse implementation of the same intermediate dimension. It effectively reduces duplicate code and duplicate class files, improves development efficiency and quality, and reduces development and operation and maintenance costs. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] In order to more clearly illustrate the embodiments of the present disclosure or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0031] Figure 1 A schematic flow chart of an embodiment of a multi-dimensional multiplexable acquisition method provided by the present invention;
[0032] Figure 2 A processing logic diagram of an embodiment of a multi-dimensional reusable acquisition method provided by the present invention;
[0033] Figure 3 A processing logic diagram of an embodiment of a multi-dimensional reusable acquisition method provided by the present invention;
[0034] Figure 4 An exemplary diagram of an embodiment of a method for acquiring a multi-dimensional multiplexable implementation provided by the present invention;
[0035] Figure 5 An exemplary diagram of an embodiment of a method for acquiring a multi-dimensional multiplexable implementation provided by the present invention;
[0036] Figure 6 An exemplary diagram of an embodiment of a method for acquiring a multi-dimensional multiplexable implementation provided by the present invention;
[0037] Figure 7An exemplary diagram of an embodiment of a method for acquiring a multi-dimensional multiplexable implementation provided by the present invention;
[0038] Figure 8 An exemplary diagram of an embodiment of a method for acquiring a multi-dimensional multiplexable implementation provided by the present invention;
[0039] Fig. 9 An exemplary diagram of an embodiment of a method for acquiring a multi-dimensional multiplexable implementation provided by the present invention;
[0040] Fig.10 An exemplary diagram of an embodiment of a method for acquiring a multi-dimensional multiplexable implementation provided by the present invention;
[0041] Fig.11 A structural block diagram of an embodiment of a multi-dimensional multiplexable acquisition device provided by the present invention. DETAILED DESCRIPTION
[0042] The embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present application, and cannot be interpreted as limiting the present application.
[0043] It will be understood by those skilled in the art that, unless otherwise stated, the singular forms "a", "an" and "the" used herein may also include plural forms. It should be further understood that the term "comprising" used in the specification of the present application refers to the presence of features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or groups thereof. The term "and / or" used herein includes all or any unit and all combinations of one or more associated listed items.
[0044] In order to make the objectives, technical solutions and advantages of the present application more clear, the specific implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.
[0045] The core of the present invention is to provide a method for obtaining a multi-dimensional reusable implementation, which is applied to the scenario where an interface requires different implementations in different dimensions. Figure 1 FIG. 1 is a flow chart of a multi-dimensional reusable acquisition method provided in this embodiment. Figure 2 and Figure 3 The processing logic diagram of the acquisition method for multi-dimensional reusable implementation provided by this embodiment. In order to better understand the method, now combined with Figure 1 , Figure 2 and Figure 3 The technical solution of this embodiment is described in detail:
[0046] Step S1: All implementations are sorted in a unified dimension according to the set rules, and different dimensions are connected by connectors to distinguish the implementations of different dimensions.
[0047] Step S2: Receive a target parameter, which contains an array of all dimensional information currently required to be searched.
[0048] Step S3: Connect each dimension value in the dimension array through the connector to form a complete dimension information string.
[0049] Step S4: Search for the corresponding implementation according to the complete dimension information string; if the implementation is found, directly return the implementation; if the corresponding implementation cannot be found, remove the end dimension of the complete dimension information string, recursively call the search function, continue to search for the implementation, until the implementation is found and directly return the implementation, or until the dimension array is removed to empty, then return a null value.
[0050] In a preferred embodiment, the method is based on searching for a corresponding implementation in a Spring framework, and the method is instantiated and managed by the Spring framework.
[0051] In a preferred implementation, if a certain dimension lacks a specific implementation and the implementation of other dimensions needs to be reused, the following operations are performed:
[0052] In the process of connecting the different dimensions using connectors, there is no need to connect the specific values of the dimensions that lack specific implementation;
[0053] In the process of connecting the different dimensions using connectors, defaulting of the intermediate dimensions is not supported.
[0054] In a preferred embodiment, if the implementation is still not obtained after the logical processing, the first element in the dimension array is removed, and the search function is recursively called. The recursive process will continue until the implementation is found and the implementation is directly returned; or the dimension array is empty, in which case a null value is returned.
[0055] According to the above technical solution, a specific example is provided to explain the specific application of the technical solution in the embodiment of the present application.
[0056] Example:
[0057] In the process approval system, the node processing logic of each node under each flowchart may be different in different business situations, so first define a node processing interface NodeAction, and implement the node processing logic by implementing the action method of the interface, as shown in the example Figure 4Assume that changes to business parameters and system parameters in an application system have their own approval processes, businessFlow and systemFlow. Business parameters A and B are both approved using the businessFlow process; system parameters C and D are both approved using the systemFlow process. The two example flow charts are shown in the example. Figure 5 , Example Figure 6 As shown. With "flowchart number + node number + parameter type" as the dimension information, the corresponding node processing implementation class is obtained according to whether the processing logic is consistent;
[0058] Execution process of multi-dimensional precise search implementation: In one embodiment, assuming that the review node of type A parameter in the business parameter approval process has special processing logic, it is necessary to define an implementation class named "process number. node number. parameter type" @Service("businessFlow.checkNode.A"), as shown in the example Figure 7 The implementation class is searched according to the dimension information array. The identification process according to the technical solution provided in this embodiment is as follows:
[0059] 1) Find the implementation class corresponding to "businessFlow.checkNode.A" and return it.
[0060] Execution process of multiplexing implementation of all sub-dimensions under the same root dimension: In one embodiment, assuming that all node processing logics of all parameter types in the business parameter approval process are the same, only one implementation class @Service("businessFlow") named with the flowchart number needs to be defined for the process. Take type A business parameter approval as an example, as shown in the example Figure 8 . According to the dimension information array, the implementation class is searched. The identification process according to the patent method is as follows:
[0061] 1) Search for the implementation class corresponding to "businessFlow.startNode.A". If no implementation class is found, continue to execute;
[0062] 2) Search for the implementation class corresponding to "businessFlow.startNode", and if it is not found, continue to execute;
[0063] 3) Find the implementation class corresponding to "businessFlow" and return it.
[0064] Execution process of multiplexing different child dimensions under the same parent dimension: In one embodiment, assuming that the processing logic of parameter operation and maintenance review nodes of types C and D in the system parameter approval process is the same, then for the operation and maintenance review node of the process, only one implementation class named "process number.node number" @Service("systemFlow.optCheckNode") needs to be defined. Take the C type system parameter approval as an example, as shown in the example Fig. 9 . According to the dimension information array, the implementation class is searched. The identification process according to the patent method is as follows:
[0065] 1) Search for the implementation class corresponding to "systemFlow.optCheckNode.C", and continue execution if it is not found;
[0066] 2) Find the implementation class corresponding to "systemFlow.optCheckNode" and return it.
[0067] Execution process of the same reused implementation in the middle dimension: In one embodiment, assuming that the initiating node processing logic of all parameter types in the business parameter approval process and the system parameter approval process is the same, it is only necessary to define an implementation class @Service("startNode") named after the node number. Take the A type business parameter approval as an example, as shown in the example Fig.10 . According to the dimension information array, the implementation class is searched. The identification process according to the patent method is as follows:
[0068] 1) Search for the implementation class corresponding to "businessFlow.startNode.A". If no implementation class is found, continue to execute;
[0069] 2) Search for the implementation class corresponding to "businessFlow.startNode", and if it is not found, continue to execute;
[0070] 3) Search for the implementation class corresponding to "businessFlow", and continue execution if it is not found;
[0071] 4) Search for the implementation class corresponding to "startNode.A", and continue execution if it is not found;
[0072] 5) Find the implementation class corresponding to "startNode" and return it after finding it.
[0073] In the scheme of this embodiment, all implementations are sorted according to the set rules in a unified dimension, and different dimensions are connected by connectors to distinguish the implementations of different dimensions; the target parameter is received, and the parameter contains an array of all dimension information of the implementation currently required to be found; each dimension value in the dimension array is spliced through the connector to form a complete dimension information string; according to the complete dimension information string, the corresponding implementation is searched; if the implementation is found, the implementation is directly returned; if the corresponding implementation cannot be found, the terminal dimension of the complete dimension information string is removed, and the search function is recursively called to continue searching for the implementation until the implementation is found and the implementation is directly returned, or until the dimension array is removed to empty, at which time a null value is returned. It realizes multi-dimensional precise search implementation, reuse implementation of all sub-dimensions under the same root dimension, reuse implementation of different sub-dimensions under the same parent dimension, and reuse implementation of the same intermediate dimension. It effectively reduces duplicate code and duplicate class files, improves development efficiency and quality, and reduces development and operation and maintenance costs.
[0074] In one embodiment of the present application, a multi-dimensional multiplexable acquisition device is provided, see Fig.11 The figure shows a structural block diagram of a multi-dimensional multiplexable acquisition device provided by this embodiment, the device comprising: a sorting unit 10, a receiving unit 20, a dimension splicing unit 30, and a retrieval unit 40;
[0075] The sorting unit 10 is used to sort all implementations in a unified dimension according to a set rule, and different dimensions are connected by connectors to distinguish implementations of different dimensions.
[0076] The receiving unit 20 is used to receive a target parameter, wherein the parameter includes an array of all dimensional information currently required to be searched and implemented.
[0077] The dimension concatenation unit 30 is used to concatenate each dimension value in the dimension array through the connector to form a complete dimension information string.
[0078] The retrieval unit 40 is used to search for the corresponding implementation according to the complete dimension information string; if the implementation is found, the implementation is directly returned; if the corresponding implementation cannot be found, the terminal dimension of the complete dimension information string is removed, and the search function is recursively called to continue searching for the implementation until the implementation is found and the implementation is directly returned, or until the dimension array is removed to empty, in which case a null value is returned.
[0079] In a preferred embodiment, the method is based on searching for a corresponding implementation in a Spring framework, and the method is instantiated and managed by the Spring framework.
[0080] In a preferred implementation, if a certain dimension lacks a specific implementation and the implementation of other dimensions needs to be reused, the following operations are performed:
[0081] In the process of connecting the different dimensions using connectors, there is no need to connect specific values of the dimensions that lack specific implementations.
[0082] In the process of connecting the different dimensions using connectors, defaulting of the intermediate dimensions is not supported.
[0083] In a preferred embodiment, if the implementation is still not obtained after the logical processing, the first element in the dimension array is removed, and the search function is recursively called. The recursive process will continue until the implementation is found and the implementation is directly returned; or the dimension array is empty, in which case a null value is returned.
[0084] In the scheme of this embodiment, all implementations are sorted according to the set rules in a unified dimension, and different dimensions are connected by connectors to distinguish the implementations of different dimensions; the target parameter is received, and the parameter contains an array of all dimension information of the implementation currently required to be found; each dimension value in the dimension array is spliced through the connector to form a complete dimension information string; according to the complete dimension information string, the corresponding implementation is searched; if the implementation is found, the implementation is directly returned; if the corresponding implementation cannot be found, the terminal dimension of the complete dimension information string is removed, and the search function is recursively called to continue searching for the implementation until the implementation is found and the implementation is directly returned, or until the dimension array is removed to empty, at which time a null value is returned. It realizes multi-dimensional precise search implementation, reuse implementation of all sub-dimensions under the same root dimension, reuse implementation of different sub-dimensions under the same parent dimension, and reuse implementation of the same intermediate dimension. It effectively reduces duplicate code and duplicate class files, improves development efficiency and quality, and reduces development and operation and maintenance costs.
[0085] The multi-dimensional multiplexed acquisition device of this embodiment is used to implement the aforementioned multi-dimensional multiplexed acquisition method. Therefore, the specific implementation of the multi-dimensional multiplexed acquisition device can be seen in the specific implementation of the multi-dimensional multiplexed acquisition method in the previous text. For example, the sorting unit 10 is used to implement step S1 in the above-mentioned multi-dimensional multiplexed acquisition method, the receiving unit 20 is used to implement step S2 in the above-mentioned multi-dimensional multiplexed acquisition method, the dimension splicing unit 30 is used to implement step S3 in the above-mentioned multi-dimensional multiplexed acquisition method, and the retrieval unit 40 is used to implement step S4 in the above-mentioned multi-dimensional multiplexed acquisition method. Therefore, its specific implementation method can refer to the description of the corresponding various partial embodiments. The device provided by the present invention is attached to the method provided by the present invention. Its specific effects can refer to the above-mentioned method, which will not be repeated here.
[0086] In one embodiment, a computing device is provided, comprising:
[0087] A memory for storing program instructions;
[0088] A processor is used to implement the steps of the method for obtaining a multi-dimensional reusable implementation as described in any of the above when executing the computer program. A method for obtaining a multi-dimensional reusable implementation of the present invention has obvious advantages and beneficial effects compared with the prior art. All implementations are sorted in a unified dimension according to the set rules, and different dimensions are connected by connectors to distinguish the implementations of different dimensions; receive a target parameter, and the parameter contains an array of all dimensional information of the implementation currently required to be found; splice each dimension value in the dimension array through the connector to form a complete dimension information string; search for the corresponding implementation according to the complete dimension information string; if the implementation is found, the implementation is directly returned; if the corresponding implementation is not found, the terminal dimension of the complete dimension information string is removed, and the search function is recursively called to continue searching for the implementation until the implementation is found and the implementation is directly returned, or until the dimension array is removed to empty, and a null value is returned at this time. It realizes multi-dimensional precise search implementation, multiplexing implementation of all sub-dimensions under the same root dimension, multiplexing implementation of different sub-dimensions under the same parent dimension, and multiplexing implementation of the same intermediate dimension. Effectively reduce duplicate code and duplicate class files, improve development efficiency and quality, and reduce development and operation and maintenance costs.
[0089] In one embodiment, a computer-readable storage medium is provided, including computer-readable instructions. When a computer reads and executes the computer-readable instructions, the steps of the method for obtaining a multi-dimensional reusable implementation described above are implemented. Compared with the prior art, the method for obtaining a multi-dimensional reusable implementation of the present invention has obvious advantages and beneficial effects. All implementations are sorted in a unified dimension according to a set rule, and different dimensions are connected by connectors to distinguish implementations of different dimensions; a target parameter is received, and the parameter contains an array of all dimension information of the implementation currently required to be found; each dimension value in the dimension array is spliced by the connector to form a complete dimension information string; according to the complete dimension information string, the corresponding implementation is searched; if the implementation is found, the implementation is directly returned; if the corresponding implementation is not found, the terminal dimension of the complete dimension information string is removed, and the search function is recursively called to continue searching for the implementation until the implementation is found and the implementation is directly returned, or until the dimension array is removed to empty, and a null value is returned at this time. The multi-dimensional precise search implementation, the reuse implementation of all sub-dimensions under the same root dimension, the reuse implementation of different sub-dimensions under the same parent dimension, and the same reuse implementation of the intermediate dimension are realized. Effectively reduce duplicate code and duplicate class files, improve development efficiency and quality, and reduce development and operation and maintenance costs.
[0090] Through the description of the above implementation methods, technical personnel in the relevant field can understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the specific device can be divided into different functional modules to complete all or part of the functions described above.
[0091] Those of ordinary skill in the art will appreciate that the modules and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0092] In several embodiments covered by the present application, it should be understood that the disclosed devices, equipment and methods can be implemented in other ways. For example, the division of modules is only a logical function division, and there may be other division methods in actual implementation, such as multiple modules or components can be combined or integrated into another device, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or modules, or it can be an electrical, mechanical or other form of connection.
[0093] The modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules, that is, they may be located in one place or distributed on multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the embodiments of the present application.
[0094] In addition, each functional module in each embodiment of the present application can be implemented in the form of hardware or in the form of software functional modules. If these functional modules are implemented in the form of software functional modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present application is essentially or part of the prior art that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a computer program product, which includes one or more computer instructions. When loading and executing computer program instructions on a computer, the process or function according to the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer program product is stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, a computer instruction can be transmitted from a website site, a computer, a server or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or a data center that includes one or more available media integrations. The available media may be magnetic media (eg, floppy disks, hard disks, magnetic tapes), optical media (eg, DVDs), or semiconductor media (eg, solid state disks (SSDs)).
[0095] The above contents are merely examples and explanations of the structure of the present invention. The technicians in this technical field may make various modifications or additions to the specific embodiments described or replace them in a similar manner. As long as they do not deviate from the structure of the invention or exceed the scope defined by the claims, they should all fall within the protection scope of the present invention.
Claims
1. A method for obtaining a multi-dimensional reusable implementation, applied to a scenario where an interface requires different implementations in different dimensions, characterized in that: include: All implementations are sorted in a unified dimension according to the set rules, and different dimensions are connected by connectors to distinguish the implementations of different dimensions; Receive a target parameter, which contains an array of all dimension information currently required to be searched; Connect each dimension value in the dimension array through the connector to form a complete dimension information string; According to the complete dimension information string, the corresponding implementation is searched; if the implementation is found, the implementation is directly returned; if the corresponding implementation cannot be found, the end dimension of the complete dimension information string is removed, and the search function is recursively called to continue searching for the implementation until the implementation is found and the implementation is directly returned, or until the dimension array is removed to empty, then a null value is returned.
2. The method for obtaining multi-dimensional reusable data according to claim 1, characterized in that: The method is based on finding a corresponding implementation in the Spring framework, and the method is instantiated and managed by the Spring framework.
3. The multi-dimensional multiplexable acquisition method according to claim 1, characterized in that: If a dimension lacks a specific implementation and you need to reuse the implementation of other dimensions, do the following: In the process of connecting the different dimensions using connectors, there is no need to connect the specific values of the dimensions that lack specific implementation; In the process of connecting the different dimensions using connectors, defaulting of the intermediate dimensions is not supported.
4. The method for obtaining multi-dimensional reusable data according to claim 1, characterized in that: If the implementation is still not found after the logical processing, the first element in the dimension array is removed, and the search function is called recursively. The recursive process continues until the implementation is found and directly returned; or the dimension array is empty, in which case an empty value is returned.
5. A device for obtaining a multi-dimensional reusable implementation, applied to a scenario where an interface requires different implementations in different dimensions, characterized in that: include: Sorting unit, receiving unit, dimension splicing unit, retrieval unit; wherein, The sorting unit is used to sort all implementations in a unified dimension according to set rules, and different dimensions are connected by connectors to distinguish implementations of different dimensions; The receiving unit is used to receive a target parameter, wherein the parameter includes an array of all dimension information currently required to be searched and implemented; The dimension concatenation unit is used to concatenate each dimension value in the dimension array through the connector to form a complete dimension information string; The retrieval unit is used to search for the corresponding implementation according to the complete dimension information string; if the implementation is found, the implementation is directly returned; if the corresponding implementation cannot be found, the end dimension of the complete dimension information string is removed, and the search function is recursively called to continue searching for the implementation until the implementation is found and the implementation is directly returned, or until the dimension array is removed to empty, in which case a null value is returned.
6. The multi-dimensional multiplexable acquisition device according to claim 5, characterized in that: The method is based on finding a corresponding implementation in the Spring framework, and the method is instantiated and managed by the Spring framework.
7. The multi-dimensional multiplexable acquisition device according to claim 5, characterized in that: If a dimension lacks a specific implementation and you need to reuse the implementation of other dimensions, do the following: In the process of connecting the different dimensions using connectors, there is no need to connect the specific values of the dimensions that lack specific implementation; In the process of connecting the different dimensions using connectors, defaulting of the intermediate dimensions is not supported.
8. The multi-dimensional multiplexable acquisition device according to claim 5, characterized in that: If the implementation is still not found after the logical processing, the first element in the dimension array is removed, and the search function is called recursively. The recursive process continues until the implementation is found and directly returned; or the dimension array is empty, in which case an empty value is returned.
9. A computing device, characterized in that include: A memory for storing program instructions; A processor is used to call the program instructions stored in the memory, and execute the method according to any one of claims 1 to 4 according to the obtained program instructions.
10. A computer-readable storage medium, characterized in that: It includes computer-readable instructions. When a computer reads and executes the computer-readable instructions, it implements the method as claimed in any one of claims 1 to 4. There can be multiple readable media, and the multiple readable media can operate independently of each other.
