Annotating form-based downstream service search method and electronic device
By using an annotation-based downstream service search method and leveraging data containers and Excel files, we can achieve efficient batch searching of upstream services. This solves the problems of low scanning efficiency and high repetition in existing technologies and improves the efficiency of downstream service optimization.
Patent Information
- Application Number
- CN202511226676.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-29
- Publication Date
- 2026-02-27
- Estimated Expiration
- 2045-08-29
AI Technical Summary
Existing technologies suffer from low scanning efficiency and high repetition during downstream service optimization. In particular, when scanning with specialized software, it is impossible to process multiple services in batches, and manual operations are required multiple times.
A downstream service search method based on annotations is adopted. By defining data containers and Excel files, service information is read, file paths are traversed, upstream service files are filtered out, and the results are output. It supports batch search in one go.
It improves search efficiency, lowers the barrier to entry, reduces the number of operations, shortens runtime, and enables efficient batch search of multiple downstream services.
Smart Images

Figure CN121070422B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computer, in particular to a downstream service search method based on annotation form, a computer readable storage medium, an electronic device and a computer program product. BACKGROUND
[0002] Spring framework can simplify Java enterprise development, has many advantages such as providing powerful and stable functions, and has been widely used in the Internet industry. The core mechanism of Spring is dependency injection (supporting multiple ways such as XML, annotation, etc.), which can reduce the coupling relationship between computer programs to a certain extent. Using this framework, if the inventory service needs to optimize the function logic, the optimized service code can be implemented by adding the version number on the basis of not changing the original service name. The calling party generally only needs to modify the downstream service annotation version number to achieve cooperation and transformation, greatly reducing the workload and reducing the production risk.
[0003] If the downstream service involves transformation, all calling parties generally need to cooperate in testing, at which time the services of all calling parties need to be sorted out. The calling relationship registered by the system is often not complete, and some may be missing. If the transformation is missed, there is a great production risk in the later period. Therefore, a special software (such as FilelLocatorPro) is generally used to scan the code library.
[0004] However, there are the following problems in scanning the code library by using special software: 1. Special software can directly scan based on string + path conditions, but many Java files that do not involve calling the service will also be scanned out, and further screening is required, which is time-consuming and laborious. 2. Special software only supports scanning a single service name each time, and if many downstream services involve optimizing internal function logic at the same time, multiple scans are required. Each time needs to wait for the previous scan to be completed, and then manually execute the scan of the next service, which cannot batch scan multiple services at a time, resulting in a repetitive and tedious process. SUMMARY
[0005] The present application aims to at least solve one of the technical problems in the related art. To this end, the purpose of the present application is to provide a downstream service search method based on annotation form, a computer readable storage medium, an electronic device and a computer program product, to improve search efficiency and reduce the use threshold.
[0006] To achieve the above object, the embodiment of the present application provides a downstream service search method based on an annotation form, which comprises the following steps: defining a first data container and a second data container, wherein the first data container is used for storing service calling information, and the second data container is used for storing downstream service information; newly creating a target Excel file, wherein the target Excel file is used for storing the downstream service information to be searched, and the row name of the target Excel file is defined as an annotation name, a version number and a downstream service name; reading the downstream service information in the target Excel file and storing the downstream service information into the second data container; determining a scanning path according to the data in the second data container, traversing all files under the scanning path, and screening out upstream service files; storing the stored service information corresponding to the upstream service files into the first data container; and outputting the data collected by the first data container to a designated Excel file.
[0007] In addition, the downstream service search method based on an annotation form provided by the embodiment of the present application can further have the following additional technical features:
[0008] According to an embodiment of the present application, the step of reading the downstream service information in the target Excel file and storing the downstream service information into the second data container comprises the following steps: reading each row of data in the target Excel file through a byte stream loop mode, and temporarily storing each row of data into a temporary object; and putting the downstream service information in the temporary object into the second data container.
[0009] According to an embodiment of the present application, the downstream service information comprises an annotation name, a version number and a downstream service name; and the step of determining a scanning path according to the data in the second data container, traversing all files under the scanning path, and screening out upstream service files comprises the following steps: traversing all files under the scanning path, screening out all Java files; reading the content in each Java file, and if the Java file comprises the annotation name and / or the version number, regarding the Java file as the upstream service file.
[0010] According to one embodiment of the present application, the step of reading the content in each of the Java files and determining whether the Java file is the upstream service file if the Java file includes the annotation name and / or the version number comprises: defining a third data container, wherein the third data container is used for temporarily storing each line of data in the Java file in the current scanning path; reading each line of data in the Java file in the scanning path in a loop and adding each line of data to the third data container; if the current line is in a line number greater than 1 and includes the downstream service name, removing the space in the previous line of data of the current line and determining whether the previous line of data includes the annotation name and / or the version number; and if yes, determining that the Java file is the upstream service file of the downstream service.
[0011] According to one embodiment of the present application, when traversing the files in the scanning path, if a subfolder is encountered, a recursive call is used to traverse the Java files in the subfolder.
[0012] According to a second aspect of the present application, a computer readable storage medium is provided, and the computer readable storage medium stores a computer program, and the computer program is executed by a processor to implement the above-mentioned downstream service search method based on the annotation form.
[0013] According to a third aspect of the present application, an electronic device is provided, and the electronic device comprises a memory, a processor and a computer program stored in the memory, and the computer program is executed by the processor to implement the above-mentioned downstream service search method based on the annotation form.
[0014] According to a fourth aspect of the present application, a computer program product is provided, and the computer program product comprises a computer program or instructions, and when the computer program or instructions are executed, the above-mentioned downstream service search method based on the annotation form is implemented.
[0015] The downstream service search method based on the annotation form in the embodiments of the present application only needs to input the annotation name, the version number and the downstream service name information of one or more services in a target Excel file and specify a search path, and all upstream service information related to the calling of the service can be obtained by one-time running. The professional regular expression does not need to be written, and the search efficiency is improved and the use threshold is reduced. Meanwhile, the one-time batch search of multiple downstream services is supported, the operation times are reduced, and the running time is shortened. BRIEF DESCRIPTION OF DRAWINGS
[0016] The disclosure of the present application will be described with reference to the accompanying drawings. It should be understood that the drawings are only for the purpose of illustration and are not intended to limit the scope of protection of the present application, and the same reference numerals are used to refer to the same components in the drawings. Among them:
[0017] Figure 1 is a flowchart of a downstream service search method based on an annotation form according to an embodiment of the present application;
[0018] Figure 2 is a flowchart of a downstream service search method based on an annotation form according to another embodiment of the present application;
[0019] Figure 3 is a structural diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0020] Embodiments of the present application are described in detail below with reference to the attached drawings. The embodiments described below are examples and are intended to explain the present application, and are not to be understood as limiting the present application.
[0021] Some embodiments of the present application are described below in detail with reference to the accompanying drawings. Embodiments described below and features in the embodiments can be combined with each other in the case of no conflict.
[0022] Reference is made below to the accompanying drawings Figure 1 - the accompanying drawings Figure 3 A downstream service search method based on an annotation form, a computer readable storage medium, an electronic device, and a computer program product according to an embodiment of the present application are described below.
[0023] Figure 1 is a flowchart of a downstream service search method based on an annotation form according to an embodiment of the present application.
[0024] As shown in Figure 1 , the downstream service search method based on an annotation form includes:
[0025] S1, defining a first data container and a second data container, wherein the first data container is used to store service call information, and the second data container is used to store downstream service information.
[0026] As an example, a Java class SingleServiceRelatedToTheCall can be defined as the first data container, which defines annotation name, version number, downstream service name, upstream service name, path, and the like. A Java class DownstreamServiceInformation can be defined as the second data container, which defines annotation name, version number, downstream service name, and the like.
[0027] S2, create a target Excel file, wherein the target Excel file is used to store the downstream service information to be searched, and the row name of the target Excel file is defined as the annotation name, the version number and the downstream service name.
[0028] As an example, an Excel file DownstreamServiceInformation.xls can be created. As shown in the following table, the column name of DownstreamServiceInformation.xls is defined as the annotation name, the version number and the downstream service name, and the information related to the downstream service (one or more) to be searched is input into the file.
[0029] Annotation name Version number Downstream service name Reference 1.0 DownstreamService1 Reference 1.1 DownstreamService2
[0030] It should be noted that the Excel is created to facilitate the user to uniformly fill in the information related to the downstream service (three columns in the Excel) to be scanned, and the information in the file is read for further processing.
[0031] S3, read the downstream service information in the target Excel file and store it in the second data container.
[0032] It should be noted that the "target downstream service information" in the Excel is loaded into the memory to provide directly accessible data for subsequent scanning and matching.
[0033] S4, determine a scanning path according to the data in the second data container, traverse all files under the scanning path, and screen out upstream service files.
[0034] As an example, all files under the scanning path can be recursively traversed to screen out files that can contain service call annotations.
[0035] S5, store the storage service information corresponding to the upstream service file to the first data container.
[0036] S6, output the data collected by the first data container to a specified Excel file.
[0037] It should be noted that the collected call relationship data can be presented in a structured form to facilitate user viewing and analysis.
[0038] The downstream service search method based on the annotation form of the embodiment of the application only needs to input one or more service annotation names, version numbers and downstream service names in a target Excel file, and then specify a search path, so that all upstream service information related to the calling of the service can be obtained by one-time operation. The search efficiency is improved, and the use threshold is reduced. At the same time, the one-time batch search of multiple downstream services is supported, the operation times are reduced, and the running time is shortened.
[0039] In some embodiments, the step of reading the downstream service information in the target Excel file and storing in the second data container comprises:
[0040] S31, reading each row of data in the target Excel file by a byte stream circulation mode, and temporarily storing each row of data in a temporary object.
[0041] It should be noted that the target Excel file is opened by using a byte stream (such as FileInputStream in Java), and the file content is read in a streaming manner, rather than loading the entire file into the memory at one time.
[0042] S32, putting the downstream service information in the temporary object into the second data container.
[0043] In this embodiment, by using the byte stream circulation reading and the temporary object intermediate storage, large files can be efficiently processed to avoid memory overflow, and the data integrity and accuracy can be ensured by step-by-step processing, so that the stability and reliability of the downstream service information loading are improved.
[0044] In some embodiments, the downstream service information includes an annotation name, a version number and a downstream service name.
[0045] According to the data in the second data container, a scanning path is determined, all files under the scanning path are traversed, and upstream service files are screened out.
[0046] S41, traversing all files under the scanning path, and screening out all Java files.
[0047] As an example, the scanning range can be quickly narrowed by path positioning and suffix screening, and the Java files that may contain service call annotations are focused, so that the processing overhead of invalid files is reduced, and the efficiency of the subsequent steps is improved.
[0048] S42, reading the content of each Java file, and if the Java file includes the annotation name and / or the version number, the Java file is the upstream service file.
[0049] As an example, first, for each Java file screened out, the file content is read by character stream line by line, and then the file content is compared with the "annotation name" and "version number" in the second data container: check whether the annotation name of the target downstream service (such as order-service in @Downstream("order-service")) is contained; check whether the corresponding version number (such as version="v2.0.0") is contained; as long as any one of the conditions "contains annotation name" or "contains version number" is met, it is determined that the file may call the target downstream service; for the Java file meeting the condition, record its path or reference, and mark it as an "upstream service file".
[0050] In this embodiment, the range is preliminarily narrowed down by file type screening, and accurate positioning is realized by content matching, which together completes efficient screening of upstream service files from massive files, and lays a foundation for subsequent collection of service call information.
[0051] In some embodiments, the step of reading the content in each of the Java files, and if the Java file includes the annotation name and / or the version number, regarding the Java file as the upstream service file, includes:
[0052] S421, defining a third data container, wherein the third data container is used for temporarily storing each line of data in the Java file in the current scanning path.
[0053] S422, reading each line of data in the Java file under the scanning path in a loop, and adding each line of data to the third data container.
[0054] S423, if the current line is greater than 1 and contains the downstream service name, removing the space in the previous line of data of the current line, and determining whether the previous line of data contains the annotation name and / or the version number.
[0055] S424, if yes, determining that the Java file is an upstream service file that calls the downstream service.
[0056] As an example, if no, it is determined that the Java file is not an upstream service file that calls the downstream service.
[0057] In this embodiment, by reading line by line and temporarily storing data, combined with accurate matching of the association between the annotation and the service name in the context line relationship, not only can the redundant overhead of full-text scanning be avoided, but also the accuracy of annotation recognition can be improved, irrelevant files can be effectively filtered, and the efficiency of upstream service file screening can be improved.
[0058] In some embodiments, when traversing the files under the scanning path, if a subfolder is encountered, a recursive call is made to the traversal operation to obtain the Java files in the subfolder.
[0059] In this embodiment, by making a recursive call to traverse the subfolder, it is ensured that all levels of Java files under the scanning path are retrieved without omission, without the need for manually processing the nested directories layer by layer, ensuring the completeness of the file scanning, simplifying the traversal logic, and improving the processing efficiency.
[0060] Next, the specific implementation process of the annotation-form-based downstream service search method of the present application will be described with reference to the following example: Figure 2
[0061] Step 1, define a Java class DownstreamServiceInformation, which defines attributes such as annotation name, version number, and downstream service name; define a Java class SingleServiceRelatedToTheCall, which defines attributes such as annotation name, version number, downstream service name, upstream service name, and path.
[0062] Step 2, define a property List <singleservicerelatedtothecall>serviceRelatedToTheCalls is used to store the information of upstream services which meet the requirements (annotation name + version number + downstream service name).
[0063] Step 3, create a new Excel file: DownstreamServiceInformation.xls, column name definition is annotation name, version number, downstream service name, and input the information of the downstream service (one or more) to be searched into the file.
[0064] Step 4, define a method List <downstreamserviceinformation>readExcelData(String fileName), where the parameter fileName is the file location path of Downstream ServiceInformation.xIs file, each line of data in the DownstreamServiceInformation.xIs file is read in a byte stream mode, the read data is assigned to the temporary variable DownstreamServiceInformation downstreamServiceInformationtmp corresponding attribute (the temporary variable plays a role of caching data), and then downstreamServicelnformationtmp is added to List <downstreamserviceinformation>downstreamServiceInformations.
[0065] Step 5, define a method findDownstreamServiceInformation(String path, DownstreamServiceInformation downstreamServiceInformation), the main logic of the method is:
[0066] (1) define a property List <string>findServiceInfolist is used to temporarily store each line of data in the Java file scanned in the current path.
[0067] (2) Read each line of data in the Java file under the path in a loop, and add each line of data to findServiceInfolist. If the line number LineNum > 1 and contains the name of the downstream service (the name of the downstream service is an attribute of the parameter downstreamServiceInformation in this method), further judgment is made:
[0068] Explanation: Because the service name generally appears in the next line according to the fixed usage form of the annotation, if the line contains the name of the downstream service involved, and the line number is greater than 1, it is judged that the previous line may contain the annotation version number and other information, and to avoid program errors.
[0069] First, eliminate the spaces in the previous line of data findServiceInfolist.get(LineNum-1), and then judge whether it contains the @ annotation name (version="version number") (the annotation name and version number are also attributes of the parameter downstreamServiceInformation in this method). If so, it means that the search has been found, and the annotation name, version number, downstream service name, upstream service name (i.e. the Java file name in the current path), path (path), etc. are assigned to temporary variables SingleServiceRelatedToTheCall singleServiceRelatedToTheCall corresponding attributes, and then the assigned singleServiceRelatedToTheCall is added to serviceRelatedToTheCalls, and the while loop is exited.
[0070] Step 6: Define a method getFiles(List <string>The method mainly traverses all files under the path paths (a path set with search files): if it is still a folder (judged by calling the findDownstreamServiceInformation method internal logic), the getFiles method is recursively called to obtain the files in the folder; if it is a file, the findDownstreamServiceInformation (String path, DownstreamServiceInformation downstreamServiceInformation) method is called to continue the remaining logic.
[0071] Description: The files in the folder can be Java files or subfolders. Generally, the files to be scanned are Java files, and for subfolders, it is necessary to recursively determine whether the subfolder contains Java files. The method searches all Java files in paths.
[0072] Step 7: Assign downstreamServiceInformations.size() to m, and i = 0.
[0073] Step 8: Determine if i ≤ m-1:
[0074] (1) If yes, call getFiles (parameter 1, parameter 2) and go to step 9.
[0075] (2) If no, go to step 13.
[0076] Step 9: Assign parameter 1.size() to n, and j = 0.
[0077] Step 10: Determine if j ≤ n-1:
[0078] (1) If yes, go to step 11.
[0079] (2) If no, i = i + 1, and go to step 8.
[0080] Step 11: Call findDownstreamServiceInformation (parameter 1.get(j), parameter 4) to determine if parameter 1.get(j) is a folder:
[0081] (1) If yes, go to step 8 (1) and recursively call the getFiles method.
[0082] (2) If no, read the data of each line of the parameter 1.get(j) file.
[0083] Step 12, judge whether the current line contains the downstreamServiceInformation attribute downstream service name and the previous line contains the corresponding annotation.
[0084] (1) If yes, add the related information to serviceRelatedToThecalls, jump out of the while loop, j=j+1, and enter step 10.
[0085] (2) If no, judge whether there is next line of data.
[0086] ① If yes, move the current line to the next line and enter step 12.
[0087] ② If no, j=j+1, and enter step 10.
[0088] Step 13, output the data of serviceRelatedToTheCalls to the Excel file (involving query results of calling downstream services.xIs) of the specified format.
[0089] In addition, the present application also provides a computer readable storage medium, which stores a computer program, and the program is executed by a processor to realize the above-mentioned downstream service search method based on the annotation form.
[0090] In addition, the present application also provides an electronic device, as shown in the figure, Figure 3 The electronic device 100 includes a memory 101, a processor 102 and a computer program stored in the memory 101. Wherein, the memory 101 and the processor 102 are connected, such as through the bus 103. Optionally, the electronic device 100 can also include a transceiver 104. When the computer program is executed by the processor 102, the above-mentioned downstream service search method based on the annotation form is realized. It should be noted that in actual application, the transceiver 104 is not limited to one, and the structure of the electronic device 100 does not constitute a limitation on the embodiments of the present application.
[0091] The processor 102 can be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array) or other programmable logic device, a transistor logic device, a hardware component, or any combination thereof. It can implement or execute various exemplary logical blocks, modules and circuits described in combination with the present disclosure. The processor 102 can also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc.
[0092] The bus 103 can include a path for transmitting information between the above-mentioned components. The bus 103 can be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus, etc. The bus 103 can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 3 In the figure, only one thick line is used to represent, but it does not mean that there is only one bus or one type of bus.
[0093] The memory 101 is used to store a computer program corresponding to the downstream service search method based on the annotation form of the above-mentioned embodiments of the present application, which is controlled and executed by the processor 102. The processor 102 is used to execute the computer program stored in the memory 101 to realize the content shown in the above-mentioned embodiments of the downstream service search method based on the annotation form.
[0094] Among them, Figure 3 The electronic device 100 shown is only an example and should not limit the functions and use range of the embodiments of the present application.
[0095] The electronic device 100 of the embodiments of the present application improves the search efficiency and reduces the use threshold by executing the downstream service search method based on the annotation form without writing professional regular expressions and without multiple running. At the same time, it supports batch search of multiple downstream services at one time without multiple repeated manual operation and running, reduces the number of operations and shortens the running time.
[0096] In addition, the application further provides a computer program product, comprising computer programs or instructions, wherein when the computer programs or instructions are executed, the above-mentioned any one kind of downstream service search method based on the form of annotation is realized.
[0097] Although the example embodiments have been described herein with reference to the accompanying drawings, it is to be understood that the example embodiments are only exemplary and are not intended to limit the scope of the present application. Those of ordinary skill in the art can make various changes and modifications without departing from the scope and spirit of the present application. All such changes and modifications are intended to be included within the scope of the present application as claimed in the appended claims.
[0098] Those of ordinary skill in the art can realize that the units and algorithm steps of each example described in connection with the embodiments disclosed herein can be realized in electronic hardware, or a combination of computer software and electronic hardware. Whether the functions are performed in hardware or software depends on the specific application and design constraints of the technical solutions. Those of ordinary skill in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.
[0099] In several embodiments provided in the present application, it should be understood that the disclosed devices can be implemented in other ways. For example, the device embodiments described above are only illustrative, for example, the division of the units is only a logical function division, and actual implementation can have another division manner, for example, multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed.
[0100] In the specification provided herein, a large number of specific details are described. However, it can be understood that the embodiments of the present application can be practiced without these specific details. In some examples, well-known structures and technologies are not shown in detail in order not to obscure the understanding of the present specification.
[0101] Similarly, it should be understood that, in order to simplify the present application and help understand one or more of the various inventive aspects, in the description of the exemplary embodiments of the present application, various features of the present application are sometimes grouped together in a single embodiment, figure, or description thereof. However, this grouping of the features of the present application should not be interpreted as reflecting an intention that the claimed present application requires more features than those explicitly recited in each claim. Rather, as reflected by the corresponding claims, the inventive point is that the corresponding technical problem can be solved with fewer features than all the features of a certain disclosed single embodiment. Therefore, the claims following the specific embodiments are hereby expressly incorporated into the specific embodiments, wherein each claim itself is a separate embodiment of the present application.
[0102] Those skilled in the art will appreciate that the features described herein can be combined in all possible technically useful combinations unless otherwise expressly excluded. Although specific embodiments of the present application have been shown and described herein, it is understood that a variety of modifications in form and detail can be made therein by those skilled in the art without departing from the spirit and scope of the application as expressed by the appended claims.
[0103] In addition, those skilled in the art will appreciate that, unless otherwise indicated herein, the features described herein can be combined in any technically useful manner, and that the combinations described are merely exemplary. For instance, in the claims, any of the claimed embodiments can be used in any combination.
[0104] Various components of the present application can be implemented in hardware, software or a combination thereof. Those skilled in the art will appreciate that some or all of the functions of some of the modules according to embodiments of the present application can be implemented in a microprocessor or digital signal processor (DSP) in practice.
[0105] It is noted that the embodiments described above illustrate rather than limit the application, and that those skilled in the art will be able to design many alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps other than those listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The application can be implemented by means of both hardware and software, and any combination thereof. In a unitary claim, several devices or means can be listed, even though the claim is drafted to the effect that only one device or means is claimed. Each of the devices or means can be then, theoretically, of a different category of items even though they are actually the same in practice. These terms should not be interpreted as implying that the application frequency is limited to products or processes covering only one of the specified device or means, unless the application explicitly specifies such a limitation. The mere fact that different claims recite a combination of elements does not preclude that some such elements qualify for patent protection on their own in one or more other claims.
[0106] The above description is only specific embodiments of the present application or specific explanations of specific embodiments. The protection scope of the present application is not limited to this, and any person skilled in the art can easily think of changes or replacements within the technical scope disclosed by the present application, which should be covered by the protection scope of the present application. The protection scope of the present application should be subject to the protection scope of the claims.< / string> < / string> < / downstreamserviceinformation> < / downstreamserviceinformation> < / singleservicerelatedtothecall>
Claims
1. A method for searching downstream services based on an annotation form, characterized by, The method comprises: defining a first data container and a second data container, wherein the first data container is used to store service call information, and the second data container is used to store downstream service information; creating a target Excel file, wherein the target Excel file is used to store the downstream service information to be searched, and the row name of the target Excel file is defined as an annotation name, a version number and a downstream service name; reading the downstream service information in the target Excel file and storing it in the second data container; determining a scanning path according to the data in the second data container, traversing all files under the scanning path, and screening out upstream service files; storing the service call information corresponding to the upstream service files to the first data container; outputting the data collected by the first data container to a designated Excel file; the downstream service information comprises an annotation name, a version number and a downstream service name; the step of determining a scanning path according to the data in the second data container, traversing all files under the scanning path, and screening out upstream service files comprises: traversing all files under the scanning path and screening out all Java files; reading the content in each Java file, and if the Java file includes the annotation name and / or the version number, the Java file is the upstream service file, and specifically comprising: defining a third data container, wherein the third data container is used to temporarily store each row of data in the Java file under the current scanning path; cyclically reading each row of data in the Java file under the scanning path and adding each row of data to the third data container; if the current row is greater than 1 and contains a downstream service name, removing the space in the previous row of data of the current row and judging whether the previous row of data contains the annotation name and / or the version number; if yes, it is determined that the Java file is an upstream service file that calls the downstream service.
2. The method of claim 1, wherein, the step of reading the downstream service information in the target Excel file and storing it in the second data container comprises: reading each row of data in the target Excel file by a byte stream cycle mode, and temporarily storing each row of data in a temporary object; putting the downstream service information in the temporary object into the second data container.
3. The method of claim 1, wherein, When traversing the files under the scanning path, if a subfolder is encountered, a recursive call is used to traverse the Java files in the subfolder.
4. A computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement the annotation-based downstream service search method according to any one of claims 1-3.
5. An electronic device comprising a memory, a processor, and a computer program stored on the memory, characterized in that, The computer program is executed by the processor to implement the annotation-based downstream service search method according to any one of claims 1-3.
6. A computer program product comprising computer programs or instructions, wherein, When the computer program or instructions are executed, the annotation-based downstream service search method according to any one of claims 1-3 is implemented.
Citation Information
Patent Citations
Data processing method based on annotation, computer equipment and readable storage medium
CN114721713A
Dynamic backoff and retry attempts based on incoming request
US20200045117A1