Resource reuse method and computer program product

By sharing the access layer and gateway equipment in the device cluster, and routing data processing requests based on the domain name information, resource reuse of production environment and pre-release environment is achieved, solving the problem of low resource utilization rate in pre-release environment and achieving low cost Build and efficient resource utilization.

CN119166110APending Publication Date: 2024-12-20SHENZHEN DACHENG COMM TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411292115.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-13
Publication Date
2024-12-20

AI Technical Summary

Technical Problem

During the project development cycle, the resource utilization rate of the pre-release environment is low, resulting in waste of resources and high construction costs.

Method used

By sharing the access layer and gateway equipment in the device cluster, data processing requests are routed according to the domain name information, resource reuse of production environment and pre-release environment is realized, and the equipment resource idle rate of pre-release environment is reduced.

Benefits of technology

It saves the equipment cost of building a pre-release environment, improves the utilization rate of equipment resources, and reduces the idle rate of equipment resources in the pre-release environment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119166110A_ABST
    Figure CN119166110A_ABST
Patent Text Reader

Abstract

The invention provides a resource reuse method and a computer program product, and belongs to the technical field of computers. The method comprises the steps that a data processing request is sent to gateway equipment through an access layer, the data processing request carries domain name information, the domain name information is used for indicating a to-be-accessed environment, and the to-be-accessed environment is a production environment or a pre-release environment; when the environment indicated by the domain name information is a pre-release environment, forwarding the data processing request to a business service interface in the pre-release environment through the gateway device, the business service interface being used for accessing a business service provided by a server in the device cluster; and processing the data processing request through the business service accessed by the business service interface. According to the technical scheme, the production environment and the pre-release environment which are isolated from each other can be deployed in the equipment cluster, the pre-release environment can be built at low cost, the idle rate of equipment resources is reduced, and the utilization rate of the equipment resources is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a resource reuse method and a computer program product. Background Art

[0002] During the development cycle of a project, the project will usually be coded and tested in the development environment and test environment. After the project passes the test, it can be released to the production environment for users to use. Before releasing the project, technicians usually build a pre-release environment with the same configuration as the production environment to conduct comprehensive system testing of the project in the pre-release environment.

[0003] However, since the pre-release environment is only used for testing when the project enters the pre-release stage, the resources in the pre-release environment are idle most of the time during the entire development cycle, and the resource utilization rate is low. Due to the high cost of resources, resources that are not used for a long time in the pre-release environment will waste a lot of costs, resulting in a high cost for setting up the pre-release environment. Therefore, how to build a pre-release environment at a low cost is a technical problem that needs to be solved. Summary of the invention

[0004] The embodiments of the present application provide a resource reuse method and a computer program product, which can reduce the idle rate of device resources in a pre-release environment and improve the utilization rate of device resources.

[0005] According to one aspect of an embodiment of the present application, a resource reuse method is provided, which is applied to a device cluster, wherein the device cluster is deployed with a production environment and a pre-release environment, and the production environment and the pre-release environment share an access layer and a gateway device in the device cluster, and the method includes:

[0006] Sending a data processing request to the gateway device through the access layer, where the data processing request carries domain name information, where the domain name information is used to indicate an environment to be accessed, where the environment to be accessed is the production environment or the pre-release environment;

[0007] In a case where the environment indicated by the domain name information is the pre-release environment, forwarding the data processing request to a business service interface in the pre-release environment through the gateway device, the business service interface being used to access a business service provided by a server in the device cluster;

[0008] The business service accessed through the business service interface processes the data processing request.

[0009] According to another aspect of an embodiment of the present application, a chip is provided, the chip comprising a programmable logic circuit, and when the chip runs on a device cluster, the chip is used to implement the resource reuse method described in the above aspect.

[0010] According to another aspect of an embodiment of the present application, a computer-readable storage medium is provided, wherein the storage medium stores at least one program code, and the at least one program code is used to be executed by a processor to implement the resource reuse method as described in the above aspects.

[0011] According to another aspect of an embodiment of the present application, a computer program product is provided. The computer program product stores at least one program code, and the at least one program code is used to be executed by a processor to implement the resource reuse method described in the above aspect.

[0012] The embodiment of the present application provides a resource reuse solution, which can deploy a pre-release environment in the device cluster by reusing some device resources in the production environment deployed in the device cluster, such as the access layer, gateway devices, etc., and route data processing requests according to domain name information through the access layer and gateway devices, thereby routing data processing requests from different environments to the business service interface of the corresponding environment for processing, thereby realizing the deployment of isolated production environments and pre-release environments in the device cluster. Compared with using additional device resources to build a pre-release environment, the above method can not only save the equipment cost of building a pre-release environment, realize low-cost construction of the pre-release environment, but also reduce the idle rate of device resources in the pre-release environment, and improve the utilization rate of device resources. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0014] Figure 1 It is a schematic diagram of an implementation environment of a resource reuse method provided in an embodiment of the present application;

[0015] Figure 2 is a flow chart of a resource reuse method provided in an embodiment of the present application;

[0016] Figure 3 is a flow chart of another resource reuse method provided in an embodiment of the present application;

[0017] Figure 4 It is a schematic diagram of a multiplexing registration center provided in an embodiment of the present application;

[0018] Figure 5 is a schematic diagram of a multiplexing device cluster provided in an embodiment of the present application;

[0019] Figure 6 is a schematic diagram of a multiplexed database provided in an embodiment of the present application;

[0020] Figure 7 It is a schematic diagram of a multiplexed message queue provided in an embodiment of the present application;

[0021] Figure 8 It is a structural block diagram of a server provided in an embodiment of the present application. DETAILED DESCRIPTION

[0022] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.

[0023] In this article, "at least one" means one or more, and "plurality" means two or more. "And / or" describes the association relationship of the associated objects, indicating that three relationships can exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the associated objects are in an "or" relationship.

[0024] It should be noted that the information (including but not limited to user device information, user personal information, etc.), data (including but not limited to data used for analysis, stored data, displayed data, etc.) and signals involved in this application are all authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions. For example, the domain name information and call information involved in this application are all obtained with full authorization.

[0025] Figure 1 Schematic diagram of an implementation environment of a resource reuse method provided in an embodiment of the present application. Figure 1 The implementation environment includes a terminal 101 and a device cluster 102. The terminal 101 is connected to the device cluster 102 via a wired network or a wireless network. The device cluster 102 includes an access layer, a gateway device, and a server.

[0026] In some embodiments, the terminal 101 can be a variety of terminals such as a smart phone, a desktop computer, a laptop computer, a tablet computer, etc. Taking the project development scenario as an example, before the project is officially released, the tester can test the project to be released in the pre-release environment through the human-computer interaction interface provided by the terminal 101. After the project passes the test, the project can be released to the production environment. At this time, the user can use the various functions of the project in the production environment through the human-computer interaction interface provided by the terminal 101. Optionally, the equipment configuration of the pre-release environment and the production environment is the same, so that various problems that may arise after the project is released can be checked as much as possible during the test process.

[0027] Accordingly, the device cluster 102 is deployed with a production environment and a pre-release environment. The production environment and the pre-release environment share the access layer, gateway device, and server in the device cluster. When the tester accesses the pre-release environment through the domain name of the pre-release environment, the terminal 101 can send a data processing request carrying the domain name information to the access layer of the device cluster 102, and the access layer sends the data processing request to the gateway device. The gateway device forwards the data processing request to the pre-release environment for processing based on the domain name information.

[0028] When a user accesses the production environment through the domain name of the production environment, the terminal 101 can send a data processing request carrying the domain name information to the access layer of the device cluster 102, and the access layer sends the data processing request to the gateway device. The gateway device can forward the data processing request to the production environment for processing based on the domain name information. Among them, the pre-release environment and the production environment share the computing resources of the device cluster 102, such as servers, GPUs (Graphics Processing Units, graphics processors), etc.

[0029] In some embodiments, the server in the device cluster 102 is an independent physical server, or it can be a server cluster or distributed system composed of multiple physical servers. It can also be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), as well as big data and artificial intelligence platforms. The embodiments of the present application do not limit this.

[0030] Figure 2 is a flow chart of a resource reuse method provided in an embodiment of the present application. The method is executed by a device cluster, see Figure 2 , the method comprising:

[0031] 201. Send a data processing request to a gateway device through an access layer. The data processing request carries domain name information. The domain name information is used to indicate an environment to be accessed.

[0032] In an embodiment of the present application, a production environment and a pre-release environment are deployed in a device cluster. The production environment and the pre-release environment share the access layer and gateway devices in the device cluster. Among them, the production environment refers to the environment in which the program is officially released after the program passes systematic and comprehensive testing. The production environment is for users who use the program. The pre-release environment refers to an environment in which the program is tested before it is released. The pre-release environment is for testers. The pre-release environment has the same machine configuration as the production environment, and the pre-release environment can simulate the real production environment as much as possible, so that during the testing process, various problems that may arise after the program is released can be checked as much as possible, thereby ensuring that the program can run stably after it goes online.

