A method, apparatus, electronic device, and storage medium for inter-service communication.
Patent Information
- Application Number
- CN202310767323.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-27
- Publication Date
- 2026-09-01
- Estimated Expiration
- 2043-06-27
AI Technical Summary
[0003]有鉴于此,本发明实施例提供一种服务间通信的方法、装置、电子设备及存储介质,能够解决基于浏览器运行的不同服务之间无法通信的问题
Smart Images

Figure CN116962497B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of communication technology, and in particular to a method, apparatus, electronic device, and storage medium for inter-service communication. Background Technology
[0002] During browser operation, there is a communication problem between applications or services (hereinafter referred to as services). Services are developed by different developers, and their input and output parameters are custom. Even if they are developed in the same programming language and have the same naming conventions, there is a problem that the same business meaning uses different variable names, which makes it impossible for different services running on the browser to communicate. Summary of the Invention
[0003] In view of this, embodiments of the present invention provide a method, apparatus, electronic device, and storage medium for inter-service communication, which can solve the problem that different services running based on a browser cannot communicate with each other.
[0004] In a first aspect, embodiments of the present invention provide a method for inter-service communication, applied to a browser. The method for inter-service communication includes: obtaining output parameters of a first service; the first service being a service currently running on the browser; determining a second service that matches the output parameters of the first service from the service matching mapping table based on the output parameters of the first service and a preset service matching mapping table; recommending a second service so that the second service runs the second service using the output parameters of the first service as input parameters of the second service, and outputs service information.
[0005] Optionally, obtaining the output parameters of the first service includes: providing the first service in the form of a first webpage; receiving first input information input in the first service, so that the first service outputs first service information based on the first input information; and obtaining the output parameters of the first service based on the first service information.
[0006] Optionally, obtaining the output parameters of the first service based on the first service information includes: obtaining key output parameters from the output parameters of the first service based on the first service information.
[0007] Optionally, determining a second service that matches the output parameters of the first service from the service matching mapping table based on the output parameters of the first service and a preset service matching mapping table includes: determining whether the first output parameter of the first service exists in the service matching mapping table; if so, determining a first input parameter corresponding to the first output parameter from the service matching mapping table; and determining a second service applicable to the first input parameter from the service matching mapping table based on the first input parameter.
[0008] Optionally, the service matching mapping table includes a dictionary table and a relation mapping table; wherein, determining whether the first output parameter of the first service exists in the preset service matching mapping table includes: determining whether the first output parameter of the first service exists in the dictionary table; the dictionary table includes two or more dictionary entries, each dictionary entry including an entry identifier, a key parameter field name, and a service identifier to which the key parameter applies; if yes, determining the first input parameter corresponding to the first output parameter from the service matching mapping table includes: if yes, determining the first dictionary entry identifier to which the first output parameter belongs; determining the second dictionary entry identifier corresponding to the first dictionary entry identifier from the relation mapping table; determining the first input parameter in the second dictionary entry from the dictionary table based on the second dictionary entry identifier; determining the second service applicable to the first input parameter from the service matching mapping table based on the first input parameter includes: determining the dictionary entry to which the first input parameter belongs in the dictionary table; determining the second service applicable to the first input parameter in the dictionary entry to which the first input parameter belongs.
[0009] Optionally, determining a second service matching the output parameters of the first service from the service matching mapping table based on the output parameters of the first service and a preset service matching mapping table includes: determining whether the first output parameters of the first service exist in the service matching mapping table; if so, determining the content type described by the key parameter field of the first output parameter from the service matching mapping table; determining a first set of input parameters with the same content type as the key parameter field of the first output parameter from the service matching mapping table; filtering out the first input parameters corresponding to the first output parameter from the first set of input parameters based on preset constraints; and determining a second service applicable to the first input parameters from the service matching mapping table based on the first input parameters.
[0010] Optionally, the service matching mapping table includes a dictionary table and a relationship mapping table; wherein, determining whether the first output parameter of the first service exists in the service matching mapping table includes: determining whether the first output parameter of the first service exists in the dictionary table; the dictionary table includes two or more dictionary entries, each dictionary entry including an entry identifier, a key parameter field name, a service identifier to which the key parameter applies, a content type described by the key parameter field, and an auxiliary field; if yes, then determining the content type described by the key parameter field of the first output parameter from the service matching mapping table includes: if yes, then determining the content type described by the key parameter field of the first output parameter from the dictionary entry to which the first output parameter belongs; the determination of the key parameter field of the first output parameter from the service matching mapping table... The first set of input parameters with the same content type as the number segment includes: determining, from the dictionary table, the first set of input parameters with the same content type as the key parameter field of the first output parameter; the step of filtering the first input parameter corresponding to the first output parameter from the first set of input parameters based on preset constraints includes: filtering according to the auxiliary field to filter the first input parameter corresponding to the first output parameter that satisfies the preset constraints; the step of determining the second service applicable to the first input parameter from the service matching mapping table based on the first input parameter includes: determining the dictionary entry to which the first input parameter belongs in the dictionary table; and determining the second service applicable to the first input parameter from the dictionary entry to which the first input parameter belongs.
[0011] Optionally, recommending a second service so that the second service uses the output parameters of the first service as input parameters to run the second service and outputs service information includes: recommending the second service in the form of a second webpage so that the second service uses the output parameters of the first service as input parameters to run the second service and outputs service information on the second webpage interface.
[0012] Optionally, after recommending a second service so that the second service runs with the output parameters of the first service as input parameters and outputs service information, the inter-service communication method further includes updating the service matching mapping table.
[0013] Secondly, embodiments of the present invention also provide an inter-service communication apparatus applied to a browser. The inter-service communication apparatus includes: a first acquisition module, configured to acquire output parameters of a first service; the first service being a service currently running on the browser; a service matching module, configured to determine a second service matching the output parameters of the first service from the service matching mapping table based on the output parameters of the first service and a preset service matching mapping table; and a service recommendation module, configured to recommend a second service so that the second service runs the second service using the output parameters of the first service as input parameters and outputs service information.
[0014] Optionally, the first acquisition module includes: a service providing submodule, configured to provide a first service in the form of a first webpage; a service information receiving submodule, configured to receive first input information entered in the first service, so that the first service outputs first service information based on the first input information; and a service parameter acquisition submodule, configured to acquire the output parameters of the first service based on the first service information.
[0015] Optionally, the service parameter acquisition submodule is specifically used to acquire key output parameters from the output parameters of the first service based on the first service information.
[0016] Optionally, the service matching module includes: a first judgment submodule, configured to determine whether the first output parameter of the first service exists in the service matching mapping table; an input parameter determination submodule, configured to determine, if so, a first input parameter corresponding to the first output parameter from the service matching mapping table; and a second service determination submodule, configured to determine, based on the first input parameter, a second service applicable to the first input parameter from the service matching mapping table.
[0017] Optionally, the service matching mapping table includes a dictionary table and a relation mapping table; the first judgment submodule is specifically used to determine whether the first output parameter of the first service exists in the dictionary table; the dictionary table includes two or more dictionary entries, each dictionary entry including an entry identifier, a key parameter field name, and a service identifier to which the key parameter applies; the input parameter determination submodule is specifically used to determine, if yes, the first dictionary entry identifier to which the first output parameter belongs; determine, from the relation mapping table, a second dictionary entry identifier corresponding to the first dictionary entry identifier; and determine, based on the second dictionary entry identifier, the first input parameter in the second dictionary entry from the dictionary table; the second service determination submodule is specifically used to determine, in the dictionary table, the dictionary entry to which the first input parameter belongs; and determine, in the dictionary entry to which the first input parameter belongs, the second service to which the first input parameter applies.
[0018] Optionally, the service matching module further includes: a second judgment submodule, used to determine whether the first output parameter of the first service exists in the service matching mapping table; a parameter content type determination submodule, used to determine, if so, the content type described by the key parameter field of the first output parameter from the service matching mapping table; a parameter set determination submodule, used to determine, from the service matching mapping table, a first set of input parameters that has the same content type as the key parameter field of the first output parameter; a parameter filtering submodule, used to filter out the first input parameter corresponding to the first output parameter from the first set of input parameters based on preset constraints; and a second service determination submodule, used to determine, based on the first input parameter, a second service applicable to the first input parameter from the service matching mapping table.
[0019] Optionally, the service matching mapping table includes a dictionary table and a relationship mapping table; the second judgment submodule is specifically used to determine whether the first output parameter of the first service exists in the dictionary table; the dictionary table includes two or more dictionary entries, each dictionary entry includes an entry identifier, a key parameter field name, a service identifier applicable to the key parameter, a content type described by the key parameter field, and an auxiliary field; the parameter content type determination submodule is specifically used to determine, if yes, the content type described by the key parameter field of the first output parameter in the dictionary entry to which the first output parameter belongs; the parameter set determination submodule is specifically used to determine, from the dictionary table, a first set of input parameters that has the same content type as the key parameter field of the first output parameter; the parameter filtering submodule is specifically used to filter according to the auxiliary field, and filter out the first input parameters corresponding to the first output parameter that meet the preset constraints from the first set of input parameters; the second service determination submodule is specifically used to determine, from the dictionary table, the dictionary entry to which the first input parameter belongs; and in the dictionary entry to which the first input parameter belongs, determine the second service applicable to the first input parameter.
[0020] Optionally, the service recommendation module is specifically used to: recommend a second service in the form of a second webpage, so that the second service runs the second service using the output parameters of the first service as the input parameters of the second service, and outputs service information on the second webpage interface.
[0021] Optionally, the apparatus further includes a mapping table update module for updating the service matching mapping table.
[0022] Thirdly, the present invention also provides an electronic device comprising: a housing, a processor, a memory, a circuit board, and a power supply circuit, wherein the circuit board is disposed within the space enclosed by the housing, and the processor and the memory are disposed on the circuit board; the power supply circuit is used to supply power to various circuits or devices of the electronic device; the memory is used to store executable program code; the processor runs a program corresponding to the executable program code by reading the executable program code stored in the memory, for executing the inter-service communication method described in any of the first aspects above.
[0023] Fourthly, embodiments of the present invention provide a computer-readable storage medium storing one or more programs, which can be executed by one or more processors to implement the inter-service communication method described in any of the first aspects.
[0024] This invention provides a method, apparatus, electronic device, and storage medium for inter-service communication. Based on the output parameters of a first service running on a browser and a preset service matching mapping table, a second service that matches the output parameters of the first service is determined from the service matching mapping table, thereby recommending the second service. This enables communication between different services running on a browser and solves the problem of communication failure between different services running on a browser. Attached Figure Description
[0025] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0026] Figure 1 This is a schematic flowchart of an embodiment of the inter-service communication method of the present invention;
[0027] Figure 2a This is a dictionary representation of a service matching mapping table in one embodiment of the present invention;
[0028] Figure 2b This is a schematic representation of the relationship mapping in the service matching mapping table in one embodiment of the present invention;
[0029] Figure 3 This is a schematic diagram of the device architecture for service communication according to an embodiment of the present invention;
[0030] Figure 4 This is a schematic block diagram illustrating the architecture of an embodiment of the electronic device of the present invention. Detailed Implementation
[0031] The embodiments of the present invention will now be described in detail with reference to the accompanying drawings.
[0032] It should be understood that the described embodiments are merely some, not all, of the embodiments of the present invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without inventive effort are within the scope of protection of the present invention.
[0033] During browser operation, web pages (referred to as services in this invention, hereinafter collectively referred to as services) cannot communicate with each other due to their different domains. Services (web pages in this invention) are developed by different developers, and their input and output parameters are custom-defined. Even with the same programming language and naming conventions, the same business meaning can be expressed using different variable names. Therefore, this invention provides a method, apparatus, electronic device, and storage medium for inter-service communication. Based on the output parameters of a first service running in the browser and a preset service matching mapping table, a second service matching the output parameters of the first service is determined from the service matching mapping table, and the second service is recommended. This enables communication between different services running in the browser, solving the problem of communication barriers between different services running in the browser.
[0034] Example 1
[0035] Please refer to Figure 1 The diagram illustrates a flowchart of an inter-service communication method provided in one embodiment of this application. This embodiment uses the method applied to a browser as an example. The inter-service communication method includes:
[0036] S20. Obtain the output parameters of the first service; the first service is a service currently running on the browser.
[0037] In this step, before the browser runs, users can click on a link in the browser or other electronic devices to jump to or directly open a webpage, and enter information on the webpage according to different business needs. In this way, the browser can obtain the output parameters of the first service at runtime. At this time, the first service is the service currently running in the browser.
[0038] Optionally, in one embodiment of the present invention, obtaining the output parameters of the first service includes: providing the first service in the form of a first webpage; receiving first input information input in the first service, so that the first service outputs first service information based on the first input information; and obtaining the output parameters of the first service based on the first service information.
[0039] Based on the first service information, all output parameters of the first service can be obtained. To improve service matching efficiency and targeting, in some embodiments, obtaining the output parameters of the first service based on the first service information includes: obtaining key output parameters from the output parameters of the first service based on the first service information.
[0040] Specifically, the service is displayed in the browser as a webpage. During runtime, the browser receives initial input information from the user within the first service and outputs first service information based on this information. This service information includes the service's business data. Based on this first service information, the browser can obtain key output parameter fields from the first service's output parameters. For example, a user opens a webpage in the browser via a link. The webpage content is service A, which provides a service for querying personal information. The user inputs their personal information into the webpage. Based on the business needs of service A, the browser needs to obtain the output parameters of service A. Thus, during runtime, the browser can obtain the output parameters of service A based on the information input by the user.
[0041] S40. Based on the output parameters of the first service and a preset service matching mapping table, determine a second service that matches the output parameters of the first service from the service matching mapping table.
[0042] Specifically, after obtaining the output parameters of the first service, the browser iterates through the output parameters of the first service, parses a preset service matching mapping table, and matches key input parameters from the service matching mapping table that match the key output parameters of the first service to determine the second service. It should be noted that the second service can be one or more; this embodiment only describes one second service. For example, service A provides users with personal information queries. Because of the business needs of service A, it needs to recommend other services based on the output parameters of service A, such as weather recommendations. Therefore, based on the output parameters of service A and the preset service matching mapping table, it queries the mapping table for service B that matches the output parameters of service A. Service B is weather.
[0043] S60. Recommend a second service so that the second service runs with the output parameters of the first service as input parameters and outputs service information.
[0044] Specifically, after finding a second service that matches the output parameters of the first service, the second service is recommended, so that the browser can use the output parameters of the first service as the input parameters of the second service to run the second service and display the information of the second service on the webpage.
[0045] The inter-service communication method of this invention can determine a second service that matches the output parameters of the first service based on the output parameters of a first service running on a browser and a preset service matching mapping table, thereby recommending the second service. This enables communication between different services running on a browser and solves the problem that different services running on a browser cannot communicate.
[0046] Optionally, in one embodiment of the present invention, the step of determining a second service that matches the output parameters of the first service from the service matching mapping table based on the output parameters of the first service and a preset service matching mapping table (step S40) includes:
[0047] S401. Determine whether the first output parameter of the first service exists in the service matching mapping table. If the first output parameter of the first service exists in the service matching mapping table, then proceed to step S402.
[0048] S402. Determine the first input parameter corresponding to the first output parameter from the service matching mapping table.
[0049] S403. Based on the first input parameter, determine the second service applicable to the first input parameter from the service matching mapping table.
[0050] Specifically, when performing key parameter matching using the service matching mapping table provided in this embodiment of the invention, the matching process can be divided into precise matching and fuzzy matching based on different key fields and the content of the service matching mapping table. When the first output parameter of the first service exists in the service matching mapping table, precise matching is performed. When the first output parameter of the first service does not exist in the service matching mapping table, fuzzy matching is performed by filtering through constraint conditions.
[0051] Optionally, in one embodiment of the present invention, the service matching mapping table includes a dictionary table and a relationship mapping table;
[0052] The step of determining whether the first output parameter of the first service exists in the preset service matching mapping table (step S401) includes: determining whether the first output parameter of the first service exists in the dictionary table; the dictionary table includes two or more dictionary entries, each dictionary entry includes an entry identifier, a key parameter field name, and a service identifier to which the key parameter applies.
[0053] Determining the first input parameter corresponding to the first output parameter from the service matching mapping table (step S402) includes: determining the identifier of the first dictionary entry to which the first output parameter belongs; determining the identifier of the second dictionary entry corresponding to the first dictionary entry from the relation mapping table; and determining the first input parameter in the second dictionary entry from the dictionary table based on the second dictionary entry identifier.
[0054] The step of determining the second service applicable to the first input parameter from the service matching mapping table based on the first input parameter (step S403) includes: determining the dictionary entry to which the first input parameter belongs in the dictionary table; and determining the second service applicable to the first input parameter in the dictionary entry to which the first input parameter belongs.
[0055] For details, please refer to Figure 2a , Figure 2b As shown in the table below, the service matching mapping table provided in this embodiment of the invention includes a dictionary table (see...). Figure 2a ) and relational mapping table ( Figure 2b The dictionary table has two or more dictionary entries. Each dictionary entry includes an entry identifier, a key parameter field name, a service identifier to which the key parameter applies, the content type described by the key parameter field, and the key parameter type. The content described by the key parameter field includes: string, number, file, etc., as well as auxiliary fields. The auxiliary fields include length (describes the length of the string if it is a string), min (describes the minimum value if it is a number), and max (describes the maximum value if it is a number). The relation mapping table has two or more relation entries. Each relation entry includes an entry identifier, an output parameter key field, and an input parameter key field, as shown in Tables 1 and 2.
[0056] Table 1
[0057]
[0058] Table 2
[0059]
[0060]
[0061] In this embodiment, during precise matching, since it is determined that the key output parameter in the output parameters of the first service obtained by the browser exists in the dictionary table, the identifier of the first dictionary entry to which the key output parameter belongs is determined based on the dictionary content. From the relational mapping table, the identifier of the second dictionary entry corresponding to the identifier of the first dictionary entry is determined. Based on the identifier of the second dictionary entry, the first input parameter in the second dictionary entry is determined according to the mapping relationship of the dictionary table. Here, the first input parameter is the input parameter of the second service. Based on the mapping, the dictionary entry to which the first input parameter belongs is determined. Based on the content of the dictionary entry to which the first input parameter belongs, the second service to which the first input parameter applies is queried. For example, when the browser runs, it obtains the output parameters of service A. By parsing the service matching mapping table, it finds that the output parameters of service A (e.g., location) exist in the dictionary table. Based on the mapping relationship of the dictionary table, the input parameter (e.g., city) corresponding to the output parameters of service A is found. Based on the input parameter (e.g., city), the corresponding service B is queried.
[0062] Specifically, the above embodiments are the operation steps of the service matching mapping table provided by the present invention when performing precise matching. Only part of the dictionary table is used, while the other part is used for fuzzy matching. It should be noted that precise matching is performed by the name of the parameter field, while fuzzy matching is performed by the type of the parameter field.
[0063] Optionally, in one embodiment of the present invention, determining a second service that matches the output parameters of the first service from the service matching mapping table based on the output parameters of the first service and a preset service matching mapping table includes:
[0064] Determine whether the first output parameter of the first service exists in the service matching mapping table;
[0065] If not, then determine the content type described by the key parameter field of the first output parameter from the service matching mapping table;
[0066] From the service matching mapping table, determine the first set of input parameters that are of the same content type as the key parameter fields of the first output parameter;
[0067] Based on preset constraints, the first input parameter corresponding to the first output parameter is selected from the first input parameter set;
[0068] Based on the first input parameter, a second service applicable to the first input parameter is determined from the service matching mapping table.
[0069] Optionally, in one embodiment of the present invention, the service matching mapping table includes a dictionary table and a relationship mapping table;
[0070] The step of determining whether the first output parameter of the first service exists in the service matching mapping table includes: determining whether the first output parameter of the first service exists in the dictionary table; the dictionary table includes two or more dictionary entries, each dictionary entry includes an entry identifier, a key parameter field name, a service identifier to which the key parameter applies, a content type described by the key parameter field, and an auxiliary field;
[0071] If so, then determine the content type described by the key parameter field of the first output parameter from the service matching mapping table, including: if so, determine the content type described by the key parameter field of the first output parameter from the dictionary table entry to which the first output parameter belongs;
[0072] Determining the first set of input parameters from the service matching mapping table that has the same content type as the key parameter field of the first output parameter includes: determining the first set of input parameters from the dictionary table that has the same content type as the key parameter field of the first output parameter;
[0073] The step of filtering out the first input parameter corresponding to the first output parameter from the first input parameter set based on preset constraints includes: filtering according to the auxiliary field to filter out the first input parameter corresponding to the first output parameter that satisfies the preset constraints from the first input parameter set;
[0074] The step of determining the second service applicable to the first input parameter from the service matching mapping table based on the first input parameter includes: determining the dictionary entry to which the first input parameter belongs in the dictionary table; and determining the second service applicable to the first input parameter in the dictionary entry to which the first input parameter belongs.
[0075] Specifically, when the first output parameter of the first service does not exist in the service matching mapping table, the content type described by the key parameter field of the first output parameter is determined based on the contents of the dictionary table (e.g., string, number, or file). Based on the content type described by the determined key parameter field, the set of first input parameters with the same content type as the key parameter field is found. Filtering is performed based on auxiliary fields (length, min, max) to select the first input parameters corresponding to the first output parameter that meet preset constraints, namely the dictionary table and the relation mapping table. Based on the selected first input parameters, the second service to which the first input parameter applies is determined from the relation table. For example, when the browser runs, it obtains the output parameter (e.g., age) of service A. By parsing the service matching mapping table, it determines the content type (e.g., Number) described by the key parameter field of the output parameter (e.g., age) of service A. Based on the content type described by the key parameter field of service A, it finds the first set of input parameters that are the same as the content type described by the key parameter field of service A. It then filters the first input parameter (limit_age) that satisfies both the dictionary table and the relational mapping table. Based on the first input parameter (limit_age), it queries the corresponding service D.
[0076] Optionally, in one embodiment of the present invention, recommending a second service, causing the second service to run with the output parameters of the first service as input parameters and output service information, includes:
[0077] The second service is recommended in the form of a second webpage, so that the second service runs the second service with the output parameters of the first service as the input parameters of the second service, and outputs service information on the second webpage interface.
[0078] Specifically, after retrieving the second service from the service matching mapping table, the second service is recommended in the form of a second webpage. This allows the second service to run using the output parameters of the first service as its input parameters, and the service information is displayed on the second webpage interface. For example, if a user enters user information on the first webpage, the browser determines the second service using the method provided in this embodiment of the invention. The second service runs using the output parameters of the first service as its input parameters. After determining the second service, it is recommended to the user in the form of a second webpage, and the service information is displayed on the second webpage interface.
[0079] Optionally, in one embodiment of the present invention, after recommending a second service so that the second service runs the second service with the output parameters of the first service as the input parameters of the second service and outputs service information, the inter-service communication method further includes: updating the service matching mapping table.
[0080] In practical implementation, a platform can be built for developers and internal operations before the browser initiates inter-service communication. Developers and operations personnel can manage and maintain the service matching mapping table through this platform. This service matching mapping table is used to match input and output parameters between different services, ensuring that the output parameters of service A can be recognized by service B. Before using the service matching mapping table for parameter matching, developers and operations personnel enter information into the table to enrich its content, i.e., to store the business data of web service input and output. Simultaneously, the platform is used to update and maintain the mapping table.
[0081] Specifically, the service matching mapping table is constantly updated. Both service developers and platform operators can trigger updates to the service matching mapping table. When updating the service matching mapping table, a combination of push and pull methods can be used to update the service matching mapping table that already exists in the browser. The push method is a long-lived connection update, which means that when there is an update in the cloud, the browser automatically triggers and downloads the updated mapping table file through a long connection. The pull method is a periodic check for updates during service runtime. That is, the browser automatically checks the status when the service is running, and if there is an update, it downloads the updated mapping table file.
[0082] This invention provides a method for inter-service communication. The method involves obtaining the output parameters of a first service; determining a second service that matches the output parameters of the first service from the service matching mapping table based on the output parameters of the first service and a preset service matching mapping table; recommending the second service so that the second service uses the output parameters of the first service as its input parameters and outputs service information. This method, using key field matching, ensures that the input and output parameters between services match, thus solving the problem of mismatched input and output parameters between services and enabling communication between services after parameter matching.
[0083] Example 2
[0084] Figure 3 Please refer to the schematic diagram of the device structure for inter-service communication provided in this embodiment of the invention. Figure 3 As shown in the embodiments of the present invention, the apparatus described is applied to a browser, and the inter-service communication apparatus includes:
[0085] The first acquisition module 31 is used to acquire the output parameters of the first service; the first service is a service currently running on the browser;
[0086] The service matching module 32 is used to determine a second service that matches the output parameters of the first service from the service matching mapping table based on the output parameters of the first service and a preset service matching mapping table;
[0087] The service recommendation module 33 is used to recommend a second service so that the second service runs the second service with the output parameters of the first service as the input parameters of the second service, and outputs service information.
[0088] In some feasible implementations, the first acquisition module includes:
[0089] The service provision submodule is used to provide the first service in the form of the first webpage;
[0090] The service information receiving submodule is used to receive first input information entered in the first service, so that the first service outputs first service information based on the first input information;
[0091] The service parameter acquisition submodule is used to acquire the output parameters of the first service based on the first service information.
[0092] In some feasible implementations, the service parameter acquisition submodule is specifically used to acquire key output parameters from the output parameters of the first service based on the first service information.
[0093] In some feasible implementations, the service matching module includes:
[0094] The first judgment submodule is used to determine whether the first output parameter of the first service exists in the service matching mapping table;
[0095] The input parameter determination submodule is used to determine, if yes, the first input parameter corresponding to the first output parameter from the service matching mapping table;
[0096] The second service determination submodule is used to determine, based on the first input parameters, a second service applicable to the first input parameters from the service matching mapping table.
[0097] In some feasible implementations, the service matching mapping table includes a dictionary table and a relationship mapping table;
[0098] The first judgment submodule is specifically used to determine whether the first output parameter of the first service exists in the dictionary table; the dictionary table includes two or more dictionary entries, each dictionary entry includes an entry identifier, a key parameter field name, and a service identifier to which the key parameter applies;
[0099] The input parameter determination submodule is specifically used to: if so, determine the first dictionary entry identifier to which the first output parameter belongs; determine the second dictionary entry identifier corresponding to the first dictionary entry identifier from the relation mapping table; and determine the first input parameter in the second dictionary entry from the dictionary table based on the second dictionary entry identifier.
[0100] The second service determination submodule is specifically used to determine the dictionary entry to which the first input parameter belongs in the dictionary table; and to determine the second service applicable to the first input parameter in the dictionary entry to which the first input parameter belongs.
[0101] In some feasible implementations, the service matching module further includes:
[0102] The second judgment submodule is used to determine whether the first output parameter of the first service exists in the service matching mapping table;
[0103] The parameter content type determination submodule is used to determine the content type described by the key parameter field of the first output parameter from the service matching mapping table if the content type is specified.
[0104] The parameter set determination submodule is used to determine, from the service matching mapping table, a first set of input parameters that is of the same content type as the key parameter field of the first output parameter;
[0105] The parameter filtering submodule is used to filter out the first input parameter corresponding to the first output parameter from the first input parameter set based on preset constraints.
[0106] The second service determination submodule is used to determine, based on the first input parameters, a second service applicable to the first input parameters from the service matching mapping table.
[0107] In some feasible implementations, the service matching mapping table includes a dictionary table and a relationship mapping table;
[0108] The second judgment submodule is specifically used to determine whether the first output parameter of the first service exists in the dictionary table; the dictionary table includes two or more dictionary entries, each dictionary entry includes an entry identifier, a key parameter field name, a service identifier to which the key parameter applies, a content type described by the key parameter field, and auxiliary fields;
[0109] The parameter content type determination submodule is specifically used to determine, if yes, the content type described by the key parameter field of the first output parameter in the dictionary entry to which the first output parameter belongs.
[0110] The parameter set determination submodule is specifically used to determine, from the dictionary table, a first set of input parameters that is of the same type as the content described by the key parameter fields of the first output parameter;
[0111] The parameter filtering submodule is specifically used to filter according to the auxiliary field, and to select the first input parameter corresponding to the first output parameter that satisfies the preset constraint conditions from the first input parameter set;
[0112] The second service determination submodule is specifically used to determine the dictionary entry to which the first input parameter belongs in the dictionary table; and to determine the second service applicable to the first input parameter in the dictionary entry to which the first input parameter belongs.
[0113] In some feasible implementations, the service recommendation module is specifically used to: recommend a second service in the form of a second webpage, so that the second service runs the second service with the output parameters of the first service as the input parameters of the second service, and outputs service information on the second webpage interface.
[0114] In some feasible implementations, the apparatus further includes a mapping table update module for updating the service matching mapping table.
[0115] The inter-service communication apparatus provided in this embodiment of the invention can be used to execute the technical solutions of any of the disclosed method embodiments in Embodiment 1. Its implementation principle and technical effects are similar, and will not be repeated here.
[0116] Example 3
[0117] Figure 4 This is a schematic block diagram of the architecture of an embodiment of the electronic device of the present invention. Based on the same technical concept as the aforementioned embodiment one, the electronic device provided by the present invention, as shown in Figure 4, can implement the steps and flow of any of the embodiments described in embodiment one of the present invention.
[0118] The aforementioned electronic device may include: a housing 41, a processor 42, a memory 43, a circuit board 44, and a power supply circuit 45, wherein the circuit board 44 is disposed inside the space enclosed by the housing 41, and the processor 42 and the memory 43 are disposed on the circuit board 44; the power supply circuit 45 is used to supply power to the various circuits or devices of the aforementioned electronic device; the memory 43 is used to store executable program code; the processor 42 runs a program corresponding to the executable program code by reading the executable program code stored in the memory 43, for executing the inter-service communication method described in any of the aforementioned embodiments.
[0119] For details on the specific execution process of the above steps by the processor 42 and the steps further executed by the processor 42 by running executable program code, please refer to the description of Embodiment 1 of the present invention, which will not be repeated here.
[0120] The electronic device exists in various forms, including but not limited to:
[0121] (1) Mobile communication devices: These devices are characterized by their mobile communication capabilities and primarily aim to provide voice and data communication. These terminals include: smartphones (e.g., iPhones), multimedia phones, feature phones, and low-end phones, etc.
[0122] (2) Ultra-mobile personal computer devices: These devices fall under the category of personal computers, possessing computing and processing capabilities, and generally also have mobile internet access features. These terminals include PDAs, MIDs, and UMPCs, such as the iPad.
[0123] (3) Portable entertainment devices: These devices can display and play multimedia content. This category includes: audio and video players (such as iPods), handheld game consoles, e-books, as well as smart toys and portable car navigation devices.
[0124] (4) Server: A device that provides computing services. The components of a server include a processor, hard disk, memory, system bus, etc. Servers are similar to general computer architectures, but because they need to provide highly reliable services, they have higher requirements in terms of processing power, stability, reliability, security, scalability, and manageability.
[0125] (5) Other electronic devices with data interaction functions.
[0126] Example 4
[0127] This invention also provides a computer-readable storage medium storing one or more programs that can be executed by one or more processors to implement the inter-service communication method described in any of the preceding embodiments.
[0128] In summary, embodiments of the present invention provide a method, apparatus, electronic device, and storage medium for inter-service communication. By using the output parameters of a first service running in a browser and a preset service matching mapping table, a second service matching the output parameters of the first service is determined from the service matching mapping table. The second service is then recommended so that it uses the output parameters of the first service as input parameters and outputs service information. This enables communication between different services running in a browser, solving the problem of communication barriers between different services running in a browser.
[0129] Furthermore, this invention uses a service matching mapping table as a communication bridge, which acts as a translation between services, enabling the input and output parameters between services to understand and recognize each other. This makes the service runtime environment (browser) and even the services on the entire operating system more flexible, providing users with a more diverse experience.
[0130] It should be noted that in this article, relational terms such as first and second are only used to refer to...
[0131] Distinguishing one entity or operation from another does not necessarily require or imply these distinctions.
[0132] There is no such actual relationship or order between entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0133] The various embodiments in this specification are described in a related manner. The same or similar parts between the various embodiments can be referred to each other. Each embodiment focuses on describing the differences from other embodiments.
[0134] For ease of description, if systems, servers, etc. are involved, they may be described separately as various units / modules based on their functions. Of course, in implementing this invention, the functions of each unit / module can be implemented in one or more software and / or hardware.
[0135] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. The storage medium can be a magnetic disk, optical disk, read-only memory (ROM), or random access memory (RAM), etc.
[0136] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A method for inter-service communication, applied to a browser, characterized in that, include: Obtain the output parameters of the first service; The first service is a service currently running on the browser; Based on the output parameters of the first service and a preset service matching mapping table, a second service that matches the output parameters of the first service is determined from the service matching mapping table; A second service is recommended so that the second service runs with the output parameters of the first service as its input parameters and outputs service information. The service matching mapping table includes a dictionary table and a relationship mapping table; the dictionary table includes two or more dictionary entries, each dictionary entry including an entry identifier, a key parameter field name, a service identifier to which the key parameter applies, the content type described by the key parameter field, and auxiliary fields; Based on the output parameters of the first service and a preset service matching mapping table, when determining a second service that matches the output parameters of the first service from the service matching mapping table, the matching process selects either exact matching or fuzzy matching according to different output parameters and the contents of the service matching mapping table; when the first output parameter of the first service exists in the service matching mapping table, exact matching is performed; when the first output parameter of the first service does not exist in the service matching mapping table, fuzzy matching is performed by filtering through preset constraints. Determining the second service from the service matching mapping table that matches the output parameters of the first service includes: Determine whether the first output parameter of the first service exists in the dictionary table; If so, determine the identifier of the first dictionary entry to which the first output parameter belongs; determine the identifier of the second dictionary entry corresponding to the first dictionary entry from the relation mapping table; determine the first input parameter in the second dictionary entry from the dictionary table based on the second dictionary entry identifier; In the dictionary table, determine the dictionary entry to which the first input parameter belongs; in the dictionary entry to which the first input parameter belongs, determine the second service to which the first input parameter applies; If not, then determine the content type described by the key parameter field of the first output parameter from the dictionary table; Determine a first set of input parameters that are the same as the content type from the dictionary table; Based on the auxiliary field, filter the first input parameters that meet the preset constraints and correspond to the first output parameters from the first input parameter set. Based on the selected first input parameters, the applicable second service is determined.
2. The method of inter-service communication of claim 1, wherein, The process of obtaining the output parameters of the first service includes: To provide the first service by creating the first webpage; Receive first input information entered in the first service, so that the first service outputs first service information based on the first input information; Based on the first service information, obtain the output parameters of the first service.
3. The method of inter-service communication of claim 2, wherein, The step of obtaining the output parameters of the first service based on the first service information includes: Based on the first service information, obtain the key output parameters from the output parameters of the first service.
4. The method of inter-service communication of claim 1, wherein, The recommended second service, which allows the second service to run using the output parameters of the first service as input parameters and output service information, includes: The second service is recommended in the form of a second webpage, so that the second service runs the second service with the output parameters of the first service as the input parameters of the second service, and outputs service information on the second webpage interface.
5. The method for inter-service communication according to claim 1, characterized in that, After recommending a second service, causing the second service to run with the output parameters of the first service as input parameters and output service information, the inter-service communication method further includes: Update the service matching mapping table.
6. An inter-server communication apparatus, applied to a browser, characterized in that, include: The first acquisition module is used to acquire the output parameters of the first service; The first service is a service currently running on the browser; A service matching module is used to determine a second service that matches the output parameters of the first service from the service matching mapping table based on the output parameters of the first service and a preset service matching mapping table. A service recommendation module is used to recommend a second service, so that the second service runs the second service with the output parameters of the first service as the input parameters of the second service, and outputs service information; The service matching mapping table includes a dictionary table and a relationship mapping table; the dictionary table includes two or more dictionary entries, each dictionary entry including an entry identifier, a key parameter field name, a service identifier to which the key parameter applies, the content type described by the key parameter field, and auxiliary fields; The service matching module is specifically used to determine a second service that matches the output parameters of the first service from the service matching mapping table based on the output parameters of the first service and a preset service matching mapping table. During the matching process, it selects between precise matching and fuzzy matching based on different output parameters and the contents of the service matching mapping table. When the first output parameter of the first service exists in the service matching mapping table, precise matching is performed; when the first output parameter of the first service does not exist in the service matching mapping table, fuzzy matching is performed by filtering through preset constraints. The service matching module includes: a first judgment submodule, specifically used to determine whether the first output parameter of the first service exists in the dictionary table; The input parameter determination submodule is specifically used to determine, if yes, the first dictionary entry identifier to which the first output parameter belongs; determine the second dictionary entry identifier corresponding to the first dictionary entry identifier from the relation mapping table; and determine the first input parameter in the second dictionary entry from the dictionary table based on the second dictionary entry identifier. The second service determination submodule is specifically used to determine the dictionary entry to which the first input parameter belongs in the dictionary table; and to determine the second service applicable to the first input parameter in the dictionary entry to which the first input parameter belongs. The parameter content type determination submodule is used to determine the content type described by the key parameter field of the first output parameter from the dictionary table if no; The parameter set determination submodule is used to determine a first set of input parameters that is the same as the content type from the dictionary table; The parameter filtering submodule is used to filter according to the auxiliary field, and select the first input parameter corresponding to the first output parameter that meets the preset constraint conditions from the first input parameter set; The second service determination submodule is used to determine the applicable second service based on the filtered first input parameters.
7. The apparatus for inter-service communication according to claim 6, characterized in that, The first acquisition module includes: The service provision submodule is used to provide the first service in the form of the first webpage; The service information receiving submodule is used to receive first input information entered in the first service, so that the first service outputs first service information based on the first input information; The service parameter acquisition submodule is used to acquire the output parameters of the first service based on the first service information.
8. The apparatus for inter-service communication according to claim 7, characterized in that, The service parameter acquisition submodule is specifically used to acquire key output parameters from the output parameters of the first service based on the first service information.
9. The apparatus for inter-service communication according to claim 6, characterized in that, The service recommendation module is specifically used to: recommend a second service in the form of a second webpage, so that the second service runs the second service with the output parameters of the first service as the input parameters of the second service, and outputs service information on the second webpage interface.
10. The apparatus for inter-service communication according to claim 6, characterized in that, The device further includes a mapping table update module, used to update the service matching mapping table.
11. An electronic device, characterized in that, The electronic device includes: a housing, a processor, a memory, a circuit board, and a power supply circuit, wherein the circuit board is disposed inside the space enclosed by the housing, and the processor and the memory are disposed on the circuit board; the power supply circuit is used to supply power to various circuits or devices of the electronic device; the memory is used to store executable program code; the processor runs a program corresponding to the executable program code by reading the executable program code stored in the memory, for executing the inter-service communication method according to any one of claims 1 to 5.
12. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores one or more programs, which can be executed by one or more processors to implement the inter-service communication method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Webpage application access method and device, storage medium and computer equipment
CN115309373A