Methods and apparatus for determining data information, storage media and electronic devices

By analyzing the source code of microservices to construct the call relationship chain, the data information of microservices can be automatically determined, solving the problem of low efficiency in manual sorting in existing technologies and achieving fast and accurate determination of data information.

CN116521767BActive Publication Date: 2026-03-10QINGDAO HAIER TECH +2
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-29
Publication Date
2026-03-10

AI Technical Summary

Technical Problem

In microservice systems, existing technologies cannot quickly and automatically determine the data information called by each microservice at runtime, mainly relying on manual sorting, which leads to low efficiency.

Method used

By analyzing the source code of microservices, we can obtain their dependencies and target methods of the underlying databases they directly connect to, build a call chain, and automatically determine the data information called by each microservice at runtime.

Benefits of technology

It enables automated and rapid determination of microservice data information, reduces manual intervention, and improves efficiency and accuracy, making it suitable for complex microservice systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116521767B_ABST
    Figure CN116521767B_ABST
Patent Text Reader

Abstract

This application discloses a method, apparatus, storage medium, and electronic device for determining data information, relating to the field of smart home technology. The method for determining data information includes: obtaining the project source code corresponding to each microservice in a plurality of microservices and the target method for each microservice to directly connect to a basic database; wherein, the basic database includes: a plurality of sub-databases, each sub-database storing a data type; parsing a first dependency relationship corresponding to the plurality of microservices from the project source code, wherein the first dependency relationship is used to indicate information on which a microservice is directly called by other services; summarizing the first dependency relationship corresponding to the plurality of microservices and the target method to obtain a first call relationship chain corresponding to the plurality of microservices; and determining the data information called by each microservice at runtime based on the first call relationship chain.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of communications, and more specifically, to a method and apparatus for determining data information, a storage medium, and an electronic device. Background Technology

[0002] In current backend development, an increasing number of server-side applications are shifting towards microservices. In our e-commerce system, the entire business is divided into several major business service modules, such as products, prices, payments, and orders. Each major business module is further subdivided into many sub-business modules, and these microservices communicate via an RPC framework. With rapid business iteration, the number of database connections across these microservice projects is increasing. When major business changes or refactoring occur, it's crucial to clearly understand which databases each project's interfaces connect to, and which projects call these databases, ensuring complete coverage of requirements and leaving no interfaces that need modification unchecked. Currently, this process primarily relies on the main business development lead to streamline the process. Therefore, quickly identifying the database connection calls and database dependencies of service projects is a problem that needs to be solved.

[0003] There is still no effective solution to the problem that the data information called by microservices at runtime can only be determined manually in related technologies. Summary of the Invention

[0004] This application provides a method and apparatus for determining data information, a storage medium, and an electronic device to at least solve the problem in related technologies that data information called by microservices at runtime can only be determined manually.

[0005] According to one embodiment of this application, a method for determining data information is provided, comprising: obtaining the project source code corresponding to each of a plurality of microservices and the target method for each microservice to directly connect to a basic database; wherein, the basic database includes: a plurality of sub-databases, each sub-database storing a data type; parsing a first dependency relationship corresponding to the plurality of microservices from the project source code, wherein the first dependency relationship is used to indicate information on which a microservice is directly called by other services; summarizing the first dependency relationship corresponding to the plurality of microservices and the target method to obtain a first call relationship chain corresponding to the plurality of microservices; and determining the data information called by each microservice at runtime based on the first call relationship chain.

[0006] In an exemplary embodiment, before obtaining the engineering source code corresponding to each of the multiple microservices, the method further includes: if it is determined that there is a historical record corresponding to the engineering source code, obtaining the update cycle corresponding to the engineering source code; determining a target time point for obtaining the engineering source code based on the update cycle, and identifying the degree of difference between the latest engineering source code obtained at the target time point and the most recently obtained historical engineering source code in the historical record; and determining whether to update the engineering source code before parsing based on the degree of difference.

