WO2019080335A1 - 一种电力交易功能进行微服务改造的方法 - Google Patents

一种电力交易功能进行微服务改造的方法

Info

Publication number
WO2019080335A1
WO2019080335A1 PCT/CN2017/117882 CN2017117882W WO2019080335A1 WO 2019080335 A1 WO2019080335 A1 WO 2019080335A1 CN 2017117882 W CN2017117882 W CN 2017117882W WO 2019080335 A1 WO2019080335 A1 WO 2019080335A1
Authority
WO
WIPO (PCT)
Prior art keywords
service
slave
master
data
redis
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.)
Ceased
Application number
PCT/CN2017/117882
Other languages
English (en)
French (fr)
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.)
Beijing Kedong Electric Power Control System Co Ltd
NARI Group Corp
State Grid Corp of China SGCC
Original Assignee
Beijing Kedong Electric Power Control System Co Ltd
NARI Group Corp
State Grid Corp of China SGCC
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 Beijing Kedong Electric Power Control System Co Ltd, NARI Group Corp, State Grid Corp of China SGCC filed Critical Beijing Kedong Electric Power Control System Co Ltd
Priority to US15/744,910 priority Critical patent/US10778751B2/en
Publication of WO2019080335A1 publication Critical patent/WO2019080335A1/zh
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q10/00Administration; Management
    • G06Q10/10Office automation; Time management
    • G06Q10/103Workflow collaboration or project management
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q50/00Information and communication technology [ICT] specially adapted for implementation of business processes of specific business sectors, e.g. utilities or tourism
    • G06Q50/06Energy or water supply
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/06Management of faults, events, alarms or notifications
    • H04L41/0654Management of faults, events, alarms or notifications using network fault recovery
    • H04L41/0659Management of faults, events, alarms or notifications using network fault recovery by isolating or reconfiguring faulty entities
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/06Management of faults, events, alarms or notifications
    • H04L41/0654Management of faults, events, alarms or notifications using network fault recovery
    • H04L41/0668Management of faults, events, alarms or notifications using network fault recovery by dynamic selection of recovery network elements, e.g. replacement by the most appropriate element after failure
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • 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/51Discovery or management thereof, e.g. service location protocol [SLP] or web services

