Local joint debugging method, system and development platform

By registering the service instance information of the local development machine to the registration center and using the tag routing mechanism, the resource conservation, debugging independence and environmental stability of local joint debugging are achieved, and the resource consumption and low joint debugging efficiency are solved in the existing technology. and debugging inconvenient issues.

CN119396685AInactive Publication Date: 2025-02-07SHANGHAI INGEEK CYBER SECURITY CO LTD

Patent Information

Application Number
CN202510006137.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-03
Publication Date
2025-02-07
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The existing local joint debugging methods have problems such as high resource consumption, low joint debugging efficiency, many version conflicts, and inconvenient debugging. Especially when multiple versions are developed in parallel, the shared environment is prone to unstable and affects the development progress.

Method used

By registering the service instance information of the local development machine to the registration center, the gateway monitors and updates the routing information, the local development machine can be elastically integrated into the shared test environment. Use the tag routing mechanism to achieve joint debugging and isolation, avoid version conflicts, and support local debugging and debugging.

Benefits of technology

It realizes joint debugging isolation, ensures debugging independence, maintains the stability of the shared test environment, saves local resources, supports flexible debugging and debugging, and improves development efficiency and resource utilization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119396685A_ABST
    Figure CN119396685A_ABST
Patent Text Reader

Abstract

The embodiment of the invention relates to the technical field of computers, and discloses a local joint debugging method and system and a development platform. The method comprises the following steps: registering information of a service instance of at least one local development machine to a registration center; the information of the service instance comprises a label of the service instance; monitoring the information of the service instance obtained by the registration center by using the gateway, and updating the routing information according to the information of the service instance; when the gateway receives the test request, the test request is forwarded to the service instance corresponding to the label according to the label carried by the test request, so that the service instance responds to the test request and returns test data through the gateway, joint debugging isolation can be realized, conflicts among different joint debugging parties are avoided, and the test efficiency is improved. After code debugging is completed, the common test environment can be kept stable all the time through publishing, a full-amount environment does not need to be set up locally, resources can be saved, local debugging can be supported, and debug is flexible and convenient.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present invention relate to the field of computer technology, and in particular to a local joint debugging method, system and development platform. Background Art

[0002] Local joint debugging refers to the process in which developers call and debug services in the local environment during the development process to ensure that the interactions between services work as expected. At present, there are two main methods for local development joint debugging: Method 1: Build a full environment locally, and the joint debugging request points to the development machine used by the R&D personnel. The disadvantages of method 1 are as follows: 1. A complete development environment needs to be built locally, which is costly and time-consuming; 2. It is easy to face the problem of insufficient local resources, which affects the efficiency of joint debugging. Method 2: Release the code to a public development environment cluster, and the joint debugging party tests it on a shared environment. The disadvantages of method 2 are as follows: 1. When multiple versions are developed in parallel, version conflicts may occur, and different versions affect each other. 2. It is not convenient for local debugging and debugging. 3. The shared environment is prone to instability, which affects the overall development progress and is not flexible enough during debugging. Summary of the invention

[0003] The embodiments of the present invention provide a local joint debugging method, system and development platform. By flexibly integrating the local development machine into the shared test environment and routing the request by labeling the application, the joint debugging isolation can be achieved to avoid conflicts between different joint debugging parties. After the code is debugged, it can be released to keep the shared test environment stable at all times. There is no need to build a full environment locally, which can save resources and support local debugging, which is flexible and convenient.

[0004] In a first aspect, an embodiment of the present invention provides a local joint debugging method, which is applied to a local joint debugging development platform, wherein the local joint debugging development platform includes: a shared test environment and at least one local development machine; the shared test environment includes: a registration center and a gateway; the method includes:

[0005] Registering information of the service instance of the at least one local development machine to the registration center; the information of the service instance includes a tag of the service instance;

[0006] Using the gateway to monitor the registration center to obtain information about the service instance, and updating routing information according to the information about the service instance;

[0007] When the gateway receives a test request, it forwards the test request to a service instance corresponding to the tag according to the tag carried by the test request, so that the service instance responds to the test request and returns test data through the gateway.

[0008] As an embodiment, the test request is a self-test request for a service instance of a service A of a local development machine to call a service B in the shared test environment; accordingly, when the gateway receives the test request, the test request is forwarded to the service instance corresponding to the tag according to the tag carried by the test request, so that the service instance responds to the test request and returns test data through the gateway, including:

[0009] Using the gateway to forward the self-test request to the service instance of service A according to the label carried by the self-test request;

[0010] The service instance of service A searches the registration center for location information of the service instance of service B according to the self-test request and the tag carried by the self-test request, and the service instance of service A calls the service instance of service B to obtain the test data of the self-test request.

[0011] As an embodiment, the test request is a joint debugging request of service A on local development machine A and service B on local development machine B. Accordingly, when the gateway receives the test request, it forwards the test request to the service instance corresponding to the label according to the label carried by the test request, so that the service instance responds to the test request and returns the test data through the gateway, including:

[0012] Using the gateway to forward the joint debugging request to the service instance of service A according to the label carried by the joint debugging request;

[0013] The service instance of service A searches for the location information of service B through the registration center according to the tag of the joint debugging request, and forwards the joint debugging request of service A to the service instance of service B to obtain the test data of the joint debugging request.

[0014] As an embodiment, the information of the service instance also includes the service name and the IP and port number of the service instance; the gateway parses the service name and label of the requested service instance from the test request, and searches for the IP and port number of the service instance based on the service name and label.

[0015] In a second aspect, an embodiment of the present invention provides a local joint debugging system, which is configured on a local joint debugging development platform, wherein the local joint debugging development platform includes: a shared test environment and at least one local development machine; the shared test environment includes: a registration center and a gateway; the system includes:

[0016] A registration module, used to register the information of the service instance of the at least one local development machine to the registration center; the information of the service instance includes a tag of the service instance;

[0017] A routing module, used to use the gateway to monitor the registration center to obtain information about the service instance, and update routing information according to the information about the service instance;

[0018] The test module is used to forward the test request to the service instance corresponding to the tag according to the tag carried by the test request when the gateway receives the test request, so that the service instance responds to the test request and returns the test data through the gateway.

[0019] In a third aspect, an embodiment of the present invention provides a local joint debugging development platform, including: a shared test environment and at least one local development machine; the shared test environment includes: a registration center and a gateway;

[0020] The service instance of the at least one local development machine registers its information to the registration center; the information of the service instance includes a tag of the service instance;

[0021] The gateway monitors the registration center to obtain information about the service instance, and updates routing information according to the information about the service instance;

[0022] When receiving the test request, the gateway forwards the test request to the service instance corresponding to the tag according to the tag carried by the test request, so that the service instance responds to the test request and returns the test data through the gateway.

[0023] The local joint debugging method and development platform provided by the embodiment of the present invention registers the service instance information of the development machine to the registration center, and the gateway monitors the registration center and updates the routing information according to the monitored service instance information, so that the development machine can be flexibly integrated into the shared test environment. In addition, the service instance information includes a tag for request routing and service identification when testing it. The test request carries the tag of the service instance so that the gateway can forward the test request to the service instance of the local development machine. Therefore, the advantages of the embodiment of the present invention in the local joint debugging process are as follows:

[0024] 1. Joint debugging isolation is achieved, so that different joint debugging parties and developers do not interfere with each other, ensuring debugging independence;

[0025] 2. Release the code only after passing the local joint debugging test, so that the shared test environment remains stable at all times;

[0026] Developers only need to start one service instance locally, which saves local resources, makes deployment easier, and achieves efficient resource utilization.

[0027] It supports developers to flexibly debug and debug locally, solving the problem of inconvenient debugging in a shared test environment. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0029] Figure 1 A flowchart of a local joint debugging method provided in Embodiment 1 of the present invention;

[0030] Figure 2 A schematic diagram of the architecture of the shared test environment startup phase of the local joint debugging method provided in the first embodiment of the present invention;

[0031] Figure 3 A schematic diagram of the architecture of the development machine startup phase of the local joint debugging method provided in the first embodiment of the present invention;

[0032] Figure 4 A schematic diagram of a self-test process of the local joint debugging method provided in the first embodiment of the present invention;

[0033] Figure 5 A schematic diagram of the joint debugging process of the local joint debugging method provided in the first embodiment of the present invention;

[0034] Figure 6 This is a schematic diagram of the local joint debugging development platform architecture provided in Example 2 of the present invention. DETAILED DESCRIPTION

[0035] The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the present invention, rather than to limit the present invention. It should also be noted that, for ease of description, only parts related to the present invention, rather than all structures, are shown in the accompanying drawings.

