Communication method among multiple technology stacks

The parameter transfer information processing module realizes efficient communication between different technical stacks, which solves the problem of communication complexity between functional pages in a multi-tech stack environment, improves development efficiency and user experience, and adapts to the diversity and scalability of the technology stack.

CN118964054AInactive Publication Date: 2024-11-15HEBEI TONGFU SHARING TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410934172.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-12
Publication Date
2024-11-15
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

In a multi-tech stack environment, the communication between functional pages is complex, which leads to developers need to write a variety of inter-tech stack transmission parameters and communication algorithms, which increases development difficulty and maintenance costs, and is not convenient to expand the new technology stack.

Method used

A parameter transfer information processing module is designed to realize efficient communication between different technical stacks by analyzing and encapsulating parameter transfer information, and to store and manage parameter transfer information using native Activity components and message queues, simplifying the page jump and parameter transfer process.

Benefits of technology

It improves development efficiency and user experience, reduces maintenance complexity and cost, enhances application performance and code stability, and adapts to the diversity and scalability of the technology stack.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118964054A_ABST
    Figure CN118964054A_ABST
Patent Text Reader

Abstract

The invention relates to a communication method among multiple technology stacks. The method comprises the following steps: constructing an initial function page based on a native Activity component; constructing a first function page and using the first technology stack; presenting the first function page; when the first function page needs to be switched to the second function page, judging the first technology stack and the second technology stack as follows; when the same technology stack is used, parameter transmission information is directly transmitted; when different technology stacks are used, the parameter transmission information processing module is called to transmit parameter transmission information. Through the innovative design of the parameter transmission information processing module, an efficient, stable and easy-to-maintain communication mechanism among different technology stacks is realized, the development efficiency is remarkably improved, the cooperation cost is reduced, the application performance and the user experience are enhanced, meanwhile, the later maintenance work is simplified, the stability and reusability of codes are improved, and the development cost is reduced. And the method adapts to the diversity of technology stacks and the expansibility of applications.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of information processing technology, and in particular to a communication method between multiple technology stacks. Background Art

[0002] Apps running on mobile terminals can be understood as a collection of multiple functional pages, each of which carries a specific user interaction function. Therefore, the communication between functional pages is particularly important. The functional page can be understood as a human-computer interaction interface to complete a certain function. For example, the user login interface allows users to enter credentials to access the application, and the user information display interface is used to display the user's personal information and settings. The design and implementation of these functional pages usually need to consider user experience, data security, and interaction with backend services.

[0003] In modern mobile application development, the diversity of technology stacks has become a prominent feature. Developers can choose different technology stacks to build functional pages based on project requirements, personal expertise, or the needs of team collaboration. For example, Flutter / Dart, Java, Vue, Kotlin, uni-app and other technology stacks each have their own advantages and applicable scenarios.

[0004] Flutter / Dart: Known for its high performance and excellent UI rendering capabilities, it is suitable for building a smooth user experience.

[0005] Java: As a long-established language for Android development, it has a mature ecosystem and rich library support.

[0006] Vue: Often used for front-end development, but its flexibility also makes it suitable for mobile development, especially in combination with frameworks such as NativeScript.

[0007] Kotlin: With its simplicity and expressiveness, it has gradually become the preferred language for Android development.

[0008] uni-app: Allows developers to write code once using Vue syntax and publish to both iOS and Android platforms at the same time.

[0009] Although the diversity of technology stacks provides developers with more choices, it also brings complexity to the communication between pages. For example:

[0010] An App is usually developed by multiple developers. When developers write function pages, the technology stacks used in the page code may be different. Taking the Android system as an example, function page A written by developer A uses the flutter / dart technology stack, function page B written by developer B uses the java technology stack, and function page C written by developer C uses the vue technology stack. It is understandable that the technology stack used by the function page may also be the kotlin technology stack, the uniapp technology stack, and so on.

[0011] Communication between functional pages is crucial to ensure the smooth operation of the App. Effective communication between pages can improve the response speed of the application and the user experience. In a multi-technology stack environment, the communication mechanism needs to be able to handle data transmission and interaction between different technology stacks to ensure data consistency and integrity. In addition, a good communication strategy can reduce the complexity and cost of later maintenance and improve development efficiency.

[0012] When the function pages use different technology stacks, switching (jumping) between function pages requires not only parameter transmission and communication, but also the development and maintenance of parameter transmission and communication algorithms are cumbersome and laborious. Take the above-mentioned function pages A, B, and C as examples:

[0013] First, we need to write an algorithm to complete parameter transmission and communication between the Flutter / Dart technology stack and the Java technology stack;