[0007] In an exemplary embodiment, after determining whether the project source code should be updated before parsing based on the difference degree, the method further includes: if the difference degree is greater than or equal to a preset difference degree, determining that the project source code has undergone iterative changes and prohibiting the use of historical project source code for parsing; if the difference degree is less than the preset difference degree, determining that the project source code has not undergone iterative changes and allowing the use of historical project source code for parsing.

[0008] In an exemplary embodiment, after parsing the first dependency relationships corresponding to the plurality of microservices from the project source code, the method further includes: if it is determined that the project source code has undergone iterative changes, obtaining the latest project source code after the iterative changes; parsing the second dependency relationships corresponding to the plurality of microservices from the latest project source code; and summarizing the second dependency relationships corresponding to the plurality of microservices and the target method to obtain the second call relationship chain corresponding to the plurality of microservices.

[0009] In an exemplary embodiment, after aggregating the second dependencies corresponding to the plurality of microservices and the target method to obtain a second call relationship chain corresponding to the plurality of microservices, the method further includes: determining the difference nodes in the second call relationship chain and the first call relationship chain; sending the difference information corresponding to the difference nodes to the target object; receiving the feedback result from the target object regarding the difference information; and, if the feedback result indicates that the first call relationship chain should be updated, replacing the first node information in the first call relationship chain with the second node information in the second call relationship chain corresponding to the difference nodes to obtain an updated first call relationship chain.

[0010] In an exemplary embodiment, after determining the data information invoked by each microservice at runtime based on the first call relationship chain, the method further includes: determining the call interface corresponding to each microservice; associating the call interface with the data information; and storing the corresponding association in the node corresponding to the first call relationship chain.

[0011] In an exemplary embodiment, after determining the data information invoked by each microservice at runtime based on the first call relationship chain, the method further includes: when a query request of the target object is obtained, determining the microservice corresponding to the query request and displaying the first call relationship chain corresponding to the microservice; obtaining operation information issued by the target object based on the first call relationship chain, wherein the operation information is used to determine whether the data information is displayed and the display order.

[0012] According to another embodiment of this application, a data information determination device is also provided, comprising: an acquisition module, configured to acquire the project source code corresponding to each microservice among multiple microservices and the target method for each microservice to directly connect to a basic database; wherein the basic database includes: multiple sub-databases, each sub-database storing a data type; a parsing module, configured to parse out a first dependency relationship corresponding to the multiple microservices from the project source code, wherein the first dependency relationship is used to indicate information on which a microservice is directly called by other services; a summarizing module, configured to summarize the first dependency relationship and the target method corresponding to the multiple microservices to obtain a first call relationship chain corresponding to the multiple microservices; and a determination module, configured to determine the data information called by each microservice at runtime based on the first call relationship chain.

[0013] According to another embodiment of the present application, a computer-readable storage medium is also provided, wherein a computer program is stored in the computer-readable storage medium, and the computer program is configured to execute the above-mentioned method for determining data information when running.

[0014] According to another embodiment of the present application, an electronic device is also provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the above-described method for determining data information through the computer program.

[0015] In this embodiment, the project source code corresponding to each of multiple microservices and the target method for each microservice to directly connect to the basic database are obtained. The basic database includes multiple sub-databases, each storing a data type. A first dependency relationship corresponding to the multiple microservices is parsed from the project source code, where the first dependency relationship indicates information about a microservice being directly called by other services. The first dependency relationship and the target method corresponding to the multiple microservices are summarized to obtain a first call relationship chain corresponding to the multiple microservices. Based on the first call relationship chain, the data information called by each microservice at runtime is determined. In other words, by parsing the microservices' project source code to obtain the microservice dependencies, and summarizing the dependencies and connection methods of different microservices, the data information called by each microservice at runtime is determined. This technical solution solves the problem that determining the data information called by microservices at runtime can only be done manually. Attached Figure Description

[0016] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0017] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0018] Figure 1 This is a schematic diagram of the hardware environment for a method of determining data information according to an embodiment of this application;

[0019] Figure 2 This is a flowchart of a method for determining data information according to an embodiment of this application;

[0020] Figure 3 This is a timing diagram of a method for determining data information according to an optional embodiment of this application;

[0021] Figure 4 This is a structural block diagram (a) of a data information determining device according to an embodiment of this application;

[0022] Figure 5 This is a structural block diagram (II) of a data information determination device according to an embodiment of this application. Detailed Implementation

[0023] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.

[0024] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0025] According to one aspect of the embodiments of this application, a method for determining data information is provided. This method for determining data information is widely applicable to whole-house intelligent digital control application scenarios such as smart homes, smart home ecosystems, and intelligence house ecosystems. Optionally, in this embodiment, the above-mentioned method for determining data information can be applied to, for example... Figure 1 The hardware environment shown consists of terminal device 102 and server 104. For example... Figure 1 As shown, server 104 is connected to terminal device 102 via a network and can be used to provide services (such as application services) to the terminal or clients installed on the terminal. A database can be set up on the server or independently of the server to provide data storage services for server 104. Cloud computing and / or edge computing services can be configured on the server or independently of the server to provide data processing services for server 104.

[0026] The aforementioned network may include, but is not limited to, at least one of the following: wired network, wireless network. The aforementioned wired network may include, but is not limited to, at least one of the following: wide area network, metropolitan area network, local area network. The aforementioned wireless network may include, but is not limited to, at least one of the following: Wi-Fi (Wireless Fidelity), Bluetooth. The terminal device 102 may not be limited to PC, mobile phone, tablet computer, smart air conditioner, smart range hood, smart refrigerator, smart oven, smart stove, smart washing machine, smart water heater, smart washing equipment, smart dishwasher, smart projector, smart TV, smart clothes rack, smart curtains, smart audio-visual equipment, smart socket, smart speaker, smart speaker box, smart fresh air equipment, smart kitchen and bathroom equipment, smart bathroom equipment, smart robot vacuum cleaner, smart window cleaning robot, smart mopping robot, smart air purifier, smart steam oven, smart microwave oven, smart water heater, smart air purifier, smart water dispenser, smart door lock, etc.

[0027] This embodiment provides a method for determining data information, applied to the aforementioned terminal device. Figure 2 This is a flowchart of a method for determining data information according to an embodiment of this application, which includes the following steps:

[0028] Step S202: Obtain the project source code corresponding to each microservice in the multiple microservices and the target method for each microservice to directly connect to the basic database; wherein, the basic database includes: multiple sub-databases, each sub-database storing a data type;

[0029] Step S204: Parse the first dependency relationship corresponding to the multiple microservices from the project source code, wherein the first dependency relationship is used to indicate information about microservices being directly called by other services;

[0030] Step S206: Summarize the first dependency relationships and the target methods corresponding to the multiple microservices to obtain the first call relationship chain corresponding to the multiple microservices;

[0031] Step S208: Determine the data information called by each microservice at runtime based on the first call relationship chain.

[0032] Through the above steps, the source code of each microservice and the target method for each microservice to directly connect to the underlying database are obtained. The underlying database includes multiple sub-databases, each storing a data type. The first dependency relationships corresponding to the multiple microservices are parsed from the source code, whereby the first dependency relationships indicate information about microservices being directly called by other services. The first dependency relationships and the target methods corresponding to the multiple microservices are summarized to obtain the first call relationship chain corresponding to the multiple microservices. Based on the first call relationship chain, the data information called by each microservice at runtime is determined. This technical solution solves the problem that determining the data information called by microservices at runtime can only be done manually.

[0033] In an exemplary embodiment, before obtaining the engineering source code corresponding to each of the multiple microservices, the method further includes: if it is determined that there is a historical record corresponding to the engineering source code, obtaining the update cycle corresponding to the engineering source code; determining a target time point for obtaining the engineering source code based on the update cycle, and identifying the degree of difference between the latest engineering source code obtained at the target time point and the most recently obtained historical engineering source code in the historical record; and determining whether to update the engineering source code before parsing based on the degree of difference.

[0034] In other words, by analyzing the historical update cycle of the project source code, the time point for the next retrieval of the project source code is predicted. The project source code retrieved at the predicted time point is compared with the project source code from the historical version closest to the predicted time point. If differences exist between the two versions of the project source code, the degree of difference between the two versions is determined. If the degree of difference is greater than the preset degree of difference, it indicates that a replacement needs to be performed before parsing.

[0035] In an exemplary embodiment, after determining whether the project source code should be updated before parsing based on the difference degree, the method further includes: if the difference degree is greater than or equal to a preset difference degree, determining that the project source code has undergone iterative changes and prohibiting the use of historical project source code for parsing; if the difference degree is less than the preset difference degree, determining that the project source code has not undergone iterative changes and allowing the use of historical project source code for parsing.

[0036] In other words, if the differences in the project source code are too large, it indicates that the project source code has undergone iterative changes, and the old project source code is no longer allowed to be parsed. If the differences in the project source code are less than the preset difference threshold, it indicates that the project source code has not undergone iterative changes, and the old project source code can be parsed.

[0037] In practical applications, if the difference exceeds the preset difference threshold, it indicates significant changes in the project source code. In this case, the old parsing scheme for the old source code may fail to parse the new source code, or parsing errors may occur. Therefore, when the difference exceeds the preset difference threshold, a new parsing scheme can be determined based on the differing source code.

[0038] Optionally, the difference between the historical project source code and the latest project source code is obtained; the functional information marked in the difference source code is identified, wherein the functional information refers to the function corresponding to the difference source code; and the parsing order of the difference source code is determined according to the priority of the corresponding function of the difference source code.

[0039] In an exemplary embodiment, after parsing the first dependency relationships corresponding to the plurality of microservices from the project source code, the method further includes: if it is determined that the project source code has undergone iterative changes, obtaining the latest project source code after the iterative changes; parsing the second dependency relationships corresponding to the plurality of microservices from the latest project source code; and summarizing the second dependency relationships corresponding to the plurality of microservices and the target method to obtain the second call relationship chain corresponding to the plurality of microservices.

[0040] In other words, if the source code undergoes iterative changes, its corresponding dependencies may also change. The changed project source code is analyzed to obtain the new dependencies. After summarizing the new dependencies and target methods, the new call chain corresponding to the microservice is obtained.

[0041] In an exemplary embodiment, after aggregating the second dependencies corresponding to the plurality of microservices and the target method to obtain a second call relationship chain corresponding to the plurality of microservices, the method further includes: determining the difference nodes in the second call relationship chain and the first call relationship chain; sending the difference information corresponding to the difference nodes to the target object; receiving the feedback result from the target object regarding the difference information; and, if the feedback result indicates that the first call relationship chain should be updated, replacing the first node information in the first call relationship chain with the second node information in the second call relationship chain corresponding to the difference nodes to obtain an updated first call relationship chain.

[0042] It's important to note that each call relationship chain contains multiple call relationship nodes. Different call relationship nodes can correspond to different databases, database tables, data values, etc. The new call relationship chain corresponding to the source code iteration is compared with the call relationship chain corresponding to the historical source code. That is, the call relationship nodes in the two call relationship chains are compared to identify the differing nodes. The difference information corresponding to these differing nodes is sent to the user, allowing the user to determine whether to replace the differing nodes and thus obtain the updated call relationship chain.

[0043] In an exemplary embodiment, after determining the data information invoked by each microservice at runtime based on the first call relationship chain, the method further includes: determining the call interface corresponding to each microservice; associating the call interface with the data information; and storing the corresponding association in the node corresponding to the first call relationship chain.

