The invention discloses a method, a device, equipment and a medium for realizing multi-service instance configuration, in the method, a
Java compiler is called to scan a
source code, a class marked with multi-instance container annotations is obtained, the class defines a plurality of service instances, and each service instance is marked with a corresponding multi-instance basic
annotation; based on a preset
annotation processor, traversing the multi-instance basic
annotation corresponding to each service instance, obtaining a class attribute value and a prefix attribute value, and obtaining a first configuration class corresponding to the first automatic
assembly class; according to the prefix attribute value,
processing the
byte code of the first configuration class and the
byte code of the first automatic
assembly class to obtain a second configuration class and a second automatic
assembly class; and adding the second configuration class file and the second automatic assembly class file to the resource
directory to realize configuration of the service instance. Thus, by introducing special multi-instance configuration annotations, namely, multi-instance container annotations and multi-instance basic annotations, the official automatic assembly class is expanded and customized, and multi-service instance configuration is achieved.