[0014] Secondly, we need to write an algorithm to complete parameter transmission and communication between the flutter / dart technology stack and the vue technology stack;

[0015] Then we need to write an algorithm to complete the parameter transfer and communication between the Vue technology stack and the Java technology stack.

[0016] Not only is the writing of algorithms time-consuming and laborious, but it is also inconvenient for subsequent maintenance. Once a new technology stack is added, the workload of rewriting the code increases significantly, affecting development efficiency.

[0017] The information disclosed in this background technology section is only intended to deepen the understanding of the overall background technology of the present invention, and should not be regarded as acknowledging or suggesting in any form that the information constitutes the prior art already known to those skilled in the art. Summary of the invention

[0018] In view of the defects existing in the prior art, the purpose of the present invention is to provide a communication method between multiple technology stacks. Through the innovative design of the parameter information processing module, an efficient, stable and easy-to-maintain communication mechanism between different technology stacks is implemented, which significantly improves development efficiency, reduces collaboration costs, enhances application performance and user experience, and simplifies subsequent maintenance work, improves the stability and reusability of the code, and adapts to the diversity of technology stacks and the scalability of applications.

[0019] In order to achieve the above purpose, the technical solution adopted by the present invention is:

[0020] A communication method between multiple technology stacks, characterized in that the method comprises:

[0021] After the App is started and initialized, build the initial function page based on the native Activity component;

[0022] Build a first function page and use a first technology stack, where the first technology stack is any one of the following: flutter / dart technology stack, java technology stack, vue technology stack, kotlin technology stack, uniapp technology stack;

[0023] Presenting the first function page;

[0024] When the first function page needs to be switched to the second function page, and the second function page uses the second technology stack, the first technology stack and the second technology stack are judged as follows;

[0025] When using the same technology stack, the parameter information from the first function page is directly passed to the second function page as part of the function call;

[0026] When using different technology stacks, call the parameter information processing module and perform the parameter information processing as described below:

[0027] The first function page transmits the parameter information to the initial function page through the parameter information processing module;

[0028] The second function page obtains the parameter information from the first function page from the initial function page through the parameter information processing module.

[0029] Based on the above technical solution, the initial function page is responsible for maintaining a message queue for storing parameter information from the first function page.

[0030] On the basis of the above technical solution, the initial function page is also used to store the parameter names and parameter values ​​parsed from the parameter information;

[0031] The initial function page is also responsible for maintaining a state manager. When the parameter name and parameter value are encapsulated as the parameter information required by the specified technology stack, it is used to record the encapsulation status to achieve one-time encapsulation and multiple calls.

[0032] On the basis of the above technical solution, when the same technology stack is used, the navigation component Navigator corresponding to the technology stack is called, and the parameter information from the first function page is passed to the second function page as a part of the function call.

[0033] On the basis of the above technical solution, the parameter information processing module maintains a first communication channel between the first technology stack and the initial function page based on the native Activity component, and maintains a second communication channel between the second technology stack and the initial function page based on the native Activity component;

[0034] The parameter information processing module includes a parsing processing submodule and a packaging processing submodule;

[0035] The parsing processing submodule is used to parse the parameter names and parameter values ​​contained in the parameter transmission information according to the specific type of the first technology stack;

[0036] The encapsulation processing submodule is used to encapsulate parameter names and parameter values ​​into parameter transmission information acceptable to the second technology stack according to the specific type of the second technology stack.

[0037] On the basis of the above technical solution, the parameter information processing module further includes: a format identification submodule, wherein the parameter information includes an information encapsulation format identifier;

[0038] The parsing processing submodule parses the parameter information based on the encapsulation format identifier and obtains the parameter name and parameter value contained in the parameter information;

[0039] The encapsulation processing submodule is based on the encapsulation format identifier, the encapsulation parameter name and the parameter value as the parameter transmission information of the corresponding format.

[0040] On the basis of the above technical solution, the specific steps of parsing the parameter information in the parsing processing submodule include:

[0041] Get parameter information;

[0042] Determine the type of business;

[0043] Call the corresponding parsing algorithm according to the business type;

[0044] Get the page ID to uniquely identify the first function page;

[0045] Determine whether the preset page switching conditions are met;

[0046] When the page switching conditions are not met, the parameter information is destroyed and the parsing failure is returned;

[0047] When the page switching conditions are met, the parameter name and parameter value are bound to the first function page.

[0048] On the basis of the above technical solution, the specific steps of encapsulating the processing submodule, encapsulating parameter names and parameter values ​​include:

[0049] Get parameter names and values;