[0044] In other words, by determining the correspondence between microservices and interfaces, the relationship between interfaces and data information can be clarified, and this relationship can be stored in the nodes corresponding to the call relationship chain.

[0045] In an exemplary embodiment, after determining the data information invoked by each microservice at runtime based on the first call relationship chain, the method further includes: when a query request of the target object is obtained, determining the microservice corresponding to the query request and displaying the first call relationship chain corresponding to the microservice; obtaining operation information issued by the target object based on the first call relationship chain, wherein the operation information is used to determine whether the data information is displayed and the display order.

[0046] In other words, users can query the call relationship chain corresponding to a microservice based on their needs. After clarifying the call relationship based on the call relationship chain, they can view detailed data information by providing feedback. If the user's feedback takes too long (i.e., longer than the preset time), there may be network latency, which could cause problems with the display of the corresponding data information. Therefore, the feedback is considered invalid. If the user's feedback takes less than or equal to the preset time, the user's feedback is valid and can be displayed.

[0047] As an optional implementation, after obtaining the operation information issued by the target object based on the first call relationship chain, the method further includes:

[0048] The first duration from the issuance of the operation information to its execution is determined; if the first duration is less than or equal to a preset duration, the operation information is determined to be valid information; if the first duration is greater than the preset duration, the operation information is determined to be invalid information.

[0049] To better understand the process of determining the above data information, the implementation flow of the above data information determination method will be described below in conjunction with optional embodiments, but this is not intended to limit the technical solution of the embodiments of this application.

[0050] This embodiment provides a method for determining data information. Figure 3 This is a timing diagram of a method for determining data information according to an optional embodiment of this application, such as... Figure 3 As shown, the specific steps are as follows:

[0051] It should be noted that Elasticsearch is an open-source search engine based on Apache Lucene, providing a distributed, multi-user full-text search engine, hereinafter referred to as es; git is an open-source distributed version control system.

[0052] Step S301: The user issues a command to make git pull the project source code;

[0053] Step S302: Use dependency analysis equipment to resolve the dependencies of the project's third-party library and construct the project's dependencies;

[0054] Step S303: Store the project dependencies obtained in step S302 into Elasticsearch;

[0055] Step S304: Use a dependency analysis device to process each project in parallel to obtain a direct database connection method;

[0056] Step S305: The dependency analysis device writes each directly connected database method node into Elasticsearch, with the parent node being the project name;

[0057] Step S306: Recursively process the direct database connection method referenced by the dependency analysis device, up to the outermost interface level;

[0058] Step S307: The dependency analysis device writes each method node to Elasticsearch, with the parent node being the lower-level method;

[0059] Step S308: The user queries the database to call dependencies / interface call dependencies;

[0060] Step S309: Elasticsearch returns the corresponding database call dependencies / API call dependencies to the user;

[0061] Step S310: If the above steps are performed, you can also capture git commit information in real time or at regular intervals, add information on changes since the change and node information for each method, and modify node information for incremental updates.

[0062] In other words, static analysis is performed based on the project source code. First, the source code of all projects is obtained through Git. The dependency information of third-party libraries of each project is parsed (the dependency packages that are internal to the company and published to the central repository for other applications to directly depend on / use). The project dependency relationship is constructed as the root node information and the data is stored in ElasticSearch, hereinafter referred to as es.

[0063] Secondly, the method of directly connecting to the database for each project is processed in parallel, with the project name as the parent node and the root node, and the data is stored in Elasticsearch (ES). Finally, the method call chain is processed recursively, storing node information in ES. After processing, ES retains a complete call relationship chain, which can be searched and queried. Furthermore, Git can be used to update the call relationship chain information in ES in real time or at regular intervals. Updates are made by locally updating node information based on code changes committed in Git. This achieves automatic detection of all database tables called in the API call process, avoiding manual analysis. In addition, it clearly displays which databases are called by the API and vice versa, remaining applicable even with many and complex projects. Furthermore, it can detect cross-project calls, making the call relationships between multiple projects clearer.