Definitions

  • the present invention relates to the field of power trading technologies, and in particular, to a method for performing microservice modification of a power trading function.
  • the national unified power market trading platform can realize market functions such as power generation rights trading and direct trading of power users, and has the parallel operation capability of multi-variety and multi-cycle transactions, which has important practical significance for improving the level of power trading operations and promoting optimal allocation of power resources.
  • the members of the nation's power trading market continue to grow, and the requirements for the concurrent performance of the system continue to increase.
  • the national unified power market trading platform used today has a large project size, and the requirements, design, development, testing, and deployment processes are fixed.
  • the new functions need to be modified and improved on the original project.
  • the system resource occupancy rate is too high, and the entire application needs Horizontal expansion, development and maintenance are very inconvenient. Therefore, the micro-service transformation of the power trading function is required to adapt to the requirements of the business development for system application.
  • the present invention provides a method for performing microservice modification of a power trading function.
  • the present invention achieves decoupling of solutions or complex systems by decomposing functions into multiple independent services.
  • a method for power service transformation to perform micro service transformation characterized in that
  • the method includes the following steps:
  • each split microservice will register a node information with the service registry
  • the external network user enters the external network transaction cloud through the PC terminal or the mobile phone terminal, obtains the actual network address that needs the service from the service registration center, sends a request to the requested service, and performs related business operations; the intranet user passes the PC.
  • the terminal enters the intranet transaction cloud, and also obtains the actual network address that needs the service from the service registration center, sends the request to the requested service, and performs related business operations.
  • the external network transaction cloud includes a separate micro service of "bidding declaration” and "transaction result inquiry”;
  • the intranet transaction cloud includes “transaction sequence creation”, “publication release”, “bidding declaration”, “transaction opening”, “declaration data check”, “combination clearing”, “safety check” and “result release” alone. Microservices.
  • step (3) when performing related business operations in each micro service, the read-write separation operation of the database is as follows:
  • ORACLE persistence layer commercial database and REDIS memory database
  • the REDIS master-slave replication mechanism is used to solve the problem, as follows:
  • the data file is sent to the slave SLAVE through the REDIS SYNC mechanism, and SLAVE performs the same operation to ensure data consistency;
  • MASTER will start a background process, save the data snapshot to the data file, and the MASTER will record all the commands to modify the data and cache it in the data file;
  • the MASTER sends the data file to SLAVE.
  • the SLAVE side saves the data file to the hard disk, and then loads it into the memory. Then the MASTER will modify all the data and send it to the SLAVE side. .
  • REDEN SENTINEL function in order to avoid the failure of MASTER and SLAVE, the REDEN SENTINEL function is used, specifically:
  • the REDIS SENTINEL upgrades a SLAVE to the primary server and configures other SLAVEs to use the new MASTER; when the application connects to the REDIS server, REDIS SENTINEL will advertise the new MASTER address and port;
  • SLAVE fails, it will automatically reconnect after returning to normal. After receiving the SLAVE connection, MASTER will send its complete data file to SLAVE. If MASTER receives multiple synchronization requests from SLAVE, MASTER only A process will be started in the background to save the data file, and then send it to all SLAVE to ensure that SLAVE is normal.
  • the power trading function microservices transformation transforms each function into a single service.
  • Each service only does a single thing, and each service is isolated and independent of each other.
  • the main benefits are as follows:
  • the microservice architecture enables complexity to be controlled by decomposing a monolithic application into multiple services. In order to achieve the same function, the application is decomposed into multiple manageable branches or services. Through the micro-service architecture model, complex functions are presented in a modular way, making a single service easier to develop and maintain.
  • Flexibility is based on a microservice architecture model that allows each service to scale independently. Under the micro-service architecture, technology selection is more flexible. In this mode, each team can make its own judgment according to the needs of its own services and the development of the industry, and choose the appropriate technology stack.
  • Microservices have separate running processes, so each microservice can also be deployed independently. This way, when a microservice changes, there is no need to compile and deploy the entire application, making publishing more efficient. UI teams can use AB testing to quickly deploy changes.
  • the microservice architecture model makes continuous deployment possible.
  • the training period of newcomers is very long, and it takes a lot of time to understand the local development environment.
  • the micro-service architecture model allows each service to be extended independently. The development and operation personnel do not need to spend too much time to familiarize themselves with the local environment, but only need to know the status of the module they are in.
  • Figure 1 is a schematic diagram of the system microservice transformation process.
  • Figure 2 is a schematic diagram of the system database read and write separation process.
  • the invention aims to achieve high cost of development and maintenance through the current situation of the national unified power trading platform. Carry out the transformation of the function of micro-services of the national unified power trading platform, reduce maintenance costs, improve development efficiency, and reduce management difficulty.
  • the "bidding declaration” and “transaction result query” in the external network transaction cloud, the "transaction sequence creation”, “publication release”, “bidding declaration”, “transaction opening bid”, and “declaration” in the intranet transaction cloud Data Checking, "Clearing Clearance”, “Safety Checking”, and “Results Release” are all separate microservices.
  • the microservice here is an autonomous service that is fully responsible for the business capability. The full responsibility here is the complete responsibility for the view layer, control layer, business logic, and data storage. Autonomous services have less impact on other parts when they are modified, and they do not affect the functions of other services during operation. Services are deployed in a distributed manner in server clusters to address the impact of high concurrency.
  • each specific function inside the module is a service deployed separately.
  • the service will be in the service registry. Register a node information.
  • the user queries the service registry to obtain the actual network address of the service and sends the request to the service).
  • the external network user enters the external network transaction cloud through the PC terminal or the mobile phone terminal, obtains the actual network address that needs the service from the service registration center, and sends a request to the requested service;
  • the intranet user enters the intranet transaction cloud through the PC end.
  • obtain the actual network address that needs the service send the request to the requested service, and perform related business operations.
  • Related business operations are performed in each micro service, and data read and write synchronization is referred to "2, database read and write separation".
  • the simple separation of read and write is to separate the operations of reading and writing the database to different database servers, which can effectively alleviate the pressure on the database and reduce the IO pressure.
  • the main database provides write operations and provides read operations from the database. In fact, in many systems, the main operations are read operations. When the primary database is written, the data is synchronized to the secondary database to ensure database integrity.
  • the ORACLE persistent layer commercial database and the REDIS in-memory database are used for reading and writing data in the present invention.
  • the ORACLE database When the user writes data according to the business needs, it is directly written into the ORACLE database to ensure strong consistency of the data; the ORACLE database is successfully written, and then written into the REDIS memory database; when the user reads the data, from the REDIS memory Read in the database.
  • the REDIS master-slave replication mechanism is used to solve the problem.
  • the data file is sent to SLAVE via the REDIS SYNC mechanism, and SLAVE performs the same operation to ensure data consistency.
  • a SLAVE process is started, it sends a SYNC COMMAND to the MASTER requesting a synchronous connection. Whether it is the first connection or reconnection, MASTER will start a background process, save the data snapshot to the data file, and the MASTER will record all the commands to modify the data and cache it in the data file. After the background process completes the cache operation, the MASTER sends the data file to SLAVE.
  • the SLAVE side saves the data file to the hard disk, and then loads it into the memory. Then the MASTER will modify all the data and send it to the SLAVE side. .
  • REDIS's SENTINEL function is used. If the MASTER fails, the REDIS SENTINEL can upgrade a SLAVE to the primary server and configure other SLAVEs to use the new MASTER. When the application connects to the REDIS server, REDIS SENTINEL will advertise the new MASTER address and port. If SLAVE fails, it will automatically reconnect after returning to normal. After receiving the SLAVE connection, MASTER will send its complete data file to SLAVE.
  • MASTER receives multiple synchronization requests from SLAVE, MASTER only A process will be started in the background to save the data file, and then send it to all SLAVE to ensure that SLAVE is normal. Ensure data read and write synchronization, improve database performance, and respond to the current market needs for high concurrency.