[0036] Those skilled in the art will appreciate that the embodiments of the present invention may be implemented as a platform, device, apparatus, method or computer program product. Therefore, the present disclosure may be implemented in the following forms, namely: complete hardware, complete software (including firmware, resident software, microcode, etc.), or a combination of hardware and software.

[0037] According to an embodiment of the present invention, a local joint debugging method and a development platform are provided. The method and the platform.

[0038] Figure 1 The flowchart of the local joint debugging method provided in the first embodiment of the present invention is shown in FIG. The local joint debugging method in the embodiment of the present invention is applicable to the local joint debugging development platform provided in the embodiment of the present invention. Figure 2 ,3 As shown, the local joint debugging development platform includes: a shared test environment 1 and at least one development machine. The shared test environment 1 includes: a registration center 11 and a gateway 12. Figure 1 As shown, the local joint debugging method of the present application includes the following steps:

[0039] Step 101: Register information of a service instance of at least one local development machine to a registration center, where the information of the service instance includes a label of the service instance.

[0040] The shared test environment is a shared development cluster, and the local development machine is a device used by developers. The shared test environment 1 mainly includes a registration center 11, a gateway 12 and multiple services.

[0041] The registration center 11 is used to manage and maintain the addresses and metadata of each service in the distributed system, and is mainly used to realize service discovery and service registration functions. The shared test environment contains all server programs whose functions are as consistent as possible with the production environment. The server programs in the local development machine are different from the corresponding server programs in the shared test environment in version or function. The service instances of the services in the shared test environment and the server programs in the local development machine can include: service name, IP+port number and label. When multiple services in the shared test environment and the local development machine are started, they actively register their service instance information with the registration center. This information should include key labels that can connect the entire link in series, so as to facilitate subsequent request routing and service identification. The registration center 11 is responsible for storing the information of all service instances, including the IP and port of each instance, as well as important labels related to business logic. These labels are used to distinguish and manage service instances of different versions or functions. In the distributed architecture, remote calls are made by accessing the IP (Internet Protocol) address plus the port. By maintaining the mapping relationship between the service name, IP address, port and label, the location of the service instance can be located in the development platform.

[0042] Step 102: Use the gateway to monitor the registration center to obtain information about the service instance, and update the routing information according to the information about the service instance.

[0043] The gateway 12 is used to monitor the registration center 11. The gateway 12 updates its routing information after monitoring the metadata changes of the registration center 11. The gateway 12 will monitor the data changes of the registration center 11 in real time. Once a new service instance is reported or the information of an existing service instance is changed, the gateway 12 will update its routing information in time. This ensures that the test request can be correctly forwarded to the corresponding server instance according to the label in the request header.

[0044] At this point, the local development machine can be flexibly integrated into the local joint debugging development platform. The service instance in the local development machine can receive test requests and call resources in the shared test environment to respond to the test requests.

[0045] Step 103: When the gateway receives the test request, it forwards the test request to the service instance corresponding to the tag according to the tag carried in the test request, so that the service instance responds to the test request and returns the test data through the gateway.

[0046] The gateway parses the service name and label of the requested service instance from the test request, and finds the IP and port number of the service instance based on the service name and label. The request header of the test party and the service of the dependent party need to use the same label. This ensures that during the request forwarding process, the gateway can correctly identify and route to the desired service instance, maintaining the consistency and correctness of the request. The request header of the test party and the dependent party need to have the same name and label.

[0047] The following describes the registration of services and the configuration of the gateway in detail in stages.

[0048] like Figure 2 The common test environment startup phase architecture diagram shown in the figure includes:

[0049] Start the registration center program: initialize metadata information, the initial status is empty: {}.

[0050] Start the gateway program: After the gateway program is started, the gateway establishes a connection with the registration center and monitors changes in metadata information in real time.

[0051] Start other services: Start other services in the test environment one by one. After each service is successfully started, register its instance information (IP + listening port, such as 10.0.0.100:9800) to the registration center.

[0052] Update the registry metadata: After receiving the registration of the service instance of the server program in the shared test environment, the registry updates the metadata information. The example is as follows:

[0053] {"userServer": {"default": ["10.0.0.2:8888"]},"permServer": {"default": ["10.0.0.11:9999"]} / / Omit other services}