[0064] In summary, based on the above embodiments, when the device is triggered to meet the set conditions, the scenario can be repeatedly executed due to the device reporting the condition as met multiple times, thereby reducing resource waste, achieving the user's expectations for the set scenario, and improving user satisfaction.

[0065] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods of the various embodiments of this application.

[0066] Figure 4 This is a structural block diagram (a) of a data information determining device according to an embodiment of this application; as shown... Figure 4 As shown, it includes:

[0067] The acquisition module 42 is used to acquire the project source code corresponding to each microservice in the multiple microservices and the target method for each microservice to directly connect to the basic database; wherein, the basic database includes: multiple sub-databases, each sub-database storing a data type;

[0068] Parsing module 44 is used to parse the first dependency relationship corresponding to the multiple microservices from the project source code, wherein the first dependency relationship is used to indicate information about microservices being directly called by other services;

[0069] The aggregation module 46 is used to aggregate the first dependency relationship and the target method corresponding to the multiple microservices to obtain the first call relationship chain corresponding to the multiple microservices;

[0070] The determination module 48 is used to determine the data information called by each microservice at runtime based on the first call relationship chain.

[0071] Using the aforementioned device, the source code of each microservice and the target method for each microservice to directly connect to the underlying database are obtained. The underlying database includes multiple sub-databases, each storing a data type. The first dependency relationships corresponding to the multiple microservices are parsed from the source code, whereby the first dependency relationships indicate information about microservices being directly called by other services. The first dependency relationships and the target methods corresponding to the multiple microservices are summarized to obtain a first call relationship chain corresponding to the multiple microservices. Based on the first call relationship chain, the data information called by each microservice at runtime is determined, solving the problem that the data information called by microservices at runtime can only be determined manually.

[0072] In one exemplary embodiment, Figure 5 This is a structural block diagram (II) of a data information determining device according to an embodiment of this application; as shown Figure 5 As shown, in addition to the above Figure 4 In addition to all the modules, the above-mentioned device also includes: an update module 52, configured to, when it is determined that there is a historical record corresponding to the project source code, obtain the update cycle corresponding to the project source code; determine the target time point for obtaining the project source code based on the update cycle, and identify the degree of difference between the latest project source code obtained at the target time point and the most recently obtained historical project source code in the historical record; and determine whether to update the project source code before parsing based on the degree of difference.

[0073] In an exemplary embodiment, the update module 52 is further configured to, if the difference degree is greater than or equal to a preset difference degree, determine that the project source code has undergone iterative changes and prohibit the use of historical project source code for parsing; if the difference degree is less than the preset difference degree, determine that the project source code has not undergone iterative changes and allow the use of historical project source code for parsing.

[0074] In an exemplary embodiment, the above apparatus further includes: a relationship module 54, configured to: obtain the latest project source code after iterative changes when it is determined that the project source code has undergone iterative changes; parse the second dependency relationships corresponding to the multiple microservices from the latest project source code; and summarize the second dependency relationships corresponding to the multiple microservices and the target method to obtain the second call relationship chain corresponding to the multiple microservices.

[0075] In an exemplary embodiment, the relationship module 54 is further configured to: determine the difference nodes in the second call relationship chain and the first call relationship chain; send the difference information corresponding to the difference nodes to the target object; receive the feedback result of the target object regarding the difference information; and, if the feedback result indicates that the first call relationship chain should be updated, replace the first node information on the first call relationship chain with the second node information on the second call relationship chain corresponding to the difference nodes to obtain the updated first call relationship chain.

[0076] In an exemplary embodiment, the above apparatus further includes: an association module 56, which is further configured to determine the calling interface corresponding to each microservice; associate the calling interface with the data information; and store the corresponding association relationship in the node corresponding to the first calling relationship chain.