Landscapes

  • Engineering & Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Strategic Management (AREA)
  • Theoretical Computer Science (AREA)
  • Human Resources & Organizations (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Economics (AREA)
  • Software Systems (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Marketing (AREA)
  • General Business, Economics & Management (AREA)
  • Entrepreneurship & Innovation (AREA)
  • Tourism & Hospitality (AREA)
  • Finance (AREA)
  • Accounting & Taxation (AREA)
  • General Engineering & Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Quality & Reliability (AREA)
  • Operations Research (AREA)
  • Data Mining & Analysis (AREA)
  • Development Economics (AREA)
  • Technology Law (AREA)
  • General Health & Medical Sciences (AREA)
  • Public Health (AREA)
  • Water Supply & Treatment (AREA)
  • Primary Health Care (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

一种电力交易功能进行微服务改造的方法。所述方法包括如下步骤:(1)将外网交易云中的功能拆分为多个单独的微服务,将内网交易云中的功能拆分为多个单独的微服务;(2)在服务部署启动时,每个单独的微服务都在服务注册中心注册一个节点信息;(3)外网用户和内网用户通过PC端或者手机端分别进入外网交易云和内网交易云,通过从服务注册中心,获取需要服务的实际网络地址,发送请求到所请求的服务,进行相关业务操作。电力交易功能微服务改造,将每个功能拆分为单个的服务。每个服务只做单一的事情,每个服务相互隔离且互不影响。

Description

一种电力交易功能进行微服务改造的方法 技术领域
本发明涉及电力交易技术领域,尤其涉及一种电力交易功能进行微服务改造的方法。
背景技术
全国统一电力市场交易平台能够实现发电权交易和电力用户直接交易等市场功能,具备多品种多周期交易并行的运营能力,对于提高电力交易运营水平、促进电力资源优化配置具有重要的现实意义。
当前,全国的电力交易市场成员不断增长,对系统的并发性能等要求不断提高。但是,现今使用的全国统一电力市场交易平台,项目体积庞大,需求、设计、开发、测试、部署流程固定,新功能需要在原项目上做修改和完善,系统的资源占用率过高,整个应用需要水平扩展,开发和维护都非常的不方便。因此需要对电力交易功能进行微服务化改造,以适应业务发展对系统应用的要求。
发明内容
针对背景技术中的问题,本发明提供了一种电力交易功能进行微服务改造的方法。本发明通过将功能分解成多个独立的服务,以实现对解决方案或者复杂系统的解耦。
为了实现上述目的,本发明提出如下技术方案:
一种电力交易功能进行微服务改造的方法,其特征在于,
所述方法包括如下步骤:
(1)将外网交易云中的功能拆分为多个单独的微服务,将内网交易云中的功能拆分为多个单独的微服务:将需要拆分的功能代码,摘取出来,创建新的服务项目,服务到注册中心注册当前服务的服务节点,通过服务节点信息和其他服务进行交互;
(2)在服务部署启动时,每个拆分的微服务都会到服务注册中心注册一个节点信息;
(3)外网用户通过PC端或者手机端进入外网交易云,通过从服务注册中心,获取需要服务的实际网络地址,发送请求到所请求的服务,进行相关业务操作; 内网用户通过PC端进入内网交易云,同样从服务注册中心,获取需要服务的实际网络地址,发送请求到所请求的服务,进行相关业务操作。
进一步地,在步骤(1)中,外网交易云中包括“竞价申报”和“交易结果查询”单独的微服务;
内网交易云中包括“交易序列创建”“公报发布”、“竞价申报”、“交易开标”、“申报数据校核”、“撮合出清”、“安全校核”和“结果发布”单独的微服务。
进一步地,步骤(3)中,在各个微服务中进行相关业务操作时,数据库的读写分离操作如下:
数据的读写分离采用的是ORACLE持久层商用数据库和REDIS内存数据库;
当用户根据业务需要写数据时,直接写入到ORACLE数据库中,保证数据的强一致性;写入ORACLE数据库成功,然后再写入到REDIS内存数据库中;当用户读取数据时,从REDIS内存数据库中进行读取。
进一步地,当REDIS出现故障导致宕机时,采用REDIS主从复制机制来解决,具体如下:
当往主服务MASTER端写入数据时,通过REDIS SYNC机制将数据文件发送至从服务SLAVE,SLAVE也会执行相同的操作确保数据一致;
当启动一个SLAVE进程后,它会向MASTER发送一个SYNC COMMAND,请求同步连接;
无论是第一次连接还是重新连接,MASTER都会启动一个后台进程,将数据快照保存到数据文件中,同时MASTER会记录所有修改数据的命令并缓存在数据文件中;
后台进程完成缓存操作后,MASTER就发送数据文件给SLAVE,SLAVE端将数据文件保存到硬盘上,然后将其在加载到内存中,接着MASTER就会所有修改数据的操作,将其发送给SLAVE端。
进一步地,在使用REDIS主从复制中,为了避免MASTER和SLAVE出现宕机故障,使用REDIS的SENTINEL功能,具体为:
若MASTER出现故障导致宕机,REDIS SENTINEL将一个SLAVE升级为主服务器,并对其他SLAVE进行配置,让它们使用新的MASTER;当应用程序连接REDIS服务器时,REDIS SENTINEL会告之新的MASTER地址和端口;
若SLAVE出现故障导致宕机,恢复正常后会自动重新连接,MASTER收到SLAVE的连接后,将其完整的数据文件发送给SLAVE,如果MASTER同时收到多个SLAVE发来的同步请求,MASTER只会在后台启动一个进程保存数据文件,然后将其发送给所有的SLAVE,确保SLAVE正常。
与现有技术相比,本发明的有益效果为:
电力交易功能微服务改造,将每个功能拆分为单个的服务。每个服务只做单一的事情,每个服务相互隔离且互不影响。其主要效益如下:
1复杂度可控
微服务架构通过分解单体式应用为多个服务的方法,让复杂性能够可控。为了实现同一功能,应用被分解为多个可管理的分支或服务,通过微服务架构模式,让复杂的功能,通过模块化的方式呈现出来,让单个服务更容易开发和维护。
2灵活可扩展
灵活性是基于微服务架构模式,使得每个服务独立扩展。微服务架构下,技术选型是比较灵活的。在这种模式下,每个团队都可以根据自身服务的需求和行业发展状况做出自己的判断,选择适合的技术栈。
3独立部署
微服务具备独立的运行进程,所以每个微服务也可以独立部署。这样,当某个微服务发生变更时无需编译、部署整个应用,让发布更高效。UI团队可以采用AB测试,快速的部署变化。微服务架构模式使得持续化部署成为可能。
4开发针对性强
在单块架构系统下,新人的培养周期很长,需要花费大量时间了解本地开发环境。而微服务架构模式使得每个服务独立扩展,开发运维人员也不需要再花费过多的时间去熟悉本地环境,而只需要了解自己所处的模块状况即可。
5降低TCO
在单块架构系统中,使用的是技术分层,譬如控制层、逻辑层、数据层等。但随着市场需求的不断变化,用户需求逐渐个性化,开发周期越来越短,产品的生命周期也开始变短,单块架构系统开始面临挑战。无论是开发还是维护成本太高。
相较而言,微服务架构模式下,当某一组件发生故障时,不会出现单块架构系统的进程内扩散等弊端,故障会被隔离在单个服务中,降低开发维护成本,提高开发效率。
附图说明
图1是系统微服务改造流程示意图。
图2是系统数据库读写分离流程示意图。
具体实施方式
下面结合附图和具体实施方式,对本发明的具体实施方案作详细的阐述。这些具体实施方式仅供叙述而并非用来限定本发明的范围或实施原则,本发明的保护范围仍以权利要求为准,包括在此基础上所作出的显而易见的变化或变动等。
本发明旨在通过全国统一电力交易平台当前的状况,开发维护的成本高。进行全国统一电力交易平台功能微服务化的改造,降低维护成本,提高开发效率,降低管理难度。
为了达到上述目的,本发明的技术解决方案如下:
1,微服务改造
如附图一所示:外网交易云中“竞价申报”和“交易结果查询”,内网交易云中“交易序列创建”“公报发布”、“竞价申报”、“交易开标”、“申报数据校核”、“撮合出清”、“安全校核”、“结果发布”都是单独的微服务。这里的微服务是一种对业务能力完全负责的自治服务,这里的完全负责是对视图层、控制层、业务逻辑、数据存储的完全负责。自治服务在修改时对其他部分造成的影响比较小,在运营时也不会对其他服务的功能造成影响。服务以分布式的方式部署在服务器集群中,用以解决高并发的影响。
如附图1所示:在现有全国统一电力交易平台,以交易模块为例(模块内部每个具体的功能都是单独部署的的一个服务。在服务部署启动时,服务会在服务注册中心注册一个节点信息。用户通过查询服务注册中心,获取服务的实际网络地址,并将请求发送至该服务)。外网用户通过PC端或者手机端进入外网交易云,通过从服务注册中心,获取需要服务的实际网络地址,发送请求到所请求的服务,进行;内网用户通过PC端进入内网交易云,同样从服务注册中心,获取需要服务的实际网络地址,发送请求到所请求的服务,进行相关业务操作。在各个微服务中进行相关业务操作,数据的读写同步参看“2,数据库的读写分离”。
2,数据库的读写分离
读写分离简单的说是把对数据库读和写的操作分开对应不同的数据库服务器,这样能有效地减轻数据库压力,也能减轻IO压力。主数据库提供写操作,从 数据库提供读操作,其实在很多系统中,主要是读的操作。当主数据库进行写操作时,数据要同步到从的数据库,这样才能有效保证数据库完整性。
如附图2所示:本发明中数据的读写分离采用的是ORACLE持久层商用数据库和REDIS内存数据库。当用户根据业务需要写数据时,直接写入到ORACLE数据库中,保证数据的强一致性;写入ORACLE数据库成功,然后再写入到REDIS内存数据库中;当用户读取数据时,从REDIS内存数据库中进行读取。
同时,为了避免一个REDIS出现宕机的情况,采用REDIS主从复制机制来解决。当往MASTER端写入数据时,通过REDIS SYNC机制将数据文件发送至SLAVE,SLAVE也会执行相同的操作确保数据一致。当启动一个SLAVE进程后,它会向MASTER发送一个SYNC COMMAND,请求同步连接。无论是第一次连接还是重新连接,MASTER都会启动一个后台进程,将数据快照保存到数据文件中,同时MASTER会记录所有修改数据的命令并缓存在数据文件中。后台进程完成缓存操作后,MASTER就发送数据文件给SLAVE,SLAVE端将数据文件保存到硬盘上,然后将其在加载到内存中,接着MASTER就会所有修改数据的操作,将其发送给SLAVE端。在使用REDIS主从复制中,为了避免MASTER和SLAVE出现宕机故障,使用REDIS的SENTINEL功能。若MASTER出现故障导致宕机,REDIS SENTINEL可以将一个SLAVE升级为主服务器,并对其他SLAVE进行配置,让它们使用新的MASTER。当应用程序连接REDIS服务器时,REDIS SENTINEL会告之新的MASTER地址和端口。若SLAVE出现故障导致宕机,恢复正常后会自动重新连接,MASTER收到SLAVE的连接后,将其完整的数据文件发送给SLAVE,如果MASTER同时收到多个SLAVE发来的同步请求,MASTER只会在后台启动一个进程保存数据文件,然后将其发送给所有的SLAVE,确保SLAVE正常。保证数据的读写同步,提高数据库性能,应对当前市场面对高并发的需要。

Claims (5)

  1. 一种电力交易功能进行微服务改造的方法,其特征在于,
    所述方法包括如下步骤:
    (1)将外网交易云中的功能拆分为多个单独的微服务,将内网交易云中的功能拆分为多个单独的微服务:将需要拆分的功能代码,摘取出来,创建新的服务项目,服务到注册中心注册当前服务的服务节点,通过服务节点信息和其他服务进行交互;
    (2)在服务部署启动时,每个拆分的微服务都会到服务注册中心注册一个节点信息;
    (3)外网用户通过PC端或者手机端进入外网交易云,通过从服务注册中心,获取需要服务的实际网络地址,发送请求到所请求的服务,进行相关业务操作;内网用户通过PC端进入内网交易云,同样从服务注册中心,获取需要服务的实际网络地址,发送请求到所请求的服务,进行相关业务操作。
  2. 根据权利要求1所述的一种电力交易功能进行微服务改造的方法,其特征在于:
    在步骤(1)中,外网交易云中包括“竞价申报”和“交易结果查询”单独的微服务;
    内网交易云中包括“交易序列创建”“公报发布”、“竞价申报”、“交易开标”、“申报数据校核”、“撮合出清”、“安全校核”和“结果发布”单独的微服务。
  3. 根据权利要求1所述的一种电力交易功能进行微服务改造的方法,其特征在于:
    步骤(3)中,在各个微服务中进行相关业务操作时,数据库的读写分离操作如下:
    数据的读写分离采用的是ORACLE持久层商用数据库和REDIS内存数据库;
    当用户根据业务需要写数据时,直接写入到ORACLE数据库中,保证数据的强一致性;写入ORACLE数据库成功,然后再写入到REDIS内存数据库中;当用户读取数据时,从REDIS内存数据库中进行读取。
  4. 根据权利要求3所述的一种电力交易功能进行微服务改造的方法,其特征在于:
    当REDIS出现故障导致宕机时,采用REDIS主从复制机制来解决,具体如下:
    当往主服务MASTER端写入数据时,通过REDIS SYNC机制将数据文件发送至从服务SLAVE,SLAVE也会执行相同的操作确保数据一致;
    当启动一个SLAVE进程后,它会向MASTER发送一个SYNC COMMAND,请求同步连接;
    无论是第一次连接还是重新连接,MASTER都会启动一个后台进程,将数据快照保存到数据文件中,同时MASTER会记录所有修改数据的命令并缓存在数据文件中;
    后台进程完成缓存操作后,MASTER就发送数据文件给SLAVE,SLAVE端将数据文件保存到硬盘上,然后将其在加载到内存中,接着MASTER就会所有修改数据的操作,将其发送给SLAVE端。
  5. 根据权利要求4所述的一种电力交易功能进行微服务改造的方法,其特征在于:
    在使用REDIS主从复制中,为了避免MASTER和SLAVE出现宕机故障,使用REDIS的SENTINEL功能,具体为:
    若MASTER出现故障导致宕机,REDIS SENTINEL将一个SLAVE升级为主服务器,并对其他SLAVE进行配置,让它们使用新的MASTER;当应用程序连接REDIS服务器时,REDIS SENTINEL会告之新的MASTER地址和端口;
    若SLAVE出现故障导致宕机,恢复正常后会自动重新连接,MASTER收到SLAVE的连接后,将其完整的数据文件发送给SLAVE,如果MASTER同时收到多个SLAVE发来的同步请求,MASTER只会在后台启动一个进程保存数据文件,然后将其发送给所有的SLAVE,确保SLAVE正常。
PCT/CN2017/117882 2017-10-25 2017-12-22 一种电力交易功能进行微服务改造的方法 Ceased WO2019080335A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US15/744,910 US10778751B2 (en) 2017-10-25 2017-12-22 Method of micro-service transformation for power trading functions

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201711005376.1A CN107895253A (zh) 2017-10-25 2017-10-25 一种电力交易功能进行微服务改造的方法
CN201711005376.1 2017-10-25

Publications (1)

Publication Number Publication Date
WO2019080335A1 true WO2019080335A1 (zh) 2019-05-02

Family

ID=61802840

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/117882 Ceased WO2019080335A1 (zh) 2017-10-25 2017-12-22 一种电力交易功能进行微服务改造的方法

Country Status (3)

Country Link
US (1) US10778751B2 (zh)
CN (1) CN107895253A (zh)
WO (1) WO2019080335A1 (zh)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112291099A (zh) * 2020-11-02 2021-01-29 西南电子技术研究所(中国电子科技集团公司第十研究所) 移动环境下多模式注册中心架构切换方法
CN112968943A (zh) * 2021-02-01 2021-06-15 国网安徽省电力有限公司 一种电力协同平台
CN119232722A (zh) * 2023-06-30 2024-12-31 许继电气股份有限公司 一种微服务跨区注册和调用的系统及方法
CN119576661A (zh) * 2024-11-29 2025-03-07 郑州云海信息技术有限公司 一种任务处理方法、计算机程序产品、设备及存储介质

Families Citing this family (29)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110189229A (zh) * 2018-05-16 2019-08-30 杜鹏飞 互联网保险核心业务系统
CN109062940A (zh) * 2018-06-20 2018-12-21 北京爱蜂科技有限公司 一种基于微服务架构的多模式交易实现系统及方法
CN110737425B (zh) * 2018-07-20 2023-05-16 网宿科技股份有限公司 一种计费平台系统的应用程序的建立方法及装置
CN109284089B (zh) * 2018-08-30 2022-04-05 上海艾融软件股份有限公司 一种基于微服务技术的电商平台的实现系统及方法
CN109257440A (zh) * 2018-10-29 2019-01-22 南京南瑞信息通信科技有限公司 一种基于服务注册中心的服务发现和客户端负载均衡方法
CN109703605B (zh) * 2018-12-25 2021-03-12 交控科技股份有限公司 一种基于微服务的ats系统
US11082287B2 (en) * 2019-03-11 2021-08-03 At&T Intellectual Property I, L.P. Data driven systems and methods to isolate network faults
CN110247981A (zh) * 2019-06-26 2019-09-17 南京南瑞继保工程技术有限公司 一种电力调度自动化系统应用微服务改造方法
CN110380936B (zh) * 2019-07-23 2021-05-14 中国工商银行股份有限公司 测试方法和装置
CN110535722A (zh) * 2019-08-27 2019-12-03 江苏瑞中数据股份有限公司 一种跨安全区域的微服务全链路运行监控方法
CN112866317A (zh) * 2019-11-28 2021-05-28 中国电力科学研究院有限公司 一种电力交易高并发申报前端响应方法及系统
CN113129162B (zh) * 2020-01-16 2024-07-02 北京科东电力控制系统有限责任公司 一种智慧能源服务平台信息交互方法与装置
CN112383410B (zh) * 2020-10-21 2023-04-18 珠海许继芝电网自动化有限公司 一种正向隔离装置状态的检测方法及介质
CN112671706A (zh) * 2020-11-25 2021-04-16 四川新网银行股份有限公司 一种基于微服务架构的网络访问控制系统
CN112394947B (zh) * 2020-11-27 2024-05-14 北京宇航系统工程研究所 一种基于微服务架构的信息系统
CN112506709B (zh) * 2020-12-16 2021-11-23 北京航天智造科技发展有限公司 微服务治理方法及装置
CN112769863B (zh) * 2021-01-26 2021-11-16 北京树米网络科技有限公司 一种业务请求报文数据的处理方法、装置、电子设备及可读存储介质
CN112953771A (zh) * 2021-02-22 2021-06-11 安徽兆尹信息科技股份有限公司 基于微服务的金融资产管理系统及解耦方法
US12367320B2 (en) * 2021-09-22 2025-07-22 Ridgeline, Inc. Mechanism for real-time identity resolution in a distributed system
CN114116486A (zh) * 2021-11-29 2022-03-01 国家电网有限公司信息通信分公司 一种微服务迭代处理方法及系统
CN114326511B (zh) * 2021-12-29 2024-06-14 珠海万力达电气自动化有限公司 基于monitor配置工具的工矿企业电力集控系统的双机切换方法
CN114371947B (zh) * 2022-01-12 2024-11-19 中国银行股份有限公司 主机服务封装为微服务的分布式应用方法和装置
CN114543403A (zh) * 2022-03-07 2022-05-27 温格智能制造(安徽)科技有限公司 一种基于物联加注设备联控方法
CN114979137A (zh) * 2022-04-28 2022-08-30 中国电力科学研究院有限公司 一种用于电力行业高并发处理的方法、系统、设备及介质
CN114881779B (zh) * 2022-05-11 2025-03-04 北京结慧科技有限公司 基于微服务架构的交易请求处理系统和方法
CN114968720A (zh) * 2022-05-30 2022-08-30 江苏普旭科技股份有限公司 跨平台多服务架构模式下实现重用解耦的业务日志收集管理方法与系统
CN115883418B (zh) * 2022-11-22 2025-09-23 北京自然常数计算机系统有限公司 一种用于实时交易数据库系统的集群构建方法
CN115858491B (zh) * 2022-11-29 2023-07-28 四川虹魔方网络科技有限公司 基于用户标签管理中心实现用户半自动化运营管理的方法
CN117311801B (zh) * 2023-11-27 2024-04-09 湖南科技大学 一种基于网络化结构特征的微服务拆分方法

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105515759A (zh) * 2015-11-27 2016-04-20 国网信息通信产业集团有限公司 一种微服务注册方法及系统
CN106210052A (zh) * 2016-07-12 2016-12-07 国家电网公司 一种广域电力服务管理方法
CN106257894A (zh) * 2016-08-29 2016-12-28 北京海誉动想科技股份有限公司 基于微服务的灰度发布方法
CN106850832A (zh) * 2017-03-01 2017-06-13 郑州云海信息技术有限公司 一种基于微服务架构的云管理系统

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105205735A (zh) * 2015-10-08 2015-12-30 南京南瑞继保电气有限公司 电力调度数据云服务系统及实现方法
CN105808643A (zh) * 2016-02-25 2016-07-27 浪潮通信信息系统有限公司 一种Redis内存数据库刷新的方法
US10389602B2 (en) * 2016-12-05 2019-08-20 General Electric Company Automated feature deployment for active analytics microservices
CN107181834B (zh) * 2017-06-13 2021-02-12 聚好看科技股份有限公司 一种redis管理虚拟IP地址的方法、装置及redis系统

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105515759A (zh) * 2015-11-27 2016-04-20 国网信息通信产业集团有限公司 一种微服务注册方法及系统
CN106210052A (zh) * 2016-07-12 2016-12-07 国家电网公司 一种广域电力服务管理方法
CN106257894A (zh) * 2016-08-29 2016-12-28 北京海誉动想科技股份有限公司 基于微服务的灰度发布方法
CN106850832A (zh) * 2017-03-01 2017-06-13 郑州云海信息技术有限公司 一种基于微服务架构的云管理系统

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112291099A (zh) * 2020-11-02 2021-01-29 西南电子技术研究所(中国电子科技集团公司第十研究所) 移动环境下多模式注册中心架构切换方法
CN112291099B (zh) * 2020-11-02 2022-07-29 西南电子技术研究所(中国电子科技集团公司第十研究所) 移动环境下多模式注册中心架构切换方法
CN112968943A (zh) * 2021-02-01 2021-06-15 国网安徽省电力有限公司 一种电力协同平台
CN112968943B (zh) * 2021-02-01 2023-04-07 国网安徽省电力有限公司 一种电力协同平台
CN119232722A (zh) * 2023-06-30 2024-12-31 许继电气股份有限公司 一种微服务跨区注册和调用的系统及方法
CN119576661A (zh) * 2024-11-29 2025-03-07 郑州云海信息技术有限公司 一种任务处理方法、计算机程序产品、设备及存储介质

Also Published As

Publication number Publication date
US10778751B2 (en) 2020-09-15
US20200084263A1 (en) 2020-03-12
CN107895253A (zh) 2018-04-10

Similar Documents

Publication Publication Date Title
WO2019080335A1 (zh) 一种电力交易功能进行微服务改造的方法
CN105205766B (zh) 基于云平台的移动互联网医院就诊系统
CN111651275A (zh) 一种MySQL集群自动化部署系统及方法
CN104391989A (zh) 一种分布式etl一体机系统
CN102710752A (zh) 灾备存储系统
CN104504145A (zh) 一种实现数据库读写分离的方法和设备
CN101562761B (zh) 一种光网络中的备份存储方法和系统
US7870095B2 (en) Apparatus, system, and method for replication of data management information
CN105446657B (zh) 一种监控raid卡的方法
CN103793278A (zh) 一种基于虚拟器件运维规则的资源自动调整方法
CN109189860A (zh) 一种基于Kubernetes系统的MySQL主备增量同步方法
CN102937964B (zh) 基于分布式系统的智能数据服务方法
CN112150042B (zh) 基于“微应用/微服务”架构系统的规划评审管理方法
CN115878384A (zh) 一种基于备份容灾系统的分布式集群及构建方法
CN101996094A (zh) 一种分布式资源管理方法及系统
CN201584980U (zh) 一种数据中心集中式控制切换系统
CN102523257A (zh) 一种基于iaas云平台的虚拟机容错方法
CN107729515B (zh) 一种数据同步的方法、装置及存储介质
CN105242988B (zh) 分布式文件系统和分布式文件系统的数据备份方法
CN102820998B (zh) 实现面向办公应用的双机容错服务系统及其数据存储方法
WO2023019953A1 (zh) 数据同步方法、系统、服务器及存储介质
CN117193855A (zh) 代码管理方法、装置、存储介质及电子设备
CN104158833A (zh) 一种智能桌面系统的构建方法
CN108345515A (zh) 存储方法和装置及其存储系统
CN109739685A (zh) 一种主从热备份数据同步方法和存储介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 17930002

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 17930002

Country of ref document: EP

Kind code of ref document: A1