[0050] Determine whether the parameter name and parameter value meet the requirements for building the second function page;

[0051] When the requirement of building the second function page is not met, a parsing failure is returned to the first function page bound to the parameter name and parameter value;

[0052] When the requirements for building the second function page are met, the corresponding encapsulation algorithm is called according to the business type.

[0053] The communication method between multiple technology stacks described in the present invention has the following beneficial effects:

[0054] 1. Simplify the developer collaboration process: Through the parameter information processing module, developers with different technology stacks can collaborate more efficiently. This module acts as a message center to coordinate communications between different technology stacks, reducing the communication costs caused by technical differences between developers;

[0055] 2. Reduce the complexity of technology stack switching: When the function pages in the App need to switch between different technology stacks, the method of the present invention makes parameter transfer and page jump more direct and simple through the parameter information processing module, without the need to write communication code separately for each technology stack combination;

[0056] 3. Improve application performance: Due to the optimization of the communication mechanism, the response speed of the App is improved, and the user experience is improved. The fast and accurate parameter transmission mechanism ensures the smoothness of user operation;

[0057] 4. Reduce maintenance workload: Unified communication strategies and parameter information processing modules reduce the complexity of later maintenance. When the App needs to be updated or new features are added, developers can manage and modify the communication logic more easily;

[0058] 5. Adapt to the scalability of the technology stack: With the emergence of new technology stacks, the communication method of the present invention can easily adapt to and integrate new technology stacks without large-scale reconstruction of existing communication mechanisms. BRIEF DESCRIPTION OF THE DRAWINGS

[0059] The present invention has the following accompanying drawings:

[0060] The accompanying drawings are used to better understand the present invention and do not constitute an improper limitation of the present invention.

[0061] Figure 1 A flowchart of embodiment 1 of a method for communication between multiple technology stacks described in the present invention. DETAILED DESCRIPTION

[0062] The present invention is further described in detail below in conjunction with the accompanying drawings. The detailed description is an explanation made in conjunction with the exemplary embodiments of the present invention, including various details of the embodiments of the present invention to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those skilled in the art that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for the sake of clarity and conciseness, the description of well-known functions and structures is omitted in the following description.

[0063] like Figure 1 As shown, the present invention provides a communication method between multiple technology stacks, the method comprising:

[0064] After the App is started and initialized, build the initial function page based on the native Activity component;

[0065] Build a first function page and use a first technology stack, where the first technology stack is any one of the following: flutter / dart technology stack, java technology stack, vue technology stack, kotlin technology stack, uniapp technology stack;

[0066] Presenting the first function page; then waiting for the function page switch to be triggered, for example: switching the first function page to the second function page according to the interactive operation requirements;

[0067] When the first function page needs to be switched to the second function page, and the second function page uses the second technology stack, the first technology stack and the second technology stack are judged as follows;

[0068] When using the same technology stack, the parameter information from the first function page is directly passed to the second function page as part of the function call;

[0069] When using different technology stacks, call the parameter information processing module and perform the parameter information processing as described below:

[0070] The first function page transmits the parameter information to the initial function page through the parameter information processing module;

[0071] The second function page obtains the parameter information from the first function page from the initial function page through the parameter information processing module.

[0072] The parameter information processing module is equivalent to a message center (MessageCenter), which is the core component for realizing communication. It is responsible for receiving messages from different technology stacks and forwarding them according to the message type and target technology stack.

[0073] The initial function page is built based on the native Activity component, which can provide a unified and standardized communication object for its function page. Different technology stacks only need to maintain the communication with the parameter information processing module and the initial function page to complete the interaction of parameter information, which greatly reduces the complexity of the algorithm. Developers can focus more on the development of their own technology stacks without paying too much attention to the communication details with other technology stacks. This helps to improve development efficiency, and when a new technology stack needs to be introduced, the change of the algorithm does not involve a significant change to the completed algorithm. Improved scalability and compatibility.

[0074] In Android, Activity is a very important component. It represents a single screen with a user interface through which users can interact with the application. Each activity is given a window on which the user interface can be drawn. The window usually fills the screen, but it can also be smaller than the screen and float above other windows. In the process of Android application development, one or more Activities are created using the native functions provided by the Android SDK. These Activities constitute the basic interface and interactive functions of the application.

[0075] Based on the above technical solution, the initial function page is responsible for maintaining a message queue for storing parameter information from the first function page.

[0076] As one of the optional implementation schemes, the parameter information from the first function page is marked as source parameter information, and the format of the source parameter information is adapted to the first technology stack.