[0077] In an exemplary embodiment, the aforementioned association module 56 is further configured to, upon receiving a query request from a target object, determine the microservice corresponding to the query request and display the first call relationship chain corresponding to the microservice; and obtain operation information issued by the target object based on the first call relationship chain, wherein the operation information is used to determine whether data information is displayed and the display order.

[0078] Embodiments of this application also provide a storage medium including a stored program, wherein the program executes any of the methods described above when it is run.

[0079] Optionally, in this embodiment, the storage medium may be configured to store program code for performing the following steps:

[0080] S1, obtain the project source code corresponding to each microservice in the multiple microservices and the target method for each microservice to directly connect to the basic database; wherein, the basic database includes: multiple sub-databases, each sub-database storing a data type;

[0081] S2, parse the first dependency relationship corresponding to the multiple microservices from the project source code, wherein the first dependency relationship is used to indicate information about microservices being directly called by other services;

[0082] S3, summarize the first dependency relationship and the target method corresponding to the multiple microservices to obtain the first call relationship chain corresponding to the multiple microservices;

[0083] S4. Based on the first call relationship chain, determine the data information called by each microservice at runtime.

[0084] Embodiments of this application also provide an electronic device including a memory and a processor, wherein the memory stores a computer program and the processor is configured to run the computer program to perform the steps in any of the above method embodiments.

[0085] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor and the input / output device is connected to the processor.

[0086] Optionally, in this embodiment, the processor can be configured to perform the following steps via a computer program:

[0087] S1, obtain the project source code corresponding to each microservice in the multiple microservices and the target method for each microservice to directly connect to the basic database; wherein, the basic database includes: multiple sub-databases, each sub-database storing a data type;

[0088] S2, parse the first dependency relationship corresponding to the multiple microservices from the project source code, wherein the first dependency relationship is used to indicate information about microservices being directly called by other services;

[0089] S3, summarize the first dependency relationship and the target method corresponding to the multiple microservices to obtain the first call relationship chain corresponding to the multiple microservices;

[0090] S4. Based on the first call relationship chain, determine the data information called by each microservice at runtime.

[0091] Optionally, in this embodiment, the storage medium may include, but is not limited to, various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.

[0092] Optionally, specific examples in this embodiment can refer to the examples described in the above embodiments and optional implementations, and will not be repeated here.

[0093] Obviously, those skilled in the art should understand that the modules or steps of this application described above can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a network of multiple computing devices. Optionally, they can be implemented using computer-executable program code, thereby storing them in a storage device for execution by a computing device. In some cases, the steps shown or described can be performed in a different order than those presented here, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Thus, this application is not limited to any particular combination of hardware and software.

[0094] The above description is only a preferred embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications should also be considered within the scope of protection of this application.

Claims

1. A method of determining data information, characterized by, The method comprises the following steps: obtaining the engineering source code corresponding to each of the plurality of microservices and the target method directly connected to the basic database of each of the plurality of microservices; wherein the basic database comprises a plurality of sub-databases, and each of the sub-databases stores a data type; parsing the first dependency relationship corresponding to the plurality of microservices from the engineering source code, wherein the first dependency relationship is used to indicate the information that the microservice is directly called by other services; obtaining the first call relationship chain corresponding to the plurality of microservices by summarizing the first dependency relationship corresponding to the plurality of microservices and the target method; determining the data information called by each of the plurality of microservices at runtime based on the first call relationship chain; The method further comprises the following steps: in the case that it is determined that the engineering source code has been iteratively changed, obtaining the latest engineering source code after the iterative change; parsing the second dependency relationship corresponding to the plurality of microservices from the latest engineering source code; obtaining the second call relationship chain corresponding to the plurality of microservices by summarizing the second dependency relationship corresponding to the plurality of microservices and the target method; determining the difference node in the second call relationship chain and the first call relationship chain; sending the difference information corresponding to the difference node to the target object; receiving the feedback result of the target object on the difference information; in the case that the feedback result indicates that the first call relationship chain is updated, replacing the first node information on the first call relationship chain with the second node information on the second call relationship chain corresponding to the difference node to obtain the updated first call relationship chain.

