CN113259407B - Data interaction method and device based on application market architecture - Google Patents

Data interaction method and device based on application market architecture Download PDF

Info

Publication number
CN113259407B
CN113259407B CN202110319837.2A CN202110319837A CN113259407B CN 113259407 B CN113259407 B CN 113259407B CN 202110319837 A CN202110319837 A CN 202110319837A CN 113259407 B CN113259407 B CN 113259407B
Authority
CN
China
Prior art keywords
service
equipment
market
routing
data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110319837.2A
Other languages
Chinese (zh)
Other versions
CN113259407A (en
Inventor
胡敏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Zhuo You Network Technology Co ltd
Original Assignee
Shanghai Zhuo You Network Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Zhuo You Network Technology Co ltd filed Critical Shanghai Zhuo You Network Technology Co ltd
Priority to CN202110319837.2A priority Critical patent/CN113259407B/en
Publication of CN113259407A publication Critical patent/CN113259407A/en
Application granted granted Critical
Publication of CN113259407B publication Critical patent/CN113259407B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/60Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources
    • H04L67/63Routing a service request depending on the request content or context
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5061Partitioning or combining of resources
    • G06F9/5072Grid computing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5083Techniques for rebalancing the load in a distributed system
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/547Remote procedure calls [RPC]; Web services
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/54Indexing scheme relating to G06F9/54
    • G06F2209/541Client-server
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/54Indexing scheme relating to G06F9/54
    • G06F2209/549Remote execution

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Mathematical Physics (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The gateway service equipment determines the market version type of an application program according to routing information in a duration request received from a client, acquires decryption parameters corresponding to the market version type, decrypts application data according to the decryption parameters to obtain service identification information and routing parameter information, and sends the service identification information and the routing parameter information to cluster registration equipment; the cluster registration equipment determines the service equipment corresponding to the service identification information and the network address of the routing equipment corresponding to the service identification information according to the routing parameter information and initiates a service request to the service equipment; the service equipment acquires the service result data of the service of the routing equipment corresponding to the network address and returns the service result data to the client in the original route, so that the interaction of the service result data of different application programs based on the constructed application market architecture is realized.

Description

Data interaction method and device based on application market architecture
Technical Field
The present application relates to the field of computer technologies, and in particular, to a data interaction method and device based on an application market framework.
Background
The number of application market functional modules is increased, and the cost of the initial server slowly expands to dozens of servers and even dozens of servers. All functions are integrated in a single service, the carried service is huge, the internal logic of the service becomes complex, the whole market service system becomes more and more bloated, the service expansibility is more and more poor, the development or iteration functions of developers are more and more difficult, the novice takes more and more efforts to manage the service, operators cannot acquire effective data more accurately and more reliably for analysis, the maintenance cost of the server is more and more high, the high-concurrency request access cannot be supported, the user experience of a mobile phone end is not good, and the like.
In the prior art, the technology used in the current application market is the combination of Java SSM framework, wherein SSM is Spring + Spring mvc + MyBatis; along with the continuous increase of market demands, more and more people join in a development team, and a code library is expanded at a rapid speed, so that a system is more and more bloated, the maintainability and the flexibility are gradually reduced, the maintenance cost is higher and higher, and the current service has many defects:
for example, the complexity is high: currently, the whole project code reaches the level of millions of lines, and contains a great number of modules, and the code quality is uneven and is disorderly piled up together; the whole project is very complex, and the code modification is accompanied by surprise war every time, even a simple function is added, or a Bug is modified, which brings hidden defects.
As another example, the deployment frequency is low: as the code increases, the time for building and not building also increases, and each function change or defect repair can cause the need to redeploy the whole application service; the non-fixed mode is very time-consuming, large in influence range and high in risk, so that the online deployment frequency of the time-consuming project is low.
For another example, the reliability is poor: if an application Bug, for example, a dead loop, memory overflow, etc., causes a crash of the entire marketplace service.
As another example, flexibility is low: when a plurality of persons cooperate to iterate new functions, labor is inconvenient, the expansibility of researching and developing new service functions is poor, and the compatibility of each new version and each old version is more and more difficult; the system library version of the supported framework is old and cannot be fully compatible for use with the newest libraries in the market.
Another example is high cost: java has high performance requirements on server hardware and high service cost, and compared with the memory resource of a more expensive server, when a plurality of complex algorithms are operated simultaneously, the system memory is easily occupied by Java, so that the whole project stops service.
As another example, the amount of concurrency currently supported is low: the service support of the current service architecture is too low; log data scatter: the user data acquisition is scattered and irregular, and the daily analysis of the operation market by the operation personnel is inconvenient; and hindering the technical innovation: project developers are all familiar with the Java architecture that understands this market, and each development must master the entire service architecture flow and operating logic.
Disclosure of Invention
An object of the present application is to provide a data interaction method and device based on an application market framework, which implement the transfer of service result data of different application programs based on the application market framework.
According to one aspect of the application, a data interaction method based on an application market architecture is provided, and is applied to a gateway service device side, wherein the method comprises the following steps:
receiving a market request transmitted from an application program of a client, wherein the market request comprises routing information and application data;
determining the market version type of the application program according to the routing information, and acquiring a decryption parameter corresponding to the market version type;
decrypting the application data according to the decryption parameter corresponding to the market version type to obtain service identification information and routing parameter information;
sending the service identification information and the routing parameter information to cluster registration equipment so that the cluster registration equipment determines the identification of the service equipment corresponding to the service identification information and the network address of the routing equipment corresponding to the service identification information according to the routing parameter information;
and receiving service result data returned by the cluster registration equipment, and returning the service result data to the client.
Further, in the above method, the decrypting the application data according to the decryption parameter corresponding to the market version type to obtain the service identifier information and the routing parameter information includes:
decrypting the application data according to the decryption parameter corresponding to the market version type to obtain decrypted data content, wherein the decrypted data content comprises a service field body and a service field head;
analyzing the service field body in the decrypted data content to obtain the service identification information, wherein the service identification information comprises the version identification of the application program and a corresponding service identification;
and analyzing the service field header in the decrypted data content to obtain the routing parameter information.
Further, in the above method, the method further includes:
acquiring user behavior data corresponding to the application program from a client;
and forwarding the user behavior data corresponding to the application program to the cluster registration equipment, so that the cluster registration equipment forwards the user behavior data corresponding to the application program to the business service equipment.
According to another aspect of the present application, there is also provided a data interaction method based on an application market architecture, applied to a cluster registration device side, where the method includes:
receiving service identification information and routing parameter information sent by gateway service equipment;
determining the service equipment corresponding to the service identification information and the network address of the routing equipment corresponding to the service identification information according to the routing parameter information;
initiating a service request to the service device, wherein the service request comprises the network address of the routing device;
and receiving the business result data returned by the business service equipment, and returning the business result data to the gateway service equipment so that the gateway service equipment returns the business result data to the client.
Further, in the foregoing method, if multiple service devices corresponding to the same service are deployed, the determining, according to the routing parameter information, the network address of the service device corresponding to the service identifier information and the network address of the routing device corresponding to the service identifier information includes:
and determining the service equipment corresponding to the service identification information and the network address of the corresponding routing equipment according to the time stamp of polling of each service equipment and the routing parameter information.
Further, in the above method, the method further includes:
receiving user behavior data corresponding to the application program sent by the client from gateway service equipment;
and forwarding the user behavior data corresponding to the application program to the business service equipment so that the business service equipment stores and analyzes the user behavior data corresponding to the application program.
According to another aspect of the present application, there is also provided a data interaction method based on an application market architecture, applied to a business service device, where the method includes:
receiving a service request sent by cluster registration equipment, wherein the service request comprises a network address of routing equipment;
acquiring service result data of the service of the routing equipment corresponding to the network address;
and returning the service result data to the cluster registration equipment so that the cluster registration equipment returns the service result data to the gateway service equipment, wherein the gateway service equipment returns the service result data to the client.
Further, in the above method, the returning the service result data to the cluster registration device to make the cluster registration device return the service result data to the gateway service device, where the returning of the service result data to the client by the gateway service device includes:
performing corresponding encryption processing on the service result data to obtain encrypted service result data;
and returning the encrypted service result data to the cluster registration equipment so that the cluster registration equipment returns the encrypted service result data to the gateway service equipment, wherein the gateway service equipment returns the encrypted service result data to the client.
Further, in the above method, the method further includes:
receiving user behavior data corresponding to an application program forwarded by gateway service equipment from cluster registration equipment, wherein the user behavior data corresponding to the application program is sent by the client;
and storing and analyzing the user behavior data corresponding to the application program.
Further, in the above method, the method further includes:
creating a business service check thread;
and performing service health check, early warning and fault tolerance processing on the service corresponding to the current service equipment through the service check thread.
According to another aspect of the present application, there is also provided a non-volatile storage medium having computer-readable instructions stored thereon, which, when executed by a processor, cause the processor to implement the data interaction method based on the application market architecture as described above.
According to another aspect of the present application, there is also provided a gateway service device for data interaction based on an application market architecture, wherein the gateway service device includes:
one or more processors;
a computer-readable medium for storing one or more computer-readable instructions,
when executed by the one or more processors, the one or more computer-readable instructions cause the one or more processors to implement the data interaction method based on the application market architecture as described above for the gateway service device side.
According to another aspect of the present application, there is also provided a cluster registration device for data interaction based on an application market architecture, where the cluster registration device includes:
one or more processors;
a computer-readable medium for storing one or more computer-readable instructions,
when executed by the one or more processors, the one or more computer-readable instructions cause the one or more processors to implement a data interaction method based on an application market architecture, such as the cluster registration device side described above.
According to another aspect of the present application, there is also provided a business service device for data interaction based on an application market architecture, wherein the business service device includes:
one or more processors;
a computer-readable medium for storing one or more computer-readable instructions,
when executed by the one or more processors, the one or more computer-readable instructions cause the one or more processors to implement the data interaction method based on the application market architecture, such as the business service equipment side.
Compared with the prior art, the application constructs an application market architecture of a client, a gateway service device, a cluster registration device and a business service device, so that a market request initiated by the client is transmitted to the gateway service device through elastic load balance, the market request comprises routing information and application data, the gateway service device determines the market version type of an application program according to the routing information, acquires decryption parameters corresponding to the market version type, decrypts the application data according to the decryption parameters corresponding to the market version type to obtain business identification information and routing parameter information, and transmits the business identification information and the routing parameter information to the cluster registration device; the cluster registration equipment determines the service equipment corresponding to the service identification information and the network address of the routing equipment corresponding to the service identification information according to the routing parameter information, and initiates a service request to the service equipment, wherein the service request comprises the network address of the routing equipment; the service equipment acquires service result data of services served by the routing equipment corresponding to the network address, and returns the service result data to the cluster registration equipment, so that the cluster registration equipment returns the service result data to the gateway service equipment, wherein the gateway service equipment returns the service result data to the client, and interaction of service result data of different application programs based on the constructed application market architecture is realized.
Drawings
Other features, objects and advantages of the present application will become more apparent upon reading of the detailed description of non-limiting embodiments made with reference to the following drawings:
FIG. 1 illustrates a schematic structural diagram of an application market framework constructed in a data interaction method based on the application market framework according to an aspect of the present application;
fig. 2 is a schematic diagram illustrating an interaction structure among a gateway service device, a cluster registration device, and a business service device of an application market architecture constructed in a data interaction method based on the application market architecture according to an aspect of the present application;
FIG. 3 illustrates a flow diagram of a method of data interaction based on an application marketplace architecture, in accordance with an aspect of the present application;
FIG. 4 illustrates a flow diagram of an actual application scenario of a data interaction method based on an application market architecture in accordance with an aspect of the subject application.
The same or similar reference numbers in the drawings identify the same or similar elements.
Detailed Description
The present application is described in further detail below with reference to the attached figures.
In a typical configuration of the present application, the terminal, the device serving the network, and the trusted party each include one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
Computer-readable media, including both permanent and non-permanent, removable and non-removable media, may implement the information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static Random Access Memory (SRAM), dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include non-transitory computer readable media (transient media), such as modulated data signals and carrier waves.
As shown in fig. 1, the present application constructs a schematic structural diagram of an application market architecture, where the application market architecture includes a Client (e.g., a Mobile Client), an Elastic Load Balancing (ELB), a gateway service device (corresponding to the gateway service center in fig. 1), a cluster registration device (corresponding to the cluster registration center in fig. 1), and a service device (corresponding to the REST API in fig. 1), and each device in the application market architecture is further explained below:
the Client (Mobile Client) can be a Mobile phone version Client in an application market, an HD version Client in the application market, a music version Client in the application market, and the like.
Elastic Load Balance (Elastic Load Balance), such as Huacheng cloud ELB, is used for automatically distributing access traffic to a plurality of cloud servers (such as gateway service equipment and the like), expanding the external service capability of an application system and realizing higher-level application fault tolerance
The gateway service equipment belongs to a core API treatment service center reconstructed by the application market architecture, and the functional logic of the gateway service equipment is simple and clear. Namely, the method provides external services for the mobile phone client, filters invalid access, resists illegal requests, calls internal business services in a load balancing manner and protects the service safety of the internal services
Cluster registry equipment (namely an Etcd cluster registry), wherein the Etcd aims to construct a highly available distributed key value (key-value) database; the interior of the Etcd adopts a raft protocol as a consistency algorithm, and the Etcd is realized based on Go language; according to benchmark data provided by the official, the Etcd single instance supports 2k + fast reading operation per second; the Etcd adopts a raft algorithm to realize the availability and consistency of data of a distributed system and ensure the reliability of the data; SSL certificate verification is supported, and safety is guaranteed. Zookeeper and etcd can both be registration and discovery for services, but etcd provides HTTP API interactions and is much simpler to use than Zookeeper.
The service equipment (namely Rest API service) comprises an APP marker service, a Report data service and a low-old Java service, wherein the APP marker service is an application market APP service, and the two servers are deployed; report data service is data service such as exposure, click, download and the like applied to market, and is deployed by two servers; the low-old Java service is an application market low-version old service overall system, namely an application market service system before market architecture reconstruction, and is deployed by two servers.
By the application market architecture constructed by the application, the system can be used as REST API service when being deployed, so that version iteration and compatibility are smoothly realized; the application market architecture can also conveniently meet the requirement of expanding any new service, and is not limited to any language; the practical slow-response old service can also utilize the etcd cluster registration center to manage and replace the optimized RESTAPI service with renovation, thereby perfectly optimizing the response speed of the old service; by utilizing business project segmentation, report data related demand components are specifically dedicated to report data collection report data service, asynchronous collection is used, and request response time of a client is greatly optimized; the innate advantages of the golang language are also used for supporting the treatment of higher concurrency; the gateway API service can be used for intensively managing each service, and the normal state of the service can be controlled and detected by the etcd, so that the access of the whole market system is not directly influenced to a certain extent due to a bug problem, and the fault influence range is reduced; the gateway API service is a uniform and unique entrance entering an application market, and is convenient for service tracking, problem troubleshooting, user behavior analysis and health service monitoring; different application market versions (application market mobile phone versions, HD versions, music video versions and the like) are marked by the routing, and encryption and decryption of each large market are independent and do not interfere with each other, so that data safety of different versions of the market is guaranteed.
In the application market architecture constructed by the application, the development language reselects compiled static language golang, and the inherent advantages of the golang language are utilized: the execution speed and the development efficiency are high, and the learning and the use are easy; the service system architecture is changed from a single architecture in the prior art into a Gin framework, an etcd cluster and a distributed service framework; splitting the project with the new function into sub-projects according to the actual service condition, wherein different teams are responsible for different sub-projects; when the new function is added, only module functions are added to a certain sub-item or new sub-items are added; data are subjected to standard statistical collection and double backup, so that effective, stable and reliable data are guaranteed to be used for operation analysis decision; the new service can be written in any language, is not limited to a certain technology, and has wider technical innovation opportunity and service invasions failure.
As shown in fig. 2, the application market architecture of the present application is a distributed system, which uses service discovery, registration and invocation of the Etcd cluster registry to manage the invocation process of the old and low system and the extended new sub-project business system. The work flow of the application market architecture system comprises the following steps: each gateway management service center (namely each gateway service device) initializes an instance and establishes connection with an etcd cluster registration center (namely cluster registration device), each gateway service device obtains service configuration information of REST API (namely service device) corresponding to each node connected with the etcd cluster registration service device, and the service configuration information comprises but is not limited to key number information mcd for a route and value for service ip + port + real route device correspondingly connected for the service; and storing node information configuration in a service system memory, wherein the specific codes are realized as follows:
Figure BDA0002992646680000101
after the REST API (i.e. service device) service initialization instance, the REST API (i.e. service device) maintains long connection with the etcd cluster registration center (i.e. cluster registration device) so as to subsequently register the routing device corresponding to the service, and the specific implementation code is as follows:
Figure BDA0002992646680000102
Figure BDA0002992646680000111
fig. 3 is a schematic interaction flow diagram illustrating a data interaction method based on an application market architecture according to an aspect of the present application, where the method includes a client, an elastic load balancing (such as hua shi cloud ELB), a gateway service device (gateway API service), a cluster registration device, a business service device, and a client, where the client may be a mobile phone client or a mobile terminal, and the following description describes an embodiment in which the client is preferably a mobile phone client, where the method includes steps S11, S12, S13, S14, S15, S21, S22, S23, S24, S31, S32, and S33, and specifically includes the following steps:
when a mobile phone client accesses the market, the hua-shi cloud ELB assigns the access of the mobile phone client to one of the gateway service devices, so that in step S11, the gateway service device receives a market request transmitted from an application program of the client, that is, the market request sent by the mobile phone client directly uses the hua-shi cloud ELB to implement load balancing, and transmits the market request to the current gateway service device, wherein the market request includes routing information and application data, the application data includes an application package name, device information of a device where the application program is located, corresponding service identification information and application version number equal to basic information of the application program, and the routing information includes routing parameters, parameter information and the like.
Step S12, the gateway service equipment determines the market version type of the application program according to the routing information, and acquires a decryption parameter corresponding to the market version type; here, the different market version types correspond to different decryption parameters, and the decryption parameters include decryption rules, decryption keys, and the like. For example, in step S12, the gateway service device determines, according to different routing information, which different market version type the query request comes from, and the specific implementation code is as follows:
g.POST("/",httpHand.DecodeReqM(),market.MarketApi)
g.POST("/ls",httpHand.DecodeReqMLs(),market.MarketApiLs)
g.POST("/hd",httpHand.DecodeReqMHd(),market.MarketApiHd)。
step S13, the gateway service device decrypts the application data according to the decryption parameter corresponding to the market version type to obtain service identification information and routing parameter information, wherein the routing parameter information includes but is not limited to a routing number mcd and the like, and the specific implementation code is as follows:
Figure BDA0002992646680000121
Figure BDA0002992646680000131
in step S13, the route is used to manage and support the market version types (such as mobile phone version, HD version, and music video version) of different applications, and the market version types are isolated from each other and do not interfere with each other.
Step S14, the gateway service equipment sends the service identification information and the routing parameter information to cluster registration equipment, so that the cluster registration equipment determines the identification of the service equipment corresponding to the service identification information and the network address of the routing equipment corresponding to the service identification information according to the routing parameter information.
Step S21, the cluster registration device receives the service identifier information and the routing parameter information sent by the gateway service device.
Step S22, the cluster registration device determines, according to the routing parameter information, a service device corresponding to the service identification information and a network address of a routing device corresponding to the service device, where the network address of the routing device includes, but is not limited to, a Uniform Resource Locator (URL) of the routing device; different services correspond to different service devices, and each service may correspond to one or more service devices.
Step S23, the cluster registration device initiates a service request to the service device, where the service request includes the network address of the routing device.
Step S31, the service device receives a service request sent by the cluster registration device, where the service request includes a network address of the routing device.
Step S32, the service device obtains service result data of a service served by the routing device corresponding to the network address. For example, as shown in fig. 4, the service device obtains the service result data of the service served by the routing device through HTTP POST access, wherein, since only the services supporting HTTP access can be made into independent service services, and the development language of the service services can be completely free from the limitation of architectural services, the service can be expanded quickly and efficiently by using the existing resources according to the actual situations of the service and company technicians, and the implementation code for obtaining the service result data of the service served by the routing device through HTTP POST access is as follows:
Figure BDA0002992646680000141
step S33, the service device returns the service result data to the cluster registration device, so that the cluster registration device returns the service result data to the gateway service device, where the gateway service device returns the service result data to the client.
Step S24, the cluster registration device receives the service result data returned by the service device, and returns the service result data to the gateway service device, so that the gateway service device returns the service result data to the client.
Step S15, the gateway service equipment receives the service result data returned by the cluster registration equipment and returns the service result data to the client.
Through the steps S11 to S15, S21 to S24, and S31 to S33, an application market architecture composed of the client, the elastic load balancing device, the gateway service device, the cluster registration device, and the service device constructed in the present application enables a market request initiated by the client to be transmitted to the gateway service device through the elastic load balancing, where the market request includes routing information and application data, the gateway service device determines a market version type of the application program according to the routing information, acquires a decryption parameter corresponding to the market version type, decrypts the application data according to the decryption parameter corresponding to the market version type, obtains service identification information and routing parameter information, and transmits the service identification information and the routing parameter information to the registration cluster device; the cluster registration equipment determines the service equipment corresponding to the service identification information and the network address of the routing equipment corresponding to the service identification information according to the routing parameter information, and initiates a service request to the service equipment, wherein the service request comprises the network address of the routing equipment; the service equipment acquires service result data of a service served by the routing equipment corresponding to the network address, and returns the service result data to the cluster registration equipment, so that the cluster registration equipment returns the service result data to the gateway service equipment, wherein the gateway service equipment returns the service result data to the client, and interaction of service result data of different application programs based on the constructed application market architecture is realized.
Further, in step S13, the gateway service device decrypts the application data according to the decryption parameter corresponding to the market version type to obtain the service identifier information and the routing parameter information, and specifically includes:
decrypting the application data according to the decryption parameter corresponding to the market version type to obtain decrypted data content, wherein the decrypted data content comprises a service field body and a service field head;
analyzing the service field body in the decrypted data content to obtain the service identification information, wherein the service identification information comprises the version identification of the application program and a corresponding service identification;
and analyzing the service field header in the decrypted data content to obtain the routing parameter information.
As shown in fig. 4, since different market version types correspond to different decryption parameters, where the decryption parameters include decryption rules, decryption keys, and the like, the gateway service device decrypts the application data according to the decryption parameters corresponding to the market version type carried in the market request to obtain decrypted data content, where the decrypted data content includes a service field body and a service field header; as shown in fig. 4, if the service field body and/or the service field header do not exist, the request related to the market service is ended; if a service field body and/or a service field header exists, analyzing the service field body in the decrypted data content to obtain service identification information, wherein the service identification information comprises a version identification of the application program and a corresponding service identification, so that whether the current application program is the latest version or not can be known through the version identification of the application program, and if the current application program is not the latest version, directly forwarding and accessing an old service system; if the version is the latest version, continuously analyzing the service field header in the decrypted data content to obtain the routing parameter information, and realizing the decryption of the application data.
Further, in step S13, if a plurality of service devices corresponding to the same service are deployed, that is, a plurality of service devices corresponding to each service exist, and when there is a request corresponding to the service and needs to reach a service device, it is necessary to select one of the service devices from the plurality of service devices to send data, step S22 in this embodiment of the present application determines, according to the routing parameter information, a network address of the service device corresponding to the service identification information and a network address of a routing device corresponding to the service identification information, which specifically includes:
and determining the service equipment corresponding to the service identification information and the network address of the corresponding routing equipment according to the timestamp for polling of each service equipment and the routing parameter information.
For example, the service device + routing device registered in the etcd cluster registration device is obtained according to the routing parameter information mcd, if a plurality of service devices corresponding to the same service are deployed, the routing parameter information mcd is an array for the server route, and a timestamp is required to be used as an algorithm base number to achieve the effect of load balancing with equal weight of each routing service device, so that one service device corresponding to the routing parameter information mcd is selected from the plurality of service devices corresponding to the same service, and the specific implementation codes are as follows:
Figure BDA0002992646680000161
by utilizing the routing parameter information mcd and the timestamp in the etcd cluster registration equipment, the load balance of the services corresponding to the plurality of service equipment corresponding to the same simple service is realized.
Further, in step S33, the service device returns the service result data to the cluster registration device, so that the cluster registration device returns the service result data to the gateway service device, where the gateway service device returns the service result data to the client, specifically including:
in order to ensure the security of the obtained service result data, firstly, carrying out corresponding encryption processing on the service result data to obtain encrypted service result data; and returning the encrypted service result data to the cluster registration device, so that the cluster registration device returns the encrypted service result data to a gateway service device, wherein the gateway service device returns the encrypted service result data to a client, and specifically, the implementation codes are as follows:
Figure BDA0002992646680000171
Figure BDA0002992646680000181
further, an embodiment of the present application provides a data interaction method based on an application market framework, where the method further includes:
the gateway service equipment acquires user behavior data corresponding to the application program from a client; here, the user behavior data includes, but is not limited to, behavior data of user's progress, such as exposure, click, download, and installation, generated by a user entering a market to operate a game and an application in the market in an application program; the gateway service equipment forwards the user behavior data corresponding to the application program to the cluster registration equipment, and does not perform storage operation on the gateway service equipment, so that the asynchronous reporting of the user behavior data by the gateway service equipment is realized, more available memory resources are released to the gateway service equipment, and the like, so that the cluster registration equipment forwards the user behavior data corresponding to the application program to the service equipment. Here, the gateway service device also directly forwards the service logic processing of the user behavior data to the report data service processing, thereby reducing the concurrency of the service unit time and releasing more resources to other services. The cluster registration equipment receives user behavior data corresponding to the application program sent by the client from gateway service equipment; and the cluster registration equipment forwards the user behavior data corresponding to the application program to the business service equipment so that the business service equipment stores and analyzes the user behavior data corresponding to the application program. The business service equipment receives user behavior data corresponding to an application program forwarded by gateway service equipment from cluster registration equipment, wherein the user behavior data corresponding to the application program is sent by the client; the business service equipment stores and analyzes the user behavior data corresponding to the application program, realizes asynchronous report of the user behavior data through the gateway service equipment, and releases more available memory resources to the gateway service equipment.
Further, an application market architecture-based data interaction method for a service device side provided in an embodiment of the present application further includes:
creating a business service check thread;
and performing service health check, early warning and fault tolerance processing on the service corresponding to the current service equipment through the service check thread. Here, each service device creates a service check thread, which is a basic service, for performing health check and early warning on a service, performing fault-tolerant processing based on a preset fault-tolerant mechanism, and the like, and the specific implementation code is as follows:
Figure BDA0002992646680000191
through all the above embodiments of the present application, the following technical effects are achieved: the gateway service API of the gateway service equipment unifies the inlet data to be clear, and data tracking is facilitated; the API request speed for accessing the market is optimized well, the average response time is within 60ms, and compared with the old service equipment in the prior art, the API request speed is improved by 10-40 times; the high concurrency of the newly constructed application market architecture is increased by more than thousand times; based on newly constructed application market service, the business expansion can be realized without being interfered and limited by a low old system and an old system, the expanded business can be completely independent and is not limited to technical personnel understanding Java language development, and company technical personnel resources can be more reasonably and effectively utilized; the hardware cost of each service device is reduced from the former 15 8-core 8G servers to 8 4-core 8G servers; because each service corresponds to different service equipment, the service modules are independent, and the influence range is minimized when abnormal faults occur; perfectly compatible with the old customers of the low version.
According to another aspect of the present application, there is also provided a non-volatile storage medium having computer-readable instructions stored thereon, which, when executed by a processor, cause the processor to implement the data interaction method based on the application market architecture as described above.
According to another aspect of the present application, there is also provided a gateway service device for data interaction based on an application market architecture, wherein the gateway service device includes:
one or more processors;
a computer-readable medium for storing one or more computer-readable instructions,
when executed by the one or more processors, the one or more computer-readable instructions cause the one or more processors to implement the data interaction method based on the application market architecture, such as the gateway service device side.
Here, for details of each embodiment in the gateway service device based on data interaction of the application market architecture, reference may be specifically made to corresponding parts of the embodiment of the data interaction method based on the application market architecture at the gateway service device side, and details are not described here again.
According to another aspect of the present application, there is also provided a cluster registration device for data interaction based on an application market architecture, where the cluster registration device includes:
one or more processors;
a computer-readable medium for storing one or more computer-readable instructions,
when executed by the one or more processors, the one or more computer-readable instructions cause the one or more processors to implement a data interaction method based on an application market architecture, such as the cluster registration device side described above.
Here, for details of each embodiment of the data interaction cluster registration device based on the application market architecture, reference may be made to a corresponding part of the embodiment of the data interaction method based on the application market architecture at the cluster registration device side, and details are not described herein again.
According to another aspect of the present application, there is also provided a business service device for data interaction based on an application market architecture, wherein the business service device includes:
one or more processors;
a computer-readable medium for storing one or more computer-readable instructions,
when executed by the one or more processors, the one or more computer-readable instructions cause the one or more processors to implement the data interaction method based on the application market architecture, such as the business service equipment side.
Here, for details of each embodiment in the business service device based on data interaction of the application market architecture, reference may be made to the corresponding part of the embodiment of the data interaction method based on the application market architecture at the business service device side, and details are not described here again.
In summary, according to the application, an application market architecture of a client, a gateway service device, a cluster registration device and a business service device is constructed, so that a market request initiated by the client is transmitted to the gateway service device through elastic load balance, the market request comprises routing information and application data, the gateway service device determines a market version type of an application program according to the routing information, acquires a decryption parameter corresponding to the market version type, decrypts the application data according to the decryption parameter corresponding to the market version type, obtains business identification information and routing parameter information, and transmits the business identification information and the routing parameter information to the cluster registration device; the cluster registration equipment determines the service equipment corresponding to the service identification information and the network address of the routing equipment corresponding to the service identification information according to the routing parameter information, and initiates a service request to the service equipment, wherein the service request comprises the network address of the routing equipment; the service equipment acquires service result data of services served by the routing equipment corresponding to the network address, and returns the service result data to the cluster registration equipment, so that the cluster registration equipment returns the service result data to the gateway service equipment, wherein the gateway service equipment returns the service result data to the client, and interaction of service result data of different application programs based on the constructed application market architecture is realized.
It should be noted that the present application may be implemented in software and/or a combination of software and hardware, for example, implemented using Application Specific Integrated Circuits (ASICs), general purpose computers or any other similar hardware devices. In one embodiment, the software programs of the present application may be executed by a processor to implement the steps or functions described above. Likewise, the software programs (including associated data structures) of the present application may be stored in a computer readable recording medium, such as RAM memory, magnetic or optical drive or diskette and the like. Additionally, some of the steps or functions of the present application may be implemented in hardware, for example, as circuitry that cooperates with the processor to perform various steps or functions.
In addition, some of the present application may be implemented as a computer program product, such as computer program instructions, which when executed by a computer, may invoke or provide methods and/or techniques in accordance with the present application through the operation of the computer. Program instructions which invoke the methods of the present application may be stored on a fixed or removable recording medium and/or transmitted via a data stream on a broadcast or other signal bearing medium and/or stored in a working memory of a computer device operating in accordance with the program instructions. An embodiment according to the present application comprises an apparatus comprising a memory for storing computer program instructions and a processor for executing the program instructions, wherein the computer program instructions, when executed by the processor, trigger the apparatus to perform a method and/or a solution according to the aforementioned embodiments of the present application.
It will be evident to those skilled in the art that the present application is not limited to the details of the foregoing illustrative embodiments, and that the present application may be embodied in other specific forms without departing from the spirit or essential attributes thereof. The present embodiments are therefore to be considered in all respects as illustrative and not restrictive, the scope of the application being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference sign in a claim should not be construed as limiting the claim concerned. Furthermore, it will be obvious that the term "comprising" does not exclude other elements or steps, and the singular does not exclude the plural. A plurality of units or means recited in the apparatus claims may also be implemented by one unit or means in software or hardware. The terms first, second, etc. are used to denote names, but not to denote any particular order.

Claims (13)

1. A data interaction method based on an application market architecture is applied to a gateway service equipment terminal, wherein the method comprises the following steps:
receiving a market request transmitted from an application program of a client, wherein the market request comprises routing information and application data;
determining the market version type of the application program according to the routing information, and acquiring a decryption parameter corresponding to the market version type;
decrypting the application data according to the decryption parameter corresponding to the market version type to obtain service identification information and routing parameter information;
sending the service identification information and the routing parameter information to cluster registration equipment so that the cluster registration equipment determines the identification of the service equipment corresponding to the service identification information and the network address of the routing equipment corresponding to the service identification information according to the routing parameter information;
receiving service result data returned by the cluster registration equipment, and returning the service result data to the client;
the decrypting the application data according to the decryption parameter corresponding to the market version type to obtain service identification information and routing parameter information includes:
decrypting the application data according to the decryption parameter corresponding to the market version type to obtain decrypted data content, wherein the decrypted data content comprises a service field body and a service field head;
analyzing the service field body in the decrypted data content to obtain the service identification information, wherein the service identification information comprises the version identification of the application program and a corresponding service identification;
and analyzing the service field header in the decrypted data content to obtain the routing parameter information.
2. The method of claim 1, wherein the method further comprises:
acquiring user behavior data corresponding to the application program from a client;
and forwarding the user behavior data corresponding to the application program to the cluster registration equipment, so that the cluster registration equipment forwards the user behavior data corresponding to the application program to the business service equipment.
3. A data interaction method based on an application market architecture is applied to a cluster registration device side, wherein the method comprises the following steps:
receiving service identification information and routing parameter information sent by gateway service equipment; after receiving a market request transmitted from an application program of a client, the gateway service equipment determines the market version type of the application program according to the routing information in the market request, acquires a decryption parameter corresponding to the market version type, and decrypts application data in the market request according to the decryption parameter corresponding to the market version type to obtain service identification information and routing parameter information;
determining the service equipment corresponding to the service identification information and the network address of the routing equipment corresponding to the service identification information according to the routing parameter information;
initiating a service request to the service device, wherein the service request comprises the network address of the routing device;
receiving business result data returned by the business service equipment, and returning the business result data to the gateway service equipment so that the gateway service equipment returns the business result data to a client;
the gateway service device decrypts the application data according to the decryption parameter corresponding to the market version type to obtain service identification information and routing parameter information, and the method comprises the following steps: decrypting the application data according to the decryption parameter corresponding to the market version type to obtain decrypted data content, wherein the decrypted data content comprises a service field body and a service field head; analyzing the service field body in the decrypted data content to obtain the service identification information, wherein the service identification information comprises the version identification of the application program and a corresponding service identification; and analyzing the service field header in the decrypted data content to obtain the routing parameter information.
4. The method of claim 3, wherein, if a plurality of service devices corresponding to the same service are deployed, the determining, according to the routing parameter information, the network addresses of the service device corresponding to the service identification information and the routing device corresponding to the service device includes:
and determining the service equipment corresponding to the service identification information and the network address of the corresponding routing equipment according to the timestamp for polling of each service equipment and the routing parameter information.
5. The method of claim 3 or 4, wherein the method further comprises:
receiving user behavior data corresponding to the application program sent by the client from gateway service equipment;
and forwarding the user behavior data corresponding to the application program to the business service equipment so that the business service equipment stores and analyzes the user behavior data corresponding to the application program.
6. A data interaction method based on an application market architecture is applied to a business service equipment terminal, wherein the method comprises the following steps:
receiving a service request sent by cluster registration equipment, wherein the service request comprises a network address of routing equipment; after receiving service identification information and routing parameter information from gateway service equipment, the cluster registration equipment determines the network address of the routing equipment according to the routing parameter information and the service identification information;
after receiving a market request transmitted from an application program of a client, the gateway service equipment determines the market version type of the application program according to the routing information in the market request, acquires a decryption parameter corresponding to the market version type, and decrypts application data in the market request according to the decryption parameter corresponding to the market version type to obtain service identification information and routing parameter information;
acquiring service result data of a service served by the routing equipment corresponding to the network address;
returning the service result data to the cluster registration equipment so that the cluster registration equipment returns the service result data to gateway service equipment, wherein the gateway service equipment returns the service result data to a client;
the gateway service device decrypts the application data according to the decryption parameter corresponding to the market version type to obtain service identification information and routing parameter information, and the method includes: decrypting the application data according to the decryption parameter corresponding to the market version type to obtain decrypted data content, wherein the decrypted data content comprises a service field body and a service field head; analyzing the service field body in the decrypted data content to obtain the service identification information, wherein the service identification information comprises the version identification of the application program and a corresponding service identification; and analyzing the service field header in the decrypted data content to obtain the routing parameter information.
7. The method of claim 6, wherein the returning the traffic result data to the cluster registration device to cause the cluster registration device to return the traffic result data to a gateway service device, wherein the returning the traffic result data to a client by the gateway service device comprises:
performing corresponding encryption processing on the service result data to obtain encrypted service result data;
and returning the encrypted service result data to the cluster registration equipment so that the cluster registration equipment returns the encrypted service result data to the gateway service equipment, wherein the gateway service equipment returns the encrypted service result data to the client.
8. The method of claim 6 or 7, wherein the method further comprises:
receiving user behavior data corresponding to an application program forwarded by gateway service equipment from cluster registration equipment, wherein the user behavior data corresponding to the application program is sent by the client;
and storing and analyzing the user behavior data corresponding to the application program.
9. The method of claim 6 or 7, wherein the method further comprises:
creating a business service check thread;
and performing service health check, early warning and fault tolerance processing on the service corresponding to the current service equipment through the service check thread.
10. A non-transitory storage medium having stored thereon computer readable instructions which, when executed by a processor, cause the processor to implement the method of any one of claims 1 to 9.
11. A gateway service device for data interaction based on an application market architecture, wherein the gateway service device comprises:
one or more processors;
a computer-readable medium for storing one or more computer-readable instructions,
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-2.
12. A cluster registration device for data interaction based on an application market architecture, wherein the cluster registration device comprises:
one or more processors;
a computer-readable medium for storing one or more computer-readable instructions,
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 3-5.
13. A business service device for data interaction based on an application market architecture, wherein the business service device comprises:
one or more processors;
a computer-readable medium for storing one or more computer-readable instructions,
the one or more computer readable instructions, when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 6-9.
CN202110319837.2A 2021-03-25 2021-03-25 Data interaction method and device based on application market architecture Active CN113259407B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110319837.2A CN113259407B (en) 2021-03-25 2021-03-25 Data interaction method and device based on application market architecture

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110319837.2A CN113259407B (en) 2021-03-25 2021-03-25 Data interaction method and device based on application market architecture

Publications (2)

Publication Number Publication Date
CN113259407A CN113259407A (en) 2021-08-13
CN113259407B true CN113259407B (en) 2023-02-03

Family

ID=77181139

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110319837.2A Active CN113259407B (en) 2021-03-25 2021-03-25 Data interaction method and device based on application market architecture

Country Status (1)

Country Link
CN (1) CN113259407B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114143324A (en) * 2021-10-27 2022-03-04 上海卓悠网络科技有限公司 Load balancing method and device based on application market architecture
CN114338682A (en) * 2021-12-24 2022-04-12 北京字节跳动网络技术有限公司 Flow identity mark transmission method and device, electronic equipment and storage medium
CN114979263B (en) * 2022-03-28 2023-09-15 慧之安信息技术股份有限公司 High concurrency gateway SIP proxy method and device based on Gin framework

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110061983A (en) * 2019-04-09 2019-07-26 苏宁易购集团股份有限公司 A kind of data processing method and system
CN110381163A (en) * 2019-07-30 2019-10-25 普信恒业科技发展(北京)有限公司 The method and gateway node of gateway node for transmitting service request
CN111814177A (en) * 2020-06-28 2020-10-23 中国建设银行股份有限公司 Multi-tenant data processing method, device, equipment and system based on micro-service
CN112087333A (en) * 2020-09-07 2020-12-15 上海浦东发展银行股份有限公司 Micro-service registration center cluster and information processing method thereof
CN112118565A (en) * 2020-08-14 2020-12-22 金蝶医疗软件科技有限公司 Multi-tenant service gray level publishing method and device, computer equipment and storage medium

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111294798B (en) * 2018-12-07 2023-04-28 中国移动通信集团陕西有限公司 Data interaction method, device, terminal equipment and medium
CN111722995B (en) * 2019-03-18 2023-08-15 杭州淘票票影视文化有限公司 Data processing method and device
CN111539622A (en) * 2020-04-22 2020-08-14 国网信通亿力科技有限责任公司 Collective enterprise project management platform based on cloud platform and micro-service architecture

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110061983A (en) * 2019-04-09 2019-07-26 苏宁易购集团股份有限公司 A kind of data processing method and system
CN110381163A (en) * 2019-07-30 2019-10-25 普信恒业科技发展(北京)有限公司 The method and gateway node of gateway node for transmitting service request
CN111814177A (en) * 2020-06-28 2020-10-23 中国建设银行股份有限公司 Multi-tenant data processing method, device, equipment and system based on micro-service
CN112118565A (en) * 2020-08-14 2020-12-22 金蝶医疗软件科技有限公司 Multi-tenant service gray level publishing method and device, computer equipment and storage medium
CN112087333A (en) * 2020-09-07 2020-12-15 上海浦东发展银行股份有限公司 Micro-service registration center cluster and information processing method thereof

Also Published As

Publication number Publication date
CN113259407A (en) 2021-08-13

Similar Documents

Publication Publication Date Title
CN113259407B (en) Data interaction method and device based on application market architecture
US11177999B2 (en) Correlating computing network events
US9712410B1 (en) Local metrics in a service provider environment
WO2020147419A1 (en) Monitoring method and apparatus, computer device and storage medium
US7761527B2 (en) Method and apparatus for discovering network based distributed applications
US11068380B2 (en) Capturing and encoding of network transactions for playback in a simulation environment
Gerndt et al. Performance Tools for the Grid: State of the Art and Future: Apart White Paper
JP2009519523A (en) Method, system, and computer program for monitoring the performance of a target virtual operating system within a virtual data center complex
US10552306B2 (en) Automated test generation for multi-interface and multi-platform enterprise virtualization management environment
US10423439B1 (en) Automatic determination of a virtual machine's dependencies on storage virtualization
CA3051439C (en) Playback of captured network transactions in a simulation environment
CN110348225A (en) Method and apparatus are determined for the security breaches of application programming interfaces
Salami et al. A framework for comparing quantitative and qualitative criteria of IoT platforms
CN114143324A (en) Load balancing method and device based on application market architecture
Stankovski et al. Implementing time-critical functionalities with a distributed adaptive container architecture
Straesser et al. A systematic approach for benchmarking of container orchestration frameworks
CN114338684A (en) Energy management system and method
US10135728B2 (en) Partial switching of network traffic
Liu et al. Towards a community cloud storage
CN114281376A (en) Service-based hot upgrading method and equipment
KR20190015817A (en) Method, Apparatus and System for Monitoring Using Middleware
Elkhatib et al. An Evaluation of Service Mesh Frameworks for Edge Systems
US11947939B1 (en) Software application dependency insights
Paul et al. Big Data Cluster Service Discovery: A System Application for Big Data Cluster Security Analysis
Khan et al. Monitoring service level workload and adapting highly available applications

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant