CN117633075A - Micro-service application data cooperation method and device, electronic equipment and storage medium - Google Patents

Micro-service application data cooperation method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN117633075A
CN117633075A CN202311594230.0A CN202311594230A CN117633075A CN 117633075 A CN117633075 A CN 117633075A CN 202311594230 A CN202311594230 A CN 202311594230A CN 117633075 A CN117633075 A CN 117633075A
Authority
CN
China
Prior art keywords
micro
data
service application
database
change information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311594230.0A
Other languages
Chinese (zh)
Inventor
郭文斌
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Merchants Finance Technology Co Ltd
Original Assignee
China Merchants Finance Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Merchants Finance Technology Co Ltd filed Critical China Merchants Finance Technology Co Ltd
Priority to CN202311594230.0A priority Critical patent/CN117633075A/en
Publication of CN117633075A publication Critical patent/CN117633075A/en
Pending legal-status Critical Current

Links

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The invention relates to a data collaboration technology, and discloses a micro-service application data collaboration method, which comprises the following steps: receiving two micro-service applications which need to be coordinated; adding a data synchronization interface in the micro-service application to call the data synchronization interface to operate the data in the background database of the micro-service application so as to obtain a target micro-service application; when any target micro-service application presents interface call of a non-data synchronous interface, determining the target service as a changed micro-service application, and determining the other target micro-service application as a cooperative micro-service application; acquiring a database operation instruction of the change micro-service application; screening and analyzing the database operation instruction to obtain data change information; and operating the data in the background database of the collaborative micro service application by utilizing the change information. The invention also provides a micro-service application data collaboration device, equipment and medium. The invention can improve the efficiency of the collaboration of the micro-service application data.

Description

