Data transmission method, server, gateway, management background and storage medium
By receiving configuration files on the server and classifying and pushing resources according to the files, and building different channels with the gateway, the problem of difficult resource isolation between different applications under the same server is solved, and resource isolation and server efficiency are improved.
Patent Information
- Application Number
- CN202310301594.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-23
- Publication Date
- 2025-04-18
- Estimated Expiration
- 2043-03-23
AI Technical Summary
In the prior art, resource isolation between different applications under the same server is difficult to achieve, resulting in the server saving redundant configuration data, increasing management complexity and inefficiency.
By receiving configuration files and configuring resources according to the files, we obtain a type of resources for pushing to all applications and a type of resources for pushing to some applications, and build different channels through the gateway to isolate and transmit resources.
Resource isolation between different applications is realized, redundant configuration data saved by the server is reduced, resource management is simplified, and server processing efficiency is improved.
Smart Images

Figure CN116405539B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to but are not limited to the field of data processing, and in particular to a data transmission method, a server, a gateway, a management background and a storage medium. Background Art
[0002] Applications have a need to isolate resources between different application packages on the same server. Currently, resource isolation is mainly achieved by setting a resource configuration file that is unique to each application package. Each application package only reads the resource configuration file that is unique to the package and obtains resources based on the resource configuration file. However, each application package on the same server has its own resource configuration file, which can easily cause the server to store too much redundant configuration data. In addition, each additional application package requires a new resource configuration file to be added and backed up and integrated, resulting in low server efficiency. Summary of the invention
[0003] The following is a summary of the subject matter described in detail herein. This summary is not intended to limit the scope of the claims.
[0004] The embodiments of the present application aim to solve at least one of the technical problems existing in the prior art. The embodiments of the present application provide a data transmission method, a server, a gateway, a management background and a storage medium, which can realize the isolated transmission of resource data between different applications.
[0005] In an embodiment of the first aspect of the present application, a data transmission method is applied to a server, and the data transmission method includes:
[0006] receiving a configuration file, wherein the configuration file records a correspondence between resources and a plurality of applications;
[0007] The resources are configured according to the configuration file to obtain first-class resources and second-class resources, wherein the first-class resources are used to push to all applications, and the second-class resources are used to push to some applications;
[0008] Receive application packages sent by applications;
[0009] Interpreting, according to the application package, a first channel identifier corresponding to the application name and a second channel identifier corresponding to the application package name;
[0010] The first type of resources are pushed through a first channel corresponding to the first channel identifier, and the second type of resources corresponding to the application are pushed through a second channel corresponding to the second channel identifier; wherein the first channel is constructed by the gateway according to the application name in the request after receiving the request, and the second channel is constructed by the gateway according to the application package name in the request after receiving the request.
[0011] In a second aspect of the present application, a data transmission method is applied to a gateway. The data transmission method includes:
[0012] Receive a request sent by an application, wherein the request includes an application name and an application package name;
[0013] Construct a first channel according to the application name, and construct a second channel according to the application package name;
[0014] A first type of resource is pushed through the first channel, and a second type of resource corresponding to the application is pushed through the second channel, wherein the first type of resource is a resource configured by the server according to a configuration file for pushing to all applications, and the second type of resource is a resource configured by the server according to the configuration file for pushing to some applications.
[0015] In certain embodiments of the second aspect of the present application, constructing the first channel according to the application name and constructing the second channel according to the application package name include:
[0016] authenticating the request;
[0017] When the authentication request succeeds, the connection information is initialized;
[0018] Obtain a third channel identifier corresponding to the first channel according to the application name, and obtain a fourth channel identifier corresponding to the second channel according to the application package name;
[0019] A connection is established with a client of the application according to the connection information, the third channel identifier, and the fourth channel identifier to construct the first channel and the second channel.
[0020] In some embodiments of the second aspect of the present application, the first type of resource carries a first channel identifier, and pushing the first type of resource through the first channel includes:
[0021] comparing the third channel identifier with the first channel identifier;
[0022] When the third channel identifier is the same as the first channel identifier, pushing a type of resource through the first channel;
[0023] When the third channel identifier is different from the first channel identifier, the first type of resources is discarded.
[0024] In some embodiments of the second aspect of the present application, the second type of resource carries a second channel identifier, and pushing the second type of resource through the second channel includes:
[0025] comparing the fourth channel identifier and the second channel identifier;
[0026] When the fourth channel identifier is the same as the second channel identifier, pushing the second type of resource through the second channel;
[0027] When the fourth channel identifier is different from the second channel identifier, the second type of resources are discarded.
[0028] An embodiment of the third aspect of the present application is a data transmission method, which is applied to a management background. The data transmission method includes:
[0029] Receive configuration information;
[0030] Obtaining a configuration file according to the configuration information, wherein the configuration file records a correspondence between resources and multiple applications;
[0031] The configuration file is sent to the server so that the server configures resources according to the configuration file to obtain first-class resources and second-class resources, wherein the first-class resources are used to push to all applications, and the second-class resources are used to push to some applications.
[0032] An embodiment of the fourth aspect of the present application is a server, which applies the data transmission method as described in the embodiment of the first aspect of the present application.
[0033] An embodiment of the fifth aspect of the present application is a gateway, which applies the data transmission method as described in the embodiment of the second aspect of the present application.
[0034] The embodiment of the sixth aspect of the present application is a management background, which applies the data transmission method as described in the embodiment of the third aspect of the present application.
[0035] The embodiment of the seventh aspect of the present application is a computer-readable storage medium storing computer-executable instructions, wherein the computer-executable instructions are used to execute the data transmission method described in the embodiment of the first aspect of the present application, the data transmission method described in the embodiment of the second aspect of the present application, and the data transmission method described in the embodiment of the third aspect of the present application.
[0036] The above scheme has at least the following beneficial effects: the configuration information of different resources of the same server is written into a configuration file, so that the resources of the same server can be directly configured according to the one configuration file, avoiding the situation where each application package has a resource configuration file belonging to this package, which causes the server to store too much redundant configuration data, and avoiding the situation where the resource configuration needs to be backed up and sorted for each additional application package, saving the storage space of the server and improving the processing efficiency of the server; by establishing a first channel to transmit a type of resources that can be used by all applications, and by establishing different second channels corresponding to different application package names to transmit a second type of resources that can be used by the corresponding applications, resource isolation between different applications is achieved. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] The accompanying drawings are used to provide further understanding of the technical solution of the present application and constitute a part of the specification. Together with the embodiments of the present application, they are used to explain the technical solution of the present application and do not constitute a limitation on the technical solution of the present application.
[0038] Figure 1 is a step diagram of a data transmission method provided by an embodiment of the present application;
[0039] Figure 2 is a sub-step diagram of step S80;
[0040] Figure 3 It is a sub-step diagram of the gateway pushing a type of resource to the client of the application through the first channel;
[0041] Figure 4 It is a sub-step diagram of the gateway pushing the second type of resources corresponding to the application to the client of the application through the second channel. DETAILED DESCRIPTION
[0042] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0043] It should be noted that, although the functional modules are divided in the device schematic diagram and the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the device or the order in the flowchart. The terms "first", "second", etc. in the specification, claims or the above drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.
[0044] The embodiments of the present application are further described below in conjunction with the accompanying drawings.
[0045] An embodiment of the present application provides a data transmission method, which is applied to a data system.
[0046] The data system includes the application's client, gateway, server, and backend.
[0047] Reference Figure 1 , data transmission methods include:
[0048] Step S10, the management background receives configuration information;
[0049] Step S20, the management backend obtains a configuration file according to the configuration information, and the configuration file records the corresponding relationship between the resources and the multiple applications;
[0050] Step S30, the management backend sends the configuration file to the server;
[0051] Step S40, the server receives the configuration file;
[0052] Step S50, the server configures resources according to the configuration file to obtain first-class resources and second-class resources, wherein the first-class resources are used to push to all applications, and the second-class resources are used to push to some applications;
[0053] Step S60, the application client sends a request to the gateway;
[0054] Step S70, the gateway receives the request sent by the application;
[0055] Step S80, the gateway constructs a first channel according to the requested application name, constructs a second channel according to the application package name, and subscribes to the first channel and the second channel;
[0056] Step S90, the application client sends the application package to the server;
[0057] Step S100, the server receives the application package;
[0058] Step S110, the server interprets the first channel identifier corresponding to the application name and the second channel identifier corresponding to the application package name according to the application package;
[0059] Step S120, the server pushes a first type of resource to the gateway through a first channel corresponding to the first channel identifier, and pushes a second type of resource corresponding to the application through a second channel corresponding to the second channel identifier;
[0060] Step S130, the gateway pushes a first type of resource to the client of the application through a first channel, and pushes a second type of resource corresponding to the application through a second channel;
[0061] Step S140: The client of the application monitors the first channel and the second channel corresponding to the application, and receives the first and second resources pushed by the server.
[0062] For step S10, the administrator can log in to the management backend and input configuration information to configure the resources through the input device on the unified management page, and the management backend receives the configuration information input by the administrator. For example, the corresponding relationship between resources and applications can be configured, that is, which applications can use the resources.
[0063] Using a unified management page for resource configuration can avoid the problem that each application package corresponds to a background matching page, and the administrator needs to configure the different pages of the corresponding application package each time. This makes the process simpler and improves resource configuration efficiency.
[0064] For example, the interface has an input field prefixed with the application package name, and the application package name can be entered in the input field corresponding to the application package name to configure the correspondence between resources and applications. For example, for resource A, enter "all" in the input field corresponding to the application package name, which means that resource A can be used by all applications; for resource B, enter "Mars" in the input field corresponding to the application package name, which means that resource B can be used by application "Mars".
[0065] For step S20, the management background obtains the configuration file based on the configuration information, and writes the configuration information of different resources of the same server into one configuration file, so that the resources of the same server can be directly configured according to the one configuration file, avoiding the situation where each application package has its own resource configuration file, causing the server to save too much redundant configuration data, and avoiding the situation where the resource configuration needs to be backed up and organized for each additional application package, saving the server's storage space and improving the server's processing efficiency.
[0066] In step S30, the management backend establishes a connection with the server, and the management backend sends a configuration file to the server.
[0067] In step S40, the server receives the configuration file sent by the management background.
[0068] For step S50, the server configures and classifies resources according to the configuration file to obtain Class I resources and Class II resources. Class I resources are used to push to all applications, and Class II resources are used to push to some applications.
[0069] For example, in the configuration file, it is recorded that resource A can be used by all applications and resource B can be used by application "Mars". In this case, resource A is classified as a first-class resource and configured to be used by all applications. Resource B is classified as a second-class resource and configured to be used by application "Mars".
[0070] In step S60, the client of the application sends a request to the gateway.
[0071] In step S70, the gateway receives the request sent by the application.
[0072] Reference Figure 2 For step S80, the gateway constructs a first channel according to the requested application name, constructs a second channel according to the application package name, and subscribes to the first channel and the second channel, specifically including but not limited to the following steps:
[0073] Step S81, authentication request;
[0074] Step S82, when the authentication request is successful, initializing the connection information;
[0075] Step S83, obtaining a third channel identifier corresponding to the first channel according to the application name, and obtaining a fourth channel identifier corresponding to the second channel according to the application package name;
[0076] Step S84, establishing a connection with the client of the application according to the connection information, the third channel identifier, and the fourth channel identifier to construct the first channel and the second channel;
[0077] For step S81, the gateway sends a request to the server, and the server authenticates the request;
[0078] For step S82, when the authentication request is successful, the connection information is initialized to the gateway;
[0079] For step S83, a third channel identifier corresponding to the first channel is obtained according to the application name, and a fourth channel identifier corresponding to the second channel is obtained according to the application package name; specifically, the gateway converts the application name into the third channel identifier app_channel_id, and converts the application package name into the fourth channel identifier application_channel_id; the channel conversion can ensure that channel_id, app_channel_id and application_channel_id are not the same;
[0080] For step S84, save the connection information, the third channel identifier and the channel information of the fourth channel identifier; establish a connection with the client of the application according to the connection information, the third channel identifier and the fourth channel identifier to build the first channel and the second channel. Specifically, build the first channel according to the third channel identifier app_channel_id, build the second channel according to the fourth channel identifier application_channel_id, and subscribe to the first channel and the second channel; then pass the authentication and establish the connection.
[0081] In addition, when the authentication fails, the connection is disconnected.
[0082] In step S90, the application client sends the application package to the server.
[0083] It is understandable that there may be multiple application package names under one application name, that is, one application may log in to multiple servers, and corresponding application package names are used to log in to different servers.
[0084] All application packages under the same server have the same application name, but different application package names.
[0085] In step S100, the server receives an application package sent by the application client.
[0086] For step S110, the server interprets the first channel identifier corresponding to the application name and the second channel identifier corresponding to the application package name according to the application package; specifically, the server converts the application name into the first channel identifier app_channel_id, and converts the application package name into the second channel identifier application_channel_id.
[0087] For step S120, the server determines the first channel according to the first channel identifier app_channel_id, and determines the second channel according to the second channel identifier application_channel_id; the server determines the first category resources and the second category resources to be pushed from the resources according to the application package.
[0088] The server pushes a type of resource to the gateway through the first channel corresponding to the first channel identifier, and pushes a type of resource corresponding to the application through the second channel corresponding to the second channel identifier. For example, resource A that can be used by all applications is pushed through the first channel, and resource B that can be used by application "Mars" is pushed through the second channel corresponding to application "Mars".
[0089] Reference Figure 3 For step S130, the gateway pushes a type of resource to the client of the application through the first channel, including but not limited to the following steps:
[0090] Step S131, comparing the third channel identifier carried by the first type of resource with the first channel identifier in the gateway;
[0091] Step S132: when the third channel identifier is the same as the first channel identifier, push a type of resource through the first channel;
[0092] Step S133: when the third channel identifier is different from the first channel identifier, discard a type of resource.
[0093] Reference Figure 4 The gateway pushes the second type of resources corresponding to the application to the client of the application through the second channel, including but not limited to the following steps:
[0094] Step S134, comparing the fourth channel identifier carried by the second type of resource with the second channel identifier in the gateway;
[0095] Step S135, when the fourth channel identifier is the same as the second channel identifier, the second type of resource is pushed through the second channel;
[0096] Step S136: When the fourth channel identifier is different from the second channel identifier, the second type of resource is discarded.
[0097] For step S140 , the client of the application monitors the first channel to receive the first type of resources pushed by the server, and monitors the second channel corresponding to the application to receive the second type of resources pushed by the server.
[0098] For example, the client of the application listens to the first channel to receive resource A that can be used by all applications, and listens to the second channel corresponding to the application "Mars" to receive resource B that can be used by the application "Mars".
[0099] In this embodiment, a first channel is established to transmit a type of resource that can be used by all applications, and different second channels are established corresponding to different application package names to transmit a second type of resource that can be used by the corresponding applications, thereby achieving resource isolation between different applications.
[0100] An embodiment of the present application provides a server, which applies the data transmission method as described above to execute steps S40, S50, S50, S100, S110 and S120.
[0101] An embodiment of the present application provides a gateway, and the gateway applies the above data transmission method to execute step S70, step S80 and step S130.
[0102] An embodiment of the present application provides a management background, and the management background applies the data transmission method as described above to execute step S10, step S20 and step S30.
[0103] An embodiment of the present application provides a computer-readable storage medium, which stores computer-executable instructions, and the computer-executable instructions are used to execute the data transmission method as described above, that is, to execute step S40, step S50, step S50, step S100, step S110 and step S120, or to execute step S70, step S80 and step S130, or to execute step S10, step S20 and step S30.
[0104] It will be appreciated by those skilled in the art that all or some of the steps and systems in the disclosed method above may be implemented as software, firmware, hardware and appropriate combinations thereof. Some physical components or all physical components may be implemented as software executed by a processor, such as a central processing unit, a digital signal processor or a microprocessor, or may be implemented as hardware, or may be implemented as an integrated circuit, such as an application specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or a non-transitory medium) and a communication medium (or a temporary medium). As known to those skilled in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technologies, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, disk storage or other magnetic storage devices, or any other medium that may be used to store desired information and may be accessed by a computer. In addition, it is well known to those of ordinary skill in the art that communication media typically contain computer-readable instructions, data structures, program modules, or other data in modulated data signals such as carrier waves or other transmission mechanisms, and may include any information delivery medium. In the above description of this specification, the description of reference terms "one embodiment / example", "another embodiment / example" or "certain embodiments / examples" and the like means that the specific features, structures, materials or characteristics described in conjunction with the embodiments or examples are included in at least one embodiment or example of the present application. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.
[0105] Those skilled in the art will appreciate that all or some of the steps in the methods disclosed above, and the functional modules / units in the systems and devices may be implemented as software, firmware, hardware, or a suitable combination thereof.
[0106] The units described above as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0107] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0108] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including multiple instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM), disk or optical disk and other media that can store programs.
[0109] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the above units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0110] Although the embodiments of the present application have been shown and described, those skilled in the art will appreciate that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present application, and that the scope of the present application is limited by the embodiments and their equivalents.
[0111] The above is a specific description of the preferred implementation of the present application, but the present application is not limited to the embodiments. Technical personnel familiar with the field can make various equivalent modifications or substitutions without violating the spirit of the present application. These equivalent modifications or substitutions are all included in the scope defined by the present embodiment.
Claims
1. A data transmission method, characterized in that: Applied to a server, the data transmission method includes: receiving a configuration file, wherein the configuration file records the correspondence between resources and multiple applications, and configuration information of different resources of the same server is written into one configuration file; The resources are configured according to the configuration file to obtain first-class resources and second-class resources, wherein the first-class resources are used to push to all applications, and the second-class resources are used to push to some applications; Receive application packages sent by applications; Interpreting, according to the application package, a first channel identifier corresponding to the application name and a second channel identifier corresponding to the application package name; The first type of resources are pushed through a first channel corresponding to the first channel identifier, and the second type of resources corresponding to the application are pushed through a second channel corresponding to the second channel identifier; wherein the first channel is constructed by the gateway according to the application name in the request after receiving the request, and the second channel is constructed by the gateway according to the application package name in the request after receiving the request.
2. A data transmission method, characterized in that: Applied to a gateway, the data transmission method includes: Receive a request sent by an application, wherein the request includes an application name and an application package name; Construct a first channel according to the application name, and construct a second channel according to the application package name; Pushing a type of resource through the first channel, and pushing a type of resource corresponding to the application through the second channel, wherein the type of resource is a resource configured by the server according to the configuration file and used to push to all applications, and the type of resource is a resource configured by the server according to the configuration file and used to push to some applications; The step of constructing the first channel according to the application name and the step of constructing the second channel according to the application package name includes: authenticating the request; When the authentication request succeeds, the connection information is initialized; Obtain a third channel identifier corresponding to the first channel according to the application name, and obtain a fourth channel identifier corresponding to the second channel according to the application package name; A connection is established with a client of the application according to the connection information, the third channel identifier, and the fourth channel identifier to construct the first channel and the second channel.
3. A data transmission method according to claim 2, characterized in that: The first type of resource carries a first channel identifier, and the pushing of the first type of resource through the first channel includes: comparing the third channel identifier with the first channel identifier; When the third channel identifier is the same as the first channel identifier, pushing a type of resource through the first channel; When the third channel identifier is different from the first channel identifier, the first type of resources is discarded.
4. A data transmission method according to claim 2, characterized in that: The second-category resource carries a second channel identifier, and the pushing of the second-category resource through the second channel includes: comparing the fourth channel identifier and the second channel identifier; When the fourth channel identifier is the same as the second channel identifier, pushing the second type of resource through the second channel; When the fourth channel identifier is different from the second channel identifier, the second type of resources are discarded.
5. A server, characterized in that: The data transmission method as claimed in claim 1 is applied.
6. A gateway, characterized in that: The data transmission method according to any one of claims 2 to 4 is applied.
7. A computer-readable storage medium, characterized in that: Computer executable instructions are stored, and the computer executable instructions are used to execute the data transmission method according to claim 1 and the data transmission method according to any one of claims 2 to 4.
Citation Information
Patent Citations
Information push method and device, server and readable storage medium
CN107872534A