CN118245056A - Method, device, equipment and storage medium for generating micro-service architecture - Google Patents
Method, device, equipment and storage medium for generating micro-service architecture Download PDFInfo
- Publication number
- CN118245056A CN118245056A CN202410187405.4A CN202410187405A CN118245056A CN 118245056 A CN118245056 A CN 118245056A CN 202410187405 A CN202410187405 A CN 202410187405A CN 118245056 A CN118245056 A CN 118245056A
- Authority
- CN
- China
- Prior art keywords
- service
- micro
- executable
- component
- components
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 34
- 238000011161 development Methods 0.000 claims abstract description 72
- 238000004806 packaging method and process Methods 0.000 claims abstract description 11
- 238000012360 testing method Methods 0.000 claims description 64
- 238000004590 computer program Methods 0.000 claims description 14
- 238000004458 analytical method Methods 0.000 claims description 11
- 230000009191 jumping Effects 0.000 claims description 4
- 230000008878 coupling Effects 0.000 abstract description 6
- 238000010168 coupling process Methods 0.000 abstract description 6
- 238000005859 coupling reaction Methods 0.000 abstract description 6
- 230000006870 function Effects 0.000 description 26
- 238000007726 management method Methods 0.000 description 8
- 238000004891 communication Methods 0.000 description 6
- 238000012986 modification Methods 0.000 description 6
- 230000004048 modification Effects 0.000 description 6
- 238000012856 packing Methods 0.000 description 5
- 230000008569 process Effects 0.000 description 5
- 230000008901 benefit Effects 0.000 description 4
- 238000005516 engineering process Methods 0.000 description 4
- 230000008713 feedback mechanism Effects 0.000 description 4
- 238000012545 processing Methods 0.000 description 4
- 238000010586 diagram Methods 0.000 description 3
- 230000004044 response Effects 0.000 description 3
- 230000002159 abnormal effect Effects 0.000 description 2
- 230000005540 biological transmission Effects 0.000 description 2
- 230000000694 effects Effects 0.000 description 2
- 238000011156 evaluation Methods 0.000 description 2
- 230000003993 interaction Effects 0.000 description 2
- 238000012423 maintenance Methods 0.000 description 2
- 230000007246 mechanism Effects 0.000 description 2
- 238000005457 optimization Methods 0.000 description 2
- 230000008439 repair process Effects 0.000 description 2
- 238000013468 resource allocation Methods 0.000 description 2
- 238000012216 screening Methods 0.000 description 2
- 230000003068 static effect Effects 0.000 description 2
- 230000001960 triggered effect Effects 0.000 description 2
- 239000002699 waste material Substances 0.000 description 2
- 230000010485 coping Effects 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/40—Transformation of program code
- G06F8/41—Compilation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/30—Creation or generation of source code
- G06F8/36—Software reuse
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/448—Execution paradigms, e.g. implementations of programming paradigms
- G06F9/4488—Object-oriented
- G06F9/449—Object-oriented method invocation or resolution
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Stored Programmes (AREA)
Abstract
The invention is applicable to the technical field of micro service architecture, and provides a method for generating a micro service architecture, which comprises the following steps: the method comprises the steps of carrying out service splitting on the obtained integral service to obtain a plurality of independent micro-service components, obtaining development codes corresponding to each micro-service component, compiling the development codes to obtain executable service components corresponding to each micro-service component, receiving executable service components selected and combined by a user from all the executable service components, packaging the received executable service components to obtain target service components, deploying the target service components to generate a corresponding micro-service architecture, and packaging through service splitting and free combination, so that the quality, efficiency and reusability of service are improved, the development efficiency is improved, the micro-service architecture with high cohesion and low coupling is realized, and the maintainability, the expandability, the stability and the reliability of the system are improved.
Description
Technical Field
The present invention belongs to the technical field of micro-service architecture, and in particular, relates to a method, an apparatus, a device, and a storage medium for generating a micro-service architecture.
Background
With the rapid development of internet and cloud computing technologies, the conventional single application architecture cannot meet the requirements of modern services, while the micro-service architecture is used as an architecture mode, and it is advocated to divide a single application program into a group of small services, and the services coordinate and mutually cooperate, so as to provide final value for users, and in order to improve the maintainability, expandability and performance of the system of the micro-service architecture, the service splitting and free packing technologies have been developed.
Service splitting is the splitting of a large service into multiple small, independent services, each of which is responsible for a particular function or business logic, which makes the code more modular, clear and easy to maintain. The service splitting has the following advantages:
1. Improving maintainability: each service can be independently developed, tested and deployed, so that the coupling degree of codes is reduced, and the maintainability of the codes is improved. When a certain service needs to be modified, only the function of the service needs to be concerned, and other services are not affected, so that the development efficiency is improved.
2. And 4, the expandability is enhanced: when the business requirement changes, one service can be extended independently without modifying other services. This makes the expansion of the system more flexible, enabling rapid coping with market changes.
3. Performance is improved: by splitting the service, resources can be more effectively utilized, improving the performance of the system. Each service can be independently deployed on different servers to realize load balancing, so that the throughput and response speed of the system are further improved.
However, service splitting also has some drawbacks:
1. Waste of resources: each service needs to be deployed by a separate machine, which may cause resource waste and increase operation and maintenance burden;
2. Distributed transaction problem: after service splitting, problems such as distributed transaction, cross-library paging and the like can be generated, and complex solutions are needed to process;
3. Service management is complex: when the services are more, the dependency relationship between the services is complex, and the management and coordination become difficult;
4. Difficulty in checking the problems: the problem can not be conveniently checked after the disassembly, and the debug difficulty is increased;
5. service attribution problem of special service: service attribution of some special services is difficult to determine, and responsibility among services may be ambiguous;
6. The technical difficulty is increased: service splitting requires higher technical capabilities, such as micro-service architecture, containerization, etc., requiring further learning and application.
To solve the above-mentioned problem of service splitting, free packing technology has been developed. Free packaging refers to packaging different services into different packages or components for ease of deployment and use according to actual needs. The advantage of free packing is as follows:
1. Flexibility: different service packages or components can be freely combined according to actual demands to meet specific business demands, so that market changes and user demands can be more flexibly dealt with;
2. easy deployment: different service packages or components can be independently deployed to different servers or environments, so that the flexibility and the efficiency of deployment are improved, and the deployment and the maintenance of the system are more convenient and quick;
3. Easy to expand: when a service needs to be extended, the package or component of that service can be extended alone without modification to other services, which makes the extension of the system more flexible and efficient.
In summary, although the service splitting and free packing technology is an important means for improving maintainability, expandability and performance of the system, how to design a service splitting and free packing technical scheme so that the micro-service architecture achieves the above purpose is still further questionable.
Disclosure of Invention
The invention aims to provide a method, a device, equipment and a storage medium for generating a micro-service architecture, which aim to solve the problems of poor maintainability, expandability and stability of the generated micro-service architecture caused by the prior art.
In one aspect, the present invention provides a method for generating a micro-service architecture, the method comprising the steps of:
carrying out service splitting on the obtained integral service to obtain a plurality of independent micro-service components;
Acquiring development codes corresponding to each micro-service component, and compiling the development codes to obtain executable service components corresponding to each micro-service component;
Receiving executable service components selected and combined by a user from all the executable service components, and packaging the received executable service components to obtain a target service component;
And deploying the target service component to generate a corresponding micro-service architecture.
Preferably, the step of splitting the acquired overall service includes:
carrying out demand analysis on the integral service to obtain a demand dependency relationship;
and splitting the whole service according to the requirement dependency relationship.
Preferably, the step of obtaining development code corresponding to each of the micro service components includes:
And carrying out software development on each micro service component according to a preset interface specification and programming language to obtain the development code.
Preferably, after the step of obtaining the executable service component corresponding to each micro service component, the method further includes, before the step of receiving the executable service component selected and combined by the user from all the executable service components:
Receiving a test request for testing the executable service component;
Testing the executable service component according to the test case in the test request to obtain a test result;
And when the test result does not reach a preset target value, modifying the development code according to the test result, and jumping to the step of acquiring the development code corresponding to each micro-service component until the test result reaches the target value.
Preferably, after the step of generating the corresponding micro-service architecture, the method further comprises:
receiving an update request for updating the micro-service architecture;
And modifying the integral service according to the updating request, and jumping to a step of splitting the acquired integral service.
In another aspect, the present invention provides a device for generating a micro-service architecture, where the device includes:
the service splitting unit is used for splitting the acquired overall service to obtain a plurality of independent micro-service components;
the component development unit is used for acquiring development codes corresponding to each micro-service component and compiling the development codes to obtain executable service components corresponding to each micro-service component;
the component packaging unit is used for receiving executable service components selected and combined by a user from all the executable service components, and packaging the received executable service components to obtain target service components;
and the component deployment unit is used for deploying the target service components and generating corresponding micro-service architecture.
Preferably, the service splitting unit includes:
the demand analysis unit is used for carrying out demand analysis on the integral service to obtain a demand dependency relationship;
And the service splitting subunit is used for splitting the service of the whole service according to the requirement dependency relationship.
Preferably, the component development unit includes:
and the component development subunit is used for carrying out software development on each micro-service component according to a preset interface specification and a programming language to obtain the development code.
In another aspect, the present invention further provides a computing device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor implements the steps of a method for generating a micro-service architecture as described above when the processor executes the computer program.
In another aspect, the present invention also provides a computer readable storage medium storing a computer program, which when executed by a processor implements the steps of a method for generating a micro-service architecture as described above.
The method and the system for achieving the micro-service system have the advantages that the acquired overall service is split to obtain a plurality of independent micro-service components, development codes corresponding to each micro-service component are acquired, the development codes are compiled to obtain executable service components corresponding to each micro-service component, the executable service components selected and combined by a user from all the executable service components are received, the received executable service components are packaged to obtain target service components, the target service components are deployed to generate corresponding micro-service architecture, and therefore the quality, efficiency and reusability of the service are improved, the development efficiency is improved, the micro-service architecture with high cohesion and low coupling is realized, and the maintainability, the expandability, the stability and the reliability of the system are improved.
Drawings
FIG. 1 is a flowchart of a method for generating a micro service architecture according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of a generating device of a micro service architecture according to a second embodiment of the present invention;
Fig. 3 is a schematic diagram of a preferred structure of a generating device of a micro service architecture according to a second embodiment of the present invention;
Fig. 4 is a schematic structural diagram of a computing device according to a third embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the drawings and examples, in order to make the objects, technical solutions and advantages of the present invention more apparent. 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 following describes in detail the implementation of the present invention in connection with specific embodiments:
Embodiment one:
Fig. 1 shows a flow of implementation of a method for generating a micro service architecture according to a first embodiment of the present invention, and for convenience of explanation, only the portions related to the embodiments of the present invention are shown, which are described in detail below:
In step S101, service splitting is performed on the obtained overall service, so as to obtain a plurality of independent micro-service components.
In the embodiment of the invention, the questionnaire, interview and/or prototype evaluation and other modes are used in advance to comprehensively collect the requirements (including but not limited to functions, performances, availability and the like) of the services such as products or projects and the like, so as to form the whole service containing the user requirements and the service scene of the services, and then the whole service is disassembled into a plurality of independent micro-service components, wherein each component has clear functions and interface definitions.
In one possible embodiment, in service splitting of the acquired overall service, interfaces between the split micro service components are defined, including but not limited to input parameters, output results, communication protocols, and data transmission formats.
In yet another possible embodiment, when the acquired overall service is split, the overall service is first subjected to demand analysis to obtain a demand dependency relationship, and then the overall service is split according to the demand dependency relationship, so that the split service components are finer in granularity, better in independence and higher in reusability, and meanwhile flexibility and safety of service combination are improved.
In the embodiment of the invention, the user requirements and the service scene are embodied in the overall service, the overall service is subjected to requirement analysis according to the user requirements and the service scene, the input, output and processing logic of each requirement are defined, the requirement dependency relationship is obtained, and the overall service is split into each independent micro-service component with different functions according to the requirement dependency relationship.
In another possible embodiment, when the overall service is split according to the requirement dependency relationship, the overall service is split according to the requirement dependency relationship in a policy mode or a factory mode.
In step S102, development codes corresponding to each micro service component are acquired, and the development codes are compiled to obtain executable service components corresponding to each micro service component.
In the embodiment of the invention, a developer can develop the components according to the functions of each disassembled micro service component, each micro service component has high-quality codes and stable functions so as to ensure that the micro service component can independently operate and work cooperatively with other components, the developer can store the completed development codes corresponding to each micro service component in a unified code library, and the code library can be local or cloud, based on the development codes, the development codes corresponding to each micro service component are acquired from a preset code library, and then the development codes are compiled to generate executable service components corresponding to each micro service component.
In one possible embodiment, when the development code corresponding to each micro-service component is obtained, software development is performed on each micro-service component according to a pre-established interface specification and programming language to obtain the development code, so that all the micro-service components are ensured to follow the same interface standard, and different components can be connected and interacted seamlessly.
In the embodiment of the invention, the programming languages include but are not limited to development languages under embedded, android, python and other framework systems, the interface specifications include but are not limited to request and response formats, parameter descriptions, interface communication protocols, version control mechanisms for supporting service upgrading and compatibility, and error code systems for processing abnormal conditions possibly occurring in the service calling process, and software development is performed on each micro-service component based on the interface specifications and the programming languages to obtain corresponding development codes.
In yet another possible embodiment, after obtaining the executable service component corresponding to each micro service component, a test request for testing the executable service component is received, the executable service component is tested according to a test case in the test request to obtain a test result, when the test result does not reach a preset target value, the development code is modified according to the test result, and the step S102 is skipped to obtain the development code corresponding to each micro service component, and the execution is continued until the test result reaches the target value, thereby improving the robustness of the executable service component.
In the embodiment of the invention, when the executable service components are tested according to the test cases in the test requests, unit test is performed on each executable service component to ensure the correctness of the single component, then integrated test is performed on a plurality of executable service components to ensure the coordination and communication between the components to be normal, test results of the unit test and the integrated test are respectively obtained, when the test results do not reach the preset target values, the corresponding development codes are modified according to the test results, then the development codes after modification of the micro service components are obtained again, and are compiled again to obtain the executable service components, and then the executable service components are tested according to the test cases in the test requests, and so on until the test results reach the target values, and then the test is ended.
In step S103, the executable service components selected and combined by the user from all the executable service components are received, and the received executable service components are packaged to obtain the target service components.
In the embodiment of the invention, a service catalog and a management platform are pre-established, and all executable service components and corresponding function descriptions of the executable service components are displayed on the platform, the platform simultaneously provides functions of searching, screening, sorting and the like, so that a user can conveniently browse, select and customize required executable service components, based on the functions, the user can select and combine the required executable service components from all the executable service components displayed in the service catalog and the management platform according to own requirements and preferences to form a customized solution, the process can be static, can also allow dynamic adjustment and modification to meet the requirements of different scenes, and when the executable service components selected and combined by the user through the service catalog and the management platform are received, the received executable service components are packaged to form a target service component, and the target service component can be an executable file or a Docker mirror image.
In step S104, the target service component is deployed to generate a corresponding micro-service architecture.
In the embodiment of the invention, tools such as Kubernetes, docker Swarm and the like are used for arranging containers, target service components are deployed in corresponding containers to obtain corresponding micro-service architectures, and meanwhile, the resource allocation, performance, version, safety and the like of the micro-service architectures running in the containers are monitored and managed to ensure the stable running and flexible expansion of the whole system.
In a possible embodiment, after the corresponding micro service architecture is generated, an update request for updating the micro service architecture is received, the whole service is modified according to the update request, and the step S101 is skipped to split the obtained whole service, so that the micro service architecture is optimized in a customized manner by continuously updating and iterating the functions of the service component, so as to meet the requirements of different industries and clients.
In the embodiment of the invention, a man-machine interaction interface is provided for a user to easily browse, select, combine and use functions corresponding to all service components in the micro-service architecture, improve detailed interface documents and courses and online technical support to help the user solve the use problem, improve the user satisfaction and use effect, establish a user feedback mechanism, collect user comments and suggestions, update the micro-service architecture, wherein the update request for updating the micro-service architecture can be triggered according to the user feedback mechanism or according to market demands, and modify the original overall service based on the update request, which involves the addition of new functions, optimization of performances, repair of security holes and the like, and then jump to step S101 to split the service of the modified overall service for continuous execution to obtain the new micro-service architecture.
In the embodiment of the invention, the acquired overall service is split to obtain a plurality of independent micro-service components, the development code corresponding to each micro-service component is acquired, the development code is compiled to obtain the executable service component corresponding to each micro-service component, the executable service components selected and combined by a user from all the executable service components are received, the received executable service components are packaged to obtain a target service component, the target service component is deployed to generate a corresponding micro-service architecture, and therefore, the development efficiency is improved while the quality, the efficiency and the reusability of the service are improved, the micro-service architecture with high cohesion and low coupling is realized, and the maintainability, the expandability, the stability and the reliability of the system are improved.
Embodiment two:
Fig. 2 shows a structure of a micro service architecture generating device according to a second embodiment of the present invention, for convenience of explanation, only a portion related to the embodiment of the present invention is shown, where the generating device includes:
the service splitting unit 21 is configured to split the acquired overall service into several independent micro-service components.
In the embodiment of the invention, the questionnaire, interview and/or prototype evaluation and other modes are used in advance to comprehensively collect the requirements (including but not limited to functions, performances, availability and the like) of the services such as products or projects and the like, so as to form the whole service containing the user requirements and the service scene of the services, and then the whole service is disassembled into a plurality of independent micro-service components, wherein each component has clear functions and interface definitions.
In one possible embodiment, in service splitting of the acquired overall service, interfaces between the split micro service components are defined, including but not limited to input parameters, output results, communication protocols, and data transmission formats.
The component development unit 22 is configured to obtain a development code corresponding to each micro service component, and compile the development code to obtain an executable service component corresponding to each micro service component.
In the embodiment of the invention, a developer can develop the components according to the functions of each disassembled micro service component, each micro service component has high-quality codes and stable functions so as to ensure that the micro service component can independently operate and work cooperatively with other components, the developer can store the completed development codes corresponding to each micro service component in a unified code library, and the code library can be local or cloud, based on the development codes, the development codes corresponding to each micro service component are acquired from a preset code library, and then the development codes are compiled to generate executable service components corresponding to each micro service component.
And the component packaging unit 23 is configured to receive the executable service components selected and combined by the user from all the executable service components, and package the received executable service components to obtain the target service component.
In the embodiment of the invention, a service catalog and a management platform are pre-established, and all executable service components and corresponding function descriptions of the executable service components are displayed on the platform, the platform simultaneously provides functions of searching, screening, sorting and the like, so that a user can conveniently browse, select and customize required executable service components, based on the functions, the user can select and combine the required executable service components from all the executable service components displayed in the service catalog and the management platform according to own requirements and preferences to form a customized solution, the process can be static, can also allow dynamic adjustment and modification to meet the requirements of different scenes, and when the executable service components selected and combined by the user through the service catalog and the management platform are received, the received executable service components are packaged to form a target service component, and the target service component can be an executable file or a Docker mirror image.
The component deployment unit 24 is configured to deploy the target service component to generate a corresponding micro-service architecture.
In the embodiment of the invention, tools such as Kubernetes, docker Swarm and the like are used for arranging containers, target service components are deployed in corresponding containers to obtain corresponding micro-service architectures, and meanwhile, the resource allocation, performance, version, safety and the like of the micro-service architectures running in the containers are monitored and managed to ensure the stable running and flexible expansion of the whole system.
Preferably, as shown in fig. 3, the service splitting unit 21 includes:
A requirement analysis unit 211, configured to perform requirement analysis on the overall service to obtain a requirement dependency relationship;
the service splitting subunit 212 is configured to split the service for the whole service according to the requirement dependency relationship.
In the embodiment of the invention, the user requirements and the service scene are embodied in the overall service, the overall service is subjected to requirement analysis according to the user requirements and the service scene, the input, output and processing logic of each requirement are defined, the requirement dependency relationship is obtained, and the overall service is split into each independent micro-service component with different functions according to the requirement dependency relationship.
In another possible embodiment, when the overall service is split according to the requirement dependency relationship, the overall service is split according to the requirement dependency relationship in a policy mode or a factory mode.
The component development unit 22 includes:
The component development subunit 221 is configured to perform software development on each microservice component according to a preset interface specification and a programming language, so as to obtain development codes.
In the embodiment of the invention, the programming languages include but are not limited to development languages under embedded, android, python and other framework systems, the interface specifications include but are not limited to request and response formats, parameter descriptions, interface communication protocols, version control mechanisms for supporting service upgrading and compatibility, and error code systems for processing abnormal conditions possibly occurring in the service calling process, and software development is performed on each micro-service component based on the interface specifications and the programming languages to obtain corresponding development codes.
Preferably, the generating device of the micro service architecture of the embodiment of the present invention further includes:
the test request receiving unit is used for receiving a test request for testing the executable service component;
The service component testing unit is used for testing the executable service component according to the test case in the test request to obtain a test result;
And a development code modifying unit, configured to modify the development code according to the test result when the test result does not reach the preset target value, and trigger the component developing unit 22 to perform obtaining of the development code corresponding to each micro service component until the test result reaches the target value.
In the embodiment of the invention, after the executable service components corresponding to each micro service component are obtained, corresponding tests are carried out on the executable service components, when the executable service components are tested according to the test cases in the test requests, unit tests are carried out on each executable service component to ensure the correctness of single components, then integrated tests are carried out on a plurality of executable service components to ensure the coordination and communication between the components to be normal, test results of the unit tests and the integrated tests are respectively obtained, when the test results do not reach preset target values, the corresponding development codes are modified according to the test results, then the development codes modified by the micro service components are obtained again, and are compiled again to obtain the executable service components, and then the executable service components are tested according to the test cases in the test requests, and so on until the test results reach the target values, and the tests are ended.
Preferably, the generating device of the micro service architecture of the embodiment of the present invention further includes:
an update request receiving unit, configured to receive an update request for updating the micro-service architecture;
And the whole service modification unit is used for modifying the whole service according to the update request and triggering the service splitting unit 21 to perform service splitting on the obtained whole service.
In the embodiment of the invention, a man-machine interaction interface is provided for a user to easily browse, select, combine and use functions corresponding to each service component in the micro-service architecture, improve detailed interface documents and courses and online technical support to help the user solve the use problem, improve the user satisfaction and use effect, establish a user feedback mechanism, collect user comments and suggestions, update the micro-service architecture, which can be triggered according to the user feedback mechanism or according to market demands, receive the update request for updating the micro-service architecture after generating the corresponding micro-service architecture, modify original overall services based on the update request, which involves the addition of new functions, optimization of performances, repair of security vulnerabilities and the like, trigger a service splitting unit 21 to split the modified overall services, and continue execution to obtain the new micro-service architecture.
In the embodiment of the present invention, each unit of the generating device of the micro service architecture may be implemented by a corresponding hardware or software unit, and each unit may be an independent software or hardware unit, or may be integrated into one software or hardware unit, which is not used to limit the present invention.
Embodiment III:
fig. 4 shows the structure of a computing device provided by the third embodiment of the present invention, and only the portions relevant to the embodiment of the present invention are shown for convenience of explanation.
The computing device 4 of an embodiment of the present invention includes a processor 40, a memory 41, and a computer program 42 stored in the memory 41 and executable on the processor 40. The processor 40 implements the steps of the embodiment of the method for generating a micro service architecture described above, such as steps S101 to S104 shown in fig. 1, when executing the computer program 42. Or the processor 40 when executing the computer program 42 performs the functions of the units of the above-described device embodiments, such as the units 21 to 24 shown in fig. 2.
In the embodiment of the invention, the acquired overall service is split to obtain a plurality of independent micro-service components, the development code corresponding to each micro-service component is acquired, the development code is compiled to obtain the executable service component corresponding to each micro-service component, the executable service components selected and combined by a user from all the executable service components are received, the received executable service components are packaged to obtain a target service component, the target service component is deployed to generate a corresponding micro-service architecture, and therefore, the development efficiency is improved while the quality, the efficiency and the reusability of the service are improved, the micro-service architecture with high cohesion and low coupling is realized, and the maintainability, the expandability, the stability and the reliability of the system are improved.
The computing device of the embodiment of the invention can be a personal computer or a server. The steps of the method for generating a micro-service architecture implemented by the processor 40 in the computing device 4 when executing the computer program 42 can refer to the description of the foregoing method embodiments, and will not be repeated here.
Embodiment four:
In an embodiment of the present invention, a computer-readable storage medium is provided, in which a computer program is stored, which when executed by a processor, implements steps in an embodiment of a method for generating a micro-service architecture as described above, for example, steps S101 to S104 shown in fig. 1. Or the computer program, when being executed by a processor, performs the functions of the units in the above-described embodiments of the apparatus, such as the functions of the units 21 to 24 shown in fig. 2.
In the embodiment of the invention, the acquired overall service is split to obtain a plurality of independent micro-service components, the development code corresponding to each micro-service component is acquired, the development code is compiled to obtain the executable service component corresponding to each micro-service component, the executable service components selected and combined by a user from all the executable service components are received, the received executable service components are packaged to obtain a target service component, the target service component is deployed to generate a corresponding micro-service architecture, and therefore, the development efficiency is improved while the quality, the efficiency and the reusability of the service are improved, the micro-service architecture with high cohesion and low coupling is realized, and the maintainability, the expandability, the stability and the reliability of the system are improved.
The computer readable storage medium of embodiments of the present invention may include any entity or device capable of carrying computer program code, recording medium, such as ROM/RAM, magnetic disk, optical disk, flash memory, and so on.
The foregoing description of the preferred embodiments of the invention is not intended to be limiting, but rather is intended to cover all modifications, equivalents, and alternatives falling within the spirit and principles of the invention.
Claims (10)
1. A method of generating a micro-service architecture, the method comprising the steps of:
carrying out service splitting on the obtained integral service to obtain a plurality of independent micro-service components;
Acquiring development codes corresponding to each micro-service component, and compiling the development codes to obtain executable service components corresponding to each micro-service component;
Receiving executable service components selected and combined by a user from all the executable service components, and packaging the received executable service components to obtain a target service component;
And deploying the target service component to generate a corresponding micro-service architecture.
2. The method of claim 1, wherein the step of service splitting the acquired overall service comprises:
carrying out demand analysis on the integral service to obtain a demand dependency relationship;
and splitting the whole service according to the requirement dependency relationship.
3. The method of claim 1, wherein the step of obtaining development code corresponding to each of the micro-service components comprises:
And carrying out software development on each micro service component according to a preset interface specification and programming language to obtain the development code.
4. The method of claim 3, wherein after the step of obtaining the executable service components corresponding to each of the micro service components, the step of receiving executable service components selected and combined by the user from all of the executable service components, the method further comprises:
Receiving a test request for testing the executable service component;
Testing the executable service component according to the test case in the test request to obtain a test result;
And when the test result does not reach a preset target value, modifying the development code according to the test result, and jumping to the step of acquiring the development code corresponding to each micro-service component until the test result reaches the target value.
5. The method of claim 1, wherein after the step of generating the corresponding micro-service architecture, the method further comprises:
receiving an update request for updating the micro-service architecture;
And modifying the integral service according to the updating request, and jumping to a step of splitting the acquired integral service.
6. A device for generating a micro-service architecture, the device comprising:
the service splitting unit is used for splitting the acquired overall service to obtain a plurality of independent micro-service components;
the component development unit is used for acquiring development codes corresponding to each micro-service component and compiling the development codes to obtain executable service components corresponding to each micro-service component;
the component packaging unit is used for receiving executable service components selected and combined by a user from all the executable service components, and packaging the received executable service components to obtain target service components;
and the component deployment unit is used for deploying the target service components and generating corresponding micro-service architecture.
7. The apparatus of claim 6, wherein the service splitting unit comprises:
the demand analysis unit is used for carrying out demand analysis on the integral service to obtain a demand dependency relationship;
And the service splitting subunit is used for splitting the service of the whole service according to the requirement dependency relationship.
8. The apparatus of claim 6, wherein the component development unit comprises:
and the component development subunit is used for carrying out software development on each micro-service component according to a preset interface specification and a programming language to obtain the development code.
9. A computing device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the method of any of claims 1 to 5 when the computer program is executed.
10. A computer readable storage medium storing a computer program, characterized in that the computer program when executed by a processor implements the steps of the method according to any one of claims 1 to 5.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202410187405.4A CN118245056A (en) | 2024-02-20 | 2024-02-20 | Method, device, equipment and storage medium for generating micro-service architecture |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202410187405.4A CN118245056A (en) | 2024-02-20 | 2024-02-20 | Method, device, equipment and storage medium for generating micro-service architecture |
Publications (1)
Publication Number | Publication Date |
---|---|
CN118245056A true CN118245056A (en) | 2024-06-25 |
Family
ID=91553744
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202410187405.4A Pending CN118245056A (en) | 2024-02-20 | 2024-02-20 | Method, device, equipment and storage medium for generating micro-service architecture |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN118245056A (en) |
-
2024
- 2024-02-20 CN CN202410187405.4A patent/CN118245056A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11868231B2 (en) | System and method for evaluating code by a hybrid of local and cloud-based computers | |
CN111273898B (en) | Automatic construction method, system and storage medium for web front-end code | |
US9760343B2 (en) | Application builder based on metadata | |
US9760365B2 (en) | Systems, methods, and computer program products for a software build and load process using a compilation and deployment service | |
CN113312037B (en) | Data processing method, device, equipment and storage medium applied to micro-service | |
CN112685035B (en) | Project development method and device, computer readable storage medium and electronic equipment | |
US11226830B2 (en) | System for building, managing, deploying and executing reusable analytical solution modules for industry applications | |
WO2022016848A1 (en) | Method and apparatus for performing application deployment according to service role | |
US8839223B2 (en) | Validation of current states of provisioned software products in a cloud environment | |
US11068243B2 (en) | Application stack builder based on node features | |
CN111026634A (en) | Interface automation test system, method, device and storage medium | |
EP4036716B1 (en) | Method and device for acquiring mirror image file | |
CN112395196A (en) | Data operation development test method, device, equipment, system and storage medium | |
US9026997B2 (en) | Systems and methods for executing object-oriented programming code invoking pre-existing objects | |
CN114546819A (en) | Code processing method and device, electronic equipment and readable medium | |
CN115390846A (en) | Compiling construction method and device, electronic equipment and storage medium | |
CN118259906A (en) | Multi-terminal page adaptation method, equipment and medium based on PaaS framework | |
CN116974555A (en) | Method, device, equipment and storage medium for assembling software development kit | |
CN113032004A (en) | Method, apparatus and program product for managing development jobs in a development environment | |
CN118245056A (en) | Method, device, equipment and storage medium for generating micro-service architecture | |
CN115061691A (en) | Integration method, device, equipment and readable storage medium | |
CN114791884A (en) | Test environment construction method and device, storage medium and electronic equipment | |
CN109815142B (en) | Product testing method and device | |
KR20210144044A (en) | System for providing development framework which support both monolithic architecture and microservice architecture, method for developing application using the same and computer program for the same | |
CN112667491A (en) | Function test method and device of virtual machine |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication |