A data search method, device, electronic device and storage medium
Through the Vuex plug-in, the three-layer model data mapping relationship is automatically collected and combined with the cache mechanism, the problem of time-consuming and labor-consuming front-end data search is solved, and the rapid and accurate data positioning is achieved, and the development efficiency is improved.
Patent Information
- Application Number
- CN202111539655.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-15
- Publication Date
- 2025-07-25
- Estimated Expiration
- 2041-12-15
AI Technical Summary
In front-end development, the data search process for three-layer models takes a long time and has low accuracy, resulting in an increase in front-end docking costs and low development efficiency. The existing technology requires manual search and positioning of interfaces layer by layer, relying on developer familiarity.
The three-layer mapping relationship of front-end data is automatically collected and associated with the plug-in, and the Vuex plug-in is used to realize function stringification and regular expression matching, and combined with the cache mechanism, it realizes a keyword search to directly obtain all information.
Save labor costs in the development process, improve developer work efficiency, and reduce performance losses in data generation.
Smart Images

Figure CN114238405B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of data processing. Specifically, it relates to a data search method, apparatus, electronic device, and storage medium. Background Art
[0002] MVC (Model View Controller, MVC framework) is a framework that compulsorily separates the input, processing, and output of an application. Among them, M refers to the business model, V refers to the user interface, and C is the controller. The purpose of using MVC is generally to separate the implementation codes of M and V, so that the same program can use different presentation forms. The purpose of C is to ensure the synchronization of M and V. Once M changes, V should be updated synchronously.
[0003] In the data layer, in the process of front-end development, the data is often made more standardized by introducing a three-layer model. This method avoids the disadvantage of directly exposing the interface in the template, but leads to the problem that the interface corresponding to the data source of the front-end query attribute is troublesome to construct, and also leads to the problem that when the front-end and back-end cooperate through the interface document, after the front-end obtains the interface address from the back-end, it cannot locate where the interface is called in the template. This requires manual reverse layer-by-layer search and positioning from the three-layer model. Manual search takes a long time and has low accuracy, resulting in an increase in the docking cost between the front-end and back-end and low development efficiency, and the search and positioning process is extremely dependent on the developer's familiarity with the development project. Summary of the Invention
[0004] The purpose of this application is to provide a data search method, apparatus, electronic device, and storage medium. By automatically collecting and associating the three-layer mapping relationship of front-end data and the interface information corresponding to the data through a plug-in, the function of directly obtaining all information through a single keyword search is realized, saving the labor cost in the development process and improving the work efficiency of developers.
[0005] The embodiments of this application are implemented as follows:
[0006] In the first aspect of the embodiments of this application, a data search method is provided. The method includes: when a data query request is received, obtaining the data corresponding to the target module based on the trigger point and the received three-layer model data; obtaining an array of target changed attribute names based on the data corresponding to the target module and the enumeration index; obtaining the target action data based on the data corresponding to the target module and the enumeration index.
[0007] In one embodiment, obtaining the data corresponding to the target module based on the trigger point and the received three-layer model data includes: obtaining the target module name and the enumeration index by subscribing to the execution of the trigger point; obtaining the data corresponding to the target module by combining the target module name and the enumeration index with the three-layer model data.
[0008] In one embodiment, an array of target changed attribute names is obtained based on the data corresponding to the target module and the enumeration index, including: obtaining a target trigger function based on the data corresponding to the target module and the enumeration index; obtaining the target changed attribute names through the target trigger function, and after de-duplicating based on at least one target changed attribute name, returning an array of results corresponding to the target changed attribute names.
[0009] In one embodiment, after obtaining the target trigger function based on the data corresponding to the target module and the enumeration index, it further includes: obtaining the corresponding trigger function string based on the obtained target trigger function; performing pre-match on the trigger function string through a regular expression to obtain at least one target changed attribute name.
[0010] In one embodiment, the target action data includes a target action and a corresponding interface address. Obtaining the target action data based on the data corresponding to the target module and the enumeration index includes: traversing and filtering the actions in the data corresponding to the target module based on the enumeration index to obtain the target action; obtaining the interface method name in the business layer corresponding to the target action, and converting the interface method name into the corresponding interface address.
[0011] In one embodiment, converting the interface method name into the corresponding interface address includes: based on the obtained interface method name, converting the interface function corresponding to the business layer into an interface function string; converting the interface function string into a line, and performing pre-match through a regular expression to obtain the corresponding interface address.
[0012] In one embodiment, after obtaining the target action data based on the data corresponding to the target module and the enumeration index, the method further includes: caching all relevant data obtained based on the trigger point, and automatically hitting the cached data when triggered again.
[0013] In the second aspect of the embodiments of the present application, a data search device is provided. The device includes: a receiving module, a first obtaining module, and a second obtaining module. Among them, the receiving module is used to obtain the data corresponding to the target module based on the trigger point and the received three-layer model data when receiving a data query request; the first obtaining module is used to obtain an array of target changed attribute names based on the data corresponding to the target module and the enumeration index; the second obtaining module is used to obtain the target action data based on the data corresponding to the target module and the enumeration index.
[0014] In the third aspect of the embodiments of the present application, an electronic device is provided. The electronic device includes: a processor and a memory for storing processor-executable instructions; wherein, the processor is configured to execute the data search method of the first aspect and any of its embodiments of the present application.
[0015] In a fourth aspect of the embodiments of the present application, a computer-readable storage medium is provided, and the storage medium stores a computer program. The computer program can be executed by a processor to complete the data search method according to the first aspect and any of its embodiments of the embodiments of the present application.
[0016] The beneficial effects of the present application compared with the prior art are as follows:
[0017] The present application can solve the difficulty of layer-by-layer search for data acquisition facing the three-layer model. By obtaining the three-layer mapping relationship of front-end data and the corresponding interface information, supporting the extensibility of adding information such as interface document addresses, and based on the cache mechanism to automatically hit the cached data when triggered again, the present application realizes direct positioning of all information through keyword search, reduces the performance loss of data generation, and has the advantages of saving development labor costs and improving the development experience of developers. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following will briefly introduce the drawings required in the embodiments. It should be understood that the following drawings only show some embodiments of the present application, and therefore should not be regarded as limiting the scope. For those of ordinary skill in the art, other related drawings can be obtained based on these drawings without creative efforts.
[0019] Figure 1 It is a schematic structural diagram of an electronic device provided by an embodiment of the present application;
[0020] Figure 2 It is a schematic diagram of an application interface of the data search method provided by an embodiment of the present application;
[0021] Figure 3 It is a schematic diagram of the basic idea of the data search method provided by an embodiment of the present application;
[0022] Figure 4 It is a schematic flowchart of the data search method provided by an embodiment of the present application;
[0023] Figure 5 It is a schematic structural diagram of an onion model provided by an embodiment of the present application;
[0024] Figure 6 It is a schematic structural diagram of a data search device provided by an embodiment of the present application.
[0025] Reference numerals: 1 - electronic device; 10 - memory; 11 - bus; 12 - processor; 600 - data search device; 610 - receiving module; 620 - first acquisition module; 630 - second acquisition module. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0026] The technical solutions in the embodiments of the present application will be described below with reference to the accompanying drawings in the embodiments of the present application.
[0027] Similar reference numerals and letters denote similar items in the following drawings. Therefore, once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings. At the same time, in the description of the present application, terms such as "first" and "second" are only used for distinguishing descriptions and cannot be construed as indicating or implying relative importance.
[0028] The technical solutions of the present application will be clearly and completely described below with reference to the accompanying drawings.
[0029] Please refer to Figure 1 , Figure 1 which is a schematic structural diagram of an electronic device 1 provided in an embodiment of the present application. As Figure 1 shown, the electronic device 1 includes at least one processor 12 and a memory 10. Figure 1 Here, one processor 12 is taken as an example. The processor 12 and the memory 10 are connected through a bus 11. The memory 10 stores a plug-in mechanism that can be executed by at least one processor 12. The plug-in mechanism is executed by at least one processor 12 so that at least one processor 12 executes the data search method in the following embodiments.
[0030] Please refer to Figure 2 , Figure 2 which is a schematic diagram of an application interface of the data search method provided in an embodiment of the present application. As Figure 2 shown, by searching for a keyword in the interface search box, the plug-in can perform location search based on all the received three-layer model data and generate all relevant information for display on the Figure 2 shown interface. Developers can also supplement or change other relevant information in the note information, which is convenient for other personnel to search or view when using it next time. The implementation method of the present application is the Vuex plug-in, which has the advantages of not polluting the project code and being detachable at any time based on the plug-and-play characteristics of the plug-in mechanism.
[0031] The present application installs a plug-in at the front end to execute the data search method in the following embodiments. Among them, there are mainly two problems to be solved. One is to obtain the three-layer mapping relationship of the front-end data and the corresponding interface information, and the other is to support the extensibility of adding information such as interface document addresses. For the first aspect, please refer to the following drawings and corresponding embodiments.
[0032] Please refer to Figure 3 , Figure 3Schematic diagram of the basic idea of the data search method provided by an embodiment of the present application. For data search and collection in a front-end project, taking the three-layer model library vuex as an example, the data search and collection do not provide the mapping relationship among the trigger-changing attributes state / getter, the trigger point mutation, and the action action. The relevant data is only associated through the commit function and the enumerated value of the enumerated index type. Moreover, the interface in the action-triggered service layer directly calls functions, which makes it difficult to implement data search and consumes a large amount of manpower and material resources for manual positioning. The present application realizes the requirement of direct positioning through the method of function stringification, regular expressions, and caching mechanism.
[0033] As Figure 3 shown, the present application obtains the target module name moduleName and the enumerated index type by listening to the execution of the trigger point, and obtains the data corresponding to the target module based on all the three-layer model data store received, and then obtains the array related to the target change attribute and the corresponding trigger action data through the data corresponding to the target module and the enumerated index.
[0034] Please refer to Figure 4 , Figure 4 Schematic diagram of the process of the data search method provided by an embodiment of the present application. As Figure 4 shown, the method includes:
[0035] S410: When a data query request is received, obtain the data corresponding to the target module based on the trigger point and the received three-layer model data.
[0036] In the three-layer model library of the present application, the three-layer model data store receives the plugin plugins option, that is, data search and caching are performed through the Vuex plugin, and this option will expose the hook triggered each time. By committing a mutation, the plugin can be used to synchronize the data source to the store. The Vuex plugin is essentially a function that receives the three-layer model data as the only parameter, and the attribute _modules.root._children in the three-layer model data is all the required three-layer model data, which is assigned to allModules. In addition, this step also includes the following steps S511 to S512 to obtain the data corresponding to the target module.
[0037] S511: Obtain the target module name and the enumerated index by subscribing to the execution of the trigger point.
[0038] In this step, to find the target module, it is necessary to monitor the trigger point mutation of the target module. In the three-layer model library Vuex, through the publish-subscribe pattern, the subscribe method is used on the three-layer model data to support the execution of subscribing to the trigger point mutation. The target module name moduleName and the trigger enumeration value TYPE can be obtained through the input parameters.
[0039] S512: Obtain the data corresponding to the target module by combining the target module name and the enumeration index with the three-layer model data.
[0040] In this step, based on the target module name moduleName and the trigger enumeration value TYPE obtained in the above step, combined with all the three-layer model data allModules obtained, the data corresponding to the target module is obtained.
[0041] S420: Obtain an array of the names of the target changed properties based on the data corresponding to the target module and the enumeration index.
[0042] In this step, when the target module name moduleName and the trigger enumeration value TYPE are obtained, the changed property state can be further obtained. It is not allowed to directly modify the state in the plugin, and the change can only be triggered by submitting a mutation. Generally, a trigger point mutation only corresponds to one changed property, but there are also cases where multiple properties are changed. Therefore, the relationship between mutation and state is one-to-many. From the perspective of JS, to obtain an array related to the target changed properties, it is necessary to monitor the change of properties on the object, and then only through the old version of Object.definePropety or the new version of proxy. However, because both of these methods require the object to be monitored to be passed in, the project code needs to be modified, which will cause a coupling problem.
[0043] Therefore, through the following sub-steps S521 - S524, the plugin obtains the corresponding array of the names of the target changed properties in the way of function stringification and regular matching.
[0044] S521: Obtain the target trigger function based on the data corresponding to the target module and the enumeration index.
[0045] In this step, the plugin obtains the corresponding mutation function through the target module name moduleName and the trigger enumeration value TYPE.
[0046] S522: Obtain the corresponding trigger function string based on the obtained target trigger function;
[0047] In this step, the plugin obtains the mutation function based on the above steps and gets the corresponding function string through toString.
[0048] S523: Perform a pre-match on the trigger function string through a regular expression to obtain at least one target changed attribute name.
[0049] Set up the written regular expression in advance. Based on the function string obtained in the above steps, the plugin obtains the attribute name in the format of state.[attribute name] for the target changed attribute according to the pre-match rule.
[0050] S524: After deduplication based on at least one target changed attribute name, the plugin returns an array of results corresponding to the target changed attribute name.
[0051] S430: Based on the data corresponding to the target module and the enumeration index, obtain the target action data. The target action data includes the target action and the corresponding interface address.
[0052] In this step, after obtaining the target module name moduleName and the trigger enumeration value type, the target action data (i.e., the trigger action data) can be further obtained. The target action data includes the action and the interface address api. The change of one data may trigger multiple actions, so the relationship between mutation and action may also be "one-to-many".
[0053] The relationship between the action and the enumeration index TYPE is not directly triggered by the function name, but by the commit function within the function body. Therefore, the target action cannot be directly obtained from all action sets module.actions through the key. The method of stringifying the function + regular expression in the above steps is required to obtain the target action data. For details, please refer to the following sub-steps S531 - S532.
[0054] S531: Based on the enumeration index, traverse and filter the actions in the data corresponding to the target module to obtain the target action;
[0055] In this step, the plugin filters according to whether there is a commit(TYPE) function in the function body. Those with commit(TYPE) belong to the corresponding actions.
[0056] S532: Obtain the interface method name in the business layer corresponding to the target action and convert the interface method name into the corresponding interface address.
[0057] When there is commit(TYPE), the plugin pre-matches the API through regular expressions to obtain the interface method name of the corresponding business layer (service) for the action, so as to prepare for obtaining the interface address in the next step.
[0058] Among them, in S532, converting the interface method name into the corresponding interface address includes:
[0059] S5321: Based on the obtained interface method name, convert the corresponding interface function in the business layer into an interface function string.
[0060] S5322: Convert the interface function string into a single line, and perform pre-matching through regular expressions to obtain the corresponding interface address.
[0061] After completing the above steps S410 - S430, the data search method further includes the following step S440: Cache all relevant data obtained based on the trigger point, and automatically hit the cached data when triggered again.
[0062] All dynamically generated content should consider extracting invariant parts for caching. Combining with the acquisition method for content that can be dynamically extracted outside the project, the plugin can implement a caching mechanism based on the front-end data storage localStorage. Each time it is triggered, it first judges whether it hits the cache, that is, whether it exists in the cache object. If it exists, it directly returns. If it does not exist, it is stored in the cache after generation and persisted to localStorage.
[0063] Based on the caching mechanism, the data of the plugin will be continuously improved as the number of uses increases. Finally, integrating the data of all team members, there will no longer be performance losses in data generation.
[0064] The second aspect of the problem that this application needs to solve is to support the extensibility of adding information such as interface document addresses. Information such as in-project text remarks and out-of-project interface document addresses cannot be collected. However, if we need to view the corresponding annotations according to the method name and find the corresponding interface document address from the backend for the same data every time, it also consumes manpower and material resources and reduces development efficiency. Therefore, the plugin provided by this application supports modifying cached data based on the extensibility problem. The present invention adds an input entry (input box), where information such as remarks and document addresses can be added by oneself, and when completed, the plugin will automatically persist it to the front-end data storage, thus eliminating the search work for this type of data.
[0065] The core role of the plugin mechanism is to provide data to users and execute user actions according to specific rules. To clarify the plugin mechanism for implementing the above method, we set the following rules:
[0066] The plugins are preset into two categories, namely data plugins and layout plugins. The data plugins are applied to the caching function, and the functions passed by the user are directly used as processing functions; the layout plugins are applied to the search function. When the user passes an object and the object has a type attribute of 1, the handler attribute is stored as the processing function.
[0067] During the processing function, the plugin receives the plugin global data object as a parameter and returns a higher-order function. For the different classifications of the above plugins, the processing functions are as follows: The data plugin receives parameters including whether to continue executing the function next and the newly added data object newObject; the corresponding function returned is whether to store noPush, with the default being false. The layout plugin receives parameters including the vue rendering function h and the built-in notification function notice of the plugin, and the corresponding function returned is vnode.
[0068] Based on the above steps, the plugin further executes the returned higher-order function, and the execution timing corresponding to the higher-order function is also different. For the higher-order function returned by the data plugin, when new data is added to the collection center of the plugin, the higher-order function will be automatically executed; for the higher-order function returned by the layout plugin. When the plugin needs to be rendered, this higher-order function will be executed, and the return value will be rendered in the plugin area.
[0069] Based on the basic architecture of the above plugin mechanism setting rules, please refer to the following implementation methods of the specific functions of the plugin mechanism.
[0070] 1. The method addPlugin to implement the function of adding plugins: Essentially, it is to store the corresponding functions in the corresponding queues by classification.
[0071] 2. Implement the function of storing functions.
[0072] 3. Implement the trigger function for data plugins.
[0073] The key point for triggering the data plugin lies in listening for the addition of new data. With the idea of aspect-oriented programming, we can hijack the push method of the array storing data, and then execute the plugin queue internally. Based on the above ideas, two points need to be achieved: The plugin can confirm whether to continue executing subsequent plugins, and the plugin can decide whether to store new data. The former is to achieve the process interruption of the plugin. For example, a plugin automatically aborts when the conditions are not met; the latter is to achieve the control of data by the plugin.
[0074] Please refer to Figure 5 , Figure 5 which is the structural schematic diagram of the onion model provided by an embodiment of the present application. As Figure 5As shown, the plug-in receives requests in a layered manner. For the implementation of the first point: the plug-in can confirm whether to continue executing subsequent plug-ins. We can refer to next in the "onion model". The first parameter of each plug-in processing function is a next function. If executed, it enters the next layer of plug-in and executes the corresponding logic. If not executed, it will not continue to process downward and directly return the corresponding information.
[0075] Regarding the implementation of the second point: the plug-in can decide whether to store new data. We can collect the return value of the plug-in. In the previous push function hijacking, if the plug-in return value noPush returns true, the plug-in will not execute the native push and will not store it.
[0076] Based on the above-mentioned relevant rules, the plug-in mechanism in this application is effective. In order to reduce performance loss and search function problems in step S440 of this application, as well as scalability problems, it is necessary to implement a cache mechanism in the plug-in. Specifically, it is manifested in two points: when the plug-in starts, the data stored in the localStorage of the front-end data is read as cache data; the cache data is matched each time it is triggered, and if it matches, it is directly returned. If it does not match, the logic is automatically generated and then persisted to the cache.
[0077] The cache plug-in is implemented based on this. The plug-in will implement the first point when the data is initialized; the returned high-order function will implement the second point when the plug-in adds new data.
[0078] Based on the above content, the search function is implemented through the plug-in: search according to keywords and directly locate the relevant information found. The search input box is implemented through the layout plug-in, and then all data can be matched with keywords according to the value of the input box.
[0079] This application solves the difficulty of layer-by-layer search for data collection for a three-layer model in the form of a Vuex plug-in through the method of function stringification + regularization + caching mechanism. This application obtains the three-layer mapping relationship of the front-end data and the corresponding interface information, supports the scalability of adding interface document addresses and other information, and automatically hits the cached data when triggered again based on the cache mechanism, so as to directly locate all information through a keyword search, reduce the performance loss of data generation, and has the advantages of saving development labor costs, improving developers' work efficiency and development experience.
[0080] See also Figure 6 , Figure 6 FIG. 6 is a schematic diagram of the structure of a data search device 600 provided in an embodiment of the present application. Figure 6As shown in the figure, the device includes: a receiving module 610, a first obtaining module 620, and a second obtaining module 630. Among them, the receiving module 610 is configured to, when receiving a data query request, obtain the data corresponding to the target module based on the trigger point and the received three-layer model data; the first obtaining module 620 is configured to obtain an array of target change attribute names based on the data corresponding to the target module and the enumeration index; and the second obtaining module 630 is configured to obtain the target action data based on the data corresponding to the target module and the enumeration index.
[0081] For the implementation processes of the functions and roles of each module in the above device, please refer to the implementation processes of the corresponding steps in the above data search method for details, which will not be elaborated here.
[0082] In several embodiments provided in the present application, the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely illustrative. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architectures, functions, and operations of devices, methods, and computer program products according to multiple embodiments of the present application. In this regard, each block in the flowchart or block diagram may represent a module, a program segment, or a part of code, and the module, program segment, or part of code contains one or more executable instructions for implementing the specified logical function. In some alternative implementations, the functions marked in the blocks may also occur in a different order from that marked in the accompanying drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram and / or flowchart, as well as the combination of blocks in the block diagram and / or flowchart, can be implemented by a dedicated hardware-based system for performing the specified functions or actions, or can be implemented by a combination of dedicated hardware and computer instructions.
[0083] In addition, in each embodiment of the present application, the functional modules can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.
[0084] The embodiment of the present application provides a computer-readable storage medium, and the storage medium stores a computer program. The computer program can be executed by a processor 12 to complete the data search method.
[0085] If a function is implemented in the form of a software functional module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods of various embodiments of this application. The aforementioned storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memories 10 (ROM, Read-Only Memory), random access memories 10 (RAM, Random Access Memory), magnetic disks, or optical discs that can store program codes.
[0086] The foregoing are only the preferred embodiments of this application and are not used to limit this application. For those skilled in the art, this application can have various changes and modifications. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of this application shall be included within the protection scope of this application.
Claims
1. A data search method, characterized in that, The described data lookup method is applied to a plugin, and the method includes: When a data query request is received, based on the trigger point and the received three-layer model data, obtain the data corresponding to the target module, including: obtaining the target module name and enumeration index by subscribing to the execution of the trigger point; through the target module name and the enumeration index, combining the three-layer model data to obtain the data corresponding to the target module, and the three-layer model data includes the front-end data mapping relationship among the trigger change attribute, trigger point, and action; Based on the data corresponding to the target module and the enumeration index, obtain an array of target change attribute names, including: based on the data corresponding to the target module and the enumeration index, obtain the target trigger function; through the target trigger function, obtain the target change attribute name, and after deduplication based on at least one target change attribute name, return the result array corresponding to the target change attribute name; Based on the data corresponding to the target module and the enumeration index, obtain the target action data, including: based on the enumeration index, traverse and filter the actions in the data corresponding to the target module to obtain the target action; obtain the interface method name in the business layer corresponding to the target action, and convert the interface method name into the corresponding interface address; The plugin supports the modification of cached data, and after the modification is completed, automatically persists the modified cached data to the front-end data storage.
2. The method according to claim 1, characterized in that, After obtaining the target trigger function based on the data corresponding to the target module and the enumeration index, it further includes: Based on the obtained target trigger function, obtain the corresponding trigger function string; Perform a pre-match on the trigger function string through a regular expression to obtain at least one of the target change attribute names.
3. The method according to claim 1, wherein The conversion of the interface method name into the corresponding interface address includes: Based on the obtained interface method name, convert the interface function corresponding to the business layer into an interface function string; Convert the interface function string into a single line, and perform a pre-match through a regular expression to obtain the corresponding interface address.
4. The method according to claim 1, characterized in that, After obtaining the target action data based on the data corresponding to the target module and the enumeration index, the method further includes: Cache all relevant data obtained based on the trigger point, and automatically hit the cached data when triggered again.
5. A data search device, characterized in that, The data lookup device is applied to a plugin, and the device includes: A receiving module, configured to, when a data query request is received, based on the trigger point and the received three-layer model data, obtain the data corresponding to the target module, including: obtaining the target module name and enumeration index by subscribing to the execution of the trigger point; through the target module name and the enumeration index, combining the three-layer model data to obtain the data corresponding to the target module, and the three-layer model data includes the front-end data mapping relationship among the trigger change attribute, trigger point, and action; A first acquisition module, configured to obtain an array of target change attribute names based on the data corresponding to the target module and the enumeration index, including: obtaining a target trigger function based on the data corresponding to the target module and the enumeration index; obtaining the target change attribute names through the target trigger function, and after de-duplicating based on at least one target change attribute name, returning a result array corresponding to the target change attribute names; A second acquisition module, configured to obtain target action data based on the data corresponding to the target module and the enumeration index, including: traversing and filtering actions in the data corresponding to the target module based on the enumeration index to obtain a target action; obtaining an interface method name in the service layer corresponding to the target action, and converting the interface method name into a corresponding interface address; The plug-in supports the modification of cached data, and after the modification is completed, automatically persists the modified cached data to the front-end data storage.
6. An electronic device, characterized in that, The electronic device includes: A processor; A memory for storing executable instructions of the processor; Wherein, the processor is configured to execute the data search method according to any one of claims 1-4.
7. A computer-readable storage medium, characterized in that, The storage medium stores a computer program, and the computer program can be executed by the processor to complete the data search method according to any one of claims 1-4.
Citation Information
Patent Citations
Function calling method and device as well as smart card
CN102023843A
A method for improving the precision query efficiency of sql database based on regular expression
CN109542931A
Dynamic data encapsulation method based on data item analysis, client and server
CN110019314A