CN109840120B - Decoupling micro-service release method, electronic device and computer readable storage medium - Google Patents
Decoupling micro-service release method, electronic device and computer readable storage medium Download PDFInfo
- Publication number
- CN109840120B CN109840120B CN201811574914.3A CN201811574914A CN109840120B CN 109840120 B CN109840120 B CN 109840120B CN 201811574914 A CN201811574914 A CN 201811574914A CN 109840120 B CN109840120 B CN 109840120B
- Authority
- CN
- China
- Prior art keywords
- micro
- services
- service
- registry
- dependency relationship
- 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.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 48
- 230000008859 change Effects 0.000 claims abstract description 45
- 230000001419 dependent effect Effects 0.000 claims abstract description 22
- 238000012216 screening Methods 0.000 claims description 8
- 238000012546 transfer Methods 0.000 claims description 3
- 238000005516 engineering process Methods 0.000 abstract description 3
- 238000004891 communication Methods 0.000 description 6
- 230000006870 function Effects 0.000 description 4
- 230000008569 process Effects 0.000 description 4
- 238000012545 processing Methods 0.000 description 4
- 238000004458 analytical method Methods 0.000 description 3
- 238000010586 diagram Methods 0.000 description 3
- 239000004973 liquid crystal related substance Substances 0.000 description 2
- 238000010295 mobile communication Methods 0.000 description 2
- 230000005540 biological transmission Effects 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 238000004590 computer program Methods 0.000 description 1
- 238000002716 delivery method Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000001914 filtration Methods 0.000 description 1
- 230000007246 mechanism Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
Landscapes
- Telephonic Communication Services (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
Abstract
The invention relates to cloud technology, and provides a decoupling micro-service release method, which comprises the following steps: classifying the resources according to a set rule, setting the resources as objects and storing the objects into a micro service; storing the objects as an association table according to the dependency relationship among different objects and the resource directory level; each object is a subclass, and notes of the dependent service names are added into the subclass declarations; storing the published micro-services to a registry; when one micro-service changes, searching other micro-services depending on the micro-service in the sub-class notes; searching the other micro services in a registry; if the micro service is found, judging that other micro services have a dependency relationship with the pre-changed micro service when the micro service is changed; if not, judging that other micro services have no dependency relationship with the pre-changed micro services when the micro services change. The invention also provides an electronic device and a computer readable storage medium. The invention can adapt to more flexible service scenes.
Description
Technical Field
The present invention relates to the field of cloud technologies, and in particular, to a decoupling micro-service publishing method, an electronic device, and a computer readable storage medium.
Background
With the development of cloud technology, people are increasingly filled with micro services, and the micro services construct an application by using a group of small services, and the services interact through a lightweight communication mechanism. When deleting a resource, the cloud portal needs to inquire whether an object depending on the resource exists. The various objects that rely on the resource are distributed among different microservices, and return is invoked through a remote interface. If a service is published, an object with B depends on the resources of the a service, and B services must be published together. Such a situation cannot accommodate certain traffic scenarios where B-service functionality is not required.
Disclosure of Invention
In view of the foregoing, an object of the present invention is to provide a decoupling micro-service publishing method, an electronic device and a computer readable storage medium that are more flexibly adapted to various service scenarios.
In order to achieve the above object, the present invention provides an electronic device including a memory and a processor, wherein the memory includes a decoupled micro-service distribution program, and the decoupled micro-service distribution program when executed by the processor implements the following steps:
classifying the resources according to the set rules, and setting the classified resources as objects and storing the objects in the micro-services;
according to the dependency relationship among different objects, storing the dependency relationship as an association table according to the directory level of the resource:
each object is taken as a subclass, and notes of dependent service names are added into declarations of the subclass, wherein the service names are identifiers of dependent micro-services;
storing the published micro-services to a registry;
when one micro-service changes, searching other micro-services depending on the micro-service in the sub-class annotation, wherein the micro-service changes comprise deleting resources, moving resources and updating resources;
searching the other micro services in a registry;
if the other micro-services are found in the registry, judging that when the micro-services change, the other micro-services have a dependency relationship with the pre-changed micro-services, and the other micro-services also make corresponding changes;
and if the other micro-services cannot be found in the registry, judging that the other micro-services have no dependency relationship with the pre-changed micro-services when the micro-services change, and the other micro-services do not change.
Preferably, in the decoupling micro service program, the pre-published micro service publishes other micro services according to the dependency relationship with other micro services, and the larger the dependency relationship is, the higher the possibility of being published simultaneously is.
In addition, in order to achieve the above object, the present invention further provides a method for releasing a decoupling micro service, including:
classifying the resources according to the set rules, and setting the classified resources as objects and storing the objects in the micro-services;
storing the directory hierarchy of the resource as an association table according to the dependency relationship among different objects;
each object is taken as a subclass, and notes of dependent service names are added into declarations of the subclass, wherein the service names are identifiers of dependent micro-services;
storing the published micro-services to a registry;
when one micro-service changes, searching other micro-services depending on the micro-service in the sub-class annotation, wherein the micro-service changes comprise deleting resources, moving resources and updating resources;
searching the other micro services in a registry;
if the other micro-services are found in the registry, judging that when the micro-services change, the other micro-services have a dependency relationship with the pre-changed micro-services, and the other micro-services also make corresponding changes;
and if the other micro-services cannot be found in the registry, judging that the other micro-services have no dependency relationship with the pre-changed micro-services when the micro-services change, and the other micro-services do not change.
Preferably, the method further comprises: and judging the magnitude of the dependency relationship between different micro services, and simultaneously issuing other micro services with large published dependency relationship when issuing one micro service.
Further, preferably, the dependency relationship is from large to small, namely complete dependency, partial dependency and transfer dependency, and when one micro-service is issued, other micro-services which are already disclosed as complete dependencies are issued at the same time.
In addition, in order to achieve the above object, the present invention further provides a computer readable storage medium, where the computer readable storage medium includes a decoupling micro service distribution program, where the decoupling micro service distribution program, when executed by a processor, implements the steps of the decoupling micro service distribution method described above.
According to the decoupling micro-service issuing method, the electronic device and the computer readable storage medium, whether other micro-services are coupled with one micro-service is determined according to whether the other micro-services are issued or not, so that the decoupling micro-service issuing method, the electronic device and the computer readable storage medium adapt to more flexible service scenes.
Drawings
Other objects and attainments together with a more complete understanding of the invention will become apparent and appreciated by referring to the following description taken in conjunction with the accompanying drawings. In the drawings:
FIG. 1 is a schematic view of an application environment of a preferred embodiment of a decoupling micro-service delivery method of the present invention;
FIG. 2 is a block diagram of a preferred embodiment of the decoupled micro service distribution program of FIG. 1;
FIG. 3 is a flow chart of a method for decoupling micro-services delivery according to a preferred embodiment of the present invention.
The same reference numerals will be used throughout the drawings to refer to similar or corresponding features or functions.
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.
Specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings.
The invention provides a decoupling microservice issuing method which is applied to an electronic device 1. Referring to fig. 1, an application environment diagram of a preferred embodiment of a decoupling micro-service publishing method according to the present invention is shown.
In this embodiment, the electronic apparatus 1 may be a terminal device having an operation function, such as a server, a mobile phone, a tablet computer, a portable computer, or a desktop computer.
The electronic device 1 comprises a memory 11, a processor 12, a network interface 13 and a communication bus 14.
The memory 11 includes at least one type of readable storage medium. The at least one type of readable storage medium may be a non-volatile storage medium such as a flash memory, a hard disk, a multimedia card, a card memory 11, etc. In some embodiments, the readable storage medium may be an internal storage unit of the electronic device 1, such as a hard disk of the electronic device 1. In other embodiments, the readable storage medium may also be an external memory 11 of the electronic device 1, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash Card (Flash Card) or the like, which are provided on the electronic device 1.
In this embodiment, the readable storage medium of the memory 11 is generally used for storing the decoupling micro service distribution program 10 installed in the electronic device 1. The memory 11 may also be used for temporarily storing data that has been output or is to be output.
The processor 12 may in some embodiments be a central processing unit (Central Processing Unit, CPU), microprocessor or other data processing chip for running program code or processing data stored in the memory 11, e.g. executing the decoupled micro service issuing program 10, etc.
The network interface 13 may comprise a wireless network interface or a wired network interface, which network interface 13 is typically used for establishing a communication connection between the electronic device 1 and other electronic devices. For example, the network interface 13 is used to connect the electronic apparatus 1 with an external terminal through a network, establish a data transmission channel and a communication connection between the electronic apparatus 1 and the external terminal, and the like. The network may be a wireless or wired network such as an Intranet (Intranet), the Internet (Intemet), the Global System for Mobile communications (Global System of Mobile communication, GSM), wideband code division multiple Access (Wideband CodeDivision Multiple Access, WCDMA), a 4G network, a 5G network, bluetooth (Bluetooth), wi-Fi, etc.
The communication bus 14 is used to enable connected communication between these components.
Fig. 1 shows only an electronic device 1 with components 11-14, but it is understood that not all shown components are required to be implemented, and that more or fewer components may be implemented instead.
Optionally, the electronic apparatus 1 may further comprise a user interface, which may comprise an input unit such as a Keyboard (Keyboard), a voice input device such as a microphone or the like with voice recognition function, a voice output device such as a sound box, a headset or the like, and optionally a standard wired interface, a wireless interface.
Optionally, the electronic device 1 may also comprise a display, which may also be referred to as a display screen or display unit.
In some embodiments, the display may be an LED display, a liquid crystal display, a touch-control liquid crystal display, an Organic Light-Emitting Diode (OLED) touch device, or the like. The display is used for displaying information processed in the electronic device 1 and for displaying a visualized user interface.
Optionally, the electronic device 1 further comprises a touch sensor. The area provided by the touch sensor for the user to perform a touch operation is referred to as a touch area. Further, the touch sensors described herein may be resistive touch sensors, capacitive touch sensors, and the like. The touch sensor may include not only a contact type touch sensor but also a proximity type touch sensor. Furthermore, the touch sensor may be a single sensor or may be a plurality of sensors arranged in an array, for example.
In the embodiment of the apparatus shown in fig. 1, an operating system and a decoupling micro service distribution program 10 may be included in a memory 11 as a computer storage medium, and the processor 12 implements the following steps when executing the decoupling micro service distribution program 10 stored in the memory 11:
classifying the resources according to a set rule (for example, a business model), and setting the classified resources as objects and storing the objects into a micro service;
storing the dependency relationship (such as the mutual reference relationship between the objects) between different objects as an association table according to the directory hierarchy of the resource;
each object is taken as a subclass, and notes of dependent service names are added into declarations of the subclass, wherein the service names are identifiers of dependent micro-services;
storing the published micro-services to a registry;
when one micro-service changes, searching other micro-services depending on the micro-service in the sub-class annotation, wherein the micro-service changes comprise deleting resources, moving resources and updating resources;
searching the other micro services in a registry;
if the other micro-services are found in the registry, judging that when the micro-services change, the other micro-services have a dependency relationship with the pre-changed micro-services, and the other micro-services also make corresponding changes;
and if the other micro-services cannot be found in the registry, judging that the other micro-services have no dependency relationship with the pre-changed micro-services when the micro-services change, and the other micro-services do not change.
The electronic device can realize the decoupling of the micro-service through simple configuration, after the decoupling, the expense brought by unnecessary service release is saved, more importantly, when the resource dependence is calculated, the calculation is carried out according to the released service, the unpublished service does not calculate the dependence, and the electronic device is suitable for more flexible service scenes.
Preferably, in the decoupling micro service program, the pre-published micro service publishes other micro services according to the dependency relationship with other micro services, and the larger the dependency relationship is, the higher the possibility of being published simultaneously is.
In other embodiments, the decoupled micro service publisher 10 may be further partitioned into one or more modules, one or more modules stored in the memory 11 and executed by the processor 12 to complete the present invention. The invention may refer to a series of computer program instruction segments capable of performing a specified function. Referring to FIG. 2, a functional block diagram of a preferred embodiment of the decoupled micro service distribution program 10 of FIG. 1 is shown. The decoupled micro service publisher 10 may be partitioned into:
the first storage module 110 classifies resources according to a set rule, and sets the classified resources as objects and stores the objects in the micro service;
the association table generating module 120 stores the association table as an association table according to the dependency relationship between different objects in the first storage module 110 and the directory hierarchy of the resource;
an annotation module 130, each object being a sub-class, adding an annotation of a dependent service name in the declaration of the sub-class, the service name being an identifier of the dependent micro-service;
a second storage module 140 storing the already published micro-services to a registry;
the first filtering module 150 searches for other micro services depending on the micro services in the sub-class annotation of the annotating module 130 when one micro service changes, wherein the micro service changes include deleting resources, moving resources and updating resources;
the second screening module 160 searches the registry of the second storage module 140 for the other micro services;
a determining module 170 configured to determine whether the other micro-service is found in the registry, and if so, send a signal to the change module 180, the signal including an identifier of the other micro-service;
the change module 180 receives the signal from the determination module 170 and changes the corresponding other micro services and the pre-changed micro services in the signal at the same time.
In addition, the invention also provides a decoupling micro-service release method. Referring to fig. 3, a flowchart of a method for decoupling micro-service delivery according to a preferred embodiment of the present invention is shown. The method may be performed by an apparatus, which may be implemented in software and/or hardware.
In this embodiment, the decoupling micro service publishing method includes:
step S1, classifying resources according to set rules, setting the classified resources as objects and storing the objects in a micro service;
step S2, storing the dependency relationship among different objects as an association table according to the directory level of the resource;
step S3, each object is used as a sub-class, and notes of the dependent service names are added into the declarations of the sub-classes, wherein the service names are identifiers of dependent micro-services;
step S4, storing the published micro-services to a registry;
when one micro-service changes, in step S5, searching other micro-services in the sub-class annotation depending on the micro-service, wherein the micro-service changes comprise deleting resources, moving resources and updating resources;
step S6, searching the other micro services in the registry, namely judging whether the other micro services are released or not;
if the other micro-service is found in the registry, in step S7, it is determined that when the micro-service is changed, the other micro-service has a dependency relationship with the pre-changed micro-service, and the other micro-service also makes a corresponding change;
if the other micro-service is not found in the registry, in step S8, it is determined that when the micro-service is changed, the other micro-service has no dependency relationship with the pre-changed micro-service, and the other micro-service is not changed.
For example, when publishing a service, find the micro-service that depends on a service in the sub-class annotation, for example, find B service from the registry in the sub-class annotation that depends on a service, if B service can be found, publish B service when publishing a service, if B service is not found, and when publishing a service, not publish B service.
Preferably, in step S7, the magnitude of the dependency relationship between different micro services is determined, when one micro service is released, other micro services with large published dependency relationship are released at the same time, other micro services with the largest dependency relationship can be released, and other micro services with set number of dependency relationships ordered from large to small can be released, for example, the dependency relationship is from large to small and is complete, partial and transfer dependency, and when one micro service is released, other micro services with complete dependency relationship already disclosed are released at the same time.
In an alternative embodiment, the method for determining the magnitude of the dependency relationship between different micro services includes:
the registry also stores other micro services which change correspondingly when each micro service changes;
when one micro-service changes, searching other micro-services depending on the micro-service in the sub-class annotation, obtaining the support degree of the simultaneous change of the one micro-service and each other micro-service according to the following formula (1), wherein the larger the support degree is, the larger the dependency relationship is,
wherein F is i For a micro-service of pre-change, F j Annotating dependencies F in subclasses i Is a micro-service of (F) j ,F i ) Is F i And F j Support level of simultaneous variation, |F j I is F in the registry i And F j The number of simultaneous changes occurring Σ|f j I is dependency F in the registry notes i Other microservices and F of (2) i The sum of the number of simultaneous fluctuations.
In a second alternative embodiment, the method for determining the magnitude of the dependency relationship between different micro services includes:
screening other micro services with dependency relationship in the micro services when one micro service is pre-changed;
the other micro-services are given different weights from big to small in terms of full dependency, partial dependency and delivery dependency assignments;
the registry also stores other micro services which change correspondingly when each micro service changes;
the support degree of the simultaneous variation of the one micro service and each other micro service is obtained according to the following formula (2), the larger the support degree is, the larger the dependency relationship is,
wherein F is i For a micro-service of pre-change, F j Annotating dependencies F in subclasses i Is a micro-service of (F) j ,F i ) Is F i And F j Support level of simultaneous variation, |F j I is F in the registry i And F j Number of simultaneous changes in occurrence, w j Is F j Dependent on F i Is Σw j |F j I is dependency F in the registry notes i Other microservices and F of (2) i And the sum of the products of the number of simultaneous fluctuations and the weights of the other microservices.
In a third alternative embodiment, the method for determining the magnitude of the dependency relationship between different micro services includes: judging the magnitude of the dependency relationship between different micro services according to different requirements of clients, and issuing different micro service combinations, wherein the method specifically comprises the following steps:
the registry stores a client demand keyword and a corresponding published micro service thereof, wherein the keyword is used as a first keyword;
extracting keywords of customer requirements of a prespecified one microservice, wherein the keywords are used as second keywords;
matching the keyword of the customer requirement of the pre-changed micro-service with the keyword stored in the registry in a similarity manner, for example, calculating word similarity based on a dictionary (hownet, wordnet and synonym Lin Cidian) or a classification system, and calculating word similarity based on a vector space model (word 2 vec);
screening out second keywords of the micro-services which meet the similarity threshold requirement and have the pre-variation in the corresponding published micro-services to form a keyword group;
determining the support degree of the prespecified micro service and other micro services according to the following formula (3), thereby determining the magnitude of the dependence relationship between the micro service and each other micro service, wherein the larger the support degree is, the larger the dependence relationship is,
wherein F is i ' is a micro-service of pre-change, F j ' rely on F in the subclass annotation i Is a micro-service of (F) j ′,F i ') is F i ' and F j ' support of simultaneous variation, |F j ' I is F corresponding to the key word group of the registry i ' and F j ' number of simultaneous changes to Sigma|F j ' I is the dependence F in the annotation corresponding to the key group of the registry i ' other microservices and F i The sum of the number of simultaneous fluctuations.
In a fourth alternative embodiment, the method for determining the magnitude of the dependency relationship between different micro services includes:
the registry stores a client demand keyword and a corresponding published micro service thereof, wherein the keyword is used as a first keyword;
extracting keywords of customer requirements of a prespecified one microservice, wherein the keywords are used as second keywords;
matching the keyword of the customer requirement of the pre-changed one micro service with the keyword stored in the registry in a similarity manner;
screening out second keywords of the corresponding published micro-services with the pre-changed micro-services to form a keyword group;
other micro-services which correspond to the keyword group and are different from the pre-changed micro-service are endowed with different weights according to the difference of the similarity, and the higher the similarity is, the larger the weight is;
determining the support degree of the prespecified micro service and other micro services according to the following formula (4), thereby determining the magnitude of the dependence relationship between the micro service and each other micro service, wherein the larger the support degree is, the larger the dependence relationship is,
wherein F is i ' is a micro-service of pre-change, F j ' rely on F in the subclass annotation i Is a micro-service of (F) j ′,F i ') is F i ' and F j ' support of simultaneous variation, |F j 'I' is the noteF corresponding to the key word group in the album center i ' and F j ' number of simultaneous variation occurrences w j ' F given according to similarity j ' dependent F i ' weight, Σw j ′|F j ' I is the dependence F in the annotation corresponding to the key group of the registry i Other microservices and F of (2) i And the sum of the products of the number of simultaneous fluctuations and the weights of the other microservices.
The above-described embodiments for determining the magnitude of the dependency relationship between different micro services are given, but the present invention is not limited thereto, and may be any combination of the above-described embodiments.
In addition, the embodiment of the invention also provides a computer readable storage medium, which comprises a decoupling micro-service release program, wherein the decoupling micro-service release program realizes the following steps when being executed by a processor:
classifying the resources according to the set rules, and setting the classified resources as objects and storing the objects in the micro-services;
storing the directory hierarchy of the resource as an association table according to the dependency relationship among different objects;
each object is taken as a subclass, and notes of dependent service names are added into declarations of the subclass, wherein the service names are identifiers of dependent micro-services;
storing the published micro-services to a registry;
when one micro-service changes, searching other micro-services depending on the micro-service in the sub-class annotation, wherein the micro-service changes comprise deleting resources, moving resources and updating resources;
searching the other micro services in a registry;
if the other micro-services are found in the registry, judging that when the micro-services change, the other micro-services have a dependency relationship with the pre-changed micro-services, and the other micro-services also make corresponding changes;
and if the other micro-services cannot be found in the registry, judging that the other micro-services have no dependency relationship with the pre-changed micro-services when the micro-services change, and the other micro-services do not change.
The embodiment of the computer readable storage medium of the present invention is substantially the same as the embodiment of the decoupling micro service issuing method and the embodiment of the electronic device, and will not be described herein.
In the above embodiments, the embodiments of making the micro-service decoupling dynamic by adding the comments of the dependent service names to the declaration of the subclasses are given, but the present invention is not limited thereto, and embodiments of making the micro-service decoupling dynamic by adding other configuration items are also within the scope of the present invention.
In the above embodiments, a decoupling method of one pre-change micro service and other micro services is provided, but the present invention is not limited to this, and when there are a plurality of pre-change micro services, the decoupling analysis may be performed on the plurality of pre-change micro services at the same time, or the decoupling analysis may be performed on the plurality of pre-change micro services sequentially, or it may be determined whether there is a dependency relationship between the plurality of pre-change micro services, and the decoupling analysis of the above embodiments may be performed by combining the pre-change micro services having the dependency relationship with the pre-change micro services.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, apparatus, article, or method that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, apparatus, article, or method. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, apparatus, article or method that comprises the element.
The foregoing embodiment numbers of the present invention are merely for the purpose of description, and do not represent the advantages or disadvantages of the embodiments. From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (e.g. ROM/RAM, magnetic disk, optical disk) as described above, comprising instructions for causing a terminal device (which may be a mobile phone, a computer, a server, or a network device, etc.) to perform the method according to the embodiments of the present invention.
The foregoing description is only of the preferred embodiments of the present invention, and is not intended to limit the scope of the invention, but rather is intended to cover any equivalents of the structures or equivalent processes disclosed herein or in the alternative, which may be employed directly or indirectly in other related arts.
Claims (7)
1. A method for decoupling microservice publication, comprising:
classifying the resources according to the set rules, and setting the classified resources as objects and storing the objects in the micro-services;
storing the directory hierarchy of the resource as an association table according to the dependency relationship among different objects;
each object is taken as a subclass, and notes of dependent service names are added into declarations of the subclass, wherein the service names are identifiers of dependent micro-services;
storing the published micro-services to a registry;
when one micro-service changes, searching other micro-services depending on the micro-service in the sub-class annotation, wherein the micro-service changes comprise deleting resources, moving resources and updating resources;
searching the other micro services in a registry;
if the other micro-services are found in the registry, judging that when the micro-services change, the other micro-services have a dependency relationship with the pre-changed micro-services, and the other micro-services also make corresponding changes;
if the other micro-services cannot be found in the registry, judging that the other micro-services have no dependency relationship with the pre-changed micro-services when the micro-services change, and the other micro-services do not change;
the method comprises the steps of,
judging the magnitude of the dependency relationship between different micro services, and simultaneously issuing other micro services with large published dependency relationship when issuing one micro service; the method for judging the magnitude of the dependency relationship between different microservices comprises the following steps: judging the magnitude of the dependency relationship between different micro services according to different requirements of clients, and issuing different micro service combinations, wherein the method comprises the following steps:
the registry stores a client demand keyword and a corresponding published micro service thereof, wherein the keyword is used as a first keyword;
extracting keywords of customer requirements of a prespecified one microservice, wherein the keywords are used as second keywords;
matching the keyword of the customer requirement of the pre-changed one micro service with the keyword stored in the registry in a similarity manner;
screening out second keywords of the micro-services which meet the requirement of the similarity threshold and have the pre-variation in the corresponding published micro-services to form a keyword group;
determining the support degree of the prespecified micro service and other micro services according to the following formula (3), thereby determining the magnitude of the dependence relationship between the micro service and each other micro service, wherein the larger the support degree is, the larger the dependence relationship is,
wherein F is i ' is a micro-service of pre-change, F j ' rely on F in the subclass annotation i Is a micro-service of (F) j ′,F i ') is F i ' and F j ' support of simultaneous variation, |F j ' I is F corresponding to the key word group of the registry i ' and F j ' simultaneous change outThe number of times of the occurrence, Σ|f j 'I' is the dependency F in the sub-class annotation corresponding to the key group of the registry i ' other microservices and F i The sum of the number of simultaneous fluctuations.
2. The method for releasing the decoupling micro-services according to claim 1, wherein the dependency relationship is from large to small as complete dependency, partial dependency and transfer dependency, and when one micro-service is released, other micro-services which have already been released as complete dependencies are released at the same time.
3. The method for distributing decoupling micro-services according to claim 1, wherein the method for determining the magnitude of the dependency relationship between different micro-services comprises:
the registry also stores other micro services which change correspondingly when each micro service changes;
when one micro-service changes, searching other micro-services depending on the micro-service in the sub-class annotation, obtaining the support degree of the simultaneous change of the one micro-service and each other micro-service according to the following formula (1), wherein the larger the support degree is, the larger the dependency relationship is,
wherein F is i For a micro-service of pre-change, F j Annotating dependencies F in subclasses i Is a micro-service of (F) j ,F i ) Is F i And F j Support level of simultaneous variation, |F j I is F in the registry i And F j The number of simultaneous changes occurring Σ|f j I is dependency F in subclass annotation in registry i Other microservices and F of (2) i The sum of the number of simultaneous fluctuations.
4. The method for distributing decoupling micro-services according to claim 1, wherein the method for determining the magnitude of the dependency relationship between different micro-services comprises:
screening other micro services with dependency relationship in the micro services when one micro service is pre-changed;
the other micro-services are given different weights from big to small in terms of full dependency, partial dependency and delivery dependency assignments;
the registry also stores other micro services which change correspondingly when each micro service changes;
the support degree of the simultaneous variation of the one micro service and each other micro service is obtained according to the following formula (2), the larger the support degree is, the larger the dependency relationship is,
wherein F is i For a micro-service of pre-change, F j Annotating dependencies F in subclasses i Is a micro-service of (F) j ,F i ) Is F i And F j Support level of simultaneous variation, |F j I is F in the registry i And F j Number of simultaneous changes in occurrence, w j Is F j Dependent on F i Is Σw j |F j I is dependency F in subclass annotation in registry i Other microservices and F of (2) i And the sum of the products of the number of simultaneous fluctuations and the weights of the other microservices.
5. The method for distributing decoupling micro-services according to claim 1, wherein the method for determining the magnitude of the dependency relationship between different micro-services comprises:
the registry stores a client demand keyword and a corresponding published micro service thereof, wherein the keyword is used as a first keyword;
extracting keywords of customer requirements of a prespecified one microservice, wherein the keywords are used as second keywords;
matching the keyword of the customer requirement of the pre-changed one micro service with the keyword stored in the registry in a similarity manner;
screening out second keywords of the corresponding micro-services with the pre-changed micro-services in the published micro-services to form a keyword group;
other micro-services which correspond to the keyword group and are different from the pre-changed micro-service are endowed with different weights according to the difference of the similarity, and the higher the similarity is, the larger the weight is;
determining the support degree of the prespecified micro service and other micro services according to the following formula (4), thereby determining the magnitude of the dependence relationship between the micro service and each other micro service, wherein the larger the support degree is, the larger the dependence relationship is,
wherein F is i ' is a micro-service of pre-change, F j ' rely on F in the subclass annotation i Is a micro-service of (F) j ′,F i ') is F i ' and F j ' support of simultaneous variation, |F j ' I is F corresponding to the key word group of the registry i ' and F j 'number of simultaneous changes, w' j For giving F according to similarity j ' dependent F i Weight of Σw' j |F j 'I' is the dependency F in the sub-class annotation corresponding to the key group of the registry i Other microservices and F of (2) i And the sum of the products of the number of simultaneous fluctuations and the weights of the other microservices.
6. An electronic device, comprising a memory and a processor, wherein the memory includes a decoupled micro-service distribution program, and the decoupled micro-service distribution program when executed by the processor implements the steps of:
classifying the resources according to the set rules, and setting the classified resources as objects and storing the objects in the micro-services;
according to the dependency relationship among different objects, storing the dependency relationship as an association table according to the directory level of the resource:
each object is taken as a subclass, and notes of dependent service names are added into declarations of the subclass, wherein the service names are identifiers of dependent micro-services;
storing the published micro-services to a registry;
when one micro-service changes, searching other micro-services depending on the micro-service in the sub-class annotation, wherein the micro-service changes comprise deleting resources, moving resources and updating resources;
searching the other micro services in a registry;
if the other micro-services are found in the registry, judging that when the micro-services change, the other micro-services have a dependency relationship with the pre-changed micro-services, and the other micro-services also make corresponding changes;
if the other micro-services cannot be found in the registry, judging that the other micro-services have no dependency relationship with the pre-changed micro-services when the micro-services change, and the other micro-services do not change;
the method comprises the steps of,
judging the magnitude of the dependency relationship between different micro services, and simultaneously issuing other micro services with large published dependency relationship when issuing one micro service; the method for judging the magnitude of the dependency relationship between different microservices comprises the following steps: judging the magnitude of the dependency relationship between different micro services according to different requirements of clients, and issuing different micro service combinations, wherein the method comprises the following steps:
the registry stores a client demand keyword and a corresponding published micro service thereof, wherein the keyword is used as a first keyword;
extracting keywords of customer requirements of a prespecified one microservice, wherein the keywords are used as second keywords;
matching the keyword of the customer requirement of the pre-changed one micro service with the keyword stored in the registry in a similarity manner;
screening out second keywords of the micro-services which meet the requirement of the similarity threshold and have the pre-variation in the corresponding published micro-services to form a keyword group;
determining the support degree of the prespecified micro service and other micro services according to the following formula (3), thereby determining the magnitude of the dependence relationship between the micro service and each other micro service, wherein the larger the support degree is, the larger the dependence relationship is,
wherein F is i ' is a micro-service of pre-change, F j ' rely on F in the subclass annotation i Is a micro-service of (F) j ′,F i ') is F i ' and F j ' support of simultaneous variation, |F j ' I is F corresponding to the key word group of the registry i ' and F j ' number of simultaneous changes to Sigma|F j 'I' is the dependency F in the sub-class annotation corresponding to the key group of the registry i ' other microservices and F i The sum of the number of simultaneous fluctuations.
7. A computer readable storage medium, wherein a decoupling micro service distribution program is included in the computer readable storage medium, and the decoupling micro service distribution program, when executed by a processor, implements the steps of the decoupling micro service distribution method according to any one of claims 1 to 5.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811574914.3A CN109840120B (en) | 2018-12-21 | 2018-12-21 | Decoupling micro-service release method, electronic device and computer readable storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811574914.3A CN109840120B (en) | 2018-12-21 | 2018-12-21 | Decoupling micro-service release method, electronic device and computer readable storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109840120A CN109840120A (en) | 2019-06-04 |
CN109840120B true CN109840120B (en) | 2024-04-16 |
Family
ID=66883231
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811574914.3A Active CN109840120B (en) | 2018-12-21 | 2018-12-21 | Decoupling micro-service release method, electronic device and computer readable storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109840120B (en) |
Families Citing this family (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113778475B (en) * | 2020-06-18 | 2024-07-16 | 北京京东振世信息技术有限公司 | Information processing method and device |
CN112540749B (en) * | 2020-11-16 | 2023-10-24 | 南方电网数字平台科技(广东)有限公司 | Micro-service dividing method, apparatus, computer device and readable storage medium |
CN112416459B (en) * | 2020-11-23 | 2024-03-01 | 杭州当虹科技股份有限公司 | System for solving version strong dependence among micro services |
CN115733750A (en) * | 2022-11-25 | 2023-03-03 | 中国工商银行股份有限公司 | Method, device, equipment and storage medium for updating metadata in micro-service gateway |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106610836A (en) * | 2016-12-23 | 2017-05-03 | 国网信息通信产业集团有限公司 | Micro-service operation management tool |
CN107872525A (en) * | 2017-11-09 | 2018-04-03 | 杭州东方通信软件技术有限公司 | A kind of micro services call framework |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US10242073B2 (en) * | 2016-07-27 | 2019-03-26 | Sap Se | Analytics mediation for microservice architectures |
-
2018
- 2018-12-21 CN CN201811574914.3A patent/CN109840120B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106610836A (en) * | 2016-12-23 | 2017-05-03 | 国网信息通信产业集团有限公司 | Micro-service operation management tool |
CN107872525A (en) * | 2017-11-09 | 2018-04-03 | 杭州东方通信软件技术有限公司 | A kind of micro services call framework |
Non-Patent Citations (1)
Title |
---|
基于微服务架构的基础设施设计;蒋勇;;软件;20160515;第37卷(第5期);第93-97页 * |
Also Published As
Publication number | Publication date |
---|---|
CN109840120A (en) | 2019-06-04 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109840120B (en) | Decoupling micro-service release method, electronic device and computer readable storage medium | |
US20240078386A1 (en) | Methods and systems for language-agnostic machine learning in natural language processing using feature extraction | |
US10360307B2 (en) | Automated ontology building | |
CN104573054B (en) | A kind of information-pushing method and equipment | |
CN107967135B (en) | Calculation engine implementation method, electronic device and storage medium | |
US8688702B1 (en) | Techniques for using dynamic data sources with static search mechanisms | |
US20090089279A1 (en) | Method and Apparatus for Detecting Spam User Created Content | |
US20110136542A1 (en) | Method and apparatus for suggesting information resources based on context and preferences | |
WO2021164231A1 (en) | Official document abstract extraction method and apparatus, and device and computer readable storage medium | |
US20140279803A1 (en) | Disambiguating data using contextual and historical information | |
CN110059172B (en) | Method and device for recommending answers based on natural language understanding | |
AU2017216520A1 (en) | Common data repository for improving transactional efficiencies of user interactions with a computing device | |
WO2020003109A1 (en) | Facet-based query refinement based on multiple query interpretations | |
US20180137098A1 (en) | Methods and systems for providing universal portability in machine learning | |
CN113626223A (en) | Interface calling method and device | |
US20140095527A1 (en) | Expanding high level queries | |
CN110895587B (en) | Method and device for determining target user | |
KR102277240B1 (en) | Method and system for extracting synonym by using keyword relation structure | |
CN110598123A (en) | Information retrieval recommendation method and device based on portrait similarity and storage medium | |
CN113434582A (en) | Service data processing method and device, computer equipment and storage medium | |
CN112749258A (en) | Data searching method and device, electronic equipment and storage medium | |
US9965558B2 (en) | Cross-channel social search | |
CN116681801A (en) | Poster generation method, poster generation device, server and storage medium | |
KR20200097949A (en) | Method and system for extracting synonym by using keyword relation structure | |
CN109471969A (en) | Application search method, device and equipment |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |