Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
The service upgrading method provided by the application can be applied to the application environment shown in fig. 1. Wherein the terminal 102 communicates with the server 104 via a network. The terminal 102 generates a service code according to the exchange rules or the rules set by the user. The server 104 compiles the service code to obtain an upgraded service dynamic link library; acquiring a transaction node configuration rule corresponding to the service to be upgraded; and upgrading the transaction node containing the service to be upgraded based on the upgraded service dynamic link library according to the transaction node configuration rule. The terminal 102 may be, but not limited to, various personal computers, notebook computers, smart phones, tablet computers, and portable wearable devices, and the server 104 may be implemented by an independent server or a server cluster formed by a plurality of servers.
In an embodiment, as shown in fig. 2, a service upgrade method is provided, which is described by taking the application of the method to the server in fig. 1 as an example, and includes the following steps:
step 202, obtaining a service code corresponding to a service to be upgraded.
Wherein the service to be upgraded is a transaction-related service. Such as spot bidding or redeeming business, etc. The service code means a code capable of implementing the service.
Specifically, the server tests and verifies the service code according to rules defined by the exchange or the user; and when the service code test fails, acquiring the service code obtained by adjusting according to rules defined by the exchange or the user. The adjusted service code is the service code corresponding to the service to be upgraded. The service code may be obtained after bug fixing, obtained after service logic is added, or obtained after service logic optimization.
And step 204, compiling the service code to obtain an upgraded service dynamic link library.
Among them, a Dynamic Link Library (abbreviated as DLL) is a way to realize the concept of shared function Library.
Specifically, the server compiles the service code to obtain an upgraded service dynamic link library.
And step 206, acquiring a transaction node configuration rule corresponding to the service to be upgraded.
The transaction node configuration rule is used for determining transaction nodes needing to be upgraded.
Specifically, the server obtains a transaction node configuration rule corresponding to the service to be upgraded from the terminal. The transaction node configuration rules may be set in the terminal. The transaction node configuration rules may include selecting a transaction node at the terminal, configuring based on node type, configuring based on update time, and the like.
And 208, upgrading the transaction node containing the service to be upgraded based on the upgraded service dynamic link library according to the transaction node configuration rule.
The trading node is a virtual concept, that is, a component instance containing one or more complete traffic paths is collectively referred to as a trading node. I.e. one transaction node may comprise at least two services. The traffic contained in each trading node is not identical. For example, transaction node 1 includes service a and service B, which may include service B and service C.
Specifically, the server upgrades the transaction node containing the service to be upgraded based on the upgraded service dynamic link library according to the transaction node configuration rule.
In this embodiment, the node a is a non-trading node, and mainly includes a spot bidding service and an ETF (Exchange Traded Fund) redemption service, and the node B is an extremely fast trading node, and mainly includes a spot bidding service. When the spot bidding service needs to be upgraded, the node A and the node B can be upgraded simultaneously, and when the ETF redeeming service needs to be upgraded, only the node A needs to be upgraded.
In the service upgrading method in this embodiment, each dynamic service library is an independent module including a code, and when details of a certain service need to be adjusted, only the code of the service needs to be adjusted and the dynamic service library of the service is independently packaged, and other services are not affected, so that all dynamic service link libraries can be subjected to secondary incremental development; by acquiring the transaction node configuration rule corresponding to the service to be upgraded and upgrading the transaction node based on the upgraded service dynamic link library, only the corresponding transaction node can be upgraded without upgrading all transaction nodes, and the upgrading time is saved.
In one embodiment, the service to be upgraded comprises a service component to be upgraded, and the service code comprises a service component code. Acquiring a service component code corresponding to a service component to be upgraded; and compiling the service component code to obtain an upgraded service dynamic link library.
In particular, the node number to which each component instance name belongs will typically be embodied in the name of that component instance name. The node does not represent a machine, e.g. there are examples
GW_1_1,GW_2_1,GW_3_2,TE_1_1,TE_2_2,TE_3_2
The second digit of the interval underlined in the nomenclature indicates a different number of the same component, the third digit indicates the node number belonging to the same, then GW _1_1, GW _2_1, TE _1_1 are examples of node 1, GW _3_2, TE _2_2, TE _3_2 are examples of node 2, these 2 nodes are set to each perform a different service, TE _1_1 example of node 1 handles spot and non-transaction traffic, TE _2_2 of node 2 handles spot traffic, TE _3_2 handles non-transaction traffic. For which machine each instance is deployed on, the evaluation is based on the resources of the machine and the resources used by the instance runtime. The main implementation logic of an independent service is in a service dynamic link library, so that when confirming the service to be processed, 1 TE component or 2 TE components in the above example respectively load the corresponding service dynamic link libraries.
In one embodiment, compiling the business code includes: the business code is compiled in a dynamically linked library of the trading system. Upgrading a transaction node containing a service to be upgraded, comprising: the dynamic link library of the transaction upgrading system comprises transaction nodes of services to be upgraded.
In particular, the trading system comprises at least one trading node. The transaction system is used for overall planning of transaction nodes. The trading system itself is also compiled through a dynamically linked library. The server compiles the transaction service code in a dynamic link library of the transaction system; and in the dynamic link library of the transaction system, upgrading the transaction node of the service to be upgraded in the dynamic link library of the transaction system.
In this embodiment, the service to be upgraded includes service components, and the service components may operate independently on different machines. The transaction system can be a distributed transaction system, and the distributed transaction system can be simply understood as a program with a complex flow, after the transaction system is split into a framework in which a plurality of components are completed in an interactive mode, the components are split into different machines to operate independently, and the program with the complex flow can still be completed normally under the mutual cooperation and interaction. After the flow is split, each component which completes independent function can be further subdivided, for example, an extension of the aforementioned dynamic library use is mainly used to adapt the benefits of the dynamic library to the distributed characteristics, so that the benefits of the dynamic library are more valuable under the distributed architecture.
In this embodiment, as shown in fig. 3, a schematic diagram of a framework of a transaction system in one embodiment is shown. The trading system 300 is included, and the trading system 300 can include a node 1, a node 2 … … and a node N. And node 1 may include service a and service B, node 2 may include service B and service C, and node N may include service X and service Y. Based on the architecture of service module decoupling, individual upgrading can be performed for certain services.
In the service upgrading method in this embodiment, the service code is compiled in the dynamic link library of the transaction system, and the transaction node including the service to be upgraded is upgraded, so that only the node needs to be upgraded for upgrading a certain service, the whole system does not need to be upgraded, and the upgrading time is saved.
In one embodiment, upgrading a transaction node including a service to be upgraded based on an upgraded service dynamic link library according to a transaction node configuration rule includes:
acquiring selection operation of a transaction node containing a service to be upgraded, and acquiring a selected transaction node;
and upgrading the selected transaction node based on the upgraded service dynamic link library.
Specifically, the server obtains a selection operation triggered at the terminal on a transaction node list containing the service to be upgraded, and obtains a selected transaction node. And the server upgrades the selected transaction node based on the upgraded service dynamic link library.
In this embodiment, the server upgrades the selected transaction node in the dynamic link library of the transaction system based on the upgraded service dynamic link library.
The service upgrading method in the embodiment obtains the selection operation of the transaction node containing the service to be upgraded, obtains the selected transaction node, upgrades the selected transaction node based on the upgraded service dynamic link library, can freely select the transaction node needing upgrading, and does not influence other nodes.
In one embodiment, upgrading a transaction node including a service to be upgraded based on an upgraded service dynamic link library according to a transaction node configuration rule includes:
determining a transaction node containing a service to be upgraded and node types respectively corresponding to the transaction node containing the service to be upgraded; determining a target node type from the node types; and dynamically linking the target transaction node corresponding to the target node type of the upgrade base based on the upgraded service.
Wherein the node type is used to classify different nodes. Each node processes which services and is planned in the management system, so that under the scene with the upgrading requirement, the nodes needing to be upgraded can be easily known. One node corresponds to one type. There may be at least one node under a node type. For example, nodes 1 and 2 are classified as X class, and nodes 3 and 4 are classified as Y class.
Specifically, the mapping relation between the business and the transaction node is stored in the server. And distributing corresponding node types for the transaction nodes in the server. And the server determines a transaction node containing the service to be upgraded and node types respectively corresponding to the transaction nodes containing the service to be upgraded according to the mapping relation between the service and the transaction nodes. The server determines a target node type from the node types. And the server dynamically links the target transaction node corresponding to the target node type of the upgrade library based on the upgraded service. For example, if the target node type determined by the server is type X, then node 1 and node 2 are updated based on the updated service dynamic link library.
The service upgrading method in this embodiment determines transaction nodes including a service to be upgraded and node types corresponding to the transaction nodes including the service to be upgraded, determines a target node type from the node types, dynamically links target transaction nodes corresponding to the target node types of the upgrade library based on the upgraded service, and can selectively upgrade different services based on different scenes of the nodes.
In one embodiment, determining the target node type from the node types includes: and acquiring the selection operation of the node type, and taking the selected node type as the target node type.
Specifically, a node containing the service to be upgraded is displayed on the terminal. And the server acquires the selection operation of the node type on the terminal and takes the selected node type as the target node type. And upgrading the target transaction node corresponding to the target node type based on the upgraded service dynamic link library.
In the service upgrading method in this embodiment, different services can be selectively upgraded based on different scenarios of nodes by obtaining a selection operation on a node type and using the selected node type as a target node type.
In one embodiment, upgrading a transaction node including a service to be upgraded based on an upgraded service dynamic link library according to a transaction node configuration rule includes: determining a transaction node containing a service to be upgraded; selecting a preset number of transaction nodes from the transaction nodes containing the service to be upgraded according to the sequence of the creation time from new to old to obtain the transaction nodes of the trial run; and upgrading the transaction node of the trial operation based on the upgraded service dynamic link library.
Wherein the trading node may have a corresponding creation time. The preset number may be preset in the server or may be filled in by the user at the time of upgrade.
Specifically, the mapping relation between the business and the transaction node is stored in the server. And the server determines the transaction node containing the service to be upgraded according to the mapping relation between the service and the transaction node. The server selects a preset number of transaction nodes from the transaction nodes containing the upgrade services according to the sequence of the creation time from old to new, and the preset number of transaction nodes are all used as trial operation transaction nodes. And the server upgrades the target transaction node based on the upgraded service dynamic link library.
In the service upgrading method in this embodiment, since some services only need to be tentatively run in some nodes, and all nodes of the service do not need to be upgraded, a preset number of nodes can be selected according to the order of creation time from new to old, transaction nodes of the tentative runs are obtained, and upgrading is performed based on the upgraded service dynamic link library, and upgrading can be performed only in some nodes of the tentative runs without affecting the nodes of normal runs.
In one embodiment, the business code is adjusted according to updated business rules of the exchange; or the service code is adjusted according to a service rule set by a user.
The service upgrading method in the embodiment of the application is applied to a service interaction scene between the service upgrading method and a trading exchange, and comprises the following steps: acquiring a service code corresponding to a service to be upgraded, wherein the service code is adjusted according to a service rule updated by a trading exchange; or the service code is adjusted according to the service rule specified by the user; compiling the service code to obtain an upgraded service dynamic link library; and acquiring a transaction node configuration rule corresponding to the service to be upgraded, and upgrading the transaction node containing the service to be upgraded based on the upgraded service dynamic link library according to the transaction node configuration rule.
In one embodiment, on the basis of a transaction system framework, each service dynamic library is an independently existing module including codes, when the details of a certain service need to be adjusted, only the codes of the service need to be adjusted, and the dynamic library of the service is independently packaged, so that other services are not affected, and therefore all the service dynamic libraries can be developed in a secondary increment mode.
The tester tests and verifies the service according to rules defined by the exchange and the user of the tester, and a conclusion about whether the service is problematic can be obtained. Or the exchange sends out a notification of detail adjustment for a certain service, and the like, at this time, it can be considered that a certain service has a problem or needs to add service logic. When a certain service has a problem or needs to be added with service logic, a certain service code can be adjusted, then independent construction is carried out according to a framework development kit, and upgrading and replacement are carried out in the environment, so that the effect of single-point independent upgrading is achieved, and the stability of the framework and other services is ensured. The user may only modify a certain service module or modules. In a distributed scenario, there may still be some strategic choices for the operation of the upgrade, a simple example: the node A is a non-trading node and mainly has a spot bidding service and an ETF (Exchange Traded Fund) redemption service, the node B is an extremely fast trading node and mainly is a spot bidding service, when the spot bidding service needs to be upgraded, the node A and the node B can be upgraded simultaneously, and when the ETF redemption service needs to be upgraded, only the node A needs to be upgraded. The framework development kit is a module unrelated to the service logic and cannot change as frequently as the service logic, so that when the service logic is adjusted, the service dynamic library is compiled based on the original framework development kit, and then the service dynamic library is updated.
The services operate independently, when upgrading is needed, one or some services can be upgraded in a targeted mode, integral upgrading is not needed, and the stability of software operation can be guaranteed.
It should be understood that, although the steps in the flowchart of fig. 2 are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least a portion of the steps in fig. 2 may include multiple steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, which are not necessarily performed in sequence, but may be performed in turn or alternately with other steps or at least a portion of the other steps or stages.
In one embodiment, as shown in fig. 4, there is provided a service upgrade apparatus, including: a code obtaining module 402, a compiling module 404, a rule obtaining module 406, and a node upgrading module 408, wherein:
a code obtaining module 402, configured to obtain a service code corresponding to a service to be upgraded;
a compiling module 404, configured to compile the service code to obtain an upgraded service dynamic link library;
a rule obtaining module 406, configured to compile a service code to obtain an upgraded service dynamic link library;
and the node upgrading module 408 is configured to upgrade the transaction node including the service to be upgraded based on the upgraded service dynamic link library according to the transaction node configuration rule.
In the service upgrading device in this embodiment, each dynamic service library is an independent module including a code, and when details of a certain service need to be adjusted, only the code of the service needs to be adjusted and the dynamic service library of the service is independently packaged, and other services are not affected, so that all dynamic service link libraries can be developed in a secondary increment manner; by acquiring the transaction node configuration rule corresponding to the service to be upgraded and upgrading the transaction node based on the upgraded service dynamic link library, only the corresponding transaction node can be upgraded without upgrading all transaction nodes, and the upgrading time is saved.
In one embodiment, the encoding module is used to compile the business code in a dynamically linked library of the trading system. The node upgrading module 408 is used for upgrading the transaction node containing the service to be upgraded in the dynamic link library of the transaction system.
In the service upgrading device in this embodiment, the service code is compiled in the dynamic link library of the transaction system, and the transaction node including the service to be upgraded is upgraded, so that only the node needs to be upgraded for upgrading a certain service, the whole system does not need to be upgraded, and the upgrading time is saved.
In one embodiment, the node upgrade module 408 is configured to obtain a selection operation on a transaction node including a service to be upgraded, and obtain a selected transaction node; and upgrading the selected transaction node based on the upgraded service dynamic link library.
The service upgrading device in this embodiment obtains selection operation on a transaction node including a service to be upgraded, obtains the selected transaction node, upgrades the selected transaction node based on the upgraded service dynamic link library, and can freely select the transaction node to be upgraded without affecting other nodes.
In one embodiment, the node upgrading module 408 is configured to determine transaction nodes including services to be upgraded, and node types respectively corresponding to the transaction nodes including the services to be upgraded; determining a target node type from the node types; and dynamically linking the target transaction node corresponding to the target node type of the upgrade base based on the upgraded service.
The service upgrading device in this embodiment determines a transaction node including a service to be upgraded and node types corresponding to the transaction nodes including the service to be upgraded, determines a target node type from the node types, dynamically links a target transaction node corresponding to the target node type based on the upgraded service, and can selectively upgrade different services based on different scenes of the nodes.
In one embodiment, node upgrade module 408 is further configured to obtain a selection operation for a node type, and use the selected node type as a target node type.
The service upgrading device in this embodiment selectively upgrades different services based on different scenarios of nodes by acquiring the selection operation on the node type and using the selected node type as the target node type.
In one embodiment, the node upgrade module 408 is configured to determine a transaction node containing a service to be upgraded; selecting a preset number of transaction nodes from the transaction nodes containing the service to be upgraded according to the sequence of the creation time from new to old to obtain the transaction nodes of the trial run; and upgrading the transaction node of the trial operation based on the upgraded service dynamic link library.
In the service upgrading device in this embodiment, since some services only need to be tentatively run in some nodes, and all nodes of the service do not need to be upgraded, a preset number of nodes can be selected according to the order from new to old of the creation time to obtain transaction nodes for tentative running, and upgrading is performed based on the upgraded service dynamic link library, and upgrading can be performed only in some nodes for tentative running without affecting nodes which normally run.
In one embodiment, the business code is adjusted according to updated business rules of the exchange; or the service code is adjusted according to a service rule set by a user.
For specific limitations of the service upgrading device, reference may be made to the above limitations of the service upgrading method, which is not described herein again. The modules in the service upgrading device can be wholly or partially realized by software, hardware and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, which may be a server, the internal structure of which may be as shown in fig. 5. The computer device includes a processor, a memory, and a network interface connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The database of the computer device is used for storing business data. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a service upgrade method.
Those skilled in the art will appreciate that the architecture shown in fig. 5 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, a computer device is further provided, which includes a memory and a processor, the memory stores a computer program, and the processor implements the steps of the above method embodiments when executing the computer program.
In an embodiment, a computer-readable storage medium is provided, in which a computer program is stored which, when being executed by a processor, carries out the steps of the above-mentioned method embodiments.
In one embodiment, a computer program product or computer program is provided that includes computer instructions stored in a computer-readable storage medium. The computer instructions are read by a processor of a computer device from a computer-readable storage medium, and the computer instructions are executed by the processor to cause the computer device to perform the steps in the above-mentioned method embodiments.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database or other medium used in the embodiments provided herein can include at least one of non-volatile and volatile memory. Non-volatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical storage, or the like. Volatile Memory can include Random Access Memory (RAM) or external cache Memory. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM), among others.
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.