[0054] Among them, userServer and permServer represent the service name, and default is the label of the service, which represents the default program instance. The default program instance is deployed in the shared test environment. The IP address and port number constitute the address of the program instance. The gateway forwards non-specified requests to the default program instance (for example, ["10.0.0.2:8888"]).

[0055] 5. Gateway updates routing information: When the gateway detects changes in the registry metadata, it updates its routing information to reflect the latest service instance.

[0056] During the gateway configuration phase: the gateway needs to forward the user's routing URL to the specified service. The configuration is as follows:

[0057] serviceName: permServerurlMap:- url: / perm / method: get serviceMethod:ListPerms# Omit others

[0058] serviceName: userServerurlMap:- url: / user / method: get serviceMethod:ListUsers# Omit others

[0059] The user requested URL / perm / is forwarded to the method ListPerms of the service permServer.

[0060] like Figure 3 The server-side program startup architecture diagram of the local development machine is shown in the figure. The server-side program startup phase of the local development machine includes:

[0061] Start the local environment:

[0062] Configure the environment variable on the local development machine: Tag=v1.2.0, where v1.2.0 is the Tag of the service instance on the development machine.

[0063] Start the server program on the local development machine. After successful startup, the program obtains the variable Tag. After obtaining the value v1.2.0, the service instance information, such as service name, (IP+monitoring port), and Tag information, is registered to the registration center. The server program startup of the local development machine is complete.

[0064] The registry updates metadata:

[0065] After receiving the data reported by the service instance of the server program of the local development machine, the registration center 11 updates the metadata information. The updated metadata example is as follows:

[0066] {"userServer": {"default": ["10.0.0.2:8888"],"v1.2.0": ["192.168.0.10:8888"]}"permServer": {"default": ["10.0.0.11:9999"]} / / Omit other services}

[0067] Among them, v1.2.0 is the label information of the service instance registered by the server program of the local development machine.

[0068] The gateway updates the routing information again: After the gateway monitors the metadata changes of the registry, it updates its routing information to include the tag of the newly registered service instance.

[0069] At this point, the server program of the local development machine A has been integrated into the local joint debugging development platform, and the server program in the local development machine A can be self-tested and jointly debugged.

[0070] The test request may be a self-test request for a service instance of service A of a local development machine A to call a service B in a shared test environment. When performing self-test on service A, when the gateway receives the test request, the test request is forwarded to the service instance corresponding to the tag according to the tag carried by the test request, so that the service instance responds to the test request and returns the test data through the gateway, which may include: using the gateway to forward the self-test request to the service instance of the service A according to the tag carried by the self-test request, the service instance of service A finds the location information of the service instance of service B in the registration center according to the self-test request and the tag carried by the self-test request, and the service instance of service A calls the service instance of service B to obtain the test data of the self-test request.

[0071] Please refer to Figure 4 , the self-test process of service A's service instance is as follows:

[0072] The developer operates the local development machine running service A to initiate a self-test request of service A to the test interface. The header of the self-test request carries a tag Tag, and the tag value is, for example, v1.2.0. The tag value can be specified using the command line or browser plug-in. Usually, a browser, program, or CURL command request can be used. Taking CURL as an example, the request code example is as follows:

[0073] $ curl -H "Tag: v1.2.0"http: / / api.test.com / user /

[0074] After receiving the request for URL / user / , the gateway retrieves from the configuration that the service corresponding to the request is userServer. The gateway finds the instance information ["192.168.0.10:8888"] corresponding to userServer+Tag: v1.2.0 in the metadata. The gateway forwards the self-test request to 192.168.0.10:8888 (the service instance of service A). The program of service A handles some user-related business logic, such as querying all user data from the database. userServer obtains the corresponding permissions for the user. The userServer program does not find the instance information corresponding to permServer+Tag: v1.2.0 in the registration center, so it calls the default instance information ["10.0.0.11:9999"] (this instance information is deployed in the shared test environment). userServer requests the permServer of 10.0.0.11:9999 to obtain the user permission information. permServer returns the result to userServer, and userServer returns the result to the gateway. The gateway returns the test data to the local development machine A for the developer to view. The CURL command execution is completed and the response content is returned.