2. The method of claim 1, wherein Before obtaining the engineering source code corresponding to each of the plurality of microservices, the method further comprises the following steps: in the case that it is determined that there is historical record corresponding to the engineering source code, obtaining the update cycle corresponding to the engineering source code; determining the target time point for obtaining the engineering source code based on the update cycle, and identifying the difference degree between the latest engineering source code obtained at the target time point and the historical engineering source code obtained last time in the historical record; determining whether to update the engineering source code before parsing according to the difference degree.

3. The method of claim 2, wherein After determining whether to update the engineering source code before parsing according to the difference degree, the method further comprises the following steps: in the case that the difference degree is greater than or equal to the preset difference degree, it is determined that the engineering source code has been iteratively changed, and the historical engineering source code is prohibited from being used to perform parsing; in the case that the difference degree is less than the preset difference degree, it is determined that the engineering source code has not been iteratively changed, and the historical engineering source code is allowed to be used to perform parsing.

4. The method of claim 1, wherein After determining the data information called by each of the plurality of microservices at runtime based on the first call relationship chain, the method further comprises the following steps: determining the call interface corresponding to each of the plurality of microservices; associating the call interface with the data information, and saving the corresponding association relationship in the node corresponding to the first call relationship chain.

5. The method of claim 1, wherein After determining the data information called by each of the plurality of microservices at runtime based on the first call relationship chain, the method further comprises the following steps: in the case that the query request of the target object is obtained, determining the microservice corresponding to the query request and displaying the first call relationship chain corresponding to the microservice; Obtain operation information issued by the target object based on the first call relationship chain, wherein the operation information is used to determine whether the data information is displayed and the display order.

6. An apparatus for determining data information, characterized by comprising: The method comprises the following steps: An acquisition module is configured to acquire engineering source code corresponding to each of a plurality of microservices and a target method directly connected to a basic database by each microservice, wherein the basic database comprises a plurality of sub-databases, and each sub-database stores a data type. An analysis module is configured to analyze a first dependency relationship corresponding to the plurality of microservices from the engineering source code, wherein the first dependency relationship is used to indicate information that a microservice is directly called by another service. A summary module is configured to summarize the first dependency relationship corresponding to the plurality of microservices and the target method to obtain a first call relationship chain corresponding to the plurality of microservices. A determination module is configured to determine data information called by each microservice at runtime based on the first call relationship chain. A relationship module is configured to, in a case where it is determined that the engineering source code has been iteratively changed, acquire latest engineering source code after the iterative change, analyze a second dependency relationship corresponding to the plurality of microservices from the latest engineering source code, summarize the second dependency relationship corresponding to the plurality of microservices and the target method to obtain a second call relationship chain corresponding to the plurality of microservices, determine a difference node in the second call relationship chain and the first call relationship chain, send difference information corresponding to the difference node to a target object, receive a feedback result of the target object on the difference information, and in a case where the feedback result indicates that the first call relationship chain is updated, replace first node information on the first call relationship chain with second node information on the second call relationship chain corresponding to the difference node to obtain an updated first call relationship chain.

7. A computer readable storage medium, characterized in that, The computer-readable storage medium comprises a stored program, wherein the program is executed to perform the method described in any one of claims 1 to 5. 8.An electronic device comprising a memory and a processor, the electronic device comprising: The memory stores a computer program, and the processor is configured to execute the method described in any one of claims 1 to 5 by using the computer program.

Citation Information

Patent Citations

  • Method, device and system for splitting micro service based on SOA (service oriented architecture) single application

    CN115794080A