Micro-service application data cooperation method and device, electronic equipment and storage medium
Technical Field
The present invention relates to data collaboration technologies, and in particular, to a method and apparatus for collaboration of micro service application data, an electronic device, and a storage medium.
Background
In the field of background technology development, when two micro service applications in different environments need to perform data collaboration, corresponding technical upgrades are often required to be performed on the micro service applications, including reconstruction and modification of code logic, and generally, an upgrade method includes reconstruction and modification of the whole code, and a location related to modification includes a location of data or resource variation (generally, an access request issuing and a database driven calling location), so that efficiency of micro service application data collaboration is low.
Disclosure of Invention
The invention provides a micro-service application data collaboration method, a micro-service application data collaboration device, electronic equipment and a storage medium, and aims to improve efficiency of micro-service application data collaboration.
Receiving two micro-service applications which need to be coordinated;
a data sensing module is added in the micro-service application to sense the data change of the data interaction with the micro-service application background database in the micro-service application, so as to obtain an initial micro-service application;
adding a data synchronization interface in the initial micro-service application to call the data synchronization interface to operate the data in the background database of the initial micro-service application so as to obtain a target micro-service application;
connecting the two target micro-service applications by using a preset message middleware;
when any target micro-service application generates interface call of a non-data synchronous interface, determining the target service as a changed micro-service application, and determining target micro-service applications except the changed micro-service application as cooperative micro-service applications;
acquiring a database operation instruction of the change micro-service application by utilizing a data perception module in the change micro-service application;
screening and analyzing the database operation instruction to obtain data change information;
and transmitting the change information to the collaborative micro-service application by using the message middleware so as to call the data synchronization interface to operate the data in the background database of the collaborative micro-service application based on the change information received by the collaborative micro-service application, thereby realizing data collaboration.
Optionally, the screening and analyzing the database operation instruction to obtain data change information includes:
the data adding command, the data deleting command and the data changing command in the database operation command are reserved, and initial data change information is obtained;
acquiring the database name of the background database of the change micro service application to obtain the change database name;
and replacing the names of the change databases in the initial data change information with preset replacement symbols to obtain the data change information.
Optionally, the reserving the data addition command, the data deletion command, and the data change command in the database operation instruction, to obtain initial data change information includes:
determining SQL sentences which contain any keywords in a preset first SQL sentence keyword set in the database operation instruction as target SQL sentences;
extracting all target SQL sentences in the data operation instruction;
and arranging all the target SQL sentences according to the sequence in the database operation instruction to obtain the initial data change information.
Optionally, deleting the data query command in the database operation instruction to obtain initial data change information includes:
deleting the data query command in the database operation instruction to obtain initial data change information;
acquiring the database name of the background database of the change micro service application to obtain the change database name;
and replacing the names of the change databases in the initial data change information with preset replacement symbols to obtain the data change information.
Optionally, deleting the data query command in the database operation instruction to obtain initial data change information includes:
determining SQL sentences which contain any keywords in a preset second SQL sentence keyword set in the database operation instruction as deleting SQL sentences;
and deleting all SQL sentences in the database operation instruction to obtain the initial data change information.
Optionally, the transmitting the change information to the collaborative micro service application by using the message middleware, so as to invoke the data synchronization interface to operate on data in a background database of the collaborative micro service application based on the change information received by the collaborative micro service application, so as to realize data collaboration, including:
when the collaborative micro service application receives the data change information;
acquiring a database name of the collaborative micro-service application background database to obtain a collaborative database name;
replacing the replacement symbol received by the collaborative micro service application in the data change information with the collaborative database name to obtain a data synchronization command;
and calling a data synchronization interface of the collaborative services application to execute the data synchronization command on a background database of the collaborative micro services application, so as to complete data synchronization of the micro services application.
In order to solve the above problems, the present invention also provides a micro service application data collaboration apparatus, the apparatus comprising:
the application connection module is used for receiving two micro-service applications needing to be cooperated; a data sensing module is added in the micro-service application to sense the data change of the data interaction with the micro-service application background database in the micro-service application, so as to obtain an initial micro-service application; adding a data synchronization interface in the initial micro-service application to call the data synchronization interface to operate the data in the background database of the initial micro-service application so as to obtain a target micro-service application; connecting the two target micro-service applications by using a preset message middleware;
the instruction analysis module is used for determining the target service as a changed micro-service application and determining the target micro-service applications except the changed micro-service application as a collaborative micro-service application when any of the target micro-service applications has interface call of a non-data synchronous interface; acquiring a database operation instruction of the change micro-service application by utilizing a data perception module in the change micro-service application; screening and analyzing the database operation instruction to obtain data change information;
and the data collaboration module is used for transmitting the change information to the collaborative micro-service application by utilizing the message middleware so as to call the data synchronization interface to operate the data in the background database of the collaborative micro-service application based on the change information received by the collaborative micro-service application, thereby realizing data collaboration.
Optionally, the screening and analyzing the database operation instruction to obtain data change information includes:
the data adding command, the data deleting command and the data changing command in the database operation command are reserved, and initial data change information is obtained;
acquiring the database name of the background database of the change micro service application to obtain the change database name;
and replacing the names of the change databases in the initial data change information with preset replacement symbols to obtain the data change information.
In order to solve the above-mentioned problems, the present invention also provides an electronic apparatus including:
a memory storing at least one computer program; and
And the processor executes the computer program stored in the memory to realize the micro-service application data collaboration method.
In order to solve the above-mentioned problems, the present invention also provides a computer-readable storage medium having stored therein at least one computer program that is executed by a processor in an electronic device to implement the micro service application data coordination method described above.
The embodiment of the invention adds a data perception module in the micro-service application to perceive the data change of the data interaction with the micro-service application background database in the micro-service application, so as to obtain an initial micro-service application; adding a data synchronization interface in the initial micro-service application to call the data synchronization interface to operate the data in the background database of the initial micro-service application, so as to obtain a database operation instruction of the target micro-service application for obtaining the change micro-service application; screening and analyzing the database operation instruction to obtain data change information; the information middleware is utilized to transmit the change information to the collaborative micro-service application, so that the data synchronization interface is called to operate the data in the background database of the collaborative micro-service application based on the change information received by the collaborative micro-service application.
Drawings
FIG. 1 is a flow chart illustrating a collaboration method of micro service application data according to an embodiment of the present invention;
FIG. 2 is a schematic block diagram of a micro-service application data collaboration device according to an embodiment of the present invention;
fig. 3 is a schematic diagram of an internal structure of an electronic device for implementing a collaboration method of micro service application data according to an embodiment of the present invention;
the achievement of the objects, functional features and advantages of the present invention will be further described with reference to the accompanying drawings, in conjunction with the embodiments.
Detailed Description
It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
The embodiment of the invention provides a micro-service application data collaboration method. The execution subject of the micro service application data collaboration method includes, but is not limited to, at least one of a server, a terminal, and the like, which can be configured to execute the method provided by the embodiments of the present application. In other words, the micro service application data coordination method may be performed by software or hardware installed in a terminal device or a server device, and the software may be a blockchain platform. The service end includes but is not limited to: the server can be an independent server, or can be a cloud server for providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (Content Delivery Network, CDNs), basic cloud computing services such as big data and artificial intelligent platforms, and the like.
Referring to fig. 1, a flow chart of a micro service application data collaboration method according to an embodiment of the present invention is shown, where in the embodiment of the present invention, the micro service application data collaboration method includes:
s1, receiving two micro-service applications needing to be cooperated;
in the embodiment of the invention, the two micro-service applications are micro-service application applications needing to perform data collaborative synchronization, and the two micro-service applications are in different environments.
Further, since the micro service applications in different environments cannot communicate directly, in order to achieve data collaboration of two micro service applications, the two micro service applications need to be upgraded to perform collaboration.
S2, adding a data sensing module in the micro-service application to sense the data change of the data interaction with the micro-service application background database in the micro-service application to obtain an initial micro-service application;
in the embodiment of the invention, in order to facilitate other micro-service applications to synchronize the changed data in other micro-service applications and realize the coordination of the data, a data sensing module is added in the micro-service application to sense the data change of the data interaction with the micro-service application background database in the micro-service application.
Specifically, in the embodiment of the present invention, the data sensing module may sense, by acquiring a database operation instruction of the micro service application for operating the micro service application background database, a data change of data interaction with the micro service application background database in the micro service application based on the acquired database operation instruction.
The embodiment of the invention can focus on sensing the data change in the micro-service application by constructing the special data sensing module, can not reconstruct the codes of the micro-service application, can not influence other functions of the micro-service application, and improves the data collaboration efficiency of the micro-service application.
S3, adding a data synchronization interface in the initial micro-service application to call the data synchronization interface to operate the data in the background database of the initial micro-service application so as to obtain a target micro-service application;
the data synchronization interface in the embodiment of the invention is used for executing a database operation command on a background database of the initial micro-service application to which the data synchronization interface belongs, so that the operation on data in the background database of the initial micro-service application is realized, and the target micro-service application is obtained.
By constructing the special data synchronization interface, compared with the interface in the micro-service application, the embodiment of the invention can concentrate on data synchronization without influencing other functions of the micro-service application, thereby improving the data collaboration efficiency of the micro-service application.
S4, connecting the two target micro-service applications by using a preset message middleware;
in the embodiment of the invention, because the two micro-service applications are in different environments and cannot exchange information, in order to facilitate the data synchronization of the two micro-service applications, the two target micro-service applications are connected by using the message middleware, so that the two micro-service applications can exchange information conveniently, and the data coordination is realized.
The message middleware in the embodiment of the invention can be RocketMq, kafka and other message middleware, and the specific type of the message middleware in the embodiment of the invention is not limited.
S5, when any target micro-service application generates interface call of a non-data synchronous interface, determining the target service as a changed micro-service application, and determining target micro-service applications except the changed micro-service application as collaborative micro-service applications;
in the embodiment of the invention, when the interface call of the non-data synchronous interface appears in any target micro-service application, the data of the target micro-service application called by the interface is possibly changed, and the coordination of the data is needed in time.
In the embodiment of the invention, the target service for interface call is determined as a change micro-service application, and the target micro-service applications except the change micro-service application are determined as a cooperative micro-service application.
S6, acquiring a database operation instruction of the change micro-service application by utilizing a data perception module in the change micro-service application;
in the embodiment of the invention, the database operation instruction is an SQL command statement executed by the change micro-service application on a background database.
S7, screening and analyzing the database operation instruction to obtain data change information;
in the embodiment of the present invention, the step of screening and analyzing the database operation instruction to obtain data change information includes:
the data adding command, the data deleting command and the data changing command in the database operation command are reserved, and initial data change information is obtained;
acquiring the database name of the background database of the change micro service application to obtain the change database name;
and replacing the names of the change databases in the initial data change information with preset replacement symbols to obtain the data change information.
The specific type of the substitution symbol is not limited in the embodiment of the invention.
In the embodiment of the invention, the step of reserving the data addition command, the data deletion command and the data change command in the database operation command to obtain the initial data change information can be replaced by deleting the data query command in the database operation command to obtain the initial data change information.
Further, in the embodiment of the present invention, the step of reserving the data addition command, the data deletion command, and the data change command in the database operation command to obtain initial data change information includes:
determining SQL sentences which contain any keywords in a preset first SQL sentence keyword set in the database operation instruction as target SQL sentences;
extracting all target SQL sentences in the data operation instruction, and arranging all the target SQL sentences according to the sequence in the database operation instruction to obtain the initial data change information.
In the embodiment of the invention, the keywords in the preset first SQL sentence keyword set are the set of keywords which can be subjected to data addition, data deletion and data change in the preset SQL keywords.
In an embodiment of the present invention, deleting the data query command in the database operation instruction to obtain the initial data change information includes:
determining SQL sentences which contain any keywords in a preset second SQL sentence keyword set in the database operation instruction as deleting SQL sentences;
and deleting all SQL sentences in the database operation instruction to obtain the initial data change information.
In the embodiment of the invention, the preset second SQL sentence keywords are keyword sets for carrying out data query in the SQL keywords.
And S8, transmitting the change information to the collaborative micro-service application by using the message middleware so as to call the data synchronization interface to operate the data in the background database of the collaborative micro-service application based on the change information received by the collaborative micro-service application, thereby realizing data collaboration.
In detail, in the embodiment of the present invention, the method for transmitting the change information to the collaborative micro service application by using the message middleware, so as to invoke the data synchronization interface to operate on data in a background database of the collaborative micro service application based on the change information received by the collaborative micro service application, thereby implementing data collaboration, including:
when the collaborative micro service application receives the data change information;
acquiring a database name of the collaborative micro-service application background database to obtain a collaborative database name;
replacing the replacement symbol received by the collaborative micro service application in the data change information with the collaborative database name to obtain a data synchronization command;
and calling a data synchronization interface of the collaborative services application based on the synchronization interface name to execute the data synchronization command on a background database of the collaborative micro services application, thereby completing micro services application data synchronization.
FIG. 2 is a functional block diagram of a micro-server application data collaboration device according to the present invention.
The micro service application data coordination apparatus 100 of the present invention may be installed in an electronic device. Depending on the implemented functions, the micro-service application data collaboration device may include an application connection module 101, an instruction parsing module 102, and a data collaboration module 103, which may also be referred to as a unit, refers to a series of computer program segments capable of being executed by a processor of an electronic device and performing a fixed function, which are stored in a memory of the electronic device.
In the present embodiment, the functions concerning the respective modules/units are as follows:
the application connection module 101 is configured to receive two micro service applications that need to be coordinated; a data sensing module is added in the micro-service application to sense the data change of the data interaction with the micro-service application background database in the micro-service application, so as to obtain an initial micro-service application; adding a data synchronization interface in the initial micro-service application to call the data synchronization interface to operate the data in the background database of the initial micro-service application so as to obtain a target micro-service application; connecting the two target micro-service applications by using a preset message middleware;
the instruction parsing module 102 is configured to determine that the target service is a changed micro-service application and determine that target micro-service applications other than the changed micro-service application are collaborative micro-service applications when any of the target micro-service applications has an interface call of a non-data synchronization interface; acquiring a database operation instruction of the change micro-service application by utilizing a data perception module in the change micro-service application; screening and analyzing the database operation instruction to obtain data change information;
the data collaboration module 103 is configured to transmit the change information to the collaborative micro service application by using the message middleware, so as to invoke the data synchronization interface to operate on data in a background database of the collaborative micro service application based on the change information received by the collaborative micro service application, thereby realizing data collaboration.
In detail, each module in the micro service application data collaboration device 100 in the embodiment of the present invention adopts the same technical means as the micro service application data collaboration method described in fig. 1, and can produce the same technical effects, which are not described herein.
Fig. 3 is a schematic structural diagram of an electronic device for implementing the micro service application data collaboration method according to the present invention.
The electronic device may comprise a processor 10, a memory 11, a communication bus 12 and a communication interface 13, and may further comprise a computer program, such as a micro-service application data co-program, stored in the memory 11 and executable on the processor 10.
The memory 11 includes at least one type of readable storage medium, including flash memory, a mobile hard disk, a multimedia card, a card memory (e.g., SD or DX memory, etc.), a magnetic memory, a magnetic disk, an optical disk, etc. The memory 11 may in some embodiments be an internal storage unit of the electronic device, such as a mobile hard disk of the electronic device. The memory 11 may in other embodiments also be an external storage device of the electronic device, such as a plug-in mobile hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card) or the like, which are provided on the electronic device. Further, the memory 11 may also include both an internal storage unit and an external storage device of the electronic device. The memory 11 may be used not only for storing application software installed in an electronic device and various types of data, such as codes of a micro service application data collaborative program, but also for temporarily storing data that has been output or is to be output.
The processor 10 may be comprised of integrated circuits in some embodiments, for example, a single packaged integrated circuit, or may be comprised of multiple integrated circuits packaged with the same or different functions, including one or more central processing units (Central Processing unit, CPU), microprocessors, digital processing chips, graphics processors, combinations of various control chips, and the like. The processor 10 is a Control Unit (Control Unit) of the electronic device, connects various components of the entire electronic device using various interfaces and lines, and executes various functions of the electronic device and processes data by running or executing programs or modules (e.g., micro service application data cooperation programs, etc.) stored in the memory 11, and calling data stored in the memory 11.
The communication bus 12 may be a peripheral component interconnect standard (perIPheral component interconnect, PCI) bus, or an extended industry standard architecture (extended industry standard architecture, EISA) bus, among others. The bus may be classified as an address bus, a data bus, a control bus, etc. The communication bus 12 is arranged to enable a connection communication between the memory 11 and at least one processor 10 etc. For ease of illustration, the figures are shown with only one bold line, but not with only one bus or one type of bus.
Fig. 3 shows only an electronic device with components, and it will be understood by those skilled in the art that the structure shown in fig. 3 is not limiting of the electronic device and may include fewer or more components than shown, or may combine certain components, or a different arrangement of components.
For example, although not shown, the electronic device may further include a power source (such as a battery) for supplying power to the respective components, and preferably, the power source may be logically connected to the at least one processor 10 through a power management device, so that functions of charge management, discharge management, power consumption management, and the like are implemented through the power management device. The power supply may also include one or more of any of a direct current or alternating current power supply, recharging device, power failure classification circuit, power converter or inverter, power status indicator, etc. The electronic device may further include various sensors, bluetooth modules, wi-Fi modules, etc., which are not described herein.
Optionally, the communication interface 13 may comprise a wired interface and/or a wireless interface (e.g., WI-FI interface, bluetooth interface, etc.), typically used to establish a communication connection between the electronic device and other electronic devices.
Optionally, the communication interface 13 may further comprise a user interface, which may be a Display, an input unit, such as a Keyboard (Keyboard), or a standard wired interface, a wireless interface. Alternatively, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch, or the like. The display may also be referred to as a display screen or display unit, as appropriate, for displaying information processed in the electronic device and for displaying a visual user interface.
It should be understood that the embodiments described are for illustrative purposes only and are not limited to this configuration in the scope of the patent application.
The micro-service application data co-program stored in the memory 11 in the electronic device is a combination of a plurality of computer programs, which when run in the processor 10, can implement:
receiving two micro-service applications which need to be coordinated;
a data sensing module is added in the micro-service application to sense the data change of the data interaction with the micro-service application background database in the micro-service application, so as to obtain an initial micro-service application;
adding a data synchronization interface in the initial micro-service application to call the data synchronization interface to operate the data in the background database of the initial micro-service application so as to obtain a target micro-service application;
connecting the two target micro-service applications by using a preset message middleware;
when any target micro-service application generates interface call of a non-data synchronous interface, determining the target service as a changed micro-service application, and determining target micro-service applications except the changed micro-service application as cooperative micro-service applications;
acquiring a database operation instruction of the change micro-service application by utilizing a data perception module in the change micro-service application;
screening and analyzing the database operation instruction to obtain data change information;
and transmitting the change information to the collaborative micro-service application by using the message middleware so as to call the data synchronization interface to operate the data in the background database of the collaborative micro-service application based on the change information received by the collaborative micro-service application, thereby realizing data collaboration.
In particular, the specific implementation method of the processor 10 on the computer program may refer to the description of the relevant steps in the corresponding embodiment of fig. 1, which is not repeated herein.
Further, the electronic device integrated modules/units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. The computer readable medium may be non-volatile or volatile. The computer readable medium may include: any entity or device capable of carrying the computer program code, a recording medium, a U disk, a removable hard disk, a magnetic disk, an optical disk, a computer Memory, a Read-Only Memory (ROM).
Embodiments of the present invention may also provide a computer readable storage medium storing a computer program which, when executed by a processor of an electronic device, may implement:
receiving two micro-service applications which need to be coordinated;
a data sensing module is added in the micro-service application to sense the data change of the data interaction with the micro-service application background database in the micro-service application, so as to obtain an initial micro-service application;
adding a data synchronization interface in the initial micro-service application to call the data synchronization interface to operate the data in the background database of the initial micro-service application so as to obtain a target micro-service application;
connecting the two target micro-service applications by using a preset message middleware;
when any target micro-service application generates interface call of a non-data synchronous interface, determining the target service as a changed micro-service application, and determining target micro-service applications except the changed micro-service application as cooperative micro-service applications;
acquiring a database operation instruction of the change micro-service application by utilizing a data perception module in the change micro-service application;
screening and analyzing the database operation instruction to obtain data change information;
and transmitting the change information to the collaborative micro-service application by using the message middleware so as to call the data synchronization interface to operate the data in the background database of the collaborative micro-service application based on the change information received by the collaborative micro-service application, thereby realizing data collaboration.
Further, the computer-usable storage medium may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function, and the like; the storage data area may store data created from the use of blockchain nodes, and the like.
In the several embodiments provided in the present invention, it should be understood that the disclosed apparatus, device and method may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is merely a logical function division, and there may be other manners of division when actually implemented.
The modules described as separate components may or may not be physically separate, and components shown as modules may or may not be physical units, may be located in one place, or may be distributed over multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
The embodiment of the application can acquire and process the related data based on the artificial intelligence technology. Among these, artificial intelligence (Artificial Intelligence, AI) is the theory, method, technique and application system that uses a digital computer or a digital computer-controlled machine to simulate, extend and extend human intelligence, sense the environment, acquire knowledge and use knowledge to obtain optimal results.
In addition, each functional module in the embodiments of the present invention may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units can be realized in a form of hardware or a form of hardware and a form of software functional modules.
It will be evident to those skilled in the art that the invention is not limited to the details of the foregoing illustrative embodiments, and that the present invention may be embodied in other specific forms without departing from the spirit or essential characteristics thereof.
The present embodiments are, therefore, to be considered in all respects as illustrative and not restrictive, the scope of the invention being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference signs in the claims shall not be construed as limiting the claim concerned.
The blockchain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, consensus mechanism, encryption algorithm and the like. The Blockchain (Blockchain), which is essentially a decentralised database, is a string of data blocks that are generated by cryptographic means in association, each data block containing a batch of information of network transactions for verifying the validity of the information (anti-counterfeiting) and generating the next block. The blockchain may include a blockchain underlying platform, a platform product services layer, an application services layer, and the like.
Furthermore, it is evident that the word "comprising" does not exclude other elements or steps, and that the singular does not exclude a plurality. A plurality of units or means recited in the system claims can also be implemented by means of software or hardware by means of one unit or means. The terms second, etc. are used to denote a name, but not any particular order.
Finally, it should be noted that the above-mentioned embodiments are merely for illustrating the technical solution of the present invention and not for limiting the same, and although the present invention has been described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that modifications and equivalents may be made to the technical solution of the present invention without departing from the spirit and scope of the technical solution of the present invention.