[0075] The test request may also be a joint debugging request for service A on local development machine A and service B on local development machine B. When performing a joint debugging test of service A and service B, when the gateway receives the test request, it forwards the test request to the service instance corresponding to the tag according to the tag carried in the test request, so that the service instance responds to the test request and returns the test data through the gateway, including: using the gateway to forward the joint debugging request to the service instance of service A according to the tag carried in the joint debugging request, the service instance of service A finds the location information of service B through the registration center according to the tag of the joint debugging request, and forwards the joint debugging request of service A to the service instance of service B to obtain the test data of the joint debugging request.

[0076] Please refer to Figure 5 The joint debugging test process of service A and service B is described in detail as follows:

[0077] The joint debugging method for two or more local services is the same. Here we take the joint debugging of two services as an example. If the service A of local development machine A is userServer, and the service B of local development machine B is permServer, userServer needs to call permServer. userServer is the relying party, and permServer is the dependent party.

[0078] Configure environment variables Tag=v1.2.0 for services A and B respectively, and then start services A and B. When services A and B start, they register their service instance information with the registration center. The gateway monitors the service instance information of services A and B in real time and updates the routing information. During the joint debugging test, the test machine initiates a joint debugging request to the test interface. The header of the HTTP request carries a tag. The tag value can be specified by the test tool. The tag value is v1.2.0. Usually, a browser, program, or CURL command request can be used. The code example of the CURL request is as follows:

[0079] $ curl -H "Tag: v1.2.0"http: / / api.test.com / user /

[0080] The gateway receives a request for URL / user / and retrieves from the configuration that the service corresponding to the request is userServer. The gateway finds the instance information ["192.168.0.10:8888"] corresponding to userServer+Tag: v1.2.0 in the metadata (this instance is the service instance of service A on local development machine A). The gateway forwards the request to 192.168.0.10:8888. Service instance A processes business logic, such as processing some user-related business logic, such as querying all user data from the database. userServer requests the corresponding permissions for the user. At this time, the userServer program finds the instance information ["192.168.0.11:8888"] corresponding to permServer+Tag: v1.2.0 in the registration center (this instance information is the service instance of service B on local development machine B), and userServer requests the permServer of 192.168.0.11:8888 to obtain user permission information. permServer returns the result to userServer, userServer returns the result to the gateway, the gateway returns the data to the test machine, the CURL command execution is completed, and the response content is returned.

[0081] The local joint debugging method of the embodiment of the present invention flexibly integrates the local development machine into the shared test environment, and performs requests and routing by labeling the application program, so that the server program on the local development machine can perform self-testing and local joint debugging, so that different joint debugging parties and developers do not interfere with each other, thereby ensuring debugging independence; the code is released only after passing the local joint debugging test, so that the shared test environment always remains stable; the developer only needs to start one service instance locally, which saves local resources, makes deployment easier, and realizes efficient resource utilization; at the same time, it also supports developers to flexibly debug and debug locally, solving the problem of inconvenient debugging in a shared test environment.

[0082] See also Figure 6 The second embodiment of the present invention provides a local joint debugging system 600, which is configured on a local joint debugging development platform. The local joint debugging development platform includes: a shared test environment and at least one local development machine. The shared test environment includes: a registration center and a gateway. The system includes:

[0083] The registration module 602 is used to register the information of the service instance of at least one local development machine to the registration center; the information of the service instance includes the label of the service instance.

[0084] The routing module 604 is used to obtain the information of the service instance by monitoring the registration center through the gateway, and update the routing information according to the information of the service instance.

[0085] The test module 606 is used to forward the test request to the service instance corresponding to the tag according to the tag carried in the test request when the gateway receives the test request, so that the service instance responds to the test request and returns the test data through the gateway.

[0086] Optionally, the test request is a self-test request for a service instance of service A on a local development machine to call service B in the shared test environment; accordingly, the test module 606 is used to utilize the gateway to forward the self-test request to the service instance of service A according to the label carried in the self-test request; the service instance of service A finds the location information of the service instance of service B in the registration center according to the self-test request and the label carried in the self-test request, and the service instance of service A calls the service instance of service B to obtain the test data of the self-test request.

[0087] Optionally, the test request is a joint debugging request for service A on the local development machine A and service B on the local development machine B. Accordingly, the test module 606 is used to use the gateway to forward the joint debugging request to the service instance of service A according to the label carried in the joint debugging request; the service instance of service A finds the location information of service B through the registration center according to the label of the joint debugging request, and forwards the joint debugging request of service A to the service instance of service B to obtain the test data of the joint debugging request.

