Method and device for requesting service
By obtaining service requests in the local environment and using service tags to query the registry center of the development environment, the problem of mutual interference between the development and testing environments is solved, enabling efficient development and testing management under limited resources.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-22
- Publication Date
- 2026-04-10
AI Technical Summary
With limited resources, development and testing environments interfere with each other, leading to complex development and testing workflows, and existing technologies lack effective solutions.
By obtaining service requests in the local environment, determining whether they carry service tags, and querying matching services in the registry center of the development environment, the system classifies and manages services using service tags, development tags, and test tags, thus achieving separate management of development and testing environments.
It enables separate management of development and testing environments under limited resources, improving development and testing efficiency and reducing resource dependence and intrusiveness of the testing environment.
Smart Images

Figure CN121833544A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of communications, and more specifically, to a method and apparatus for requesting services. Background Technology
[0002] In the traditional large-scale model development and testing environment preparation, due to resource limitations, development and testing are usually based on the same set of resources, which causes mutual interference between development and testing and makes the development and testing workflow more complicated.
[0003] Setting up two separate sets of resources for development and testing—with the development environment's models and services provided to developers and the testing environment's models and services provided to testers—aims to prevent interference between them. However, this approach faces numerous challenges in resource-constrained environments. Enterprises often struggle to allocate sufficient resources to both development and testing environments.
[0004] There is currently no effective solution to the above problems. Summary of the Invention
[0005] This invention provides a method and apparatus for requesting services, which at least solves the problem of mutual interference between development and testing in related technologies.
[0006] According to an embodiment of the present invention, a method for requesting a service is provided, comprising: obtaining a service request in a local environment, wherein the service request is used to request a target service; determining, through the local environment, whether the service request carries a service tag; if the service tag is carried, querying a service matching the service tag in a development registry of a development environment; and if a service matching the service tag is found, determining the service matching the service tag as the target service.
[0007] In one exemplary embodiment, the method further includes: if it is determined through the local environment that the service request does not carry the service tag, querying the development registry to see if a service with the development tag exists; if a service with the development tag is found, identifying the service with the development tag as the target service.
[0008] In one exemplary embodiment, the method further includes: if no service with the development tag is found, querying the development registry to see if a service with the test tag exists; if a service with the test tag is found, identifying the service with the test tag as the target service.
[0009] In one exemplary embodiment, the method further includes: the development environment receiving a first registration request, wherein the first registration request includes a first service to be registered by the development environment; and storing the first service in the development registry.
[0010] In one exemplary embodiment, after saving the first service in the development registry, the method further includes adding at least one of the following tags to the first service: service tag, development tag.
[0011] In one exemplary embodiment, the method further includes: the test environment receiving a second registration request, wherein the second registration request includes a second service to be registered by the test environment; and storing the second service in the test registration center.
[0012] In one exemplary embodiment, after saving the second service in the test registry, the method further includes adding at least one of the following tags to the second service: service tag, test tag.
[0013] In one exemplary embodiment, after adding the tag to the second service, the method further includes: synchronizing the second service and the tag added to the second service to the development registry of the development environment.
[0014] According to another embodiment of the present invention, an apparatus for requesting a service is provided, comprising: a first acquisition module, configured to acquire a service request in a local environment, wherein the service request is used to request a target service; a first determination module, configured to determine, through the local environment, whether the service request carries a service tag; a query module, configured to, if the service tag is carried, query a service matching the service tag in a development registry of a development environment; and a second determination module, configured to, if a service matching the service tag is found, determine the service matching the service tag as the target service.
[0015] According to yet another embodiment of the present invention, a computer-readable storage medium is also provided, wherein a computer program is stored therein, wherein the computer program, when executed by a processor, implements the steps of the method described in any of the preceding claims.
[0016] According to yet another embodiment of the present invention, an electronic device is also provided, including a memory and a processor, wherein the memory stores a computer program and the processor is configured to run the computer program to perform the steps in any of the above method embodiments.
[0017] According to yet another embodiment of the present invention, a computer program product is also provided, comprising a computer program that, when executed by a processor, implements the steps of the method described in any of the preceding claims.
[0018] This invention obtains service requests in the local environment, which are used to request a target service. It determines whether the service request carries a service tag. If it does, it queries the development registry in the development environment for a service that matches the tag. If a service matching the tag is found, it is identified as the target service. This achieves the goal of separating the management of the development and testing environments. Therefore, it solves the problem of mutual interference between development and testing in related technologies, achieving separate management of development and testing and improving development and testing efficiency. Attached Figure Description
[0019] Figure 1 This is a hardware structure block diagram of a mobile terminal for a method of requesting services according to an embodiment of the present invention.
[0020] Figure 2 This is a flowchart of a method for requesting services according to an embodiment of the present invention;
[0021] Figure 3 This is a schematic diagram of the request service architecture according to an embodiment of the present invention;
[0022] Figure 4 This is a structural block diagram of a service request device according to an embodiment of the present invention. Detailed Implementation
[0023] The embodiments of the present invention will be described in detail below with reference to the accompanying drawings and examples.
[0024] It should be noted that the terms "first," "second," etc., in the specification, claims, and drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence.
[0025] The methods and embodiments provided in this application can be executed on a mobile terminal, computer terminal, or similar computing device. Taking running on a mobile terminal as an example, Figure 1 This is a hardware structure block diagram of a mobile terminal for a method of requesting services according to an embodiment of the present invention. Figure 1 As shown, a mobile terminal may include one or more ( Figure 1Only one is shown in the diagram. A processor 102 (which may include, but is not limited to, a microprocessor MCU or a programmable logic device FPGA, etc.) and a memory 104 for storing data are also shown. The mobile terminal may further include a transmission device 106 for communication functions and an input / output device 108. Those skilled in the art will understand that... Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the mobile terminal described above. For example, the mobile terminal may also include components that are more... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown.
[0026] The memory 104 can be used to store computer programs, such as application software programs and modules, like the computer program corresponding to the service request method in this embodiment of the invention. The processor 102 executes various functional applications and data processing by running the computer programs stored in the memory 104, thereby implementing the aforementioned method. The memory 104 may include high-speed random access memory and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to the mobile terminal via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0027] The transmission device 106 is used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by the mobile terminal's communication provider. In one example, the transmission device 106 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 106 may be a Radio Frequency (RF) module used for wireless communication with the Internet.
[0028] This embodiment provides a method for requesting services on the aforementioned mobile terminal. Figure 2 This is a flowchart of a method for requesting services according to an embodiment of the present invention, such as... Figure 2 As shown, the process includes the following steps:
[0029] Step S202: Obtain a service request in the local environment, wherein the service request is used to request the acquisition of a target service;
[0030] Step S204: Determine whether the service request carries a service tag based on the local environment;
[0031] Among them, service tags are called tags, for example, such as Figure 3 The architecture diagram shown indicates that the service requests sent by the local end user (consumer) may or may not carry the service tag tag=10.10.1.1.
[0032] Step S206: With the service tag carried, query the development registry of the development environment for services that match the service tag;
[0033] In one exemplary embodiment, such as Figure 3 If the service request carries the service tag tag=10.10.1.1, the local environment will forward the service request to the development registry in the development environment through the local large model service. The development registry will then check whether a matching target service exists by checking if the service tag tag=10.10.1.1 exists.
[0034] In an exemplary embodiment, the development registry of the development environment stores the registered services. The registered services have corresponding service tags, development tags (dev) and test tags (tst). The development tag is used to identify that the service is registered from the development environment, and the test tag indicates that the service is registered from the test environment and then synchronized to the development environment.
[0035] Because the development registry stores service tags, including service tags, development tags, and testing tags, it achieves the goal of classifying and managing services for both development and testing environments within the same resource set. This, in turn, improves development and testing efficiency by allowing for separate management of development and testing environments under limited resource conditions.
[0036] Step S208: If a service matching the service tag is found, the service matching the service tag is identified as the target service.
[0037] by Figure 3 For example, the local large model service sends a service request with the service tag tag=10.10.1.1 to the development registry in the development environment. The development registry checks whether there is a service that matches the service tag. If there is, it is the target service.
[0038] Optionally, the entity performing the above steps may be a background processor or other devices with similar processing capabilities, or a machine that integrates at least an image acquisition device and a data processing device. The image acquisition device may include an image acquisition module such as a camera, and the data processing device may include a terminal such as a computer or a mobile phone, but is not limited thereto.
[0039] In one exemplary embodiment, the method further includes: if the service request does not carry the service tag as determined by the local environment, querying the development registry to see if a service with the development tag exists; and if a service with the development tag is found, identifying the service with the development tag as the target service.
[0040] by Figure 3 For example, if tag=null, the local environment will forward the service request to the development registry through the development model service in the development environment. The development registry will then check if a service with the development tag "dev" exists. If it does, the service with that development tag will be identified as the target service.
[0041] In one exemplary embodiment, the method further includes: if no service with the development tag is found, querying the development registry to see if a service with the test tag exists; if a service with the test tag is found, identifying the service with the test tag as the target service.
[0042] If the development registry does not have the service for the development tag, then check the development registry to see if the service for the village test tag tst exists. If it does, then the service for the test tag will be identified as the target service.
[0043] In one exemplary embodiment, the method further includes: the development environment receiving a first registration request, wherein the first registration request includes a first service to be registered by the development environment; and storing the first service in the development registry.
[0044] For service registration in the development environment, the development environment receives a first registration request. The first registration request is used to instruct the registration of the first service. The first registration request may also carry a service tag assigned to the first service, or the development registry may assign a service tag to the first service.
[0045] In one exemplary embodiment, after saving the first service in the development registry, the method further includes adding at least one of the following tags to the first service: service tag, development tag.
[0046] In one exemplary embodiment, the method further includes: the test environment receiving a second registration request, wherein the second registration request includes a second service to be registered by the test environment; and storing the second service in the test registration center.
[0047] For service registration in the test environment, a second registration request is received in the test environment. The second registration request is used to instruct the registration of the second service. The second registration request may also carry a service tag assigned to the second service, or the test registry may assign a service tag to the second service.
[0048] In one exemplary embodiment, after saving the second service in the test registry, the method further includes adding at least one of the following tags to the second service: service tag, test tag.
[0049] In one exemplary embodiment, after adding the tag to the second service, the method further includes: synchronizing the second service and the tag added to the second service to the development registry of the development environment.
[0050] A tag-based large-scale model development and testing service device. The tag service can be divided into the following stages:
[0051] 1. Service Registration: When a service starts, it proactively registers its current service metadata information with the registry center, which stores the information.
[0052] 2. Service discovery: The process by which services registered with the registry center enable other services to retrieve service information. This is achieved through the client actively retrieving registered service information from the registry center.
[0053] 3. Service Strategy: In order to better meet the diverse request strategies of users, the registry component usually opens up customized service strategy extensions.
[0054] 4. Data Service: During the actual network request submission stage, the service selection result is converted into a real IP port call, which is then routed through the network link to the actual service.
[0055] Without changing the original model registration environment, a synchronization component is added to the development environment to synchronize the service information registered in the test environment to the development environment. This is a one-way synchronization, where only the service information registered in the test environment is synchronized to the development environment.
[0056] In the development and testing environments, the registered services are tagged with service tags. The development tag is 'dev' and the testing tag is 'tst'. The development environment can adaptively use Internet Protocol addresses (IP addresses) as the service tag values.
[0057] Prioritize matching service tags with the same tag. If no matching service tag is found, adaptive matching will prioritize the development tag "dev". If no match is found, the test tag "tst" will be selected.
[0058] For service registration, a synchronization component is deployed in the development environment. It periodically (e.g., every 5 seconds) pulls the service information (registered services, service tags, test tags) registered in the test environment to the development environment and assigns it to a test resource group. This group is logically isolated from the development resources. This component is only deployed in the development environment and does not intrude on the test environment, nor does it affect the services in the test environment.
[0059] Services registered in the development environment use the development tag "dev", while those registered in the testing environment use the testing tag "tst".
[0060] The local environment uses dynamic service tags. By default, the tag value of the service tag is generated based on the user's host IP address. When deploying a service, the tag is automatically registered with the development registry center and the service tag is sent with the service tag.
[0061] For service matching, by default, services with the same tag are prioritized for matching. If no service with the same tag is found, the search is conducted for services with the "dev" tag. If such a service exists, it is a match. If not, the search continues for "tst" tag model services, so that they can ultimately serve the test environment model service.
[0062] This application manages model services across local, development, and testing environments, significantly reducing model service resource dependencies, supporting model development and testing scenarios, and reducing resource investment costs in the testing domain. It employs a one-way registration and synchronization mechanism, enhancing registration only for the local and development environments, minimizing environment intrusion, and ensuring the stability of the testing environment while supporting multi-environment registration synchronization. It implements automated tag generation and strategy selection, seamlessly integrating with the local, development, and testing environments, allowing users to transparently implement automated development and testing strategy services.
[0063] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of the present invention.
[0064] This embodiment also provides a service requesting device for implementing the above embodiments and preferred embodiments; details already described will not be repeated. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.
[0065] Figure 4 This is a structural block diagram of a service request device according to an embodiment of the present invention, such as... Figure 4 As shown, the device includes:
[0066] The first acquisition module 42 is used to acquire a service request in the local environment, wherein the service request is used to request the acquisition of a target service;
[0067] The first determining module 44 is used to determine whether the service request carries a service tag through the local environment;
[0068] The query module 46 is used to query the development registry center of the development environment for services that match the service tag when the service tag is carried.
[0069] The second determining module 48 is used to determine the service that matches the service tag as the target service when a service matching the service tag is found.
[0070] In an exemplary embodiment, the above-described apparatus is further configured to, if it is determined through the local environment that the service request does not carry the service tag, query the development registry to see if a service with the development tag exists; and if a service with the development tag is found, determine the service with the development tag as the target service.
[0071] In an exemplary embodiment, the above-described apparatus is further configured to, if no service with the development tag is found, query the development registry to see if a service with the test tag exists; and if a service with the test tag is found, determine the service with the test tag as the target service.
[0072] In an exemplary embodiment, the above-described apparatus is further configured to receive a first registration request in the development environment, wherein the first registration request includes a first service to be registered by the development environment; and to store the first service in the development registry.
[0073] In an exemplary embodiment, the above-described apparatus is further configured to add at least one of the following tags to the first service after saving the first service in the development registry: service tag, development tag.
[0074] In one exemplary embodiment, the above-described apparatus is further configured to receive a second registration request in the test environment, wherein the second registration request includes a second service to be registered by the test environment; and to store the second service in the test registration center.
[0075] In one exemplary embodiment, the above-described apparatus is further configured to add at least one of the following tags to the second service after saving the second service in the test registry: service tag, test tag.
[0076] In one exemplary embodiment, the above-described apparatus is further configured to, after adding the tag to the second service, synchronize the second service and the tag added to the second service to the development registry of the development environment.
[0077] It should be noted that the above modules can be implemented by software or hardware. For the latter, they can be implemented in the following ways, but are not limited to: all the above modules are located in the same processor; or, the above modules are located in different processors in any combination.
[0078] Embodiments of the present invention also provide a computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the steps of the method described in any of the preceding claims.
[0079] In one exemplary embodiment, the aforementioned computer-readable storage medium may include, but is not limited to, various media capable of storing computer programs, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard disk, magnetic disk, or optical disk.
[0080] Embodiments of the present invention also provide an electronic device including a memory and a processor, the memory storing a computer program and the processor being configured to run the computer program to perform the steps in any of the above method embodiments.
[0081] In one exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor and the input / output device is connected to the processor.
[0082] Specific examples in this embodiment can be found in the examples described in the above embodiments and exemplary implementations, and will not be repeated here.
[0083] Embodiments of the present invention also provide a computer program product, including a computer program that, when executed by a processor, implements the steps of the methods described in various embodiments of the present application.
[0084] It is obvious to those skilled in the art that the modules or steps of the present invention described above can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a network of multiple computing devices. They can be implemented using computer-executable program code, and thus can be stored in a storage device for execution by a computing device. In some cases, the steps shown or described can be performed in a different order than those described herein, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Thus, the present invention is not limited to any particular combination of hardware and software.
[0085] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, or improvements made within the principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for requesting a service, characterized in that, include: Obtain a service request in the local environment, wherein the service request is used to request the acquisition of a target service; The local environment is used to determine whether the service request carries a service tag. With the service tag included, search for services that match the service tag in the development registry of the development environment; If a service matching the service tag is found, the service matching the service tag is identified as the target service.
2. The method according to claim 1, characterized in that, The method further includes: If it is determined through the local environment that the service request does not carry the service tag, then query the development registry to see if a service with the development tag exists. If the service with the development tag is found, the service with the development tag is identified as the target service.
3. The method according to claim 2, characterized in that, The method further includes: If no service with the development tag is found, check the development registry center to see if a service with the test tag exists. If the service with the test tag is found, the service with the test tag is identified as the target service.
4. The method according to claim 1, characterized in that, The method further includes: The development environment receives a first registration request, wherein the first registration request includes a first service to be registered by the development environment; The first service is stored in the development registry.
5. The method according to claim 4, characterized in that, After storing the first service in the development registry, the method further includes: Add at least one of the following tags to the first service: service tag, development tag.
6. The method according to claim 1, characterized in that, The method further includes: The test environment receives a second registration request, wherein the second registration request includes a second service to be registered by the test environment; The second service is stored in the test registry.
7. The method according to claim 6, characterized in that, After storing the second service in the test registry, the method further includes: Add at least one of the following tags to the second service: service tag, test tag.
8. The method according to claim 7, characterized in that, After adding the tag to the second service, the method further includes: The second service, and the tags added to the second service, are synchronized to the development registry of the development environment.
9. A device for requesting a service, characterized in that, include: The first acquisition module is used to acquire a service request in the local environment, wherein the service request is used to request the acquisition of a target service; The first determining module is used to determine, through the local environment, whether the service request carries a service tag; The query module is used to query the development registry center of the development environment for services that match the service tag, when the service tag is carried. The second determining module is used to determine the service that matches the service tag as the target service when a service matching the service tag is found.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, wherein the computer program, when executed by a processor, implements the steps of the method described in any one of claims 1 to 8.
11. An electronic device comprising a memory and a processor, characterized in that, The memory stores a computer program, and the processor is configured to run the computer program to perform the method as described in any one of claims 1 to 8.
12. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method described in any one of claims 1 to 8.