Claims (10)

1. A method of collaboration of micro-service application data, the method comprising:
receiving two micro-service applications which need to be coordinated;
a data sensing module is added in the micro-service application to sense the data change of the data interaction with the micro-service application background database in the micro-service application, so as to obtain an initial micro-service application;
adding a data synchronization interface in the initial micro-service application to call the data synchronization interface to operate the data in the background database of the initial micro-service application so as to obtain a target micro-service application;
connecting the two target micro-service applications by using a preset message middleware;
when any target micro-service application generates interface call of a non-data synchronous interface, determining the target service as a changed micro-service application, and determining target micro-service applications except the changed micro-service application as cooperative micro-service applications;
acquiring a database operation instruction of the change micro-service application by utilizing a data perception module in the change micro-service application;
screening and analyzing the database operation instruction to obtain data change information;
and transmitting the change information to the collaborative micro-service application by using the message middleware so as to call the data synchronization interface to operate the data in the background database of the collaborative micro-service application based on the change information received by the collaborative micro-service application, thereby realizing data collaboration.
2. The method of collaboration of micro service application data according to claim 1, wherein the filtering and analyzing the database operation instruction to obtain data change information includes:
the data adding command, the data deleting command and the data changing command in the database operation command are reserved, and initial data change information is obtained;
acquiring the database name of the background database of the change micro service application to obtain the change database name;
and replacing the names of the change databases in the initial data change information with preset replacement symbols to obtain the data change information.
3. The method of collaboration of micro service application data according to claim 2, wherein the reserving the data add command, the data delete command, the data change command in the database operation instruction to obtain the initial data change information includes:
determining SQL sentences which contain any keywords in a preset first SQL sentence keyword set in the database operation instruction as target SQL sentences;
extracting all target SQL sentences in the data operation instruction;
and arranging all the target SQL sentences according to the sequence in the database operation instruction to obtain the initial data change information.
4. The method for collaboration of micro-service application data as claimed in claim 1, wherein said deleting the data query command in the database operation instruction to obtain the initial data change information comprises:
deleting the data query command in the database operation instruction to obtain initial data change information;
acquiring the database name of the background database of the change micro service application to obtain the change database name;
and replacing the names of the change databases in the initial data change information with preset replacement symbols to obtain the data change information.
5. The method for collaboration of micro-service application data as claimed in claim 4, wherein said deleting the data query command in the database operation instruction to obtain the initial data change information comprises:
determining SQL sentences which contain any keywords in a preset second SQL sentence keyword set in the database operation instruction as deleting SQL sentences;
and deleting all SQL sentences in the database operation instruction to obtain the initial data change information.
6. The method of collaboration of micro service application data according to claim 1, wherein the transmitting the change information to the collaboration micro service application by using the message middleware to invoke the data synchronization interface to operate on data in a background database of the collaboration micro service application based on the change information received by the collaboration micro service application, and realizing data collaboration comprises:
when the collaborative micro service application receives the data change information;
acquiring a database name of the collaborative micro-service application background database to obtain a collaborative database name;
replacing the replacement symbol received by the collaborative micro service application in the data change information with the collaborative database name to obtain a data synchronization command;
and calling a data synchronization interface of the collaborative services application to execute the data synchronization command on a background database of the collaborative micro services application, so as to complete data synchronization of the micro services application.
7. A micro service application data coordination device, comprising:
the application connection module is used for receiving two micro-service applications needing to be cooperated; a data sensing module is added in the micro-service application to sense the data change of the data interaction with the micro-service application background database in the micro-service application, so as to obtain an initial micro-service application; adding a data synchronization interface in the initial micro-service application to call the data synchronization interface to operate the data in the background database of the initial micro-service application so as to obtain a target micro-service application; connecting the two target micro-service applications by using a preset message middleware;
the instruction analysis module is used for determining the target service as a changed micro-service application and determining the target micro-service applications except the changed micro-service application as a collaborative micro-service application when any of the target micro-service applications has interface call of a non-data synchronous interface; acquiring a database operation instruction of the change micro-service application by utilizing a data perception module in the change micro-service application; screening and analyzing the database operation instruction to obtain data change information;
and the data collaboration module is used for transmitting the change information to the collaborative micro-service application by utilizing the message middleware so as to call the data synchronization interface to operate the data in the background database of the collaborative micro-service application based on the change information received by the collaborative micro-service application, thereby realizing data collaboration.
8. The micro service application data collaboration device of claim 7, wherein the filtering and parsing the database operation instruction to obtain data change information comprises:
the data adding command, the data deleting command and the data changing command in the database operation command are reserved, and initial data change information is obtained;
acquiring the database name of the background database of the change micro service application to obtain the change database name;
and replacing the names of the change databases in the initial data change information with preset replacement symbols to obtain the data change information.
9. An electronic device, the electronic device comprising:
at least one processor; the method comprises the steps of,
a memory communicatively coupled to the at least one processor;
wherein the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the micro service application data coordination method of any one of claims 1 to 6.
10. A computer readable storage medium storing a computer program, wherein the computer program when executed by a processor implements the micro service application data coordination method of any one of claims 1 to 6.
CN202311594230.0A 2023-11-24 2023-11-24 Micro-service application data cooperation method and device, electronic equipment and storage medium Pending CN117633075A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311594230.0A CN117633075A (en) 2023-11-24 2023-11-24 Micro-service application data cooperation method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311594230.0A CN117633075A (en) 2023-11-24 2023-11-24 Micro-service application data cooperation method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN117633075A true CN117633075A (en) 2024-03-01