[0077] As one of the optional implementation schemes, when the function page switching is triggered, the first function page also outputs a page type parameter to specify the second function page to be constructed;

[0078] The page creation module creates a specified second function page according to the page type parameter;

[0079] When the page type parameter is not output, the page creation module creates the second function page according to the default setting.

[0080] On the basis of the above technical solution, the initial function page is also used to store the parameter names and parameter values ​​parsed from the parameter information;

[0081] The initial function page is also responsible for maintaining a state manager. When the parameter name and parameter value are encapsulated as the parameter information required by the specified technology stack, it is used to record the encapsulation status to achieve one-time encapsulation and multiple calls.

[0082] As one of the optional implementation schemes, the parameter information that needs to be obtained by the second function page is marked as target parameter information, and the format of the target parameter information is adapted to the second technology stack;

[0083] The initial function page is responsible for maintaining another message queue for storing the parameter information that the second function page needs to obtain, namely the target parameter information. The number of times the target parameter information is obtained and the page where the request is initiated are written into the state manager. When the target parameter information needs to be obtained multiple times, the state manager can be used to complete the repeated acquisition of the target parameter information, which not only avoids the trouble of repeated encapsulation, but also ensures the consistency of the multiple acquisitions of the target parameter information, and avoids malicious tampering or forgery of the target parameter information.

[0084] On the basis of the above technical solution, when the same technology stack is used, the navigation component Navigator corresponding to the technology stack is called, and the parameter information from the first function page is passed to the second function page as a part of the function call.

[0085] On the basis of the above technical solution, the parameter information processing module maintains a first communication channel between the first technology stack and the initial function page based on the native Activity component, and maintains a second communication channel between the second technology stack and the initial function page based on the native Activity component;

[0086] The parameter information processing module includes a parsing processing submodule and a packaging processing submodule;

[0087] The parsing processing submodule is used to parse the parameter names and parameter values ​​contained in the parameter transmission information according to the specific type of the first technology stack;

[0088] The encapsulation processing submodule is used to encapsulate parameter names and parameter values ​​into parameter transmission information acceptable to the second technology stack according to the specific type of the second technology stack.

[0089] According to the specific type of the first technology stack, the parsing algorithm can have a standardized output format with unified parameter names and parameter values; when there are more than two versions of the parsing algorithm, the first function page can output the parsing algorithm version information and specify the use of a specific version of the parsing algorithm; this can achieve compatibility between old and new parsing algorithms, and when the parsing algorithm version is iteratively updated, not all parsing algorithms will be unable to be called. The parsing algorithm includes at least two types: a default parsing version and a custom parsing version, and the default parsing version is a parsing algorithm version with a fixed format.

[0090] According to the specific type of the second technology stack, the parameter names and parameter values ​​are not directly transmitted to the second technology stack, but are encapsulated to obtain the target parameter information before being transmitted to the second technology stack for use; the encapsulation algorithm can be designed according to the second function page for different purposes, so that the page creation module can create the second function page, and the second technology stack can accurately obtain the required parameter names and parameter values ​​according to the required format.

[0091] On the basis of the above technical solution, the parameter information processing module further includes: a format identification submodule, wherein the parameter information includes an information encapsulation format identifier;

[0092] The parsing processing submodule parses the parameter information based on the encapsulation format identifier and obtains the parameter name and parameter value contained in the parameter information;

[0093] The encapsulation processing submodule is based on the encapsulation format identifier, the encapsulation parameter name and the parameter value as the parameter transmission information of the corresponding format.

[0094] Based on the above technical solution, the specific steps of the parsing submodule parsing the parameter information from the first function page include:

[0095] Obtaining parameter information; the parameter information is from the first function page, that is, source parameter information;

[0096] Determine the type of business;

[0097] Call the corresponding parsing algorithm according to the business type;

[0098] Get the page ID to uniquely identify the first function page;

[0099] Determine whether the preset page switching conditions are met;

[0100] When the page switching conditions are not met, the parameter information is destroyed and the parsing failure is returned;

[0101] When the page switching conditions are met, the parameter name and parameter value are bound to the first function page.

[0102] The first function page and the second function page are relative concepts. Function page C may be switched from function page A (in this case, function page A is the first function page, and function page C is the second function page), and function page C may also be switched from function page B (in this case, function page B is the first function page, and function page C is the second function page). Therefore, binding processing can avoid erroneous calls to parameter information from different first function pages, and can also prevent the parameter information from being tampered with or forged.

[0103] On the basis of the above technical solution, the specific steps of encapsulating the processing submodule and encapsulating parameter names and parameter values ​​as target parameter information (parameter information required to be obtained by the second function page) include:

[0104] Obtain parameter names and parameter values; obtain corresponding parameter names and parameter values ​​according to the binding relationship with the first function page;

[0105] Determine whether the parameter name and parameter value meet the requirements for building the second function page;

[0106] When the requirement of building the second function page is not met, a parsing failure is returned to the first function page bound to the parameter name and parameter value;

[0107] When the requirements for building the second function page are met, the corresponding encapsulation algorithm is called according to the business type.

[0108] Different business types usually correspond to second function pages with different purposes, and it is necessary to design an encapsulation processing algorithm that is adapted to the business type.

[0109] The contents not described in detail in this specification belong to the prior art known to professional and technical personnel in this field.

[0110] The above description is only a preferred embodiment of the present invention, and the protection scope of the present invention is not limited to the above embodiment. Any equivalent modifications or changes made by those skilled in the art based on the contents disclosed by the present invention should be included in the protection scope recorded in the claims.

Claims

1. A communication method between multiple technology stacks, characterized in that: The method comprises: After the App is started and initialized, build the initial function page based on the native Activity component; Build a first function page and use a first technology stack, where the first technology stack is any one of the following: flutter / dart technology stack, java technology stack, vue technology stack, kotlin technology stack, uniapp technology stack; Presenting the first function page; When the first function page needs to be switched to the second function page, and the second function page uses the second technology stack, the first technology stack and the second technology stack are judged as follows; When using the same technology stack, the parameter information from the first function page is directly passed to the second function page as part of the function call; When using different technology stacks, call the parameter information processing module and perform the parameter information processing as described below: The first function page transmits the parameter information to the initial function page through the parameter information processing module; The second function page obtains the parameter information from the first function page from the initial function page through the parameter information processing module.

2. A communication method between multiple technology stacks as claimed in claim 1, characterized in that: The initial function page is responsible for maintaining a message queue for storing parameter information from the first function page.

3. A communication method between multiple technology stacks as claimed in claim 2, characterized in that: The initial function page is also used to store parameter names and parameter values ​​parsed from the parameter information; The initial function page is also responsible for maintaining a state manager. When the parameter name and parameter value are encapsulated as the parameter information required by the specified technology stack, it is used to record the encapsulation status to achieve one-time encapsulation and multiple calls.

4. A communication method between multiple technology stacks as claimed in claim 1, characterized in that: When the same technology stack is used, the navigation component Navigator corresponding to the technology stack is called, and the parameter information from the first function page is passed to the second function page as a part of the function call.

5. A method for communication between multiple technology stacks as claimed in claim 1, characterized in that: The parameter information processing module maintains a first communication channel between the first technology stack and the initial function page based on the native Activity component, and maintains a second communication channel between the second technology stack and the initial function page based on the native Activity component; The parameter information processing module includes a parsing processing submodule and a packaging processing submodule; The parsing processing submodule is used to parse the parameter names and parameter values ​​contained in the parameter transmission information according to the specific type of the first technology stack; The encapsulation processing submodule is used to encapsulate parameter names and parameter values ​​into parameter transmission information acceptable to the second technology stack according to the specific type of the second technology stack.

6. A method for communication between multiple technology stacks as claimed in claim 5, characterized in that: The parameter information processing module further includes: a format identification submodule, wherein the parameter information includes an information encapsulation format identifier; The parsing processing submodule parses the parameter information based on the encapsulation format identifier and obtains the parameter name and parameter value contained in the parameter information; The encapsulation processing submodule is based on the encapsulation format identifier, the encapsulation parameter name and the parameter value as the parameter transmission information of the corresponding format.

7. A method for communication between multiple technology stacks as claimed in claim 5, characterized in that: The specific steps of parsing the parameter information in the parsing processing submodule include: Get parameter information; Determine the type of business; Call the corresponding parsing algorithm according to the business type; Get the page ID to uniquely identify the first function page; Determine whether the preset page switching conditions are met; When the page switching conditions are not met, the parameter information is destroyed and the parsing failure is returned; When the page switching conditions are met, the parameter name and parameter value are bound to the first function page.

8. A method for communication between multiple technology stacks as claimed in claim 1, characterized in that: The specific steps of encapsulating parameter names and parameter values ​​in the encapsulation processing submodule include: Get parameter names and values; Determine whether the parameter name and parameter value meet the requirements for building the second function page; When the requirement of building the second function page is not met, a parsing failure is returned to the first function page bound to the parameter name and parameter value; When the requirements for building the second function page are met, the corresponding encapsulation algorithm is called according to the business type.