[0033] A program is a computer program in the development cycle. The development cycle of a program usually includes the development phase, the testing phase, the pre-release phase, etc. In the development phase, R&D personnel code, debug, and self-test the program in the development environment. After entering the testing phase, the program is deployed to the testing environment, where testers conduct comprehensive testing of the program. Before releasing the program to the production environment, that is, before the program is officially launched, testers can also conduct further testing of the program in the pre-release phase to ensure the stability of the program after it is launched.

[0034] The following uses the scenario of testing a program in the pre-release stage as an example to illustrate the data communication process between multiple devices in a device cluster.

[0035] In the pre-release stage of the program, testers can access the pre-release environment through the terminal to perform multiple test operations in the pre-release environment. During the test process, in response to any test operation, the terminal sends a data processing request to the access layer, and the data processing request is used to indicate the execution of the test instructions corresponding to the test operation, such as resource download instructions, resource upload instructions, resource verification instructions, etc. Among them, the data processing request usually carries domain name information, and the domain name information can indicate the environment to be accessed, such as the production environment, pre-release environment, etc. The access layer sends the data processing request to the gateway device, and the gateway device forwards the data processing request to the corresponding environment for processing according to the domain name information and routing rules.

[0036] Optionally, the domain name information is related to the environment accessed by the terminal. For example, when the terminal accesses the pre-release environment through the domain name of the pre-release environment, the environment indicated by the domain name information is the pre-release environment. When the terminal accesses the production environment through the domain name of the production environment, the environment indicated by the domain name information is the production environment.

[0037] 202. When the environment indicated by the domain name information is a pre-release environment, forward the data processing request to the business service interface in the pre-release environment through a gateway device.

[0038] In an embodiment of the present application, if the environment indicated by the domain name information is a pre-release environment, the gateway device forwards the data processing request to the business service interface in the pre-release environment. The business service interface is connected to the business services provided by the server in the device cluster. The business services provided by the server in the device cluster include but are not limited to: resource download service, resource upload service, resource verification service, resource update service, etc.

[0039] 203. The business service accessed through the business service interface processes the data processing request.

[0040] In an embodiment of the present application, after receiving a data processing request, the business service interface can process the data processing request through the business service to which it is connected. For example, if the data processing request is a resource verification request, the business service interface can verify the resource to be verified through the resource verification service provided by the server. Optionally, the business service interface can also return the processing result of the data processing request to the terminal through the gateway device and the access layer, and the terminal displays the processing result.

[0041] The embodiment of the present application provides a resource reuse method, which can deploy a pre-release environment in the device cluster by reusing some device resources in the production environment deployed in the device cluster, such as the access layer, gateway devices, etc., and route data processing requests according to domain name information through the access layer and gateway devices, thereby routing data processing requests from different environments to the business service interface of the corresponding environment for processing, thereby realizing the deployment of isolated production environments and pre-release environments in the device cluster. Compared with using additional device resources to build a pre-release environment, the above method can not only save the equipment cost of building a pre-release environment, realize low-cost construction of the pre-release environment, but also reduce the idle rate of device resources in the pre-release environment, and improve the utilization rate of device resources.

[0042] Figure 3 is a flow chart of another resource reuse method provided in an embodiment of the present application. The method is executed by a device cluster, see Figure 3 , the method comprising:

[0043] 301. Send a data processing request to a gateway device through an access layer. The data processing request carries domain name information, and the domain name information is used to indicate an environment to be accessed.

[0044] In the embodiment of the present application, during the pre-release stage of the program, the technician can deploy the pre-release environment in the device cluster where the production environment is deployed. The pre-release environment is isolated from the production environment. The production environment and the pre-release environment share the access layer, gateway devices, etc. in the device cluster. The technician can access different environments through different domain names, thereby isolating the pre-release environment from the production environment.

[0045] The access layer in the device cluster refers to the entrance for user devices to access the network. In other words, the access layer can connect user devices to the network. Optionally, the access layer may include devices such as switches and wireless access points. User devices may be terminals such as mobile phones and computers. The gateway device in the device cluster is used to connect multiple different networks. The gateway device can route data to nodes in different networks according to routing rules, thereby realizing data communication between networks.

[0046] In response to a data processing request from any terminal, the access layer sends the data processing request to the gateway device, which routes the data processing request to the corresponding environment for processing. The domain name information carried in the data processing request can indicate the environment to be accessed. For example, if the domain name information indicates a production environment, the network device routes the data processing request to the production environment information processing. If the domain name information indicates a pre-release environment, the network device routes the data processing request to the pre-release environment information processing.

[0047] Optionally, the domain name information includes a domain name, such as a domain name of a production environment and a domain name of a pre-release environment. Or the domain name information includes a label, and the label is used to indicate the environment to be accessed. For example, when the label is prod, the environment to be accessed is the production environment, and when the label is pre, the environment to be accessed is the pre-release environment.

[0048] 302. When the environment indicated by the domain name information is a pre-release environment, query the first node for call information of the target interface based on the interface identifier carried in the data processing request through the gateway device.

[0049] In an embodiment of the present application, the data processing request also carries an interface identifier. The interface identifier is used to represent the target interface to be called among multiple business service interfaces. Among them, the business service interface is connected to the business service provided by the server in the device cluster. The business service interface can be called a business API (Application Programming Interface). Both the production environment and the pre-release environment include multiple business service interfaces. The business service interface in the production environment can be called a production business API, and the business service interface in the pre-release environment can be called a pre-release business API. The business service interface in the production environment and the business service interface in the pre-release environment are not exactly the same. For example, the pre-release environment includes business service interfaces corresponding to business services that have not yet been launched.

[0050] After the gateway device receives the data processing request, the gateway device parses the data processing request to obtain the domain name information and interface identifier carried by the data processing request. In the case where the environment indicated by the domain name information carried by the data processing request is a pre-release environment, the gateway device queries the call information of the target interface represented by the interface identifier in the first node. Among them, the first node is a registered node in the registration center. The first node is used to record the call information of multiple business service interfaces in the pre-release environment. The call information includes at least one of an IP address, a port, and a call method. By querying the call information of the target interface in the registered node, the call information of the target interface can be determined more quickly and accurately, and then the gateway device can call the target interface according to the call information, thereby realizing the processing of data processing requests through the business service accessed by the target interface, and improving data processing efficiency.

[0051] In some embodiments, the first node is a node in the registration center corresponding to the pre-release environment. Among them, the registration center is a middleware, and the registration center is used to record the call information of the business service interface through the node. The production environment and the pre-release environment can share the same registration center. Correspondingly, the registration center also includes a second node. The second node is a node corresponding to the production environment, and the second node is used to record the call information of multiple business service interfaces in the production environment. By using different nodes in the registration center to record the call information of the business service interfaces in different environments, it is possible to ensure that the call information of the business service interfaces in different environments are isolated from each other while realizing that the pre-release environment and the production environment share the registration center. Since the machine resource configuration required by middleware services such as the registration center is relatively high and the resource cost is also high, by reusing the registration center, the machine resources consumed by configuring the registration center separately for the pre-release environment can be saved, further reducing the cost of building the pre-release environment.

[0052] Optionally, the registration center is zookeeper. Zookeeper can provide open source distributed configuration services, synchronization services and naming registration for large-scale distributed computing. For example, zookeeper can act as a registration center. Zookeeper is used to register services through zk nodes. Service providers can register the call information of business service interfaces on the zk node in zookeeper, and then service consumers can call the corresponding business service interface based on the call information obtained in the zk node.

[0053] Figure 4 Schematic diagram of a multiplexing registration center provided in an embodiment of the present application. Figure 4As shown, the registration center includes a first node "pre" and a second node "prod". The first node and the second node are connected to the same root node. The first node corresponds to the pre-release environment, and the first node records the call information of multiple business service interfaces and the call information of multiple remote services in the pre-release environment. The second node corresponds to the production environment, and the second node records the call information of multiple business service interfaces and the call information of multiple remote services in the production environment.

[0054] Among them, the remote service is the RPC (Remote Procedure Call) service. In the microservice architecture, RPC is used to communicate between different microservices. RPC allows one microservice to call another microservice. RPC service is a microservice that can be called remotely. In an embodiment of the present application, by registering the call information of multiple microservices in the node of the registration center, mutual discovery between microservices can be achieved, and then mutual calls between microservices can be achieved based on the call information of the microservices. For example, the business service interface can query the call information of the remote service in the node, and call the remote service based on the call information.

[0055] 303. Forward the data processing request to the target interface based on the call information through the gateway device.

[0056] In an embodiment of the present application, after the gateway device obtains the call information of the target interface through the registration center, the grid device routes the data processing request to the target interface based on the call information. Optionally, in the case where the call information includes an IP address, the gateway device determines the next hop corresponding to the IP address by querying the routing table, and then the gateway device forwards the data processing request to the next hop. Wherein, the next hop refers to the next network node to which the data leaves the current network node when it is routed and forwarded in the network. The next hop can be a network node directly connected to the gateway device, or it can be a farther network node. For example, the next hop can be the target interface, or it can be an intermediate gateway device, such as a router, a switch, etc., which is not limited in the embodiment of the present application. If the next hop is an intermediate gateway device, the intermediate gateway device can continue to forward the data processing request according to the routing table until the data processing request reaches the target interface.

[0057] 304. The business service accessed through the target interface processes the data processing request.

[0058] In the embodiment of the present application, after the target interface receives the data processing request, the target interface processes the data processing request by calling the accessed business service.

[0059] For example, the data processing request is a resource upload request, the target interface is a resource upload interface, and the target interface is connected to a resource upload service provided by a server. The target interface can upload the corresponding resource in the server by calling the resource upload service. Optionally, the target interface can also return the processing result of the data processing request to the terminal through the gateway device and the access layer, and the terminal displays the processing result. For example, the processing result includes upload success and upload failure.

[0060] In some embodiments, the target interface can also process data processing requests by calling a remote service. The remote service is an RPC service. Accordingly, the target interface can query the call information of the remote service in the first node. Then, based on the call information, the target interface sends a data processing request to the remote service. In response to the data processing request, the remote service processes the data processing request. By supporting microservices to query the call information of other microservices in the node of the registration center, mutual discovery and mutual calling between microservices can be achieved, which simplifies the calling process between microservices and improves data processing efficiency.

[0061] The above embodiment mainly introduces the process of sending the data processing request of the terminal to the corresponding environment for processing through the access layer and gateway devices in the device cluster. Figure 5 The schematic diagram of a multiplexing device cluster is shown to illustrate the above process. Figure 5 As shown, the device cluster includes an access layer and a gateway device. Through the same set of access layers and gateway devices in the device cluster, two sets of environments can be compatible. When the terminal accesses the production environment through the domain name of the production environment, the data processing request of the terminal can be forwarded to the production environment and processed by the production business API in the production environment. When the terminal accesses the pre-release environment through the domain name of the pre-release environment, the data processing request of the terminal can be forwarded to the pre-release environment and processed by the pre-release business API in the pre-release environment. In addition, in the process of the gateway device forwarding the data processing request to the business API and the mutual calls between microservices, the gateway device and the microservice can query the call information in the registration center to implement the routing of the data processing request according to the call information.

[0062] The above embodiments mainly introduce the process in which the production environment and the pre-release environment share the access layer, gateway device and server in the equipment cluster. In some embodiments, the production environment and the pre-release environment can also share the same database. Among them, the database includes a first area and a second area that are isolated from each other. The first area is used to store data of the production environment, and the second area is used to store data of the pre-release environment. Correspondingly, in the case where the data processing request is a data read and write request, the business service interface can execute the read instruction or write instruction indicated by the data read and write request in the second area of ​​the database according to the accessed business service, that is, read or write the corresponding data in the second area. By storing the data of the production environment and the data of the pre-release environment in different areas of the database, it is possible to achieve the reuse of the database while ensuring that the data of different environments are isolated from each other, thereby avoiding the impact of data read and write operations in the pre-release environment on the data of the production environment.

[0063] In some embodiments, the database is used to store data in the form of key-value pairs. Optionally, the database may be Redis (a memory-based non-relational database). The key-value pairs stored in the first area have a first label, and the key-value pairs stored in the second area have a second label. The first label is used to identify the production environment, and the second label is used to identify the pre-release environment. The first label and the second label may be prefix labels of the key-value pairs. For example, if the first label is prod and the second label is pre, the key-value pairs stored in the first area may be prod::key-value, and the key-value pairs stored in the second area may be pre::key-value. By adding prefix labels to the key-value pairs stored in different areas of the database, data in different environments can be identified by the prefix labels, thereby isolating the data of the production environment and the data of the pre-release environment in the database.

[0064] In some embodiments, when a data read / write request is used to indicate writing of target data, the business service interface can write a key-value pair with a second tag in the second area according to the accessed business service, and the key-value pair is used to store the target data. Alternatively, when a data read / write request is used to indicate reading of target data, the business service interface can read a key-value pair with a second tag in the second area according to the accessed business service, and the key-value pair stores the target data. By reading or writing key-value pairs with prefix tags in different areas of the database, data in different environments can be quickly written or searched in the database, thereby improving the efficiency of data reading and writing.

