Resource access method, device, medium and robot
By selecting the target channel domain name in robots and user terminals and dynamically allocating business domain names, the problems of network channel blocking and domain name hijacking are solved, and the resource access success rate and user experience are improved.
Patent Information
- Application Number
- CN202210406807.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-18
- Publication Date
- 2024-09-03
- Estimated Expiration
- 2042-04-18
AI Technical Summary
When robots and user terminals access the network resources of the backend server, there is a risk of network channel blocking and domain name being hijacked, resulting in a low resource access success rate and poor user experience.
By selecting the target channel domain name from at least two alternative channel domain names, sending a resource access request to the backend server, and performing resource access based on the target business domain name in the feedback access response data, the business domain name is dynamically allocated to reduce network channel congestion and domain name Hijacking risk.
It improves the success rate of resource access, reduces the risk of network channel blocking and the possibility of domain name being hijacked, thereby improving user experience.
Smart Images

Figure CN114827283B
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of computer application technology, and in particular, to a resource access method, device, medium and robot. Background Art
[0002] With the continuous development of artificial intelligence technology, more and more robots have entered the market to replace humans in providing services. The types of robots are increasing, and the business types are becoming increasingly complex, covering a variety of service scenarios such as catering services, hotel services, medical services, and home services.
[0003] In the process of providing services, robots often need to access network resources in the background server. In addition, user terminals such as mobile phones or tablets used to manage and configure robots also need to access network resources in the background server. How to meet the resource access needs of robots and user terminals, reduce the risk of network channel blocking for robots and user terminals, and increase the success rate of resource access for robots and user terminals is of great significance to improving user experience. Summary of the invention
[0004] The embodiments of the present application provide a resource access method, device, medium and robot, which can improve the success rate of resource access, reduce the risk of network channel blocking, and improve user experience.
[0005] In a first aspect, an embodiment of the present application provides a resource access method, the method comprising:
[0006] Selecting a target channel domain name from at least two candidate channel domain names according to a resource access request of a target application;
[0007] Sending the resource access request to a backend server based on the target channel domain name, so that the backend server feeds back access response data for the resource access request;
[0008] The resource access is performed based on the target business domain name in the access response data.
[0009] In a second aspect, an embodiment of the present application provides a resource access device, the device comprising:
[0010] A target channel domain name selection module, used to select a target channel domain name from at least two candidate channel domain names according to a resource access request of a target application;
[0011] A resource access request sending module, used to send the resource access request to a backend server based on the target channel domain name, so that the backend server feeds back access response data for the resource access request;
[0012] The resource access module is used to access resources based on the target business domain name in the access response data.
[0013] In a third aspect, an embodiment of the present application provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the resource access method as described in the embodiment of the present application is implemented.
[0014] In a fourth aspect, an embodiment of the present application provides a robot, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the resource access method as described in the embodiment of the present application when executing the computer program.
[0015] The technical solution provided in the embodiment of the present application selects a target channel domain name from at least two candidate channel domain names according to a resource access request of a target application; sends the resource access request to a background server based on the target channel domain name, so that the background server feeds back access response data for the resource access request; and performs resource access based on the target business domain name in the access response data. The embodiment of the present application uses the channel domain name to obtain the business domain name, and realizes the dynamic allocation of the business domain name to the target application, so that the target application can access resources based on the business domain name, reducing the risk of network channel congestion and the risk of domain name hijacking, and improving the success rate of resource access, thereby improving the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 is a flow chart of a resource access method provided in Example 1 of the present application;
[0017] Figure 2 is a flowchart of another resource access method provided in Embodiment 2 of the present application;
[0018] Figure 3 This is a flowchart of another resource access method provided in Embodiment 3 of the present application;
[0019] Figure 4 It is a structural diagram of a resource access device provided in Embodiment 4 of the present application;
[0020] Figure 5 This is a schematic diagram of the structure of a robot provided in Example 6 of the present application. DETAILED DESCRIPTION
[0021] The present application 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 application, rather than to limit the present application. It should also be noted that, for ease of description, only the parts related to the present application, rather than all structures, are shown in the accompanying drawings.
[0022] It should be mentioned before discussing the exemplary embodiments in more detail that some exemplary embodiments are described as processes or methods depicted as flow charts. Although the flow charts describe the steps as sequential processes, many of the steps therein can be implemented in parallel, concurrently or simultaneously. In addition, the order of the steps can be rearranged. The process can be terminated when its operation is completed, but can also have additional steps not included in the accompanying drawings. The process can correspond to a method, function, procedure, subroutine, subprogram, etc.
[0023] Embodiment 1
[0024] Figure 1 This is a flow chart of a resource access method provided in the first embodiment of the present application. This embodiment is applicable to the case where a client device accesses resources on a backend server. The method can be executed by a resource access device provided in the embodiment of the present application. The device can be implemented by software and / or hardware and can be integrated into a terminal running the system, such as a mobile phone, tablet computer, computer, robot, etc.
[0025] like Figure 1 As shown, the resource access method includes:
[0026] S110. Select a target channel domain name from at least two candidate channel domain names according to a resource access request of a target application.
[0027] The resource access request is used to request network resources from the backend server for the target application. The target application may be a service business program configured in the client device. The client device may be a robot terminal or a user terminal such as a mobile phone or a tablet. The target application is determined according to actual business needs and is not limited here. For example, the service business program may be a medical disinfection program, a catering service program, a file transfer program, etc., such as a food delivery APP for a food delivery robot, a disinfection APP for a disinfection robot, etc. The resource access request may be generated when the target application is started.
[0028] The alternative channel domain name corresponds to the target application. The alternative channel domain name can be initialized and then dynamically updated. The alternative channel domain name is used to request the business domain name from the background server. The business domain name is a resource location identifier of the background server provided to the target application. The target application can access network resources of the background server based on the business domain name. It is worth noting that in this embodiment, the target application does not access resources of the background server based on the alternative channel domain name. The alternative channel domain name is only used to request the business domain name from the background server to obtain the latest business domain name that can be dynamically changed.
[0029] The number of candidate channel domain names is at least two, and the available channel domain names in the candidate channel domain names are the target channel domain names. When the number of available channel domain names in the candidate channel domain names is greater than one, any one of the available channel domain names can be selected as the target channel domain name.
[0030] It is understandable that multiple applications can be configured in the client device at the same time, that is, alternative channel domain names corresponding to different applications can exist in the client device at the same time. The client device selects a target channel domain name from at least two alternative channel domain names according to a resource access request of the target application.
[0031] S120: Send the resource access request to a background server based on the target channel domain name, so that the background server feeds back access response data for the resource access request.
[0032] The client device sends a resource access request to the backend server based on the target channel domain name. The backend server receives the resource access request and feeds back access response data to the client device. The access response data includes the target business domain name. The target application can access resources on the backend server based on the target business domain name. Optionally, after receiving the access response data, the client device stores the target business domain name in the access response data into the memory.
[0033] S130: Access resources based on the target business domain name in the access response data.
[0034] The target application in the client device accesses resources on the backend server according to the target business domain name in the access response data.
[0035] The technical solution provided in the embodiment of the present application selects a target channel domain name from at least two candidate channel domain names according to a resource access request of a target application; sends the resource access request to a background server based on the target channel domain name, so that the background server feeds back access response data for the resource access request; and performs resource access based on the target business domain name in the access response data. The embodiment of the present application uses the channel domain name to obtain the business domain name, and realizes the dynamic allocation of the business domain name to the target application, so that the target application can access resources based on the business domain name, reducing the risk of network channel congestion and the risk of domain name hijacking, and improving the success rate of resource access, thereby improving the user experience.
[0036] In an optional embodiment, in response to receiving a domain name update message pushed by the background server, the alternative channel domain name and / or the target business domain name are updated according to the domain name update message; and / or the alternative channel domain name is updated according to the latest channel domain name in the access response data.
[0037] The domain name update message is generated by the background server and is used to instruct the client device to update the original candidate channel domain name and / or the target service domain name. Optionally, the domain name update message may be generated periodically by the background server, or may be generated when the service domain name and / or the channel domain name changes. The domain name update message may include the latest channel domain name and / or the latest service domain name.
[0038] The client device can update only the original alternative channel domain name or only the original target business domain name, or update both the original alternative channel domain name and the target business domain name according to the domain name update message pushed by the background server. Specifically, whether to update only the original alternative channel domain name, or only the original target business domain name, or to update both the original alternative channel domain name and the target business domain name needs to be determined based on the domain name update information, which is not limited here. Optionally, the background server pushes the domain name update message to the client device via MQTT (Message Queuing Telemetry Transport).
[0039] Optionally, the access response data fed back by the backend server for the resource access request also includes the latest channel domain name. The client device can also update the original candidate channel domain name according to the latest channel domain name in the access response data. And, the client device can update the original target business domain name according to the target business domain name in the access response data.
[0040] The original candidate channel domain name and / or the target service domain name will be updated according to the domain name update information as the first update method for the client device to update the domain name; the original candidate channel domain name will be updated according to the access response data as the second update method for the client device to update the domain name. The first update method and the second update method coexist, and the client device can use only the first update method to update the domain name, or only the second update method to update the domain name, and the client device can also use both the first update method and the second update method to update the domain name.
[0041] The above technical solution provides a domain name update mechanism, which supports the background server to actively push the latest channel domain name and / or the latest business domain name to the client device when the channel domain name and / or the business domain name changes, so that the original alternative channel domain name and / or the target business domain name in the client device can be updated in time, further improving the success rate of resource access.
[0042] Embodiment 2
[0043] Figure 2It is a flow chart of another resource access method provided in Example 2 of the present application. This embodiment is further optimized on the basis of the above-mentioned embodiment. The specific optimization is that, according to the resource access request of the target application, the target channel domain name is selected from at least two alternative channel domain names, including: according to the resource access request of the target application, determining the target configuration file corresponding to the target application; performing availability verification on each of the alternative channel domain names in the target configuration file; and determining the alternative channel domain name that passes the availability verification as the target channel domain name.
[0044] like Figure 2 As shown, the resource access method includes:
[0045] S210. Determine a target configuration file corresponding to the target application according to a resource access request of the target application.
[0046] The target configuration file and the resource access request correspond to the target application respectively, and the target configuration file refers to the configuration file of the target application. The target configuration file and the target application are configured in the client device together. According to the resource access request of the target application, the target configuration file corresponding to the target application is determined.
[0047] Optionally, the target configuration file records the alternative channel domain name, and when the target application in the client device is started, the alternative channel domain name is read from the target configuration file.
[0048] S220: Verify the availability of each of the candidate channel domain names in the target configuration file.
[0049] Changes in business requirements may cause changes in the alternative channel domain names in the backend server. The backend server may abandon, change, or add alternative channel domain names. If the client device does not update the alternative channel domain name in the target configuration file, the alternative channel domain name in the target configuration file may become unavailable.
[0050] Therefore, it is necessary to verify the availability of each alternative channel domain name in the target configuration file to verify whether the alternative channel domain name is available and whether the backend server can be accessed normally based on the alternative channel domain name.
[0051] The availability of the alternative channel domain name is verified. Specifically, the availability of the alternative channel domain name can be verified according to the Internet Protocol address corresponding to the alternative channel domain name, or the availability of the alternative channel domain name can be verified according to the request response data returned by the background server.
[0052] In an optional embodiment, the availability of each of the alternative channel domain names in the target configuration file is verified, including: selecting a channel domain name to be verified from the alternative channel domain names in the target configuration file; based on the channel domain name to be verified, sending a channel verification request to the background server, so that the background server feeds back verification response data for the channel verification request; based on at least one of the data format, response status and data content of the verification response data, the availability of the channel domain name to be verified is verified; if the availability verification fails, returning to the channel domain name selection operation to be verified to reselect the channel domain name to be verified, until the availability of each of the alternative channel domain names is verified. If all alternative channel domain names are unavailable, the target application is upgraded.
[0053] Among them, the domain name of the channel to be verified refers to the domain name of the alternative channel that needs to be verified for availability. The client device sends a channel verification request to the background server based on the domain name of the channel to be verified. The background server feeds back verification response data to the client device in response to the channel verification request. The channel verification request and the verification response data are generated by the client device and the background server respectively. The client device receives the verification response data, and performs availability verification on the domain name of the channel to be verified for at least one of the data format, response status and data content of the verification response data. Specifically, it is determined whether the data format of the verification response data is a preset data format, such as determining whether the verification response data can be successfully parsed. If the data format of the verification response data is not a preset data format, the verification response data cannot be successfully parsed; it can be determined whether the HTTP status code in the verification response data is a set data value, such as 200. If so, it is confirmed that the corresponding channel domain name is available; it can also be determined whether the data content of the verification response data contains the set content.
[0054] Preferably, the data format, response status and data content of the response data are all verified. If at least one of the verifications fails, the domain name of the channel to be verified is at risk of being tampered with, and the availability verification of the domain name of the channel to be verified fails. Otherwise, the availability verification of the domain name of the channel to be verified passes. This ensures the security of data access and avoids the risk of tampering or data leakage.
[0055] If the availability verification of the domain name of the channel to be verified fails, the process returns to the domain name selection operation of the channel to be verified to reselect the domain name of the channel to be verified until the availability of each candidate channel domain name is verified.
[0056] Optionally, the client device generates domain name exception information for the alternative channel domain name that fails the availability verification, and reports the domain name exception information to the background server based on the target channel domain name. Of course, it is understandable that the target business domain name may also be unavailable due to factors such as business changes and domain name hijacking. The above alternative channel domain name availability verification method is also applicable to the availability verification of the target business domain name. If the target business domain name is unavailable, the client device generates domain name exception information for the target business domain name that fails the availability verification, and reports the domain name exception information to the background server based on the target channel domain name. The background server can promptly process the unavailable target business domain name or alternative channel domain name.
[0057] It is worth noting that in order to save computing resources of the client device, if the availability of a channel domain name to be verified is verified, the availability of other candidate channel domain names will not be verified. The candidate channel domain name that has passed the availability verification is directly determined as the target channel domain name.
[0058] The above technical solution provides a verification mechanism for verifying the availability of alternative channel domain names. The above technical solution traverses the alternative channel domain names, verifies the availability of the alternative channels according to the verification response data fed back by the background server, selects the available alternative channel domain names as the target channel domain names, and requests the target business domain name from the background server for the target application based on the target channel domain name, thereby improving the probability of successful resource access.
[0059] In an optional embodiment, the availability of each of the alternative channel domain names in the target configuration file is verified, and the method further includes: querying the Internet Protocol address corresponding to each of the alternative channel domain names at a set time interval; and verifying the availability of the alternative channel domain names based on a preset domain name IP binding relationship.
[0060] Among them, the setting time interval is predetermined according to actual business needs and is not limited here. The client device queries the Internet Protocol address, i.e., the IP address, corresponding to each alternative channel domain name at a set time interval. Specifically, the client may query the Internet Protocol address corresponding to the alternative channel domain name by operating the ping command at a set time interval. The preset domain name IP binding relationship is preset according to actual business needs. The preset domain name IP binding relationship records the mapping relationship between the alternative channel domain name and the Internet Protocol address. The actual Internet Protocol address of each alternative channel domain name queried is matched with the preset Internet Protocol address in the preset domain name IP binding relationship. If the match is successful, the alternative channel domain name availability verification is passed. Otherwise, the alternative channel domain name availability verification fails.
[0061] Considering that the alternative channel domain name is not used for the target application to access resources on the backend server, the alternative channel domain name only involves the sending of business domain names and reporting of abnormal domain names, which occupies very little network traffic and has a very small network bandwidth. Therefore, each alternative channel domain name can be mapped to the same Internet Protocol address. To verify the availability of the alternative channel domain name, the Internet Protocol addresses corresponding to the queried alternative channel domain names are directly matched with each other for similarity, and the availability of the alternative channel domain name is verified based on the similarity matching results between the alternative channel domain names. In the case of mapping each alternative channel domain name to the same Internet Protocol address, if there is an alternative channel domain name with an Internet Protocol address that is different from the Internet Protocol addresses of other alternative channel domain names, it can be determined that the availability verification of the alternative channel domain name has failed, and the alternative channel domain name is at risk of being tampered with.
[0062] The above technical solution provides another method for verifying the availability of alternative channel domain names. The above technical solution verifies the availability of alternative channel domain names based on the Internet Protocol addresses by periodically querying the Internet Protocol addresses corresponding to each alternative channel domain name, and can promptly detect the unavailability of the alternative channel domain name, thereby improving the success rate of resource access.
[0063] S230: Determine the candidate channel domain name that has passed the availability verification as the target channel domain name.
[0064] The client device determines the candidate channel domain name that has passed the availability verification as the target channel domain name, so that the target application can access resources on the backend server based on the target channel domain name.
[0065] S240: Send the resource access request to a background server based on the target channel domain name, so that the background server feeds back access response data for the resource access request.
[0066] The client device sends a resource access request to the backend server based on the target channel domain name. After receiving the resource access request, the backend server feeds back access response data to the client device in response to the resource access request. Optionally, the access response data includes: the target service domain name, and / or the latest channel domain name.
[0067] S250: Access resources based on the target business domain name in the access response data.
[0068] The embodiment of the present application verifies the availability of the candidate channel domain name and selects the target channel domain name. The candidate channel domain name that has passed the availability verification is used as the target channel domain name, and data is exchanged with the backend server based on the target channel domain name, and the target service channel domain name is obtained from the backend server, thereby improving the success rate of resource access.
[0069] Embodiment 3
[0070] Figure 3 It is a flow chart of another resource access method provided in Example 3 of the present application. This embodiment is further optimized on the basis of the above-mentioned embodiment. The specific optimization is to perform resource access based on the target business domain name in the access response data, including: parsing the access response data, extracting a business domain name set from the access response data; wherein the business domain name set includes alternative business domain names and application business identifiers; according to the application business identifier in the resource access request, selecting the target business domain name from the alternative business domain names for the target application; and performing resource access based on the target business domain name.
[0071] like Figure 3 As shown, the resource access method includes:
[0072] S310: Select a target channel domain name from at least two candidate channel domain names according to a resource access request of a target application.
[0073] S320: Send the resource access request to a background server based on the target channel domain name, so that the background server feeds back access response data for the resource access request.
[0074] S330: Parse the access response data, and extract a service domain name set from the access response data.
[0075] The client device parses the access response data fed back by the backend server and extracts a service domain name set from the access response data, wherein the service domain name set includes an alternative service domain name and an application service identifier.
[0076] Optionally, in the service domain name set, the alternative service domain name and the application service identifier exist in the form of a key-value pair to indicate the correspondence between the service service program and the application service identifier. Among them, the application service identifier is the key value, and the alternative service domain name is the value value. The alternative service domain name is used for the service service program to access resources on the background server. The application service identifier is used to identify the application service. Exemplarily, the key-value pair consisting of the alternative service domain name and the application service identifier can be [(catering-simple, https: / / catering.com), (medical-simple, https: / / medical.com), (mobile, https: / / mobile.com), (file, https: / / file.com)]. Among them, the key values are catering-simple, medical-simple, mobile and file, and correspondingly, the value values are https: / / catering.com, https: / / medical.com, https: / / mobile.com and https: / / file.com. Optionally, the application service identifier and the alternative service domain name are in a one-to-one relationship. One application service identifier corresponds to one alternative service domain name, so as to facilitate the management and allocation of the alternative service domain names.
[0077] S340: Select the target service domain name from the candidate service domain names for the target application program according to the application service identifier in the resource access request.
[0078] The client device selects a target business domain name from the candidate business domain names for the target application program according to the application business identifier in the resource access request. Specifically, the client device matches the application business identifier in the resource access request with the application business identifier as the key value in the business domain name set, and determines the candidate business domain name corresponding to the key value that successfully matches as the target business domain name.
[0079] In an optional embodiment, before selecting the target business domain name from the alternative business domain names for the target application based on the application business identifier in the resource access request, the method also includes: determining the current application version information of the target application; and assigning the application business identifier to the target application based on the application version information and application type information.
[0080] In some scenarios, the type of service business program is related to the type of network resources that the service business program needs to access. For example, the type of network resources that a catering service program needs to access is related to catering services, and may be network resources such as a food delivery area map and food delivery announcement voice. The type of network resources that a disinfection service program needs to access is related to disinfection services, and may be a disinfection area map and disinfection announcement voice.
[0081] When the application service type is determined, the network resources that service service programs with different application version information need to access on the background server may be different. For example, if the service service program is a catering service program, when the application version of the catering service program is upgraded from 1.0 to 1.1, a file transfer service is added to the original catering service of the catering service program. Therefore, in addition to allocating a catering service identifier to the 1.1 version of the catering service program, a file transfer identifier can also be allocated to this version of the catering service program.
[0082] The target application is based on a one-to-many relationship based on the application business identifier, that is, a target application can have two or more application business identifiers at the same time. Considering the limitation of domain name resources, the application business identifier can also be assigned to the target application in combination with the business traffic size of the service business program. For a service business program with a small business traffic, it can share an application business identifier with other service business programs, that is, not every service business program has a unique corresponding application business identifier.
[0083] The above technical solution allocates an application business identifier to the target application according to the application version information and application type information, and can flexibly allocate a business domain name to the target application according to actual business needs, thereby improving network channel utilization, reducing network channel congestion, and improving resource access success rate. The above technical solution takes business version information into consideration when allocating an application business identifier to the target application, and can still provide a business domain name for the target application when the target application application version is upgraded, thereby ensuring the resource access success rate.
[0084] S350: Access resources based on the target business domain name.
[0085] The technical solution of the embodiment of the present application selects a business domain name matching the business of the target application program from among the alternative business domain names as the target business domain name according to the application business identifier, and performs resource access based on the target business domain name, thereby improving the success rate of resource access and improving the user experience.
[0086] In a specific embodiment, the target application configured in the client device is started and a resource access request is generated. The client device determines the target configuration file corresponding to the target application according to the resource access request of the target application, and verifies the availability of the alternative channel domain names in the target configuration file. Specifically, a channel domain name to be verified is selected from the alternative channel domain names, and a channel verification request is sent to the background server based on the channel domain name to be verified. If the availability verification passes, the channel domain name to be verified is determined as the target channel domain name, and the availability verification is no longer performed on other alternative channel domain names in the target configuration file. If the availability verification fails, the operation of selecting the channel domain name to be verified is returned to reselect the channel domain name to be verified until the availability of each alternative channel domain name is verified.
[0087] When the target channel domain name is determined, the client device directly sends a resource access request to the background server based on the target channel domain name. The background server processes the received resource access request and feeds back access response data to the client device.
[0088] Exemplarily, the target configuration file includes three alternative channel domain names, namely x.com, y.com and z.com. Select x.com as the channel domain name to be verified to verify the availability of x.com. If x.com is not available, then select one of the remaining alternative channel domain names y.com and z.com as the channel domain name to be verified. For example, select z.com as the channel domain name to be verified. If z.com is available, then use z.com as the target channel domain name. When z.com is determined as the target channel domain name, there is no need to verify the availability of y.com. The client device sends a resource access request to the background server based on z.com.
[0089] Optionally, the client device generates domain name exception information for x.com that fails the availability verification, and reports the domain name exception information about x.com to the background server based on the target channel domain name z.com.
[0090] The target application in the client device accesses resources on the backend server according to the target business domain name in the access response data.
[0091] The resource access method provided in the embodiment of the present application is applicable to multi-machine scenarios, which are illustrated in the following example. For example, user A's store is equipped with 5 client devices, namely, food delivery robots A1 and A2, disinfection robots A3 and A4, and mobile phone A5.
[0092] In the prior art, when A1-A5 access the background data resources, no matter which device, or which specific business data a device wants to access, they all access through the same domain name, such as robot.com. Although this solution using a fixed unique domain name for access is easy to configure, with the development of robot business, the number of robots has increased significantly, and different types of robots have begun to appear. Different types of robots may have the same business or different businesses. This leads to the risk that, with the existing technical solutions, there is a risk of malicious users, such as A5, using fixed domain names to attack user servers, and causing the robot device side, such as A1-A4, to have abnormal network channels; any device downloading or uploading large-volume files will affect the normal background communication of all devices; and when the business expands, the flexibility of the domain name is poor.
[0093] In the technical solution provided in this application, the five client devices in store A can all be installed with service business programs, A1 and A2 are installed with catering service programs, A3 and A4 are installed with disinfection service programs, and A5 is installed with a system docking program. The system docking program can be used for uploading and downloading system files.
[0094] The client devices in store A initially set three candidate channel domain names x.com, y.com and z.com in the configuration file corresponding to the service business program. The processes of A1, A2, A3, A4 and A5 determining the target channel domain name from the candidate channel domain names are independent of each other, that is, the target channel domain names determined by different client devices can be different.
[0095] For example, A1, A2, A3, A4, and A5 can each select any one of the three candidate channel domain names for availability verification. Assuming that x.com and z.com are both available, and y.com is not available, client devices A1 and A2 may verify x.com and z.com respectively after verifying that y.com is not available. A1 determines x.com as the target channel domain name, and A2 determines z.com as the target channel domain name. At the same time, A1 and A2 simultaneously generate domain name anomaly information about y.com. A3, A4, and A5 directly verify that x.com, x.com, and z.com are available, respectively. A3, A4, and A5 determine x.com, x.com, and z.com as the target channel domain names, respectively. Optionally, the background server can determine that y.com is unavailable based on the domain name anomaly information reported by A1, A2, A3, A4, and A5, and judge that y.com is at risk of being hijacked, and perform corresponding processing on y.com, such as abandoning y.com. The backend server can update the alternative channel domain name based on the domain name anomaly information. For example, y.com is removed from the original x.com, y.com and z.com, and the alternative channel domain name in the backend server is updated to x.com and z.com. This application can improve communication security by verifying the availability of the channel domain name. Setting multiple alternative channel domain names at the same time can ensure that the impact on the device side when a certain domain name is at risk of hijacking is reduced. At the same time, the alternative channel domain name can be updated in a timely manner to improve the success rate of obtaining the business domain name.
[0096] When the client devices A1, A2, A3, A4 and A5 have determined the target channel domain name, they send resource access requests to the background server based on the target channel domain name they have determined. The background server feeds back access response data to each client device. Optionally, the access response data includes: the latest alternative channel domain name and a business domain name set. Exemplarily, when the background server replaces y.com with w.com and updates the alternative channel domain names in the background server to x.com, w.com and z.com, the latest alternative channel domain names are x.com, w.com and z.com, and the business domain name set is [(catering-simple, https: / / catering.com), (medical-simple, https: / / medical.com), (mobile, https: / / mobile.com), (file, https: / / file.com)], the client device writes the latest alternative channel domain name in the access response data back to the corresponding configuration file to update the alternative channel domain name in the client device, and the client device writes the business domain name set in the access response data into the cache to update the target business domain name in the client device. The technical solution of the present application adopts the solution of setting a channel domain name to obtain a dynamic business domain name, which effectively solves the problem of domain name expansion and abandonment, avoids the maintenance difficulties caused by hard coding of domain names, and is particularly suitable for multi-type and large-scale service robot application scenarios.
[0097] According to the application version information and application type information of the service business program in each client device of store A, the service business programs in A1, A2, A3, A4 and A5 are assigned application business identifiers. For example, A1 (catering service program 1.0): catering-simple; A2 (catering service program 1.1): catering-simple, file; A3 (disinfection service program 1.0): medical-simple; A4 (disinfection service program 1.0): medical-simple; A5 (web program version 1.0): mobile
[0098] Each client device selects a target business domain name from the alternative business domain names in the business domain name set according to the service business program configured for each of them by the application business identifier. Specifically, the target business domain name corresponding to A1 is https: / / catering.com; the target business domain name corresponding to A2 is https: / / catering.com and https: / / file.com; the target business domain names corresponding to A3 and A4 are both https: / / catering.com; the target business domain name corresponding to A5 is https: / / mobile.com. Each client device accesses resources on the background server based on its own determined target business domain name. In this application, the business domain names used to access the background server are distinguished according to different businesses, which can reduce the blockage of the network channel during access and reduce the impact of large-volume access by a single device. It is also possible to adaptively adjust the bandwidth of the network channel corresponding to the business domain name according to the different business access volumes to avoid blockage or waste of resources.
[0099] In user store B, there are 5 client devices configured, namely food delivery robots B1 and B2, disinfection robots B3 and B4, and tablet B5. Among the 5 client devices of store B, B1 and B2 are installed with catering service programs, B3 and B4 are installed with disinfection service programs, and B5 is installed with system docking programs. Due to business expansion needs, store B upgraded the catering service program to version 2.0, and added catering tracking services based on the original versions 1.0 and 1.1. Correspondingly, the original alternative channel domain names are x.com, y.com, and z.com. In the case of x.com, the background server abandoned x.com and added a new alternative channel domain name w.com. The background server added (catering-track, https: / / catering-track.com) to the business domain name set,
[0100] When the background server feeds back access response data to each client device, it feeds back the latest candidate channel domain names w.com, y.com and z.com to the client device, and feeds back the business domain name set as [(catering-simple, https: / / catering.com), (medical-simple, https: / / medical.com), (mobile, https: / / mobile.com), (file, https: / / file.com), (catering-track, https: / / catering-track.com)].
[0101] According to the application version information and application type information of the service business programs in each client device of store B, application business identifiers are allocated to the service business programs in B1, B2, B3, B4 and B5. B1 (catering service program 2.0): catering-simple, file, catering-track; B2 (catering program version 2.0): catering-simple, file, catering-track; B3 (disinfection program version 1.0): medical-simple; B4 (disinfection program version 1.0): medical-simple; B5 (web program version 1.0): mobile.
[0102] Each client device selects a target service domain name from the candidate service domain names in the service domain name set according to the service service program configured for each client device by the application service identifier. Specifically, the target service domain names corresponding to B1 and B2 are https: / / catering.com, https: / / catering-track.com, and https: / / file.com; the target service domain names corresponding to B3 and B4 are both https: / / catering.com; and the target service domain name corresponding to B5 is https: / / mobile.com.
[0103] The embodiment of the present application utilizes the channel domain name to obtain the business domain name, thereby dynamically allocating the business domain name to the target application, allowing the target application to access resources based on the business domain name, reducing the risk of network channel congestion and the risk of domain name hijacking, improving the success rate of resource access, and thereby improving the user experience.
[0104] Embodiment 4
[0105] Figure 4 This is a resource access device provided in the fourth embodiment of the present application. This embodiment can be applied to the case where a client device accesses resources on a backend server. The device can be implemented by software and / or hardware and can be integrated into a robot such as an intelligent terminal.
[0106] like Figure 4 As shown, the device may include: a target channel domain name selection module 410 , a resource access request sending module 420 and a resource access module 430 .
[0107] A target channel domain name selection module 410 is used to select a target channel domain name from at least two candidate channel domain names according to a resource access request of a target application program;
[0108] A resource access request sending module 420, configured to send the resource access request to a backend server based on the target channel domain name, so that the backend server feeds back access response data for the resource access request;
[0109] The resource access module 430 is used to access resources based on the target business domain name in the access response data.
[0110] The technical solution provided in the embodiment of the present application selects a target channel domain name from at least two candidate channel domain names according to a resource access request of a target application; sends the resource access request to a background server based on the target channel domain name, so that the background server feeds back access response data for the resource access request; and performs resource access based on the target business domain name in the access response data. The embodiment of the present application uses the channel domain name to obtain the business domain name, and realizes the dynamic allocation of the business domain name to the target application, so that the target application can access resources based on the business domain name, reducing the risk of network channel congestion and the risk of domain name hijacking, and improving the success rate of resource access, thereby improving the user experience.
[0111] Optionally, the target channel domain name selection module 410 includes: a target configuration file determination submodule, used to determine the target configuration file corresponding to the target application according to the resource access request of the target application; an availability verification submodule, used to verify the availability of each alternative channel domain name in the target configuration file; and a target channel domain name determination submodule, used to determine the alternative channel domain name that has passed the availability verification as the target channel domain name.
[0112] Optionally, the availability verification submodule includes: a channel domain name selection unit to be verified, used to select a channel domain name to be verified from the alternative channel domain names in the target configuration file; a channel verification request sending unit, used to send a channel verification request to the background server based on the channel domain name to be verified, so that the background server feeds back verification response data for the channel verification request; a first availability verification unit, used to verify the availability of the channel domain name to be verified based on at least one of the data format, response status and data content of the verification response data; and a channel domain name reselection unit to be verified, used to return to the channel domain name selection operation to be verified and reselect the channel domain name to be verified if the availability verification fails, until the availability of each of the alternative channel domain names is verified.
[0113] Optionally, the availability verification submodule also includes: an Internet Protocol address query unit, used to query the Internet Protocol address corresponding to each of the alternative channel domain names at a set time interval; a second availability verification unit, used to verify the availability of the alternative channel domain name based on a preset domain name IP binding relationship.
[0114] Optionally, the resource access module 430 includes: a business domain name set extraction submodule, used to parse the access response data and extract a business domain name set from the access response data; wherein the business domain name set includes alternative business domain names and application business identifiers; a target business domain name selection submodule, used to select the target business domain name from the alternative business domain names for the target application according to the application business identifier in the resource access request; and a resource access submodule, used to access resources based on the target business domain name.
[0115] Optionally, the device also includes: an application version information determination module, used to determine the current application version information of the target application before selecting the target business domain name from the alternative business domain names for the target application based on the application business identifier in the resource access request; an application business identifier allocation module, used to allocate the application business identifier to the target application based on the application version information and application type information.
[0116] Optionally, the device further includes: a domain name update module, specifically configured to update the alternative channel domain name and / or the target service domain name according to the domain name update message in response to receiving the domain name update message pushed by the background server;
[0117] And / or, updating the candidate channel domain name according to the latest channel domain name in the access response data.
[0118] A resource access device provided in an embodiment of the present invention can execute a resource access method provided in any embodiment of the present invention, and has a performance module and beneficial effects corresponding to executing a resource access method.
[0119] Embodiment 5
[0120] Embodiment 5 of the present application further provides a storage medium containing computer executable instructions, wherein the computer executable instructions are used to execute a resource access method when executed by a computer processor, the method comprising:
[0121] Selecting a target channel domain name from at least two candidate channel domain names according to a resource access request of a target application;
[0122] Sending the resource access request to a backend server based on the target channel domain name, so that the backend server feeds back access response data for the resource access request;
[0123] The resource access is performed based on the target business domain name in the access response data.
[0124] Storage media refers to any of various types of memory electronic devices or storage electronic devices. The term "storage medium" is intended to include: installation media, such as CD-ROM, floppy disk or tape device; computer system memory or random access memory, such as DRAM, DDR RAM, SRAM, EDO RAM, Rambus RAM, etc.; non-volatile memory, such as flash memory, magnetic media (such as hard disk or optical storage); registers or other similar types of memory elements, etc. The storage medium may also include other types of memory or combinations thereof. In addition, the storage medium may be located in the computer system in which the program is executed, or may be located in a different second computer system, which is connected to the computer system via a network (such as the Internet). The second computer system can provide program instructions to the computer for execution. The term "storage medium" may include two or more storage media that may reside in different unknowns (for example, in different computer systems connected via a network). The storage medium may store program instructions (for example, embodied as a computer program) that can be executed by one or more processors.
[0125] Of course, the storage medium containing computer executable instructions provided in the embodiments of the present application is not limited to the resource access operations described above, and can also execute related operations in the resource access method provided in any embodiment of the present application.
[0126] Embodiment 6
[0127] Embodiment 6 of the present application provides a robot, in which the resource access device provided in the embodiment of the present application can be integrated. The robot can be configured within the system, or can be a device that executes part or all of the performance within the system. Figure 5 Schematic diagram of the structure of a robot provided in Example 6 of the present application. Figure 5 As shown, this embodiment provides a robot 500, which includes: one or more processors 520; a storage device 510, which is used to store one or more programs. When the one or more programs are executed by the one or more processors 520, the one or more processors 520 implement the resource access method provided in the embodiment of the present application. The method includes:
[0128] Selecting a target channel domain name from at least two candidate channel domain names according to a resource access request of a target application;
[0129] Sending the resource access request to a backend server based on the target channel domain name, so that the backend server feeds back access response data for the resource access request;
[0130] The resource access is performed based on the target business domain name in the access response data.
[0131] Of course, those skilled in the art can understand that the processor 520 also implements the technical solution of the resource access method provided in any embodiment of the present application.
[0132] Figure 5 The robot 500 shown is merely an example and should not bring any limitation to the performance and scope of use of the embodiments of the present application.
[0133] like Figure 5 As shown, the robot 500 includes a processor 520, a storage device 510, an input device 530, and an output device 540; the number of processors 520 in the robot can be one or more. Figure 5 A processor 520 is taken as an example; the processor 520, storage device 510, input device 530 and output device 540 in the robot can be connected via a bus or other means. Figure 5 The connection via bus 550 is taken as an example.
[0134] The storage device 510, as a computer-readable storage medium, can be used to store software programs, computer executable programs and module units, such as program instructions corresponding to the resource access method in the embodiment of the present application.
[0135] The storage device 510 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system and at least one application required for performance; the data storage area may store data created according to the use of the terminal, etc. In addition, the storage device 510 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some instances, the storage device 510 may further include a memory remotely arranged relative to the processor 520, and these remote memories may be connected via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0136] The input device 530 can be used to receive input numbers, character information or voice information, and generate key signal input related to user settings and performance control of the robot. The output device 540 can include a display screen, a speaker, etc.
[0137] The resource access device, medium and robot provided in the above embodiments can execute the resource access method provided in any embodiment of the present application, and have the corresponding performance modules and beneficial effects of executing the method. For technical details not described in detail in the above embodiments, please refer to the resource access method provided in any embodiment of the present application.
[0138] Note that the above are only preferred embodiments of the present application and the technical principles used. Those skilled in the art will understand that the present application 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 application. Therefore, although the present application is described in more detail through the above embodiments, the present application is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present application, and the scope of the present application is determined by the scope of the appended claims.
Claims
1. A resource access method, characterized in that: The method comprises: Determining a target configuration file corresponding to the target application according to a resource access request of the target application; Verify the availability of each alternative channel domain name in the target configuration file; wherein the alternative channel domain name is used to request a business domain name from a backend server, and the business domain name is a resource location identifier provided to the backend server of the target application; Determine the candidate channel domain name that has passed the availability verification as the target channel domain name; Sending the resource access request to the backend server based on the target channel domain name, so that the backend server feeds back access response data for the resource access request; The resource access is performed based on the target business domain name in the access response data.
2. The method according to claim 1, characterized in that: The verifying the availability of each candidate channel domain name in the target configuration file includes: Select a channel domain name to be verified from the candidate channel domain names in the target configuration file; Based on the domain name of the channel to be verified, sending a channel verification request to the backend server, so that the backend server feeds back verification response data for the channel verification request; Performing availability verification on the domain name of the channel to be verified based on at least one of the data format, response status and data content of the verification response data; If the availability verification fails, the process returns to the operation of selecting a channel domain name to be verified to reselect a channel domain name to be verified until the availability of each candidate channel domain name is verified.
3. The method according to claim 1, characterized in that The verifying the availability of each candidate channel domain name in the target configuration file further includes: At set time intervals, querying the Internet Protocol address corresponding to each of the candidate channel domain names; Based on the preset domain name IP binding relationship, the availability of the alternative channel domain name is verified.
4. The method according to claim 1, characterized in that: The performing resource access based on the target business domain name in the access response data includes: Parsing the access response data, and extracting a service domain name set from the access response data; wherein the service domain name set includes an alternative service domain name and an application service identifier; selecting the target service domain name from the candidate service domain names for the target application program according to the application service identifier in the resource access request; Resource access is performed based on the target business domain name.
5. The method according to claim 4, characterized in that Before selecting the target service domain name from the candidate service domain names for the target application program according to the application service identifier in the resource access request, the method further includes: Determine the current application version information of the target application; The application service identifier is allocated to the target application program according to the application version information and the application type information.
6. The method according to claim 1, characterized in that The method further comprises: In response to receiving a domain name update message pushed by the background server, updating the alternative channel domain name and / or the target service domain name according to the domain name update message; And / or, updating the candidate channel domain name according to the latest channel domain name in the access response data.
7. A resource access device, characterized in that: The device comprises: A target channel domain name selection module, comprising: a target configuration file determination submodule, an availability verification submodule and a target channel domain name determination submodule; The target configuration file determination submodule is used to determine the target configuration file corresponding to the target application according to the resource access request of the target application; The availability verification submodule is used to verify the availability of each alternative channel domain name in the target configuration file; wherein the alternative channel domain name is used to request a business domain name from a backend server, and the business domain name is a resource location identifier provided to the backend server of the target application; The target channel domain name determination submodule is used to determine the candidate channel domain name that has passed the availability verification as the target channel domain name; A resource access request sending module, used to send the resource access request to the backend server based on the target channel domain name, so that the backend server feeds back access response data for the resource access request; The resource access module is used to access resources based on the target business domain name in the access response data.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the resource access method according to any one of claims 1 to 6 is implemented.
9. A robot comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the resource access method according to any one of claims 1 to 6 is implemented.
