Unified access methods, devices, systems and storage media for skill traffic
Patent Information
- Application Number
- CN202211295604.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-21
- Publication Date
- 2025-12-02
- Estimated Expiration
- 2042-10-21
AI Technical Summary
[0005]本申请提供一种技能流量的统一接入方法、装置、系统及存储介质,用以解决现有技术中在技能请求过多的情况下,可能会导致技能服务器宕机,无法提供对应的服务的缺陷,实现对技能请求进行流量控制,增强技能服务器的稳定性
[0036]本申请提供的技能流量的统一接入方法、装置、系统及存储介质,方法包括:接收应用服务器发送的当前技能请求,其中,当前技能请求为应用服务器基于当前技能网关URL发送的技能请求,当前技能网关URL为应用服务器基于当前技能请求,以及预先存储的技能与技能网关URL的对应关系确定的技能网关URL,基于当前技能请求,以及预先存储的技能、技能网关URL和技能服务器URL的对应关系,确定当前技能请求对应的当前技能服务器URL,基于当前技能服务器URL,转发当前技能请求至技能服务器。
Smart Images

Figure CN115766863B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of communication technology, and in particular to a unified access method, apparatus, system and storage medium for skill traffic. Background Technology
[0002] Skills are advanced cloud-based functionalities of devices. They differ from basic device functions in that basic functions are inherent to the device itself, while skills are advanced cloud-based functions developed based on those basic functions. Smart home products can enrich their core capabilities, enhance their competitiveness, and increase their market share by deploying a variety of skills.
[0003] Skills can be deployed on cloud servers (i.e., skill servers). Skill servers are distributed servers. Currently, application servers can send skill requests to skill servers, and skill servers can process skill requests and return responses.
[0004] However, skill requests sent by the application server may be distributed across various skill servers, making it impossible to achieve unified access to skill requests. Summary of the Invention
[0005] This application provides a unified access method, device, system, and storage medium for skill traffic, which addresses the shortcomings of existing technologies where excessive skill requests may cause skill servers to crash and fail to provide corresponding services. This allows for traffic control of skill requests and enhances the stability of skill servers.
[0006] This application provides a unified access method for skill traffic, applied to a skill gateway, the method comprising:
[0007] Receive a current skill request sent by the application server, wherein the current skill request is a skill request sent by the application server based on the current skill gateway URL, and the current skill gateway URL is a skill gateway URL determined by the application server based on the current skill request and a pre-stored correspondence between skills and skill gateway URLs;
[0008] Based on the current skill request and the pre-stored correspondence between skills, skill gateway URLs, and skill server URLs, the current skill server URL corresponding to the current skill request is determined;
[0009] Based on the current skill server URL, forward the current skill request to the skill server.
[0010] According to the unified access method for skill traffic provided in this application, after forwarding the current skill request to the skill server, the method further includes:
[0011] Receive the current control instruction sent by the skill server, wherein the current control instruction is a control instruction obtained by the skill server based on the current skill request;
[0012] Forward the current control command to the application server.
[0013] According to the unified access method for skill traffic provided in this application, before determining the current skill server URL corresponding to the current skill request based on the current skill request and the pre-stored correspondence between skills, skill gateway URLs, and skill server URLs, the method further includes:
[0014] Verify whether the current skill request meets the permission verification conditions;
[0015] If the current skill request meets the permission verification conditions, the step of determining the current skill server URL corresponding to the current skill request is performed based on the current skill request and the pre-stored correspondence between skills, skill gateway URLs and skill server URLs.
[0016] According to the unified access method for skill traffic provided in this application, before receiving the current skill request sent by the application server, the method further includes:
[0017] For each skill, register the skill information, generate the skill gateway URL for the skill, and send the mapping relationship between the skill and the skill gateway URL to the application server.
[0018] According to the unified access method for skill traffic provided in this application, the skill gateway URL for the skill is generated, including:
[0019] Get the skill server URL for this skill;
[0020] Replace the information to be replaced in the skill server URL of the skill with the domain name of the skill gateway to obtain the skill gateway URL of the skill.
[0021] According to the unified access method for skill traffic provided in this application, after generating the skill gateway URL for the skill, the method further includes:
[0022] Store the skill, the skill gateway URL of the skill, and the skill server URL of the skill.
[0023] According to the unified access method for skill traffic provided in this application, the mapping relationship between the skill and its skill gateway URL is sent to the application server, including:
[0024] The mapping between the skill and its skill gateway URL is sent to the messaging platform so that the application server can listen to the messaging platform and obtain the mapping between the skill and its skill gateway URL.
[0025] This application also provides a unified access device for skill traffic, applied to a skill gateway, the device comprising:
[0026] The first receiving module is used to receive a current skill request sent by the application server, wherein the current skill request is a skill request sent by the application server based on the current skill gateway URL, and the current skill gateway URL is a skill gateway URL determined by the application server based on the current skill request and a pre-stored correspondence between skills and skill gateway URLs;
[0027] The determining module is used to determine the current skill server URL corresponding to the current skill request based on the current skill request and the pre-stored correspondence between skills, skill gateway URLs and skill server URLs;
[0028] The first forwarding module is used to forward the current skill request to the skill server based on the current skill server URL.
[0029] This application also provides a unified access system for skill traffic, the system comprising: an application server, a skill gateway, and a skill server;
[0030] The application server is used to determine the current skill gateway URL based on the current skill request and the pre-stored correspondence between skills and skill gateway URLs, and to send the current skill request to the skill gateway based on the current skill gateway URL.
[0031] The skill gateway is configured to receive the current skill request sent by the application server, determine the current skill server URL corresponding to the current skill request based on the current skill request and the pre-stored correspondence between skills, skill gateway URLs and skill server URLs, and forward the current skill request to the skill server based on the current skill server URL.
[0032] The skill server is used to receive current skill requests sent by the skill gateway.
[0033] This application also provides an electronic device including a memory and a processor, wherein the memory stores a computer program and the processor is configured to execute, through the computer program, a unified access method for skill traffic as described above.
[0034] This application also provides a computer-readable storage medium comprising a stored program, wherein the program, when executed, implements a unified access method for skill traffic as described above.
[0035] This application also provides a computer program product, including a computer program that, when executed by a processor, implements a unified access method for skill traffic as described above.
[0036] The unified access method, apparatus, system, and storage medium for skill traffic provided in this application include: receiving a current skill request sent by an application server, wherein the current skill request is a skill request sent by the application server based on a current skill gateway URL, the current skill gateway URL is a skill gateway URL determined by the application server based on the current skill request and a pre-stored correspondence between skills and skill gateway URLs; determining the current skill server URL corresponding to the current skill request based on the current skill request and the pre-stored correspondence between skills, skill gateway URLs, and skill server URLs; and forwarding the current skill request to the skill server based on the current skill server URL.
[0037] The skill gateway receives the current skill request, determines the URL of the current skill server corresponding to the current skill request, and forwards the current skill request to the skill server, thereby enabling the skill gateway to uniformly access skill requests. Attached Figure Description
[0038] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0039] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0040] Figure 1 This is a schematic diagram of the hardware environment for a unified access method for skill traffic according to an embodiment of this application;
[0041] Figure 2 This is one of the flowcharts illustrating a unified access method for skill traffic provided in this application;
[0042] Figure 3 This is one of the flowcharts illustrating the current skills development and skills execution processes provided in this application;
[0043] Figure 4This is the second flowchart illustrating a unified access method for skill traffic provided in this application;
[0044] Figure 5 This is a schematic diagram of the structure of a unified access device for skill traffic provided in this application;
[0045] Figure 6 This is a schematic diagram of the structure of a unified access system for skill traffic provided in this application;
[0046] Figure 7 This is a schematic diagram of the electronic device provided in this application. Detailed Implementation
[0047] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.
[0048] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0049] According to one aspect of the embodiments of this application, a unified access method, apparatus, system, and storage medium for skill traffic are provided. This unified access method, apparatus, system, and storage medium for skill traffic are widely applicable to whole-house intelligent digital control application scenarios such as smart homes, smart home ecosystems, and intelligence house ecosystems. Optionally, in this embodiment, the aforementioned unified access method, apparatus, system, and storage medium for skill traffic can be applied to, for example... Figure 1 The hardware environment shown consists of terminal device 102 and server 104. For example... Figure 1As shown, server 104 is connected to terminal device 102 via a network and can be used to provide services (such as application services) to the terminal or clients installed on the terminal. A database can be set up on the server or independently of the server to provide data storage services for server 104. Cloud computing and / or edge computing services can be configured on the server or independently of the server to provide data processing services for server 104.
[0050] The aforementioned network may include, but is not limited to, at least one of the following: wired network, wireless network. The aforementioned wired network may include, but is not limited to, at least one of the following: wide area network, metropolitan area network, local area network. The aforementioned wireless network may include, but is not limited to, at least one of the following: Wi-Fi (Wireless Fidelity), Bluetooth. The terminal device 102 may not be limited to PC, mobile phone, tablet computer, smart air conditioner, smart range hood, smart refrigerator, smart oven, smart stove, smart washing machine, smart water heater, smart washing equipment, smart dishwasher, smart projector, smart TV, smart clothes rack, smart curtains, smart audio-visual equipment, smart socket, smart speaker, smart speaker box, smart fresh air equipment, smart kitchen and bathroom equipment, smart bathroom equipment, smart robot vacuum cleaner, smart window cleaning robot, smart mopping robot, smart air purifier, smart steam oven, smart microwave oven, smart water heater, smart air purifier, smart water dispenser, smart door lock, etc.
[0051] To achieve traffic control of skill requests and enhance the stability of skill servers, this application provides a unified access method, apparatus, system, computer-readable storage medium, electronic device, and computer program product for skill traffic. The following describes the process in conjunction with... Figure 2 This application introduces the unified access method for skill traffic.
[0052] like Figure 2 As shown, the unified access method for skill traffic provided in this application is applied to a skill gateway, and the method includes:
[0053] S201, Receive the current skill request sent by the application server.
[0054] When a user wants to invoke a skill, they can send a skill invoke request to the application server via their terminal device. The application server then receives the skill invoke request, which is the current skill request. The application server is the server corresponding to the application program, which is the program installed on terminal devices such as mobile phones, computers, and tablets.
[0055] The application server stores a mapping between skills and gateway URLs (Uniform Resource Locators). To invoke the skill corresponding to the current skill request, the application server determines the corresponding skill gateway URL based on the current skill request and the pre-stored mapping, and uses this URL as the current skill gateway URL. Then, the application server can forward the current skill request to the skill gateway based on this current skill gateway URL.
[0056] In one implementation, the application server can determine whether the current skill gateway URL is stored based on the current skill request and the pre-stored correspondence between skills and skill gateway URLs. If the current skill gateway URL is not stored, it indicates that the current skill request is unavailable, and the application server can return a skill request failure message to the terminal device.
[0057] If a request stores the current skill gateway URL, it means that the current skill request is available. After determining the current skill gateway URL, the application server can forward the current skill request to the skill gateway based on the current skill gateway URL. In this way, the skill gateway can receive the current skill request sent by the application server.
[0058] S202, based on the current skill request and the pre-stored correspondence between skills, skill gateway URLs and skill server URLs, determine the current skill server URL corresponding to the current skill request.
[0059] After receiving the current skill request, the skill gateway can determine the skill server URL corresponding to the current skill request based on the pre-stored correspondence between the skill, skill gateway URL, and skill server URL, since the skill gateway stores the correspondence between the skill, skill gateway URL, and skill server URL.
[0060] S203, based on the current skill server URL, forward the current skill request to the skill server.
[0061] After determining the current skill server URL, the skill gateway can forward the current skill request to the skill server based on the current skill server URL. In this way, the skill server can receive the skill that the user wants to call.
[0062] Among them, the skill server is the server corresponding to the skill. The skill server can store the skills developed by the developers. The skill server can be a distributed server, in other words, there can be multiple skill servers.
[0063] As can be seen, the unified access method for skill traffic provided in this application can receive the current skill request through the skill gateway, then determine the current skill server URL corresponding to the current skill request, and forward the current skill request to the skill server, thereby enabling the skill gateway to uniformly access skill requests.
[0064] As one embodiment of this application, after forwarding the current skill request to the skill server, the above method may further include:
[0065] Receive the current control instruction sent by the skill server, wherein the current control instruction is a control instruction obtained by the skill server based on the current skill request; forward the current control instruction to the application server.
[0066] The skill server can receive current skill requests. After receiving a current skill request, the skill server can obtain the current control command based on the current skill request. The current control command can represent the command executed by the skill that the user needs to invoke.
[0067] After obtaining the current control command, it can be sent to the skill gateway. There are three possible scenarios for the skill server to send the current control command to the skill gateway:
[0068] In the first scenario, when sending a current skill request, the skill gateway can also send its current skill gateway URL to the skill server. The skill server can then receive both the current skill request and the current skill gateway URL, establishing a correspondence between them. Furthermore, upon receiving the current control command, the skill server can send the command back to the skill gateway based on the current skill gateway URL.
[0069] In the second scenario, the current skill request carries a unique skill request identifier, and the current control command obtained by the skill server also carries a unique skill request identifier. The skill server can then send a current control command carrying a unique skill request identifier to the skill gateway.
[0070] In the third scenario, if the skill server obtains the current control command corresponding to the current skill request, it can send the current skill request and the current control command together to the skill gateway.
[0071] After receiving the current control command, the skill gateway can forward it to the application server, which then forwards it to the terminal device. The terminal device can then execute the current control command, and the user can see the interface and effects corresponding to the command executed by the terminal device, thus completing the skill invocation.
[0072] There are three scenarios when the skill gateway forwards the current control command to the application server:
[0073] In the first scenario, upon receiving a current skill request, the skill gateway can record the mapping between the current skill request and the application server URL. Then, after obtaining the current control command corresponding to the current skill request, the skill gateway can forward the current control command to the corresponding application server based on the mapping between the current skill request and the application server URL, as well as the mapping between the current skill request and the current control command. In this way, the application server can obtain the current control command.
[0074] Furthermore, the application server can store the correspondence between the current skill request and the terminal device. After obtaining the current control command corresponding to the current skill request, it can forward the current control command to the corresponding terminal device based on the correspondence between the current skill request and the terminal device, as well as the correspondence between the current skill request and the current control command.
[0075] In the second scenario, the current skill request carries a unique skill request identifier, and the current control command obtained by the skill gateway also carries a unique skill request identifier. The skill gateway can send the current control command carrying the unique skill request identifier to the application server. In this way, the application server can obtain the current control command and then forward the current control command to the corresponding terminal device based on the unique skill request identifier.
[0076] In the third scenario, once the skill gateway obtains the current control command corresponding to the current skill request, it can send both the current skill request and the current control command to the application server. Furthermore, the application server can store the mapping between current skill requests and terminal devices. After obtaining the current control command corresponding to the current skill request, it can forward the current control command to the corresponding terminal device based on the mapping between the current skill request and the terminal device, as well as the mapping between the current skill request and the current control command.
[0077] As can be seen, the unified access method for skill traffic provided in this application can receive the current control instructions sent by the skill server through the skill gateway. In other words, the unified access of the current control instructions is achieved through the skill gateway, thereby enabling traffic control based on the received control instructions, which facilitates subsequent traffic analysis.
[0078] As one implementation of this application, the skill gateway can perform traffic control on the received skill requests and / or control instructions based on technologies such as traffic limiting, traffic degradation, traffic shaping, and traffic proxy. Compared with the method where only the skill server receives the skill requests sent by the application server, this can enhance the stability of the skill server.
[0079] Furthermore, the skill gateway can perform traffic analysis on the received skill requests and / or control commands, and then conduct operational analysis and other decisions based on the traffic analysis. It can also conduct user behavior analysis and user profiling based on the traffic analysis, thereby building a powerful skill data operational analysis system.
[0080] As one embodiment of this application, before determining the current skill server URL corresponding to the current skill request based on the current skill request and the pre-stored correspondence between skills, skill gateway URLs, and skill server URLs, the above method may further include:
[0081] Verify whether the current skill request meets the permission verification conditions; if the current skill request meets the permission verification conditions, execute the step of determining the current skill server URL corresponding to the current skill request based on the current skill request and the pre-stored correspondence between skills, skill gateway URLs and skill server URLs.
[0082] Upon receiving a skill request, the skill gateway can verify whether the skill request meets the permission verification conditions. These conditions can indicate whether the skill request is available or legitimate.
[0083] If the current skill request meets the permission verification conditions, it indicates that the current skill request is available. Therefore, the skill gateway can perform the steps described above to determine the current skill server URL corresponding to the current skill request based on the current skill request and the pre-stored correspondence between skills, skill gateway URLs, and skill server URLs. If the current skill request does not meet the permission verification conditions, it indicates that the current skill request is unavailable. Therefore, the skill gateway can return a skill request failure message to the application server, and the application server can then return a skill request failure message to the terminal device.
[0084] In one implementation, the skill gateway can verify the current skill request based on the current skill request and the correspondence between the skill, the skill gateway URL, and the skill server URL.
[0085] If the skill gateway verifies that the current skill request has a corresponding skill gateway URL, meaning the current skill request is available, then the current skill request meets the permission verification conditions. Therefore, the steps described above for determining the current skill server URL corresponding to the current skill request can be executed based on the current skill request and the pre-stored correspondence between skills, skill gateway URLs, and skill server URLs.
[0086] If the skill gateway verifies that the current skill request does not have a corresponding skill gateway URL, meaning the current skill request is unavailable, it indicates that the current skill request does not meet the permission verification conditions. Therefore, a skill request failure message can be returned to the application server.
[0087] In another implementation, the current skill request may carry a first verification identifier, and the application server may carry a second verification identifier when sending the current skill request. When the skill gateway receives the current skill request sent by the application server, it may verify whether there is a correspondence between the first verification identifier and the second verification identifier.
[0088] If there is a correspondence between the first verification identifier and the second verification identifier, it indicates that the current skill request meets the permission verification conditions. Therefore, the steps described above, which determine the current skill server URL corresponding to the current skill request based on the current skill request and the pre-stored correspondence between skills, skill gateway URLs, and skill server URLs, can be performed.
[0089] If there is no correspondence between the first verification identifier and the second verification identifier, it indicates that the current skill request does not meet the permission verification conditions. Therefore, a skill request failure message can be returned to the application server.
[0090] As one implementation method, the skill gateway stores the correspondence between skills, application servers, and skill permissions. The skill gateway can use filter-related technologies to authenticate the current skill requests sent by the application server.
[0091] If the permissions corresponding to the current skill request meet the permission verification conditions, the above-described step of determining the current skill server URL corresponding to the current skill request is performed based on the current skill request and the pre-stored correspondence between skills, skill gateway URLs, and skill server URLs. If the permissions corresponding to the current skill request do not meet the permission verification conditions, a request failure message can be returned to the application server.
[0092] By using the above method, the verification of the current skill request that the skill server needs to perform is moved to the front end. The skill server no longer needs to verify the current skill request, thereby further improving the stability of the skill server.
[0093] As one embodiment of this application, before receiving the current skill request sent by the application server, the above method may further include:
[0094] For each skill, register the skill information, generate the skill gateway URL for the skill, and send the mapping relationship between the skill and the skill gateway URL to the application server.
[0095] After developers create a skill on the skill development platform, they can register the skill's URL on the skill server. This URL serves as the skill server URL for that skill. The skill platform can then store the skill's basic information; in other words, it can persistently store this basic information. This basic information includes the skill's skill server URL.
[0096] In one implementation, the skill platform can store the basic information of the skill in the skill platform's database, that is, store the skill and the skill server URL of the skill in the skill platform's database. This achieves the persistence of the basic information of the skill.
[0097] To facilitate subsequent traffic control of received skill requests through the skill gateway, for each skill, the basic information of the skill developed by the developer can be registered on the skill gateway, a skill gateway URL for the skill can be generated, and the mapping relationship between the skill and the skill gateway URL can be sent to the application server.
[0098] As one implementation method, after the skill platform obtains the basic information of the skill, it can send the basic information of the skill to the skill gateway, so that the skill gateway can register the basic information of the skill. That is, the skill platform can send the mapping relationship between the skill and the skill server URL to the skill gateway.
[0099] The above method enables the application server to obtain the correspondence between skills and skill gateway URLs, so that when it receives a current skill request, it can forward the current skill request to the skill gateway, thereby realizing traffic control of the received skill requests based on the skill gateway.
[0100] As one embodiment of this application, generating the skill gateway URL for the skill may include:
[0101] Obtain the skill server URL of the skill; replace the information to be replaced in the skill server URL of the skill with the domain name of the skill gateway to obtain the skill gateway URL of the skill.
[0102] For each skill, after the skill gateway obtains the skill server URL, in order to generate the skill gateway URL for that skill, the information to be replaced in the skill server URL can be replaced with the domain name of the skill gateway, thus obtaining the skill gateway URL for that skill. The information to be replaced can be pre-set according to actual needs, specifically the domain name of the skill server.
[0103] For example, the skill server URL for skill A could be https: / / a.skill.com / skill / execute, the skill server domain name is a.skill.com (meaning the replacement zone is a.skill.com), and the skill gateway domain name is skill.gateway.com. By replacing "a.skill.com" with "skill.gateway.com" in the skill server URL, we can obtain the skill gateway URL for skill A, which is "https: / / skill.gateway.com / skill / execute".
[0104] In this way, skill gateway URLs can be generated, enabling subsequent traffic control of received skill requests based on the skill gateway.
[0105] As one embodiment of this application, after generating the skill gateway URL for the skill, the above method may further include:
[0106] Store the skill, the skill gateway URL of the skill, and the skill server URL of the skill.
[0107] For each skill, the skill gateway can send the mapping between the skill, its skill gateway URL, and its skill server URL to its database. In other words, the skill gateway's database persists the mapping between the skill, its skill gateway URL, and its skill server URL.
[0108] In one implementation, after the application server receives the correspondence between skills and their skill gateway URLs, it can store the correspondence between skills and their skill gateway URLs in the application server's database, that is, persist the correspondence between skills and their skill gateway URLs in the application server's database.
[0109] As one implementation, after the skill gateway persists the mapping between the skill, the skill gateway URL, and the skill server URL in the skill gateway's database, the skill gateway can return a persistence success message to the development platform so that developers can understand.
[0110] After the application server establishes the database persistence skill and the skill gateway URL mapping, the application server can return a persistence success message to the skill gateway, so that the skill gateway can send the application server's persistence success message to the development platform for developers to understand.
[0111] As one embodiment of this application, sending the correspondence between the skill and its skill gateway URL to the application server may include:
[0112] The mapping between the skill and its skill gateway URL is sent to the messaging platform so that the application server can listen to the messaging platform and obtain the mapping between the skill and its skill gateway URL.
[0113] In some cases, the skill gateway does not need to send the mapping between skills and their skill gateway URLs to the application server in real time. This is to facilitate the application server in obtaining the mapping between skills and their skill gateway URLs later.
[0114] For each skill, the skill gateway can send the mapping between the skill and its corresponding skill gateway URL to the messaging platform. In other words, the skill gateway asynchronously sends this mapping to the messaging platform.
[0115] In one implementation, after receiving the correspondence between the skill and its skill gateway URL, the messaging platform can store the correspondence between the skill and its skill gateway URL in the messaging platform's database, thereby achieving persistent data storage of the correspondence between the skill and its skill gateway URL in the messaging platform's data path.
[0116] For each skill, the application server can listen to the messaging platform and obtain the mapping between the skill and its skill gateway URL. In one implementation, the skill server can subscribe to a topic on the messaging platform that maps skills to their skill gateway URLs. Therefore, after receiving the mapping between skills and their skill gateway URLs on the messaging platform, the skill server can obtain the mapping between the skills and their skill gateway URLs.
[0117] Using the above method, the mapping relationship between skills and their skill gateway URLs can be asynchronously sent to the messaging platform according to actual needs, thereby enabling the application server to obtain the mapping relationship between skills and their skill gateway URLs.
[0118] To better understand the unified access method for skill traffic provided in this application, the following will be combined with... Figure 3 as well as Figure 4 For example, this paper compares and introduces the current skill development and execution process with the unified access method for skill traffic proposed in this application. Among them, Figure 3 This is a schematic diagram of the current skills development and skills execution process. Figure 4 A flowchart illustrating the unified access method for skill traffic provided in this application.
[0119] like Figure 3 As shown, the current skills development and execution system includes: a skills platform, a messaging platform, a skills server, an application server, and terminal devices. The current skills development and execution process flowchart includes the following steps:
[0120] S301, the skill platform obtains the skill and the skill server URL of the skill, and stores it.
[0121] S302, the skill platform asynchronously forwards the mapping relationship between the skill and the skill server URL to the message platform.
[0122] S303, the messaging platform stores the mapping between skills and the skill server URLs of those skills.
[0123] S304, the messaging platform sends the mapping between skills and the skill server URLs to the application server.
[0124] S305, the application server stores the mapping between skills and the skill server URLs of those skills.
[0125] S306, The terminal device receives the current skill request sent by the user.
[0126] S307, the terminal device sends the current skill request to the application server.
[0127] S308, the application server obtains the current skill server URL based on the current skill request and the correspondence between the skill and the skill server URL.
[0128] S309, Based on the current skill server URL, the application server sends the current skill request to the skill server.
[0129] S310, the skill server obtains the current control command based on the current skill request.
[0130] S311, the skill server returns the current control command to the application server.
[0131] S312, the application server returns the current control command to the terminal device.
[0132] like Figure 4 As shown, the unified access system for skill traffic may include a skill platform, a skill gateway, a message platform, a skill server, an application server, and terminal devices. The flowchart of the unified access method for skill traffic provided in this application includes the following steps:
[0133] S401, the skill platform obtains the skill and the skill server URL of the skill, and stores it.
[0134] In one implementation, the skill platform can store the mapping between skills and skill server URLs in the skill platform's database and receive a message from the skill platform's database indicating successful storage.
[0135] S402, the skill gateway registers skill information, generates the skill gateway URL of the skill, and stores the correspondence between the skill and the skill gateway URL.
[0136] In one implementation, after storing the correspondence between skills and skill gateway URLs in the skill gateway's database, the skill gateway can receive a storage success message sent by the skill gateway server and forward the storage success message to the skill platform.
[0137] S403, the skill gateway sends the mapping between skills and their corresponding skill gateway URLs to the messaging platform.
[0138] S404, the messaging platform stores the mapping between skills and their corresponding skill gateway URLs.
[0139] S405 is an application server that listens to messages, obtains and stores the correspondence between skills and their skill gateway URLs.
[0140] Specifically, the application server can listen to topics that correspond to skills and their corresponding skill server URLs, so that after receiving the correspondence between skills and their corresponding skill server URLs on the messaging platform, it can obtain the correspondence between skills and their corresponding skill server URLs.
[0141] S406, The terminal device receives the current skill request sent by the user.
[0142] S407, the terminal device sends the current skill request to the application server.
[0143] S408, the application server determines the current skill gateway URL based on the current skill request and the pre-stored correspondence between skills and skill gateway URLs.
[0144] S409, Based on the current skill gateway URL, the application server sends the current skill request to the skill gateway.
[0145] S410, the skill gateway determines the current skill server URL based on the current skill request and the pre-stored correspondence between skills, skill gateway URLs and skill server URLs.
[0146] S411, Based on the current skill server URL, the skill gateway sends the current skill request to the skill server.
[0147] S412, the skill server obtains the current control command based on the current skill request.
[0148] S413, the skill server returns the current control command to the skill gateway.
[0149] S414, the skill gateway returns the current control command to the application server.
[0150] S415, the application server returns the current control command to the terminal device.
[0151] As can be seen from the comparison, the unified access method for skill traffic provided in this application can receive the current skill request sent by the application server and the current control command sent by the skill server through the skill gateway. In other words, the unified access of the current skill request and the current control command is achieved through the skill gateway, thereby enabling traffic control based on the received skill request and control command. This not only improves the stability of the skill server, but also facilitates subsequent traffic analysis.
[0152] The unified access device for skill traffic provided in this application is described below. The unified access device for skill traffic described below can be referred to in correspondence with the unified access method for skill traffic described above.
[0153] like Figure 5 As shown, this application provides a unified access device for skill traffic, applied to a skill gateway, the device comprising:
[0154] The first receiving module 510 is used to receive the current skill request sent by the application server.
[0155] Wherein, the current skill request is a skill request sent by the application server based on the current skill gateway URL, and the current skill gateway URL is a skill gateway URL determined by the application server based on the current skill request and the pre-stored correspondence between skills and skill gateway URLs.
[0156] The determining module 520 is used to determine the current skill server URL corresponding to the current skill request based on the current skill request and the pre-stored correspondence between skills, skill gateway URLs and skill server URLs.
[0157] The first forwarding module 530 is used to forward the current skill request to the skill server based on the current skill server URL.
[0158] As one embodiment of this application, the above-mentioned apparatus may further include:
[0159] The second receiving module is used to receive the current control command sent by the skill server after forwarding the current skill request to the skill server.
[0160] The current control instruction is the control instruction obtained by the skill server based on the current skill request.
[0161] The second forwarding module is used to forward the current control command to the application server.
[0162] As one embodiment of this application, the above-mentioned apparatus may further include:
[0163] The first verification module is used to verify whether the current skill request meets the permission verification conditions before determining the current skill server URL corresponding to the current skill request based on the current skill request and the pre-stored correspondence between skills, skill gateway URLs and skill server URLs.
[0164] The second verification module is used to perform the step of determining the current skill server URL corresponding to the current skill request based on the current skill request and the pre-stored correspondence between the skill, skill gateway URL and skill server URL when the current skill request meets the permission verification conditions.
[0165] As one embodiment of this application, the above-mentioned apparatus may further include:
[0166] The registration module is used to register the information of each skill, generate the skill gateway URL of the skill, and send the correspondence between the skill and the skill gateway URL to the application server before receiving the current skill request sent by the application server.
[0167] As one embodiment of this application, the registration module described above may include:
[0168] The acquisition unit is used to obtain the skill server URL for that skill.
[0169] The replacement unit is used to replace the information to be replaced in the skill server URL of the skill with the domain name of the skill gateway, so as to obtain the skill gateway URL of the skill.
[0170] As one embodiment of this application, the above-mentioned apparatus may further include:
[0171] The storage module is used to store the skill, the skill gateway URL, and the skill server URL after the skill's skill gateway URL is generated.
[0172] As one embodiment of this application, the registration module may further include:
[0173] The sending unit is used to send the mapping relationship between the skill and the skill gateway URL of the skill to the message platform, so that the application server listens to the message platform and obtains the mapping relationship between the skill and the skill gateway URL of the skill.
[0174] The unified access system for skill traffic provided in this application is described below. The unified access system for skill traffic described below can be referred to in correspondence with the unified access method for skill traffic described above.
[0175] like Figure 6 As shown, the unified access system for skill traffic provided in this application may include an application server 610, a skill gateway 620, and a skill server 630.
[0176] The application server 610 is used to determine the current skill gateway URL based on the current skill request and the pre-stored correspondence between skills and skill gateway URLs, and send the current skill request to the skill gateway 620 based on the current skill gateway URL.
[0177] The skill gateway 620 is used to receive the current skill request sent by the application server 610, determine the current skill server URL corresponding to the current skill request based on the current skill request and the pre-stored correspondence between skills, skill gateway URLs and skill server URLs, and forward the current skill request to the skill server 630 based on the current skill server URL.
[0178] The skill server 630 is used to receive the current skill request sent by the skill gateway 620.
[0179] As one implementation method of this application,
[0180] The skill server 630 is also used to obtain the current control command based on the current skill request and send the current control command to the skill gateway 620.
[0181] The skill gateway 620 is also used to receive the current control command sent by the skill server 630 and forward the current control command to the application server 610.
[0182] Application server 610 is used to receive current control commands.
[0183] As one implementation method of this application,
[0184] The skill gateway 620 is also used to verify whether the current skill request meets the permission verification conditions before determining the current skill server URL corresponding to the current skill request based on the current skill request and the pre-stored correspondence between skills, skill gateway URLs and skill server URLs.
[0185] If the current skill request meets the permission verification conditions, the step of determining the current skill server URL corresponding to the current skill request is performed based on the current skill request and the pre-stored correspondence between skills, skill gateway URLs and skill server URLs.
[0186] As one implementation method of this application,
[0187] The skill gateway 620 is also used to register the information of each skill, generate the skill gateway URL of the skill, and send the correspondence between the skill and the skill gateway URL to the application server 610 before receiving the current skill request sent by the application server.
[0188] Application server 610 is also used to receive the correspondence between the skill and the skill gateway URL sent by skill gateway 620.
[0189] As one implementation method of this application,
[0190] Skill Gateway 620 is specifically used to obtain the skill server URL for this skill. The information to be replaced in the skill server URL is replaced with the domain name of the skill gateway to obtain the skill gateway URL for this skill.
[0191] As one implementation method of this application,
[0192] The skill gateway 620 is also used to store the skill, the skill gateway URL, and the skill server URL after the skill's skill gateway URL is generated.
[0193] As one embodiment of this application, the unified access system for the aforementioned skill traffic also includes: a messaging platform;
[0194] Skill Gateway 620 is specifically used to send the mapping relationship between the skill and its skill gateway URL to the messaging platform.
[0195] The messaging platform is used to receive the mapping relationship between the skill and the skill gateway URL sent by the skill gateway 620.
[0196] Application server 610 is also used to listen to the message platform and obtain the correspondence between the skill and the skill gateway URL.
[0197] Figure 7 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 7 As shown, the electronic device may include a processor 710, a communications interface 720, a memory 730, and a communication bus 740, wherein the processor 710, communications interface 720, and memory 730 communicate with each other via the communication bus 740. The processor 710 can call logical instructions in the memory 730 to execute a unified access method for skill traffic. This method includes: receiving a current skill request sent by an application server, wherein the current skill request is a skill request sent by the application server based on a current skill gateway URL, and the current skill gateway URL is a skill gateway URL determined by the application server based on the current skill request and a pre-stored correspondence between skills and skill gateway URLs; determining the current skill server URL corresponding to the current skill request based on the current skill request and the pre-stored correspondence between skills, skill gateway URLs, and skill server URLs; and forwarding the current skill request to the skill server based on the current skill server URL.
[0198] Furthermore, the logical instructions in the aforementioned memory 730 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0199] On the other hand, this application also provides a computer program product, which includes a computer program that can be stored on a computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the unified access method for skill traffic provided by the above methods. The method includes: receiving a current skill request sent by an application server, wherein the current skill request is a skill request sent by the application server based on a current skill gateway URL, and the current skill gateway URL is a skill gateway URL determined by the application server based on the current skill request and a pre-stored correspondence between skills and skill gateway URLs; determining the current skill server URL corresponding to the current skill request based on the current skill request and the pre-stored correspondence between skills, skill gateway URLs, and skill server URLs; and forwarding the current skill request to the skill server based on the current skill server URL.
[0200] In another aspect, this application also provides a computer-readable storage medium, the computer-readable storage medium including a stored program, wherein the program executes the unified access method for skill traffic provided by the above methods when it runs, the method comprising: receiving a current skill request sent by an application server, wherein the current skill request is a skill request sent by the application server based on a current skill gateway URL, the current skill gateway URL is a skill gateway URL determined by the application server based on the current skill request and a pre-stored correspondence between skills and skill gateway URLs; determining the current skill server URL corresponding to the current skill request based on the current skill request and the pre-stored correspondence between skills, skill gateway URLs and skill server URLs; and forwarding the current skill request to a skill server based on the current skill server URL.
[0201] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0202] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0203] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.
Claims
1. A unified access method for skill traffic, characterized in that, Applied to a skill gateway, the method includes: Receive a current skill request sent by the application server, wherein the current skill request is a skill request sent by the application server based on the current skill gateway URL, and the current skill gateway URL is a skill gateway URL determined by the application server based on the current skill request and a pre-stored correspondence between skills and skill gateway URLs; Verify whether the current skill request meets the permission verification conditions; If it is determined that the current skill request meets the permission verification conditions, the current skill server URL corresponding to the current skill request is determined based on the current skill request and the pre-stored correspondence between skills, skill gateway URLs and skill server URLs. The steps to verify that the current skill request meets the permission verification conditions include: Based on the current skill request and the correspondence between the skill, the skill gateway URL, and the skill server URL, the current skill request is verified. If the current skill request has a corresponding skill gateway URL, the current skill request is determined to meet the permission verification conditions. By replacing the domain name in the skill server URL with the skill gateway domain name, a skill gateway URL is generated, and skills are created. The skill gateway URL is then determined based on the skills to construct a mapping relationship between the skill server URLs. Based on the current skill server URL, forward the current skill request to the skill server.
2. The unified access method for skill traffic according to claim 1, characterized in that, After forwarding the current skill request to the skill server, the method further includes: Receive the current control instruction sent by the skill server, wherein the current control instruction is a control instruction obtained by the skill server based on the current skill request; Forward the current control command to the application server.
3. The unified access method for skill traffic according to any one of claims 1, characterized in that, Before receiving the current skill request sent by the application server, the method further includes: For each skill, register the skill information, generate the skill gateway URL for the skill, and send the mapping relationship between the skill and the skill gateway URL to the application server.
4. The unified access method for skill traffic according to claim 3, characterized in that, After generating the skill gateway URL for the skill, the method further includes: Store the skill, the skill gateway URL of the skill, and the skill server URL of the skill.
5. The unified access method for skill traffic according to claim 3, characterized in that, Sending the mapping between the skill and its skill gateway URL to the application server includes: The mapping between the skill and its skill gateway URL is sent to the messaging platform so that the application server can listen to the messaging platform and obtain the mapping between the skill and its skill gateway URL.
6. A unified access device for skill traffic, characterized in that, Applied to a skills gateway, the device includes: The first receiving module is used to receive a current skill request sent by the application server, wherein the current skill request is a skill request sent by the application server based on the current skill gateway URL, and the current skill gateway URL is a skill gateway URL determined by the application server based on the current skill request and a pre-stored correspondence between skills and skill gateway URLs; The determining module is used to determine the current skill server URL corresponding to the current skill request based on the current skill request and the pre-stored correspondence between skills, skill gateway URLs and skill server URLs; By replacing the domain name in the skill server URL with the skill gateway domain name, a skill gateway URL is generated, and skills are created. The skill gateway URL is then determined based on the skills to construct a mapping relationship between the skill server URLs. The first forwarding module is used to forward the current skill request to the skill server based on the current skill server URL.
7. A unified access system for skill traffic, characterized in that, The system includes: an application server, a skill gateway, and a skill server; The application server is used to determine the current skill gateway URL based on the current skill request and the pre-stored correspondence between skills and skill gateway URLs, and to send the current skill request to the skill gateway based on the current skill gateway URL. The skill gateway is configured to receive the current skill request sent by the application server, verify whether the current skill request meets the permission verification conditions; if it is determined that the current skill request meets the permission verification conditions, based on the current skill request and the pre-stored correspondence between skills, skill gateway URLs, and skill server URLs, determine the current skill server URL corresponding to the current skill request, and forward the current skill request to the skill server based on the current skill server URL; the step of verifying that the current skill request meets the permission verification conditions includes: verifying the current skill request based on the current skill request and the correspondence between skills, skill gateway URLs, and skill server URLs, and determining that the current skill request meets the permission verification conditions if it is verified that the current skill request has a corresponding skill gateway URL; By replacing the domain name in the skill server URL with the skill gateway domain name, a skill gateway URL is generated, and skills are created. The skill gateway URL is then determined based on the skills to construct a mapping relationship between the skill server URLs. The skill server is used to receive current skill requests sent by the skill gateway.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored program, wherein the program, when executed, performs the method of any one of claims 1 to 5.
9. An electronic device comprising a memory and a processor, characterized in that, The memory stores a computer program, and the processor is configured to execute the method of any one of claims 1 to 5 through the computer program.
Citation Information
Patent Citations
Front-end request processing method, device and equipment and readable storage medium
CN111324843A