[0065] Figure 6 Schematic diagram of a multiplexed database provided in an embodiment of the present application. Figure 6As shown, clients in the production environment can read or write key-value pairs with the prefix "prod" in the database. Clients in the pre-release environment can read or write key-value pairs with the prefix "pre" in the database. It should be noted that in the above data reading and writing process, data usually needs to be transferred through the device cluster, that is, the client usually cannot directly communicate with the database.

[0066] In some embodiments, the production environment and the pre-release environment can also share the same message queue. Among them, the message queue (Message Queue, MQ) is also a middleware for implementing asynchronous message delivery. In the message queue, different types of messages published by producers are usually stored through topics. Correspondingly, consumers can read the corresponding messages in the subscribed topics for processing. Among them, the producer is also the application, microservice, etc. that publishes messages in the message queue. The consumer is also the application, microservice, etc. that reads messages in the message queue.

[0067] When the production environment and the pre-release environment share the same message queue, the message queue can store messages in the message type associated with the production environment (prod-topic) and the message type associated with the pre-release environment (pre-topic). Among them, prod-topic is used to store messages published by producers in the production environment, so that consumers in the production environment can execute corresponding instructions based on the messages in the subscribed prod-topic. Pre-topic is used to store messages published by producers in the pre-release environment, so that consumers in the pre-release environment can execute corresponding instructions based on the messages in the subscribed pre-topic.

[0068] Figure 7 Schematic diagram of a multiplexed message queue provided in an embodiment of the present application. Figure 7 As shown, the message queue includes message type 1 and message type 2. Among them, message type 1 is prod-topic, that is, the topic associated with the production environment. Message type 2 is pre-topic, that is, the topic associated with the pre-release environment. Producers in the production environment publish messages in message type 1 so that consumers in the production environment can read messages in message type 1. Producers in the pre-release environment publish messages in message type 2 so that consumers in the pre-release environment can read messages in message type 2.

[0069] In the case where the business service accessed by the above-mentioned business service interface is a consumer, the business service interface can process data processing requests based on the updated messages in the subscribed pre-topic. Among them, the message is used to represent at least one piece of data or at least one condition required to process the data processing request. In the case where the business service accessed by the business service interface is a producer, after the business service interface completes the processing of the data processing request, it can publish a message in the pre-topic corresponding to the business service, and the message is used to indicate the processing result of the data processing request. By storing messages from different environments in different topics of the message queue, it is possible to achieve that the production environment and the pre-release environment share the same message queue while ensuring that messages from different environments are isolated from each other.

[0070] For example, data processing request 1 is a resource verification request, and the resource verification service accessed by the resource verification interface is a producer. After the resource to be uploaded passes the verification, the resource verification interface can publish the verification result of "resource passed verification" in the pre-topic. Data processing request 2 is a resource upload request, and the resource upload service accessed by the resource upload interface is a consumer. The resource upload interface obtains the resource verification result in the pre-topic. When the verification result is "resource passed verification", the resource upload interface can upload the resource, thereby avoiding uploading resources that have not passed the verification.

[0071] It should be noted that the above embodiments mainly introduce how to build a pre-release environment in the pre-release stage of the program by reusing the access layer and gateway devices in the device cluster as well as the registration center, database, message queue and other middleware, so as to realize the deployment of the pre-release environment in the device cluster where the production environment is deployed. In some embodiments, in the process of deploying the pre-release environment, microservices, namely business APIs and RPC services, can be dynamically deployed and destroyed in the pre-release environment according to the testing requirements of different business versions, so as to realize the ready-to-use pre-release environment, ensure that the above microservices only occupy resources in the pre-release stage, and save resource costs.

[0072] Optionally, in the process of deploying and destroying microservices, multiple microservices can be deployed or destroyed in batches through containerization technology. In addition, containerization technology can also orchestrate the release and destruction order of microservices, thereby improving the efficiency of building a pre-release environment. For example, after orchestration, you can first release 3 microservices with one click, and then release 4 microservices with one click. The 4 microservices released later may depend on the deployment of the first 3 microservices.

[0073] For example, if the development cycle of a project is 30 days, one week is used for project requirements preparation, two weeks for project development, and one week for project testing. The pre-release environment is used for about 3 days in 30 days. Therefore, compared with using dedicated machine resources to build a pre-release environment, the resource cost saved by this solution in one month is approximately the sum of the machine resource costs generated by access services, public gateway services, and middleware services in 27 days, which significantly reduces the resource cost of building a pre-release environment.