[0088] Optionally, the service instance information also includes the service name and the IP and port number of the service instance. The gateway parses the service name and label of the requested service instance from the test request, and finds the IP and port number of the service instance according to the service name and label.

[0089] Compared with the prior art, the local joint debugging system of the embodiment of the present invention flexibly integrates the local development machine into the shared test environment, and performs requests and routing by labeling the application program, so that the server program on the local development machine can perform self-testing and local joint debugging, so that different joint debugging parties and developers do not interfere with each other, thereby ensuring debugging independence; the code is released only after passing the local joint debugging test, so that the shared test environment always remains stable; the developer only needs to start one service instance locally, which saves local resources, makes deployment easier, and realizes efficient resource utilization; at the same time, it also supports developers to flexibly debug and debug locally, solving the problem of inconvenient debugging in a shared test environment.

[0090] Please continue reading Figure 2~Figure 5 , Embodiment 3 of the present invention provides a local joint debugging development platform, including: a shared test environment 1 and at least one local development machine. The shared test environment 1 includes: a registration center 11 and a gateway 12. The service instance of at least one local development machine registers its information to the registration center 11, and the information of the service instance includes the label of the service instance. The gateway 12 monitors the registration center 11 to obtain the information of the service instance, and updates the routing information according to the information of the service instance. When receiving a test request, the gateway 12 forwards the test request to the service instance corresponding to the label according to the label carried by the test request, so that the service instance responds to the test request and returns the test data through the gateway 12.

[0091] Optionally, the test request is a self-test request for a service instance of service A on a local development machine to call a service B in a shared test environment. Accordingly, the gateway 12 forwards the self-test request to the service instance of service A according to the tag carried in the self-test request. The service instance of service A finds the location information of the service instance of service B in the registration center according to the self-test request and the tag carried in the self-test request, and the service instance of service A calls the service instance of service B to obtain the test data of the self-test request.

[0092] Optionally, the test request is a joint debugging request for service A on the local development machine A and service B on the local development machine B. Accordingly, the gateway 12 forwards the joint debugging request to the service instance of service A according to the label carried in the joint debugging request; the service instance of service A finds the location information of service B through the registration center according to the label of the joint debugging request, and forwards the joint debugging request of service A to the service instance of service B to obtain the test data of the joint debugging request.

[0093] Optionally, the service instance information also includes the service name and the IP and port number of the service instance. The gateway parses the service name and label of the requested service instance from the test request, and finds the IP and port number of the service instance according to the service name and label.

[0094] Compared with the prior art, the local joint debugging development platform of the embodiment of the present invention flexibly integrates the local development machine into the shared test environment, and performs requests and routing by labeling the application program, so that the server program on the local development machine can perform self-testing and local joint debugging, so that different joint debugging parties and developers do not interfere with each other, thereby ensuring debugging independence; the code is released only after passing the local joint debugging test, so that the shared test environment always remains stable; the developer only needs to start one service instance locally, which saves local resources, makes deployment easier, and realizes efficient resource utilization; at the same time, it also supports developers to flexibly debug and debug locally, solving the problem of inconvenient debugging in a shared test environment.

[0095] Through the above description of the implementation methods, the technicians in the relevant field can clearly understand that the present invention can be implemented by means of software and necessary general hardware, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as a computer floppy disk, read-only memory (ROM), random access memory (RAM), flash memory (FLASH), hard disk or optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a grid device, etc.) to execute the methods described in each embodiment of the present invention.

[0096] It is worth noting that in the embodiment of the above-mentioned device, the various units and modules included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of the present invention.

[0097] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims

1. A local joint debugging method, characterized in that: Applied to a local joint debugging development platform, the local joint debugging development platform includes: a shared test environment and at least one local development machine; the shared test environment includes: a registration center and a gateway; the method includes: Registering information of the service instance of the at least one local development machine to the registration center; the information of the service instance includes a tag of the service instance; Using the gateway to monitor the registration center to obtain information about the service instance, and updating routing information according to the information about the service instance; When the gateway receives a test request, it forwards the test request to a service instance corresponding to the tag according to the tag carried by the test request, so that the service instance responds to the test request and returns test data through the gateway.