Family

ID=90033191

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311594230.0A Pending CN117633075A (en) 2023-11-24 2023-11-24 Micro-service application data cooperation method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN117633075A (en)

Similar Documents

Publication Publication Date Title
CN111813963B (en) Knowledge graph construction method and device, electronic equipment and storage medium
CN113704665B (en) Dynamic service release method and device, electronic equipment and storage medium
CN115408399A (en) Blood relationship analysis method, device, equipment and storage medium based on SQL script
CN113806434A (en) Big data processing method, device, equipment and medium
CN113890712A (en) Data transmission method and device, electronic equipment and readable storage medium
CN113722533B (en) Information pushing method and device, electronic equipment and readable storage medium
CN115129753A (en) Data blood relationship analysis method and device, electronic equipment and storage medium
CN114519084A (en) Block chain-based medical data inspection method, device, equipment and medium
CN113868528A (en) Information recommendation method and device, electronic equipment and readable storage medium
CN113468175A (en) Data compression method and device, electronic equipment and storage medium
CN114816371B (en) Message processing method, device, equipment and medium
CN114064033A (en) Front-end component development method and device, electronic equipment and readable storage medium
CN114691782A (en) Database table increment synchronization method and device and storage medium
CN114547011A (en) Data extraction method and device, electronic equipment and storage medium
CN114185522A (en) Page theme customizing method and device, electronic equipment and storage medium
CN117633075A (en) Micro-service application data cooperation method and device, electronic equipment and storage medium
CN114721952A (en) Method, device, equipment and storage medium for synchronously deploying multiple sets of test environments
CN112686759A (en) Account checking monitoring method, device, equipment and medium
CN115174698B (en) Market data decoding method, device, equipment and medium based on table entry index
CN113778447B (en) Service compatibility method and device of front-end system, electronic equipment and storage medium
CN114860314B (en) Deployment upgrading method, device, equipment and medium based on database compatibility
CN113886446A (en) Job automatic scheduling method and device, electronic equipment and readable storage medium
CN113868285A (en) Data reading method and device, electronic equipment and storage medium
CN115408293A (en) Test environment building method, device, equipment and medium
CN114416575A (en) Method, device and equipment for generating Mock data and storage medium

Legal Events

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