[0074] The embodiment of the present application provides a resource reuse method, which can deploy a pre-release environment in a device cluster by reusing some device resources in the production environment deployed in the device cluster, such as the access layer, gateway devices, etc., in the pre-release stage of the program, and route data processing requests according to domain name information through the access layer and gateway devices, thereby routing data processing requests from different environments to the business service interface of the corresponding environment for processing, thereby realizing the deployment of isolated production environments and pre-release environments in the device cluster. Compared with using additional device resources to build a pre-release environment, the above method can not only save the equipment cost of building a pre-release environment, realize low-cost construction of the pre-release environment, but also reduce the idle rate of device resources in the pre-release environment, and improve the utilization rate of device resources.

[0075] All the above optional technical solutions can be arbitrarily combined to form optional embodiments of the present application, which will not be described one by one here.

[0076] The embodiment of the present application provides a device cluster, which includes an access layer, a gateway device and a server. The access layer is used to send a data processing request to the gateway device in response to the data processing request. The gateway device is used to forward the data processing request to the business service interface. The business service interface is connected to a business service provided by the server. The business service interface can process the data processing request through the business service provided by the server.

[0077] Figure 8 800 is a structural block diagram of a server provided in an embodiment of the present application. In some embodiments, the server 800 is a server such as a smart phone, a tablet computer, a wearable device, etc. that can access a wireless local area network as a wireless station. The server 800 in the present application includes at least one or more of the following components: a processor 810, a memory 820, and at least two wireless links 830.

[0078] In some embodiments, the processor 810 includes one or more processing cores. The processor 810 uses various interfaces and lines to connect various parts of the entire server 800, and executes various functions and processes data of the server 800 by running or executing program codes stored in the memory 820, and calling data stored in the memory 820. In some embodiments, the processor 810 is implemented in at least one hardware form of digital signal processing (DSP), field-programmable gate array (FPGA), and programmable logic array (PLA). The processor 810 can integrate one or more combinations of a central processing unit (CPU), a graphics processing unit (GPU), a neural network processor (NPU), and a modem. Among them, the CPU mainly processes the operating system, user interface, and application programs; the GPU is responsible for rendering and drawing the content that needs to be displayed on the display screen; the NPU is used to implement artificial intelligence (AI) functions; and the modem is used to process wireless communications. It is understandable that the above-mentioned modem may not be integrated into the processor 810, but may be implemented by a separate chip.

[0079] In some embodiments, the processor 810 is used to control the working conditions of at least two wireless links 830. Accordingly, the processor 810 is a processor integrated with a wireless fidelity (Wireless Fidelity, Wi-Fi) chip. The Wi-Fi chip is a chip with dual Wi-Fi processing capabilities. For example, the Wi-Fi chip is a dual-band dual concurrent (Dual Band Dual Concurrent, DBDC) chip, or a dual-band synchronous (Dual Band Simultaneous, DBS) chip, etc.

[0080] In some embodiments, the memory 820 includes a random access memory (RAM), and in some embodiments, the memory 820 includes a read-only memory (ROM). In some embodiments, the memory 820 includes a non-transitory computer-readable storage medium. The memory 820 can be used to store program codes. The memory 820 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the following various method embodiments, etc.; the data storage area may store data (such as audio data, a phone book) created according to the use of the server 800, etc.

[0081] In some embodiments, the memory 820 stores reception schemes for receiving beacon frames of different wireless links 830, as well as identifiers of access nodes connected to different wireless links 830, identifiers of wireless links 830, and the like.

[0082] The at least two wireless links 830 are used to connect different access points (APs) to receive downlink data sent by the APs, wherein the different access points are access points in the same router or access points in different routers.

[0083] In addition, those skilled in the art will understand that the structure of the server 800 shown in the above-mentioned figures does not constitute a limitation on the server 800. The server 800 includes more or fewer components than shown in the figures, or a combination of certain components, or a different arrangement of components, and the embodiments of the present application do not limit this.

[0084] The present application also provides a computer-readable storage medium, which stores at least one program code, and the at least one program code is loaded and executed by the processor to implement the resource reuse method shown in the above embodiments.

[0085] The present application also provides a chip, which includes a programmable logic circuit. When the chip runs on a device cluster, it is used to implement the resource reuse method shown in the above embodiments.