2. The local joint debugging method according to claim 1, characterized in that: The test request is a self-test request for a service instance of a service A of a local development machine to call a service B in the shared test environment; accordingly, when the gateway receives the test request, the gateway forwards the test request to the service instance corresponding to the tag according to the tag carried by the test request, so that the service instance responds to the test request and returns test data through the gateway, including: Using the gateway to forward the self-test request to the service instance of service A according to the label carried by the self-test request; The service instance of service A searches the registration center for location information of the service instance of service B according to the self-test request and the tag carried by the self-test request, and the service instance of service A calls the service instance of service B to obtain the test data of the self-test request.

3. The local joint debugging method according to claim 1, characterized in that: The test request is a joint debugging request of service A on local development machine A and service B on local development machine B. Accordingly, when the gateway receives the test request, it forwards the test request to the service instance corresponding to the tag according to the tag carried by the test request, so that the service instance responds to the test request and returns test data through the gateway, including: Using the gateway to forward the joint debugging request to the service instance of service A according to the label carried by the joint debugging request; The service instance of service A searches for the location information of service B through the registration center according to the tag of the joint debugging request, and forwards the joint debugging request of service A to the service instance of service B to obtain the test data of the joint debugging request.

4. The local joint debugging method according to claim 2 or 3, characterized in that: The information of the service instance also includes the service name and the IP and port number of the service instance; the gateway parses the service name and label of the requested service instance from the test request, and searches for the IP and port number of the service instance based on the service name and label.

5. A local joint debugging system, characterized in that: Configured on a local joint debugging and development platform, the local joint debugging and development platform includes: a shared test environment and at least one local development machine; the shared test environment includes: a registration center and a gateway; the system includes: A registration module, used to register the information of the service instance of the at least one local development machine to the registration center; the information of the service instance includes a tag of the service instance; A routing module, used to use the gateway to monitor the registration center to obtain information about the service instance, and update routing information according to the information about the service instance; The test module is used to forward the test request to the service instance corresponding to the tag according to the tag carried by the test request when the gateway receives the test request, so that the service instance responds to the test request and returns the test data through the gateway.

6. The local joint debugging system according to claim 5, characterized in that: The test request is a self-test request in which the service instance of service A of the local development machine calls service B in the shared test environment; accordingly, the test module is used to use the gateway to forward the self-test request to the service instance of service A according to the label carried by the self-test request; the service instance of service A searches the registration center for the location information of the service instance of service B according to the self-test request and the label carried by the self-test request, and the service instance of service A calls the service instance of service B to obtain the test data of the self-test request.

7. The local joint debugging system according to claim 5, characterized in that: The test request is a joint debugging request for service A on local development machine A and service B on local development machine B. Accordingly, the test module is used to use the gateway to forward the joint debugging request to the service instance of service A according to the label carried by the joint debugging request; the service instance of service A finds the location information of service B through the registration center according to the label of the joint debugging request, and forwards the joint debugging request of service A to the service instance of service B to obtain the test data of the joint debugging request.

8. The local joint debugging system according to claim 6, characterized in that: The information of the service instance also includes the service name and the IP and port number of the service instance; the gateway parses the service name and label of the requested service instance from the test request, and searches for the IP and port number of the service instance based on the service name and label.

9. A local joint debugging development platform, characterized in that: include: A shared test environment and at least one local development machine; The shared test environment includes: a registration center and a gateway; The service instance of the at least one local development machine registers its information to the registration center; the information of the service instance includes a tag of the service instance; The gateway monitors the registration center to obtain information about the service instance, and updates routing information according to the information about the service instance; When receiving the test request, the gateway forwards the test request to the service instance corresponding to the tag according to the tag carried by the test request, so that the service instance responds to the test request and returns the test data through the gateway.

10. The local joint debugging development platform according to claim 9, characterized in that: The test request is a joint debugging request for service A on local development machine A and service B on local development machine B. Accordingly, the gateway forwards the joint debugging request to the service instance of service A according to the label carried by the joint debugging request; The service instance of service A searches for the location information of service B through the registration center according to the tag of the joint debugging request, and forwards the joint debugging request of service A to the service instance of service B to obtain the test data of the joint debugging request.

Citation Information

Patent Citations

  • Micro-service debugging method and device, electronic equipment and readable storage medium

    CN115599669A

  • Front-end multi-developer independent operation system and method

    CN115766736A

  • Local service debugging method and system based on micro-service architecture and containerization

    CN116800761A

  • Routing method for service debugging, electronic device, medium and program product

    WO2023103727A1

Cited By

  • Micro-service debugging method and device

    CN120179533A