[0086] The present application also provides a computer program product, which stores at least one program code, and the at least one program code is used to be executed by a processor to implement the resource reuse method shown in the above embodiments.

[0087] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0088] Those skilled in the art can understand that all or part of the steps in the resource reuse method of the above embodiment can be completed by hardware, or by a program to instruct the relevant hardware to complete, and the program can be stored in a computer-readable storage medium, and the storage medium mentioned above can be a read-only memory, a disk or an optical disk, etc. The above is only an optional embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.

Claims

1. A resource reuse method, characterized in that: Applied to a device cluster, the device cluster is deployed with a production environment and a pre-release environment, the production environment and the pre-release environment share an access layer and a gateway device in the device cluster, the method includes: Sending a data processing request to the gateway device through the access layer, wherein the data processing request carries domain name information, and the domain name information is used to indicate the environment to be accessed, wherein the environment to be accessed is the production environment or the pre-release environment; In a case where the environment indicated by the domain name information is the pre-release environment, forwarding the data processing request to a business service interface in the pre-release environment through the gateway device, the business service interface being used to access a business service provided by a server in the device cluster; The business service accessed through the business service interface processes the data processing request.

2. The method according to claim 1, characterized in that: The data processing request also carries an interface identifier, and the interface identifier is used to indicate the target interface to be called; When the environment indicated by the domain name information is the pre-release environment, forwarding the data processing request to the business service interface in the pre-release environment through the gateway device includes: In a case where the environment indicated by the domain name information is the pre-release environment, querying the call information of the target interface in a first node based on the interface identifier through the gateway device, the first node being used to record the call information of multiple business service interfaces in the pre-release environment, the call information including at least one of an IP address, a port, and a call mode; The data processing request is forwarded to the target interface based on the calling information through the gateway device.

3. The method according to claim 2, characterized in that The first node is a node in the registration center corresponding to the pre-release environment, and the registration center is used to record the call information of the business service interface through the node. The registration center also includes a second node, and the second node is a node corresponding to the production environment. The second node is used to record the call information of multiple business service interfaces in the production environment.

4. The method according to claim 3, characterized in that The first node is also used to record the call information of multiple remote services in the pre-release environment; The business service accessed through the business service interface processes the data processing request, including: In a case where the target interface processes the data processing request by calling a remote service, querying the first node for calling information of the remote service through the target interface; Sending the data processing request to the remote service based on the call information through the target interface; The data processing request is processed based on the remote service.

5. The method according to claim 1, characterized in that The production environment and the pre-release environment share the same database, the database includes a first area and a second area isolated from each other, the first area is used to store data of the production environment, and the second area is used to store data of the pre-release environment; The business service accessed through the business service interface processes the data processing request, including: In the case where the data processing request is a data read / write request, the business service accessed through the business service interface executes a read instruction or a write instruction indicated by the data read / write request in the second area of ​​the database.

6. The method according to claim 5, characterized in that The database is used to store data in the form of key-value pairs, the key-value pairs stored in the first area have a first label, the key-value pairs stored in the second area have a second label, the first label is used to identify the production environment, and the second label is used to identify the pre-release environment.

7. The method according to claim 6, characterized in that The executing the read instruction or the write instruction indicated by the data read / write request in the second area of ​​the database comprises: In the case where the data read / write request is used to indicate writing target data, a key-value pair having the second tag is written into the second area, the key-value pair being used to store the target data; or In a case where the data read / write request is used to instruct to read target data, a key-value pair with the second tag is read in the second area, and the key-value pair is used to store the target data.

8. The method according to claim 1, characterized in that The production environment and the pre-release environment share the same message queue, and the message queue is used to store messages published by producers under multiple message types, so that consumers can execute corresponding instructions based on messages in subscribed message types; The business service accessed through the business service interface processes the data processing request, including: In the case where the business service accessed by the business service interface is a consumer, the data processing request is processed based on an updated message in a message type subscribed by the business service, the message type subscribed by the business service is a message type associated with the pre-release environment, and the message is used to represent at least one piece of data or at least one condition required to process the data processing request.

9. The method according to claim 8, characterized in that The method further comprises: In the case where the business service accessed by the business service interface is a producer, after processing the data processing request, a message is published in the message type corresponding to the business service, and the message is used to indicate the processing result of the data processing request.

10. A computer program product, comprising a computer program, characterized in that The computer program product stores at least one program code, and the at least one program code is used to be executed by a processor to implement the resource reuse method according to any one of claims 1 to 9.